/***********************************************************
 * Copyright (c) 2010 Oliver Sahner osahner(at)medianet.de *
 * medianet GmbH http://www.medianet.de                    *
 * @author Oliver Sahner <osahner(at)medianet.de>          *
 * @version $Rev: 6094 $                                   *
 * $Date: 2010-08-11 15:51:07 +0200 (Wed, 11 Aug 2010) $   *
 ***********************************************************
 * - jQuery Cookie
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * - jQuery i18n
 * Copyright (c) 2008 Maxime Haineault (haineault.com)
 * - jQuery BASE64
 * Muhammad Hussein Fattahizadeh < muhammad [AT] semnanweb [DOT] com >
 * - EuclideanProjection/ELabel/EPolys
 * Community Church Javascript Team http://econym.org.uk/gmap/
 * - LabeledMarker
 * (c) 2007 Mike Purvis (http://uwmike.com)
 */
function openDetailTab(b,a,c){$(b).tabs({ajaxOptions:{async:false,data:{id:c}}});
if($(b).tabs("option","disabled")){$(b).tabs("enable",a)
}selectTab(b,a)
}function openMap(d,a,b,c){selectTab(d,a);
updateMap(b,c)
}function selectTab(b,a){$(b).find("ul.ui-tabs-nav a").eq(a).triggerHandler("click",{id:b.replace(/(#|\.|:)/g)});
$(b).find("ul.ui-tabs-nav a").eq(a).trigger("click",{id:b.replace(/(#|\.|:)/g)})
}function toggleWatchlistCheckbox(b,a){var c="";
if($(a).is(":checked")){c="true"
}else{c="false"
}$.ajax({type:"GET",url:gCtx+"/grid-watchlist-checkbox",data:{checkedStatus:c,adressnr:b},success:function(d){$("#tab4 span").html($("#l18n-watchlist-label").html()+d)
}})
}function selectAllWatchlistCheckboxes(b){var a="";
$(b+" input[type=checkbox]").each(function(){$(this).attr("checked",true);
if(a!=""){a+=","
}a+=$(this).attr("name")
});
$.ajax({type:"GET",url:gCtx+"/gridWatchlistCheckboxSelectAll?",data:{adressnrs:a},success:function(c){$("#tab4 span").html($("#l18n-watchlist-label").html()+c)
}})
}function unselectAllWatchlistCheckboxes(b){var a="";
$(b+" input[type=checkbox]").each(function(){$(this).attr("checked",false);
if(a!=""){a+=","
}a+=$(this).attr("name")
});
$.ajax({type:"GET",url:gCtx+"/gridWatchlistCheckboxUnselectAll?",data:{adressnrs:a},success:function(c){$("#tab4 span").html($("#l18n-watchlist-label").html()+c)
}})
}function toggleAllWatchlistCheckboxes(b){var a="";
$(b+" input[type=checkbox]").each(function(){if($(this).is(":checked")){$(this).attr("checked",false);
if(a!=""){a+=","
}a+="false:"+$(this).attr("name")
}else{$(this).attr("checked",true);
if(a!=""){a+=","
}a+="true:"+$(this).attr("name")
}});
$.ajax({type:"GET",url:gCtx+"/gridWatchlistCheckboxToggleAll?",data:{adressnrs:a},success:function(c){$("#tab4 span").html($("#l18n-watchlist-label").html()+c)
}})
}function selectSingleWatchlistEntry(a){$.ajax({type:"GET",url:gCtx+"/gridWatchlistSelectSingle?",data:{adressnr:a},success:function(b){$("#tab4 span").html($("#l18n-watchlist-label").html()+b);
$("#select-single-watchlist-entry").css("display","none");
$("#unselect-single-watchlist-entry").css("display","block")
}})
}function unselectSingleWatchlistEntry(a){$.ajax({type:"GET",url:gCtx+"/gridWatchlistUnselectSingle?",data:{adressnr:a},success:function(b){$("#tab4 span").html($("#l18n-watchlist-label").html()+b);
$("#select-single-watchlist-entry").css("display","block");
$("#unselect-single-watchlist-entry").css("display","none")
}})
}function checkboxFormatter(a,b,d){a=a+"";
a=a.toLowerCase();
var c=a.search(/(false|0|no|off|n)/i)<0?' checked="checked"':"";
return"<input type='checkbox' onclick=\"toggleWatchlistCheckbox('"+b.rowId+"', this);\" "+c+" value='"+a+"' offval='no' name='"+b.rowId+"' />"
}function generateVideoMarkerForDetailPage(){var d='<embed src="http://video.dlg.org/eurotier/2010/';
var a='" autostart="false" loop="false" hidden="false"></embed>';
var b=$("#neuheiten-description-gold").html();
if(b!=null){if(b.match(/\[video:.*\]/g)){b=b.replace(/(.*)\[video:(.*)\](.*)/g,"$1"+d+"$2"+a+"$3");
$("#neuheiten-description-gold").html(b)
}}var c=$("#neuheiten-description-silver").html();
if(c!=null){if(c.match(/\[video:.*\]/g)){c=c.replace(/(.*)\[video:(.*)\](.*)/g,"$1"+d+"$2"+a+"$3");
$("#neuheiten-description-silver").html(c)
}}}$(function(){generateVideoMarkerForDetailPage()
});var gCtx="";
var sCtx=gCtx;
var mdiv="map";
var hallen=[];
var polys=[];
var faktor={};
var offset={};
var standStyles={};
var serviceIcons={};
var infoWindow=null;
var map=null;
var currentStand=null;
var currentHalle=null;
var homeMapID;
var homeMapZoom;
var homeMapLatLng;
var async=true;
var cookieName="";
var iTl=null;
var debug=false;
function StandStyle(g,f,e,b,a,c,d){this.bC=g;
this.fC=f;
this.tC=e;
this.dL=b;
this.lS=a;
this.o=c;
this.i=d
}function gmapInit(b,c,a){gCtx=c?c:"";
sCtx=a?a:gCtx;
mdiv=b
}function gmapInitialize(){if(GBrowserIsCompatible()){map=new GMap2(document.getElementById(mdiv),{mapTypes:[]});
map.addControl(new GLargeMapControl3D());
map.addControl(new GMenuMapTypeControl());
map.enableScrollWheelZoom();
var f=new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(68,470));
map.addControl(new MapInfoControl({position:f,gCtx:gCtx,background:"transparent"}));
$.i18n.properties({path:gCtx+"/js/",name:"messages",language:GLanguage.getLanguageCode(),mode:"map"});
var b=new GMapType(G_HYBRID_MAP.getTileLayers(),G_HYBRID_MAP.getProjection(),$.i18n.prop("home"));
b.halle=homeMapID;
map.addMapType(b);
map.setCenter(homeMapLatLng,homeMapZoom,b);
var a=[new GTileLayer(new GCopyrightCollection("medianet GmbH"),0,3)];
a[0].getCopyright=function(h,g){return{prefix:$.i18n.prop("copyright.prefix"),copyrightTexts:[$.i18n.prop("copyright")]}
};
a[0].getTileUrl=function(h,g){var i="";
if($.browser.msie){i=(h.x+h.y)%4
}return"http://static"+i+".agritechnica.com/t/eurotier2010/"+currentHalle+"/"+g+"_"+h.x+"_"+h.y+".jpg"
};
for(var d=0,c;
c=hallen[d++];
){if(c!=homeMapID){var e=new GMapType(a,new EuclideanProjection(18),$.i18n.prop(c),{errorMessage:$.i18n.prop(c),alt:$.i18n.prop(c)});
e.getMinimumResolution=function(){return 2
};
e.getMaximumResolution=function(){return 4
};
e.halle=c;
map.addMapType(e)
}}registerEventHandlers();
setupStyles();
mapChanged()
}else{alert("Sorry, the Google Maps API is not compatible with this browser")
}}function registerEventHandlers(){GEvent.addListener(map,"maptypechanged",mapChanged);
iTl=GEvent.addListener(map,"tilesloaded",function(){$("#menumtctl").width("122px");
$("#menumtctl_main").width("120px");
GEvent.removeListener(iTl)
});
$(document).unload(function(){GUnload()
})
}function updateMap(a,c){log("updateMap("+a+", "+c+")");
if(map==null){gmapInitialize()
}else{map.checkResize()
}var b=null;
if($.cookie(cookieName)){b=$.cookie(cookieName)
}else{b=null
}if(c){if(currentStand){deFocusStand(currentStand)
}currentStand=stripSubStand(c);
if(b!=currentStand){b=currentStand;
$.cookie(cookieName,b,{expires:null,path:"/"})
}if(a!=currentHalle){map.setMapType(getMapType(a))
}else{focusStand(currentStand)
}}else{currentStand=null
}}function mapChanged(){log("mapChanged()");
map.clearOverlays();
polys=[];
currentHalle=map.getCurrentMapType().halle;
log(currentHalle);
if(currentHalle!=homeMapID){map.setCenter(new GLatLng(0,0),2)
}else{map.setCenter(homeMapLatLng,homeMapZoom)
}map.savePosition();
loadServicePoints();
loadStaende()
}function loadServicePoints(){var a=gCtx+"/service";
var b="h="+currentHalle;
$.ajax({type:"GET",async:async,cache:true,dataType:"json",ifModified:true,data:b,url:a,success:function(c){$.each(c,function(e,g){var d;
var h;
if(g.icon=="halle"){h=new GLatLng(g.latitude,g.longitude);
var f={icon:serviceIcons[g.icon],clickable:true,labelText:g.label,labelOffset:serviceIcons[g.icon].labelOffset};
d=new LabeledMarker(h,f);
GEvent.addListener(d,"click",function(){var i=getMapType(g.label);
map.setMapType(i)
})
}else{h=transformPoint(g.latitude,g.longitude);
d=new GMarker(h,{icon:serviceIcons[g.icon]})
}map.addOverlay(d)
})
}})
}function loadStaende(){var a=gCtx+"/data";
var b="h="+currentHalle;
$.ajax({type:"GET",async:async,cache:false,dataType:"json",ifModified:true,data:b,url:a,success:function(c){$.each(c,function(d,e){if(!isNaN(e.name.charAt(e.name.length-1))){if(currentHalle==homeMapID){e.style=standStyles.halle
}else{if(e.style!=e.messeId){e.style=standStyles[e.messeId+"."+e.style]
}else{e.style=standStyles[e.style]
}}var f=drawStand(e);
if(e.style.dL){e.ilabel=drawLabel(e)
}f.item=e;
polys.push(f)
}});
if(currentStand){focusStand(currentStand)
}}})
}function drawLabel(b){var a="<strong>"+b.firma+"</strong>";
var c=new ELabel(transformPoint(b.jsoncenter.y,b.jsoncenter.x),a,b.style.lS,new GSize(0,0),70,false);
map.addOverlay(c);
return c
}function drawStand(c){var e=[];
for(var b=0,a;
a=c.jsonpoints[b++];
){e.push(transformPoint(a.y,a.x))
}e.push(transformPoint(c.jsonpoints[0].y,c.jsonpoints[0].x));
var d=new GPolygon(e,c.style.bC,1,1,c.style.fC,c.style.o,{clickable:true,mouseOutTolerance:0});
GEvent.addListener(d,"mouseover",function(f){var g='<div style="background:'+c.style.tC+'" class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"><span class="ui-dialog-title" style="white-space:nowrap;"><img style="width: 16px; height: 16px; vertical-align:middle;" src="'+c.style.i+'"/><span style="padding:2px 4px;">Stand: '+d.item.name+'<span></span></div><div style="padding:2px 4px;"><strong>'+d.item.firma+"</strong><br />"+(GLanguage.getLanguageCode()=="en"?d.item.landEn:d.item.land)+"</div>";
if(infoWindow!=null){map.removeOverlay(infoWindow);
infoWindow=null
}if(d.item.ilabel){d.item.ilabel.hide()
}var h=transformPoint(d.item.jsoncenter.y,d.item.jsoncenter.x);
infoWindow=new ELabel(h,g,"ui-corner-all ui-widget ui-widget-content",new GSize(0,0),standStyles[c.messeId+".current"].o*100,false);
d.setFillStyle({opacity:1});
map.addOverlay(infoWindow)
});
GEvent.addListener(d,"mouseout",function(f){d.setFillStyle({opacity:c.style.o});
if(infoWindow!=null){map.removeOverlay(infoWindow);
infoWindow=null
}if(d.item.ilabel){d.item.ilabel.show()
}});
if(c.link){GEvent.addListener(d,"click",function(f){openDetailTab("#remotetabs",2,d.item.adressnr)
})
}map.addOverlay(d);
return d
}function transformPoint(d,a){var c=d;
var b=a;
if(currentHalle!=homeMapID){c=faktor[currentHalle]*(c+offset[currentHalle].y);
b=2*faktor[currentHalle]*(b+offset[currentHalle].x)
}return new GLatLng(c,b)
}function getMapType(b){for(var a=0,c;
c=map.getMapTypes()[a++];
){if(c.halle==b){return c
}}return null
}function focusStand(c){var b=findStand(c);
if(b){var a=transformPoint(b.item.jsoncenter.y,b.item.jsoncenter.x);
b.item.style=standStyles[b.item.messeId+".current"];
b.setFillStyle({opacity:b.item.style.o,color:b.item.style.fC});
if(!b.item.ilabel){b.item.ilabel=drawLabel(b.item)
}map.setZoom(3);
map.panTo(a)
}}function deFocusStand(b){var a=findStand(b);
if(a){a.item.style=standStyles[a.item.messeId];
a.setFillStyle({opacity:a.item.style.o,color:a.item.style.fC});
if(a.item.ilabel){a.item.ilabel.hide();
map.removeOverlay(a.item.ilabel);
a.item.ilabel=null
}}}function findStand(d){var e=new Date();
for(var b=0,c;
c=polys[b++];
){if(c.item.name==d){var a=new Date();
return c
}}return null
}function log(a){if(window.console&&debug){window.console.log(a)
}}function stripSubStand(a){return isNaN(a.charAt(a.length-1))?a.substring(0,a.length-1):a
}function setupStyles(){var a=new GIcon();
a.image=sCtx+"/i/info.png";
a.printImage=sCtx+"/i/printInfo.gif";
a.mozPrintImage=sCtx+"/i/mozPrintInfo.gif";
a.iconSize=new GSize(24,24);
a.shadow=sCtx+"/i/shadow.png";
a.transparent=sCtx+"/i/transparent.png";
a.shadowSize=new GSize(36,24);
a.printShadow=sCtx+"/i/printShadow.gif";
a.iconAnchor=new GPoint(12,12);
a.infoWindowAnchor=new GPoint(12,0);
serviceIcons.info=a;
a=new GIcon();
a.image=sCtx+"/i/eingang.png";
a.printImage=sCtx+"/i/eingang_printImage.gif";
a.mozPrintImage=sCtx+"/i/eingang_mozPrintImage.gif";
a.iconSize=new GSize(20,20);
a.shadow=sCtx+"/i/eingang_shadow.png";
a.transparent=sCtx+"/i/eingang_transparent.png";
a.shadowSize=new GSize(30,20);
a.printShadow=sCtx+"/i/eingang_printShadow.gif";
a.iconAnchor=new GPoint(10,20);
a.infoWindowAnchor=new GPoint(10,0);
serviceIcons.eingang=a;
a=new GIcon();
a.image=sCtx+"/i/restaurant.png";
a.printImage=sCtx+"/i/printRestaurant.gif";
a.mozPrintImage=sCtx+"/i/mozPrintRestaurant.gif";
a.iconSize=new GSize(24,24);
a.shadow=sCtx+"/i/shadow.png";
a.transparent=sCtx+"/i/transparent.png";
a.shadowSize=new GSize(36,24);
a.printShadow=sCtx+"/i/printShadow.gif";
a.iconAnchor=new GPoint(12,12);
a.infoWindowAnchor=new GPoint(12,0);
serviceIcons.restaurant=a;
a=new GIcon();
a.image=sCtx+"/i/restroom.png";
a.printImage=sCtx+"/i/printRestroom.gif";
a.mozPrintImage=sCtx+"/i/mozPrintRestroom.gif";
a.iconSize=new GSize(24,24);
a.shadow=sCtx+"/i/shadow.png";
a.transparent=sCtx+"/i/transparent.png";
a.shadowSize=new GSize(36,24);
a.printShadow=sCtx+"/i/printShadow.gif";
a.iconAnchor=new GPoint(12,12);
a.infoWindowAnchor=new GPoint(12,0);
serviceIcons.restroom=a;
a=new GIcon();
a.image=sCtx+"/i/halle.png";
a.printImage=sCtx+"/i/printHalle.gif";
a.mozPrintImage=sCtx+"/i/mozPrintHalle.gif";
a.iconSize=new GSize(23,23);
a.shadow=sCtx+"/i/shadowHalle.png";
a.transparent=sCtx+"/i/transparent.png";
a.shadowSize=new GSize(35,23);
a.printShadow=sCtx+"/i/printShadowHalle.gif";
a.iconAnchor=new GPoint(12,12);
a.infoWindowAnchor=new GPoint(12,0);
a.labelOffset=$.browser.msie?new GSize(-10,-4):new GSize(-10,-3);
serviceIcons.halle=a
};function ELabel(a,e,f,c,d,b){this.point=a;
this.html=e;
this.classname=f||"";
this.pixelOffset=c||new GSize(0,0);
if(d){if(d<0){d=0
}if(d>100){d=100
}}this.percentOpacity=d;
this.overlap=b||false;
this.hidden=false
}ELabel.prototype=new GOverlay();
ELabel.prototype.initialize=function(a){var b=document.createElement("div");
b.style.position="absolute";
b.innerHTML='<div class="'+this.classname+'">'+this.html+"</div>";
a.getPane(G_MAP_FLOAT_SHADOW_PANE).appendChild(b);
this.map_=a;
this.div_=b;
if(this.percentOpacity){if(typeof(b.style.filter)=="string"){b.style.filter="alpha(opacity:"+this.percentOpacity+")"
}if(typeof(b.style.KHTMLOpacity)=="string"){b.style.KHTMLOpacity=this.percentOpacity/100
}if(typeof(b.style.MozOpacity)=="string"){b.style.MozOpacity=this.percentOpacity/100
}if(typeof(b.style.opacity)=="string"){b.style.opacity=this.percentOpacity/100
}}if(this.overlap){this.div_.style.zIndex=GOverlay.getZIndex(this.point.lat())
}if(this.hidden){this.hide()
}};
ELabel.prototype.remove=function(){this.div_.parentNode.removeChild(this.div_)
};
ELabel.prototype.copy=function(){return new ELabel(this.point,this.html,this.classname,this.pixelOffset,this.percentOpacity,this.overlap)
};
ELabel.prototype.redraw=function(b){var c=this.map_.fromLatLngToDivPixel(this.point);
var a=parseInt(this.div_.clientHeight);
this.div_.style.left=(c.x+this.pixelOffset.width)+"px";
this.div_.style.top=(c.y+this.pixelOffset.height-a)+"px"
};
ELabel.prototype.show=function(){if(this.div_){this.div_.style.display="";
this.redraw()
}this.hidden=false
};
ELabel.prototype.hide=function(){if(this.div_){this.div_.style.display="none"
}this.hidden=true
};
ELabel.prototype.isHidden=function(){return this.hidden
};
ELabel.prototype.supportsHide=function(){return true
};
ELabel.prototype.setContents=function(a){this.html=a;
this.div_.innerHTML='<div class="'+this.classname+'">'+this.html+"</div>";
this.redraw(true)
};
ELabel.prototype.setPoint=function(a){this.point=a;
if(this.overlap){var b=GOverlay.getZIndex(this.point.lat());
this.div_.style.zIndex=b
}this.redraw(true)
};
ELabel.prototype.setOpacity=function(a){if(a){if(a<0){a=0
}if(a>100){a=100
}}this.percentOpacity=a;
if(this.percentOpacity){if(typeof(this.div_.style.filter)=="string"){this.div_.style.filter="alpha(opacity:"+this.percentOpacity+")"
}if(typeof(this.div_.style.KHTMLOpacity)=="string"){this.div_.style.KHTMLOpacity=this.percentOpacity/100
}if(typeof(this.div_.style.MozOpacity)=="string"){this.div_.style.MozOpacity=this.percentOpacity/100
}if(typeof(this.div_.style.opacity)=="string"){this.div_.style.opacity=this.percentOpacity/100
}}};
ELabel.prototype.getPoint=function(){return this.point
};function EuclideanProjection(g){this.pixelsPerLonDegree=[];
this.pixelsPerLonRadian=[];
this.pixelOrigo=[];
this.tileBounds=[];
var f=256;
var j=1;
for(var i=0;
i<g;
i++){var h=f/2;
this.pixelsPerLonDegree.push(f/360);
this.pixelsPerLonRadian.push(f/(2*Math.PI));
this.pixelOrigo.push(new GPoint(h,h));
this.tileBounds.push(j);
f*=2;
j*=2
}}EuclideanProjection.prototype=new GProjection();
EuclideanProjection.prototype.fromLatLngToPixel=function(f,e){var h=Math.round(this.pixelOrigo[e].x+f.lng()*this.pixelsPerLonDegree[e]);
var g=Math.round(this.pixelOrigo[e].y+(-2*f.lat())*this.pixelsPerLonDegree[e]);
return new GPoint(h,g)
};
EuclideanProjection.prototype.fromPixelToLatLng=function(g,f,j){var i=(g.x-this.pixelOrigo[f].x)/this.pixelsPerLonDegree[f];
var h=-0.5*(g.y-this.pixelOrigo[f].y)/this.pixelsPerLonDegree[f];
return new GLatLng(h,i,j)
};
EuclideanProjection.prototype.tileCheckRange=function(f,e,h){var g=this.tileBounds[e];
if(f.y<0||f.y>=g){return false
}if(f.x<0||f.x>=g){f.x=f.x%g;
if(f.x<0){f.x+=g
}}return true
};
EuclideanProjection.prototype.getWrapWidth=function(a){return this.tileBounds[a]*256
};(function(c){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var d=function(f){f=f.replace(/\x0d\x0a/g,"\x0a");
var e="";
for(var h=0;
h<f.length;
h++){var g=f.charCodeAt(h);
if(g<128){e+=String.fromCharCode(g)
}else{if((g>127)&&(g<2048)){e+=String.fromCharCode((g>>6)|192);
e+=String.fromCharCode((g&63)|128)
}else{e+=String.fromCharCode((g>>12)|224);
e+=String.fromCharCode(((g>>6)&63)|128);
e+=String.fromCharCode((g&63)|128)
}}}return e
};
var a=function(e){var f="";
var g=0;
var h=c1=c2=0;
while(g<e.length){h=e.charCodeAt(g);
if(h<128){f+=String.fromCharCode(h);
g++
}else{if((h>191)&&(h<224)){c2=e.charCodeAt(g+1);
f+=String.fromCharCode(((h&31)<<6)|(c2&63));
g+=2
}else{c2=e.charCodeAt(g+1);
c3=e.charCodeAt(g+2);
f+=String.fromCharCode(((h&15)<<12)|((c2&63)<<6)|(c3&63));
g+=3
}}}return f
};
c.extend({base64Encode:function(g){var e="";
var o,m,k,n,l,j,h;
var f=0;
g=d(g);
while(f<g.length){o=g.charCodeAt(f++);
m=g.charCodeAt(f++);
k=g.charCodeAt(f++);
n=o>>2;
l=((o&3)<<4)|(m>>4);
j=((m&15)<<2)|(k>>6);
h=k&63;
if(isNaN(m)){j=h=64
}else{if(isNaN(k)){h=64
}}e=e+b.charAt(n)+b.charAt(l)+b.charAt(j)+b.charAt(h)
}return e
},base64Decode:function(g){var e="";
var o,m,k;
var n,l,j,h;
var f=0;
g=g.replace(/[^A-Za-z0-9\+\/\=]/g,"");
while(f<g.length){n=b.indexOf(g.charAt(f++));
l=b.indexOf(g.charAt(f++));
j=b.indexOf(g.charAt(f++));
h=b.indexOf(g.charAt(f++));
o=(n<<2)|(l>>4);
m=((l&15)<<4)|(j>>2);
k=((j&3)<<6)|h;
e=e+String.fromCharCode(o);
if(j!=64){e=e+String.fromCharCode(m)
}if(h!=64){e=e+String.fromCharCode(k)
}}e=a(e);
return e
}})
})(jQuery);jQuery.cookie=function(d,e,b){if(arguments.length>1&&(e===null||typeof e!=="object")){b=jQuery.extend({},b);
if(e===null){b.expires=-1
}if(typeof b.expires==="number"){var g=b.expires,c=b.expires=new Date();
c.setDate(c.getDate()+g)
}return(document.cookie=[encodeURIComponent(d),"=",b.raw?String(e):encodeURIComponent(String(e)),b.expires?"; expires="+b.expires.toUTCString():"",b.path?"; path="+b.path:"",b.domain?"; domain="+b.domain:"",b.secure?"; secure":""].join(""))
}b=e||{};
var a,f=b.raw?function(h){return h
}:decodeURIComponent;
return(a=new RegExp("(?:^|; )"+encodeURIComponent(d)+"=([^;]*)").exec(document.cookie))?f(a[1]):null
};(function($){$.i18n={};
$.i18n.map={};
$.i18n.properties=function(settings){var defaults={name:"Messages",language:"",path:"",mode:"vars",callback:function(){}};
settings=$.extend(defaults,settings);
if(settings.language===null||settings.language==""){settings.language=$.i18n.browserLang()
}if(settings.language===null){settings.language=""
}var files=getFiles(settings.name);
for(i=0;
i<files.length;
i++){loadAndParseFile(settings.path+files[i]+".properties",settings.language,settings.mode);
if(settings.language.length>=2){loadAndParseFile(settings.path+files[i]+"_"+settings.language.substring(0,2)+".properties",settings.language,settings.mode)
}if(settings.language.length>=5){loadAndParseFile(settings.path+files[i]+"_"+settings.language.substring(0,5)+".properties",settings.language,settings.mode)
}}if(settings.callback){settings.callback()
}};
$.i18n.prop=function(key,placeHolderValues){var value=$.i18n.map[key];
if(value==null){return"["+key+"]"
}if(!placeHolderValues){return value
}else{for(var i=0;
i<placeHolderValues.length;
i++){var regexp=new RegExp("\\{("+i+")\\}","g");
value=value.replace(regexp,placeHolderValues[i])
}return value
}};
$.i18n.browserLang=function(){return normaliseLanguageCode(navigator.language||navigator.userLanguage)
};
function loadAndParseFile(filename,language,mode){$.ajax({url:filename,async:false,cache:false,contentType:"text/plain;charset=UTF-8",dataType:"text",success:function(data,status){parseData(data,mode)
}})
}function parseData(data,mode){var parsed="";
var parameters=data.split(/\n/);
var regPlaceHolder=/(\{\d+\})/g;
var regRepPlaceHolder=/\{(\d+)\}/g;
var unicodeRE=/(\\u.{4})/ig;
for(var i=0;
i<parameters.length;
i++){parameters[i]=parameters[i].replace(/^\s\s*/,"").replace(/\s\s*$/,"");
if(parameters[i].length>0&&parameters[i].match("^#")!="#"){var pair=parameters[i].split("=");
if(pair.length>0){var name=unescape(pair[0]).replace(/^\s\s*/,"").replace(/\s\s*$/,"");
var value=pair.length==1?"":pair[1];
while(value.match(/\\$/)=="\\"){value=value.substring(0,value.length-1);
value+=parameters[++i].replace(/\s\s*$/,"")
}for(var s=2;
s<pair.length;
s++){value+="="+pair[s]
}value=value.replace(/^\s\s*/,"").replace(/\s\s*$/,"");
if(mode=="map"||mode=="both"){var unicodeMatches=value.match(unicodeRE);
if(unicodeMatches){for(var u=0;
u<unicodeMatches.length;
u++){value=value.replace(unicodeMatches[u],unescapeUnicode(unicodeMatches[u]))
}}$.i18n.map[name]=value
}if(mode=="vars"||mode=="both"){checkKeyNamespace(name);
if(regPlaceHolder.test(value)){var parts=value.split(regPlaceHolder);
var first=true;
var fnArgs="";
var usedArgs=[];
for(var p=0;
p<parts.length;
p++){if(regPlaceHolder.test(parts[p])&&(usedArgs.length==0||usedArgs.indexOf(parts[p])==-1)){if(!first){fnArgs+=","
}fnArgs+=parts[p].replace(regRepPlaceHolder,"v$1");
usedArgs.push(parts[p]);
first=false
}}parsed+=name+"=function("+fnArgs+"){";
var fnExpr='"'+value.replace(regRepPlaceHolder,'"+v$1+"')+'"';
parsed+="return "+fnExpr+";};"
}else{parsed+=name+'="'+value+'";'
}}}}}eval(parsed)
}function checkKeyNamespace(key){var regDot=/\./;
if(regDot.test(key)){var fullname="";
var names=key.split(/\./);
for(var i=0;
i<names.length;
i++){if(i>0){fullname+="."
}fullname+=names[i];
if(eval("typeof "+fullname+' == "undefined"')){eval(fullname+"={};")
}}}}function getFiles(names){return(names&&names.constructor==Array)?names:[names]
}function normaliseLanguageCode(lang){lang=lang.toLowerCase();
if(lang.length>3){lang=lang.substring(0,3)+lang.substring(3).toUpperCase()
}return lang
}function unescapeUnicode(str){var codes=[];
var code=parseInt(str.substr(2),16);
if(code>=0&&code<Math.pow(2,16)){codes.push(code)
}var unescaped="";
for(var i=0;
i<codes.length;
++i){unescaped+=String.fromCharCode(codes[i])
}return unescaped
}var cbSplit;
if(!cbSplit){cbSplit=function(str,separator,limit){if(Object.prototype.toString.call(separator)!=="[object RegExp]"){if(typeof cbSplit._nativeSplit=="undefined"){return str.split(separator,limit)
}else{return cbSplit._nativeSplit.call(str,separator,limit)
}}var output=[],lastLastIndex=0,flags=(separator.ignoreCase?"i":"")+(separator.multiline?"m":"")+(separator.sticky?"y":""),separator=RegExp(separator.source,flags+"g"),separator2,match,lastIndex,lastLength;
str=str+"";
if(!cbSplit._compliantExecNpcg){separator2=RegExp("^"+separator.source+"$(?!\\s)",flags)
}if(limit===undefined||+limit<0){limit=Infinity
}else{limit=Math.floor(+limit);
if(!limit){return[]
}}while(match=separator.exec(str)){lastIndex=match.index+match[0].length;
if(lastIndex>lastLastIndex){output.push(str.slice(lastLastIndex,match.index));
if(!cbSplit._compliantExecNpcg&&match.length>1){match[0].replace(separator2,function(){for(var i=1;
i<arguments.length-2;
i++){if(arguments[i]===undefined){match[i]=undefined
}}})
}if(match.length>1&&match.index<str.length){Array.prototype.push.apply(output,match.slice(1))
}lastLength=match[0].length;
lastLastIndex=lastIndex;
if(output.length>=limit){break
}}if(separator.lastIndex===match.index){separator.lastIndex++
}}if(lastLastIndex===str.length){if(lastLength||!separator.test("")){output.push("")
}}else{output.push(str.slice(lastLastIndex))
}return output.length>limit?output.slice(0,limit):output
};
cbSplit._compliantExecNpcg=/()??/.exec("")[1]===undefined;
cbSplit._nativeSplit=String.prototype.split
}String.prototype.split=function(separator,limit){return cbSplit(this,separator,limit)
}
})(jQuery);if(!this.JSON){this.JSON={}
}(function(){function f(n){return n<10?"0"+n:n
}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null
};
String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()
}
}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;
function quote(string){escapable.lastIndex=0;
return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];
return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)
})+'"':'"'+string+'"'
}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];
if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)
}if(typeof rep==="function"){value=rep.call(holder,key,value)
}switch(typeof value){case"string":return quote(value);
case"number":return isFinite(value)?String(value):"null";
case"boolean":case"null":return String(value);
case"object":if(!value){return"null"
}gap+=indent;
partial=[];
if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;
for(i=0;
i<length;
i+=1){partial[i]=str(i,value)||"null"
}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";
gap=mind;
return v
}if(rep&&typeof rep==="object"){length=rep.length;
for(i=0;
i<length;
i+=1){k=rep[i];
if(typeof k==="string"){v=str(k,value);
if(v){partial.push(quote(k)+(gap?": ":":")+v)
}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);
if(v){partial.push(quote(k)+(gap?": ":":")+v)
}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";
gap=mind;
return v
}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;
gap="";
indent="";
if(typeof space==="number"){for(i=0;
i<space;
i+=1){indent+=" "
}}else{if(typeof space==="string"){indent=space
}}rep=replacer;
if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")
}return str("",{"":value})
}
}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;
function walk(holder,key){var k,v,value=holder[key];
if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);
if(v!==undefined){value[k]=v
}else{delete value[k]
}}}}return reviver.call(holder,key,value)
}cx.lastIndex=0;
if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)
})
}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");
return typeof reviver==="function"?walk({"":j},""):j
}throw new SyntaxError("JSON.parse")
}
}}());function LabeledMarker(b,a){this.opts_=a;
this.labelText_=a.labelText||"";
this.labelClass_=a.labelClass||"LabeledMarker_markerLabel";
this.labelOffset_=a.labelOffset||new GSize(0,0);
this.clickable_=(a.clickable==false)?false:true;
this.title_=a.title||"";
this.labelVisibility_=true;
this.ownVisibility_=true;
if(a.draggable){a.draggable=false
}GMarker.apply(this,arguments)
}LabeledMarker.prototype=new GMarker(new GLatLng(0,0));
LabeledMarker.prototype.initialize=function(c){GMarker.prototype.initialize.apply(this,arguments);
this.map_=c;
this.div_=document.createElement("div");
this.div_.className=this.labelClass_;
this.div_.innerHTML=this.labelText_;
this.div_.style.position="absolute";
if(this.clickable_){this.div_.style.cursor="pointer"
}this.div_.title=this.title_;
if(!this.ownVisibility_){this.hide()
}this.applyLabelVisibility_();
c.getPane(G_MAP_MARKER_PANE).appendChild(this.div_);
if(this.clickable_){var d=["click","dblclick","mousedown","mouseup","mouseover","mouseout"];
for(var b=0;
b<d.length;
b++){var a=d[b];
GEvent.addDomListener(this.div_,a,GEvent.callback(GEvent,GEvent.trigger,this,a,this.getLatLng()))
}}};
LabeledMarker.prototype.redraw=function(a){GMarker.prototype.redraw.apply(this,arguments);
this.redrawLabel_()
};
LabeledMarker.prototype.redrawLabel_=function(){var a=this.map_.fromLatLngToDivPixel(this.getLatLng());
var b=GOverlay.getZIndex(this.getLatLng().lat());
this.div_.style.left=(a.x+this.labelOffset_.width)+"px";
this.div_.style.top=(a.y+this.labelOffset_.height)+"px";
this.div_.style.zIndex=b
};
LabeledMarker.prototype.remove=function(){GEvent.clearInstanceListeners(this.div_);
if(this.div_.outerHTML){this.div_.outerHTML=""
}if(this.div_.parentNode){this.div_.parentNode.removeChild(this.div_)
}this.div_=null;
GMarker.prototype.remove.apply(this,arguments)
};
LabeledMarker.prototype.copy=function(){var a=new LabeledMarker(this.getLatLng(),this.opts_);
a.labelVisibility_=this.labelVisibility_;
a.ownVisibility_=this.ownVisibility_;
return a
};
LabeledMarker.prototype.show=function(){GMarker.prototype.show.apply(this,arguments);
this.ownVisibility_=true;
this.applyLabelVisibility_()
};
LabeledMarker.prototype.hide=function(){GMarker.prototype.hide.apply(this,arguments);
this.ownVisibility_=false;
this.applyLabelVisibility_()
};
LabeledMarker.prototype.setLabelVisibility=function(a){this.labelVisibility_=a;
this.applyLabelVisibility_()
};
LabeledMarker.prototype.getLabelVisibility=function(){return this.labelVisibility_
};
LabeledMarker.prototype.applyLabelVisibility_=function(){if(this.div_){if((!this.isHidden())&&this.labelVisibility_){this.div_.style.display="block"
}else{this.div_.style.display="none"
}}};
LabeledMarker.prototype.setLabelText=function(a){this.labelText_=a;
this.div_.innerHTML=a;
this.opts_.labelText=a
};function MapInfoControl(a){a=a?a:{};
this.background=a.background?a.background:"#ffffff";
this.foreground=a.foreground?a.foreground:"#000000";
this.position=a.position?a.position:new GControlPosition(G_ANCHOR_BOTTOM_LEFT,new GSize(0,45));
this.gCtx=a.gCtx?a.gCtx:"";
this.parent=a.container?a.container:null
}MapInfoControl.prototype=new GControl(true,true);
MapInfoControl.prototype.initialize=function(b){var a=this;
this.map=b;
this.container=document.createElement("div");
this.container.style.backgroundColor=this.background;
this.container.style.height="42px";
this.container.style.width="320px";
this.container.style.border="0px solid #ccc";
this.innerDiv=document.createElement("div");
this.container.appendChild(this.innerDiv);
if(this.parent){this.parent.appendChild(container)
}else{this.map.getContainer().appendChild(this.container)
}GEvent.addListener(this.map,"maptypechanged",function(){a.maptypechanged()
});
this.maptypechanged=function(){var d=this.gCtx+"/info";
var e="h="+this.map.getCurrentMapType().halle;
var c=this.innerDiv;
jQuery(c).fadeOut();
jQuery.ajax({type:"GET",async:false,cache:true,dataType:"json",data:e,url:d,success:function(f){jQuery(c).fadeOut();
c.innerHTML=f.info?f.info:"";
jQuery(c).fadeIn("slow")
}})
};
return this.container
};
MapInfoControl.prototype.getDefaultPosition=function(){return this.position
};
MapInfoControl.prototype.show=function(){this.container.style.display=""
};
MapInfoControl.prototype.hide=function(){this.container.style.display="none"
};
MapInfoControl.prototype.toggle=function(){this.container.style.display=this.container.style.display==""?"none":""
};homeMapID="0";
homeMapZoom=15;
homeMapLatLng=new GLatLng(52.323354,9.805169);
cookieName="bioenergymap";
hallen=["11","12","13","14","15","16","17","25","26","27","F"];
faktor={"11":0.35747,"12":0.34983,"13":0.3333,"14":0.414,"15":0.4129,"16":0.4718,"17":0.4877,"25":0.35243,"26":0.338,"27":0.36888,F:0.482};
offset={"11":{x:-144.45,y:-106.95},"12":{x:-145.308,y:-118.231},"13":{x:-159,y:-99.525},"14":{x:-125.595,y:-124.75},"15":{x:-125.76,y:-125.99},"16":{x:-108.16,y:-77.77},"17":{x:-100.944,y:-107.91},"25":{x:-158.874,y:-92.516},"26":{x:-150.446,y:-85.269},"27":{x:-134.1,y:-129.078},F:{x:-200.15,y:-232.3}};
standStyles.mouseover=new StandStyle("#000000","#0000FF","#0000FF",true,"labelStyle",0.5,"");
standStyles.current=new StandStyle("#000000","#CC0000","#CC0000",true,"labelStyle",1,"");
standStyles.merkliste=new StandStyle("#000000","#0059E3","#0059E3",true,"labelStyle",0.5,"");
standStyles.other=new StandStyle("#000000","#B8B888","#B8B888",false,"",0.5,"");
standStyles.halle=new StandStyle("#000000","#0059E3","#0059E3",false,"",0.5,"");
standStyles["0913710"]=new StandStyle("#000000","#FF7E00","#FF7E00",false,"",0.3,"http://static.agritechnica.com/i/bioenergy-tiny.png");
standStyles["0913710.merkliste"]=new StandStyle("#000000","#0059E3","#FF7E00",true,"labelStyle",0.5,"http://static.agritechnica.com/i/bioenergy-tiny.png");
standStyles["0913710.current"]=new StandStyle("#000000","#CC0000","#FF7E00",true,"labelStyle",1,"http://static.agritechnica.com/i/bioenergy-tiny.png");
standStyles["0013710"]=new StandStyle("#000000","#B8B8B8","#B8B8B8",false,"",0.3,"http://static.agritechnica.com/i/eurotier-tiny.png");
standStyles["0013710.merkliste"]=new StandStyle("#000000","#B8B8B8","#B8B8B8",true,"labelStyle",0.5,"http://static.agritechnica.com/i/eurotier-tiny.png");
standStyles["0013710.current"]=new StandStyle("#CC0000","#B8B8B8","#B8B8B8",true,"labelStyle",0.8,"http://static.agritechnica.com/i/eurotier-tiny.png");jQuery(document).ready(function(){gmapInit("map","/dlg-bioenergy","http://static.agritechnica.com")
});
