if(typeof bergfex=="undefined"){var bergfex=new Object();}var mapSearch=null;if(window.location.hash!=""&&window.location.hash.substr(0,2)=="#/"){window.location.href=window.location.hash.substr(1);
}else{var bergfexMap=null;var fnDocumentWrite=null;var libsLoaded=false;jssm.inline();
$(document).ready(function(){var c=$("#mapactions-text").text();$("#mapaction_help").bind("click",function(d){Infobar.show("javascript performance index: "+getJSPerformance());
});$("#mapaction_link").bind("click",function(e){if(bergfexMap!=null){var d=bergfexMap.getUrlFromLocation();
Infobar.show('Link: <a style="font-weight: normal;" href="'+d+'">'+d+"</a>");}});
$("#mapaction_up").bind("click",function(d){if(bergfexMap!=null){bergfexMap.increaseMapHeight(-50);
}});$("#mapaction_down").bind("click",function(d){if(bergfexMap!=null){bergfexMap.increaseMapHeight(50);
}});$("#mapaction_full").bind("click",function(d){if(bergfexMap!=null){bergfexMap.toggleFullscreen();
}});$("#mapaction_close").bind("click",function(d){if(bergfexMap!=null){bergfexMap.setFullscreen(false);
unloadMap();}});$(".map_enable").bind("click",function(d){loadMap();});$("#infobar-close").bind("click",function(d){Infobar.hide();
});$("#mapaction_help").bind("mouseover",function(d){$("#mapactions-text").text("Hilfe und Beschreibung");
});$("#mapaction_link").bind("mouseover",function(d){$("#mapactions-text").text("Link zur Kartenposition");
});$("#mapaction_up").bind("mouseover",function(d){$("#mapactions-text").text("Kartenausschnitt verkleinern");
});$("#mapaction_down").bind("mouseover",function(d){$("#mapactions-text").text("Kartenausschnitt vergrößern");
});$("#mapaction_full").bind("mouseover",function(d){$("#mapactions-text").text("Vollbild");
});$("#mapaction_close").bind("mouseover",function(d){$("#mapactions-text").text("Karte ausblenden");
});$(".map_enable").bind("mouseover",function(d){$("#mapactions-text").text("Karte einblenden");
});$("#mapaction_help,#mapaction_link,#mapaction_up,#mapaction_down,#mapaction_full,#mapaction_close,.map_enable").bind("mouseout",function(d){$("#mapactions-text").text(c);
});var a=($("meta[name=geonomap]").attr("content")==1);var b=getJSPerformance();if(window.location.href.indexOf("mapstate=")!=-1||(mapEnabled&&!a&&$(window).height()>660&&b>4)){loadMap();
}else{if(!a){$("#mapactions-text").html("<div style='color: green; font-size: 10px;'>Karte einblenden?</div>");
}}initColorbox();$(".searchbox").searchbox();});}function getPageUri(){var a=null;
if(window.location.hash!=""&&window.location.hash.substr(0,2)=="#/"){a="http://"+window.location.hostname+window.location.hash.substr(1);
}else{a=window.location.href;}return a;}function getJSPerformance(){if(typeof(getJSPerformance.jsindex)=="undefined"){var d=new Date();
var a=d.getTime();for($i=0;$i<25;$i++){var b=$("div").length;}var c=new Date();var e=c.getTime()-a;
getJSPerformance.jsindex=Math.round(1/(e/b));}return getJSPerformance.jsindex;}function loadMap(b){if(!b&&!$.cookie("skipSpeedCheck")){var a=getJSPerformance();
if(a<8){Infobar.show("Bei älteren Internetbrowsern ist die Navigation möglicherweise eingeschränkt. <a href='' onclick='Infobar.hide(); loadMap(true); return false;'>Trotzdem einblenden?</a>");
return false;}}else{$.cookie("skipSpeedCheck",true);}$("#home_header").hide("blind",{},400,function(){$("#home_header").remove();
});$("#map").height(mapHeight);$("#map").show("blind",{},400);if(!libsLoaded){GoogleMapsApiLoader.load(gMapKey,loadMapLibs);
}else{setupMap();}return true;}function loadMapLibs(){$.getScript("/include/jsmin/map-libs.yui.js",setupMap);
}function mapSearchCallback(a){loadPage(a.link);return false;}function setupMap(){libsLoaded=true;
if(typeof(BergfexMap)=="undefined"){window.setTimeout(setupMap,0);return;}$("#mapaction_help,#mapaction_link,#mapaction_up,#mapaction_down,#mapaction_full,#mapaction_close").show();
$(".map_enable").hide();bergfexMap=new BergfexMap("map_canvas","map");mapSearch=new bergfex.MapSearch(bergfexMap.map,{callbackOnShow:mapSearchCallback});
$(document).bind("mapsearchhide",function(){$("#mapfullscreen").css("right","24px");
});$(document).bind("mapsearchclose",function(){$("#mapfullscreen").css("right","6px");
});window.setTimeout(function(){bergfexMap.setResizable(true);},250);bindLinks();
$.post("/ajax/cookies/",{bergfexMapEnabled:"true"});$(document).trigger("maploaded");
return false;}function unloadMap(a){if(typeof(a)=="undefined"){a=true;}GUnload();
$(".map_enable").show();$("#mapaction_help,#mapaction_link,#mapaction_up,#mapaction_down,#mapaction_full,#mapaction_close").hide();
$("a[href!=]").unbind("click");$("a[href!=]").each(function(){if(jQuery.isFunction(this.onclick)&&this.onclick.toString().indexOf("loadPage")!=-1){this.onclick=null;
}});bergfexMap.unload();bergfexMap=null;if(a){$.post("/ajax/cookies/",{bergfexMapEnabled:"false"});
}$("#map").hide("blind",{},500);return false;}function loadTrack(type,id){if(bergfexMap!=null&&bergfexMap.isLoaded()&&!bergfexMap.isOverlayLoaded(type+id)){$.getScript("/ajax/gmap/gpx/?type="+type+"&id="+id,function(data,textStatus){eval(data);
if(typeof(trackpoints)!="undefined"){var polyline=new GPolyline(trackpoints,"#ff0000",4);
bergfexMap.addOverlay(type+id,polyline);}});}else{$(document).bind("maploaded",function(){loadTrack(type,id);
});}}function toggleMap(){effect="blind";if($("#map").is(":visible")){$("#map").hide(effect,{},600);
$("#togglemap").html("einblenden");document.title="Karte ausgeblendet";}else{$("#map").show(effect,{},600);
$("#togglemap").html("ausblenden");document.title="Karte eingeblendet";}}function setTarget(d,b,c,a){if(bergfexMap==null){$(document).bind("maploaded",function(){setTarget(d,b,c,a);
if($(window).scrollTop()>120){window.scrollTo(0,$("#map").position().top);}});loadMap();
}else{bergfexMap.setCenter(new GLatLng(d,b),c);bergfexMap.setTarget(new GLatLng(d,b));
if(typeof(a)!="undefined"){bergfexMap.setMapTypeById(a);}if($(window).scrollTop()>120){window.scrollTo(0,$("#map").position().top);
}}return false;}function loadPage(a){if(a.match(/(link|images|shop|mybergfex|login)/)){location.href=a;
return true;}var b=a.replace(/http:\/\/[^\/]*/,"");jssm.setHash(b);bergfexMap.setFullscreen(false);
return false;}function getPage(a){$("#loading-indicator").show();$.post(a,{isAjax:1},function(g,c){var d=new RegExp("<title>([^<]*)</title>");
var f=d.exec(g);if(f!==null){document.title=f[1];}var h=getMetaData("geoposition",g);
var b=getMetaData("geocontext",g);var j=getMetaData("geonomap",g);var i=getMetaData("geotarget",g);
if(h&&(h!=0)){bergfexMap.setPosition(h,b,i);}if(j==1){unloadMap(false);}var k=g.substring(g.indexOf("<!--page-top-->"),g.indexOf("<!--/page-top-->")-1);
var e=g.substring(g.indexOf("<!--page-bottom-->"),g.indexOf("<!--/page-bottom-->"));
if(k&&e){$("#page-top").html(k);$("#page-bottom").html(e);if(j!=1){bindLinks();}}else{window.location.href=a;
}initColorbox();$(".searchbox").searchbox();addMetaData("geocontext",b);addMetaData("geotarget",i);
addMetaData("geonomap",j);addMetaData("geoposition",h);$("#loading-indicator").hide();
});if(bergfexMap!==null){bergfexMap.setFullscreen(false);}return false;}function initColorbox(){var a={transition:"elastic",speed:250,current:"{current}/{total}"};
a.title=function(){var b=$(this).find("div.colorboxTitleInfo");if(b.length>0){return b.html();
}else{return $(this).attr("title");}};$("a[rel=colorbox]").colorbox(a);$(document).bind("cbox_open",function(){$(".hasFlash").css("visibility","hidden");
});$(document).bind("cbox_closed",function(){$(".hasFlash").css("visibility","visible");
});}function bindLinks(a){if(typeof(a)=="undefined"){a="";}else{a+=" ";}$(a+"a[href^='/'],a[href*='"+location.hostname+"']").not("[href*=/link/]").not("[class=lightbox]").not("[rel=nojs]").not("[href*=/shop/]").not("[rel=colorbox]").not("[href*=/login/]").jssm("click");
}function getMetaData(b,c){var a=false;var d=new RegExp('meta name="'+b+'" content="([^"]*)">');
var e=d.exec(c);if(e!=null){a=e[1];}return a;}function addMetaData(a,b){if(b===false){b=0;
}if(b===true){b=1;}if($("meta[name="+a+"]").length==0){$("head").append('<meta name="'+a+'" content="">');
}$("meta[name="+a+"]").attr({content:b});}function on(c){if(document.images){regexp=/(\/on\/)+/gi;
path=document[c].src.replace(regexp,"/");var a=path.split("/");a[a.length-1]="on/"+a[a.length-1];
path=a.join("/");var b=new Image();b.src=path;document[c].src=path;}}function off(b){if(document.images){regexp=/(\/on\/)+/gi;
}path=document[b].src.replace(regexp,"/");var a=new Image();a.src=path;document[b].src=path;
}function switchTeaserDetail(a){divDetail=document.getElementById(a+"_detail");divTeaser=document.getElementById(a+"_teaser");
if(divDetail){divDetail.style.display="block";}if(divTeaser){divTeaser.style.display="none";
}}function switchImage(b,c){if(document.images){var a=new Image();a.src=c;document[b].src=c;
}}function getAjaxAdByZone(e,a,d){if(typeof(d)=="undefined"){d=e;}var b=new Date();
var c="http://openx.bergfex.at/delivery/jsonp.php?zoneid="+e+"&source="+a+"&loc="+escape(window.location)+"&ts="+b.getTime()+"&isAjax=1&jsoncallback=?";
if(!$.browser.opera){$.getJSON(c,function(f,i){if(f.html.length>0){if(e==5){$("#adzone_"+d).html(f.html);
$("#adzone_"+d).show();}else{var g=f.cache;g="/include/cache/?id="+f.bannerid+"&source="+f.source+"&zonedivid="+d;
if(f.html.substring(0,7)=="adsense"){g=getPageUri();if(g.indexOf("?")!=-1){g=g.substring(0,g.indexOf("?"));
}var h=f.html.substring(8,28);g+="?adsense="+h+"&nolog";$("#adzone_"+d).show();}$("#adzone_"+d).append('<iframe id="adiframe_'+d+'" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe>');
$("#adiframe_"+d).attr("src",g);$("#adzone_"+d+",#adiframe_"+d).attr({width:f.width,height:f.height});
}}});}}$(document).ready(function(){$("div[id^=adiframe]").each(function(){if($(this).contents().width()>0){}});
});
