
/**
 * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */

var b_box_mt = 20;

function setShowLayout() {
    var tag_id = "#i_346";
    var css_element = "min-height";
    var css_value = $(tag_id).height();
    var attr_value = parseInt($(tag_id).css(css_element));
    var margin_top = b_box_mt + css_value - attr_value;
    
    setStyle(margin_top);
}

function setHideLayout() { setStyle(b_box_mt); }

function setStyle(css_value) {
    var tag_id = "#b_box";
    var css_element = "margin-top";
    
    $(tag_id).css(css_element, css_value);
}

function show(id) {
    document.getElementById(id).style.display = "inline";
    setShowLayout();
}
function hide(id) {
    document.getElementById(id).style.display = "none";
    setHideLayout();   
}

var thumbnailviewer={
    enableTitle: false,
    enableAnimation: true,
    definefooter: '<p class="footerbar"><a href="#" onClick="thumbnailviewer.closeit()">Schlie&szlig;en&nbsp;&nbsp;&nbsp;</a></p>',
    defineLoading: ' Bitte warten ...',
    defineBulletArea: '<map name="Map1">'+
        '<area shape="rect" coords="455,225,490,255" onmouseover="show(\'bullet1\')" onmouseout="hide(\'bullet1\')">'+
        '<area shape="rect" coords="15,260,50,290" onmouseover="show(\'bullet2\')" onmouseout="hide(\'bullet2\')">'+
        '<area shape="rect" coords="15,330,50,360" onmouseover="show(\'bullet2\')" onmouseout="hide(\'bullet2\')">'+
        '<area shape="rect" coords="510,345,545,375" onmouseover="show(\'bullet3\')" onmouseout="hide(\'bullet3\')">'+
        '<area shape="rect" coords="15,370,50,400" onmouseover="show(\'bullet4\')" onmouseout="hide(\'bullet4\')">'+
        '<area shape="rect" coords="510,385,545,415" onmouseover="show(\'bullet5\')" onmouseout="hide(\'bullet5\')">'+
        '<area shape="rect" coords="15,410,50,440" onmouseover="show(\'bullet6\')" onmouseout="hide(\'bullet6\')">'+
        '<area shape="rect" coords="510,425,545,455" onmouseover="show(\'bullet7\')" onmouseout="hide(\'bullet7\')">'+
        '<area shape="rect" coords="15,520,50,550" onmouseover="show(\'bullet8\')" onmouseout="hide(\'bullet8\')">'+
    '</map>'+
    '<map name="Map2">'+
        '<area shape="rect" coords="15,150,50,180" onmouseover="show(\'bullet9\')" onmouseout="hide(\'bullet9\')">'+
        '<area shape="rect" coords="270,200,305,230" onmouseover="show(\'bullet10\')" onmouseout="hide(\'bullet10\')">'+
        '<area shape="rect" coords="300,85,335,115" onmouseover="show(\'bullet11\')" onmouseout="hide(\'bullet11\')">'+
        '<area shape="rect" coords="385,85,420,115" onmouseover="show(\'bullet12\')" onmouseout="hide(\'bullet12\')">'+
        '<area shape="rect" coords="510,205,545,235" onmouseover="show(\'bullet13\')" onmouseout="hide(\'bullet13\')">'+
        '<area shape="rect" coords="15,230,50,260" onmouseover="show(\'bullet14\')" onmouseout="hide(\'bullet14\')">'+
        '<area shape="rect" coords="165,265,195,295" onmouseover="show(\'bullet15\')" onmouseout="hide(\'bullet15\')">'+
        '<area shape="rect" coords="165,310,195,340" onmouseover="show(\'bullet16\')" onmouseout="hide(\'bullet16\')">'+
        '<area shape="rect" coords="15,350,50,380" onmouseover="show(\'bullet17\')" onmouseout="hide(\'bullet17\')">'+
        '<area shape="rect" coords="15,460,50,490" onmouseover="show(\'bullet18\')" onmouseout="hide(\'bullet18\')">'+
        '<area shape="rect" coords="510,540,545,570" onmouseover="show(\'bullet19\')" onmouseout="hide(\'bullet19\')">'+        
    '</map>'+
    '<map name="Map3">'+
        '<area shape="rect" coords="15,150,50,180" onmouseover="show(\'bullet20\')" onmouseout="hide(\'bullet20\')">'+
        '<area shape="rect" coords="15,355,50,385" onmouseover="show(\'bullet21\')" onmouseout="hide(\'bullet21\')">'+
    '</map>'+
    '<map name="Map4">'+
        '<area shape="rect" coords="455,225,490,255" onmouseover="show(\'bullet1gas\')" onmouseout="hide(\'bullet1gas\')">'+
        '<area shape="rect" coords="15,260,50,290" onmouseover="show(\'bullet2gas\')" onmouseout="hide(\'bullet2gas\')">'+
        '<area shape="rect" coords="15,325,50,355" onmouseover="show(\'bullet2gas\')" onmouseout="hide(\'bullet2gas\')">'+
        '<area shape="rect" coords="510,345,545,375" onmouseover="show(\'bullet3gas\')" onmouseout="hide(\'bullet3gas\')">'+
        '<area shape="rect" coords="15,370,50,400" onmouseover="show(\'bullet4gas\')" onmouseout="hide(\'bullet4gas\')">'+
        '<area shape="rect" coords="510,385,545,415" onmouseover="show(\'bullet5gas\')" onmouseout="hide(\'bullet5gas\')">'+
        '<area shape="rect" coords="15,410,50,440" onmouseover="show(\'bullet6gas\')" onmouseout="hide(\'bullet6gas\')">'+
        '<area shape="rect" coords="510,425,545,455" onmouseover="show(\'bullet7gas\')" onmouseout="hide(\'bullet7gas\')">'+
        '<area shape="rect" coords="15,520,50,550" onmouseover="show(\'bullet8gas\')" onmouseout="hide(\'bullet8gas\')">'+
    '</map>'+
    '<map name="Map5">'+
        '<area shape="rect" coords="15,150,50,180" onmouseover="show(\'bullet9gas\')" onmouseout="hide(\'bullet9gas\')">'+
        '<area shape="rect" coords="270,200,305,230" onmouseover="show(\'bullet10gas\')" onmouseout="hide(\'bullet10gas\')">'+
        '<area shape="rect" coords="300,85,335,115" onmouseover="show(\'bullet11gas\')" onmouseout="hide(\'bullet11gas\')">'+
        '<area shape="rect" coords="385,85,420,115" onmouseover="show(\'bullet12gas\')" onmouseout="hide(\'bullet12gas\')">'+
        '<area shape="rect" coords="430,85,465,115" onmouseover="show(\'bullet13gas\')" onmouseout="hide(\'bullet13gas\')">'+
        '<area shape="rect" coords="510,200,545,235" onmouseover="show(\'bullet14gas\')" onmouseout="hide(\'bullet14gas\')">'+
        '<area shape="rect" coords="15,230,50,260" onmouseover="show(\'bullet15gas\')" onmouseout="hide(\'bullet15gas\')">'+
        '<area shape="rect" coords="165,265,195,295" onmouseover="show(\'bullet16gas\')" onmouseout="hide(\'bullet16gas\')">'+
        '<area shape="rect" coords="165,310,195,340" onmouseover="show(\'bullet17gas\')" onmouseout="hide(\'bullet17gas\')">'+
        '<area shape="rect" coords="15,350,50,380" onmouseover="show(\'bullet18gas\')" onmouseout="hide(\'bullet18gas\')">'+
        '<area shape="rect" coords="15,420,50,450" onmouseover="show(\'bullet19gas\')" onmouseout="hide(\'bullet19gas\')">'+        
        '<area shape="rect" coords="510,460,545,490" onmouseover="show(\'bullet20gas\')" onmouseout="hide(\'bullet20gas\')">'+
        '<area shape="rect" coords="15,600,50,630" onmouseover="show(\'bullet21gas\')" onmouseout="hide(\'bullet21gas\')">'+
        '</map>',
    scrollbarwidth: 16,
    opacitystring: 'filter:progid:DXImageTransform.Microsoft.alpha(opacity=10); -moz-opacity: 0.1; opacity: 0.1',
    targetlinks:[], //Array to hold links with rel="thumbnail"
    createthumbBox:function(){
        document.write('<div id="thumbBox">'+this.definefooter+'<div id="thumbImage"></div></div>')
        document.write('<div id="thumbLoading">'+this.defineLoading+'</div>')
        this.thumbBox=document.getElementById("thumbBox")
        this.footerbar=document.getElementById("footerbar")
        this.thumbImage=document.getElementById("thumbImage")
        this.thumbLoading=document.getElementById("thumbLoading") 
        this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
    },
    centerDiv:function(divobj){
        var ie=document.all && !window.opera
        var dom=document.getElementById
        var scroll_top=(ie)? this.standardbody.scrollTop : window.pageYOffset
        var scroll_left=(ie)? this.standardbody.scrollLeft : window.pageXOffset
        var docwidth=(ie)? this.standardbody.clientWidth : window.innerWidth-this.scrollbarwidth
        var docheight=(ie)? this.standardbody.clientHeight: window.innerHeight
        var docheightcomplete=(this.standardbody.offsetHeight>this.standardbody.scrollHeight)? this.standardbody.offsetHeight : this.standardbody.scrollHeight //Full scroll height of document
        var objwidth=divobj.offsetWidth
        var objheight=divobj.offsetHeight
        var topposition=(docheight>objheight)? scroll_top+docheight/2-objheight/2+"px" : scroll_top+120+"px"
        //divobj.style.left=docwidth/2-objwidth/2+"px" 
        divobj.style.left="293px";
        divobj.style.top=Math.floor(parseInt(topposition))+"px"
        divobj.style.visibility="visible"

        document.getElementById("posTheBullet").style.top = Math.floor(parseInt(topposition))+"px";
    },
    showthumbBox:function(){ 
        this.centerDiv(this.thumbBox)
        if (this.enableAnimation){ 
            this.currentopacity=0.1 
            this.opacitytimer=setInterval("thumbnailviewer.opacityanimation()", 20)
        }
    },
    loadimage:function(link){
        if (this.thumbBox.style.visibility=="visible") 
            this.closeit() //Hide it first (not doing so causes triggers some positioning bug in Firefox
        if ( link.toString().indexOf("strom_seite-1") != -1 ) {
            var imageHTML='<img src="'+link.getAttribute("href")+'" style="'+this.opacitystring+'" usemap="#Map1"/>'+this.defineBulletArea;
        } else if ( link.toString().indexOf("strom_seite-2") != -1 ) {
            var imageHTML='<img src="'+link.getAttribute("href")+'" style="'+this.opacitystring+'" usemap="#Map2"/>'+this.defineBulletArea;
        } else if ( link.toString().indexOf("strom_seite-3") != -1 ) {
            var imageHTML='<img src="'+link.getAttribute("href")+'" style="'+this.opacitystring+'" usemap="#Map3"/>'+this.defineBulletArea;
        } else if ( link.toString().indexOf("gas_seite-1") != -1 ) {
            var imageHTML='<img src="'+link.getAttribute("href")+'" style="'+this.opacitystring+'" usemap="#Map4"/>'+this.defineBulletArea;
        } else if ( link.toString().indexOf("gas_seite-2") != -1 ) {
            var imageHTML='<img src="'+link.getAttribute("href")+'" style="'+this.opacitystring+'" usemap="#Map5"/>'+this.defineBulletArea;
        } else {
            var imageHTML='';
        }
        if (this.enableTitle && link.getAttribute("title"))
            imageHTML+='<br />'+link.getAttribute("title")
        this.centerDiv(this.thumbLoading)
        this.thumbImage.innerHTML=imageHTML 
        this.featureImage=this.thumbImage.getElementsByTagName("img")[0]
        this.featureImage.onload=function(){
            thumbnailviewer.thumbLoading.style.visibility="hidden"
            thumbnailviewer.showthumbBox() 
        }
        if (document.all && !window.createPopup) //Target IE5.0 browsers only. Address IE image cache not firing onload bug: panoramio.com/blog/onload-event/
            this.featureImage.src=link.getAttribute("href")
        this.featureImage.onerror=function(){
            thumbnailviewer.thumbLoading.style.visibility="hidden"
        }
    },
    setimgopacity:function(value){
        var targetobject=this.featureImage
        if (targetobject.filters && targetobject.filters[0]){ //IE syntax
            if (typeof targetobject.filters[0].opacity=="number") //IE6
                targetobject.filters[0].opacity=value*100
            else //IE 5.5
                targetobject.style.filter="alpha(opacity="+value*100+")"
        }
        else if (typeof targetobject.style.MozOpacity!="undefined") //Old Mozilla syntax
            targetobject.style.MozOpacity=value
        else if (typeof targetobject.style.opacity!="undefined") //Standard opacity syntax
            targetobject.style.opacity=value
        else
            this.stopanimation()
    },
    opacityanimation:function(){
        this.setimgopacity(this.currentopacity)
        this.currentopacity+=0.1
        if (this.currentopacity>1)
            this.stopanimation()
    },
    stopanimation:function(){
        if (typeof this.opacitytimer!="undefined")
            clearInterval(this.opacitytimer)
    },
    closeit:function(){ //Close "thumbbox" div function
        this.stopanimation()
        this.thumbBox.style.visibility="hidden"
        this.thumbImage.innerHTML=""
        this.thumbBox.style.left="-2000px"
        this.thumbBox.style.top="-2000px"
    },
    cleanup:function(){
        this.thumbLoading=null
        if (this.featureImage) this.featureImage.onload=null
        this.featureImage=null
        this.thumbImage=null
        for (var i=0; i<this.targetlinks.length; i++)
            this.targetlinks[i].onclick=null
        this.thumbBox=null
    },
    dotask:function(target, functionref, tasktype){
        var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
        if (target.addEventListener)
            target.addEventListener(tasktype, functionref, false)
        else if (target.attachEvent)
            target.attachEvent(tasktype, functionref)
    },
    init:function(){
        if (!this.enableAnimation)
            this.opacitystring=""
        var pagelinks=document.getElementsByTagName("a")
        for (var i=0; i<pagelinks.length; i++){ //BEGIN FOR LOOP
            if (pagelinks[i].getAttribute("rel") && pagelinks[i].getAttribute("rel")=="thumbnail"){ //Begin if statement
                pagelinks[i].onclick=function(){
                    thumbnailviewer.stopanimation()
                    thumbnailviewer.loadimage(this)
                    return false
                }
                this.targetlinks[this.targetlinks.length]=pagelinks[i] //store reference to target link
            } //end if statement
        } //END FOR LOOP
        //Reposition "thumbbox" div when page is resized
        this.dotask(window, function(){if (thumbnailviewer.thumbBox.style.visibility=="visible") thumbnailviewer.centerDiv(thumbnailviewer.thumbBox)}, "resize")
    }
}

thumbnailviewer.createthumbBox()
thumbnailviewer.dotask(window, function(){thumbnailviewer.init()}, "load")
thumbnailviewer.dotask(window, function(){thumbnailviewer.cleanup()}, "unload")

var newWindow;
function openPopUpWindow(url){
    newWindow=window.open(url,'name','scrollbars=yes,menubar=no,resizable=yes,toolbar=no,location=no,status=no');
    if (window.focus) {newWindow.focus()}
}

function checkPlz(plz) {
    if(plz == "") { plz = ("Bitte Postleitzahl eingeben"); }
    return plz;
}
function checkVerbrauch(verbrauch) {
    if(verbrauch == "") { verbrauch = ("Ihr Jahresverbrauch in kWh"); }
    return verbrauch;
}



  

