if(document.addEventListener){window.addEventListener('load',initialize,false);}
else if(document.attachEvent){window.attachEvent('onload',initialize);}
else{window.onload=initialize;}
var showbox;var newsshow;function initialize(){Custom.init();showbox=new SHOWBOX('menu_sub_news','menu_sub_events','menu_sub_pfeil_runter','menu_sub_pfeil_hoch',{max_height:320,min_height:155,bg_max:'images/menue.jpg',bg_min:'images/menu_sub.jpg',delay:3,amount:10});MM_preloadImages(preloadImages);}
function change_galerie(aid){window.fotos=window.fotoarray[aid];window.imgpath=window.imgpatharray[aid];document.getElementById("overlay_scroll").innerHTML='<table cellpadding="0" cellspacing="0" style="margin-top:-1px;"><tr>'+window.thumbs[aid]+"</tr></table>";document.getElementById("anzahlbilder").innerHTML=window.fotoarray[aid]?window.fotoarray[aid].length:0;document.getElementById("overlay_scroll").style.left=0;document.getElementById("galerie_name").innerHTML=window.namenarray[aid];document.getElementById("anzeigentext_thumb").src=window.smallthumburls[aid];document.getElementById("anzeigentext").innerHTML=window.anzeigentexte[aid];scrollstart(20);}
function change_rubid(rubid)
{document.getElementById("overlay_thumb_frame").innerHTML=window.bigthumbs[rubid];}
function change_all(rubid,aid)
{change_rubid(rubid);change_galerie(aid);}
function createMarker(point,html){var marker=new GMarker(point);GEvent.addListener(marker,"click",function(){marker.openInfoWindowHtml(html);});GEvent.addListener(marker,"mouseover",function(){marker.openInfoWindowHtml(html);});return marker;}
var isbig=0;function change_textsize(lng)
{var divs=document.getElementsByTagName("div");for(i=0;i<divs.length;i++)
{if(isbig==0)
{if(divs[i].className=="text_box")
{divs[i].className="text_box_big";}}
else if(isbig==1)
{if(divs[i].className=="text_box_big")
{divs[i].className="text_box_bigger";}}else{if(divs[i].className=="text_box_bigger")
{divs[i].className="text_box";}}}
if(isbig==0){isbig=1;}else if(isbig==1){isbig=2;if(lng=="eng"){document.getElementById("textzoom").innerHTML="Zoom text";}else{document.getElementById("textzoom").innerHTML="Text verkleinern";}}else{isbig=0;if(lng=="eng"){document.getElementById("textzoom").innerHTML="Zoom text";}else{document.getElementById("textzoom").innerHTML="Text vergrößern";}}}
var fader;var fadeopacity=1;function fadeout($img,$src)
{fadeopacity-=0.1;document.getElementById("bigimage").style.filter="alpha(opacity="+parseInt(fadeopacity*100)+")";document.getElementById("overlay_inner_bildbigframe").style.opacity=fadeopacity;if(fadeopacity>0)
{fader=setTimeout("fadeout('"+$img+"','"+$src+"')",25);}
else
{oldImg=document.getElementById($img);newImg=new Image();newImg.src=$src;newImg.id=$img;newImg.border=oldImg.border;newImg.className=oldImg.className;newImg.style.filter="alpha(opacity=0)";oldImg.parentNode.appendChild(newImg);oldImg.parentNode.removeChild(oldImg);document.getElementById("overlay_preload").style.visibility="visible";fader=setTimeout("complete('"+$img+"')",5);}}
function fadein()
{fadeopacity+=0.1;document.getElementById("bigimage").style.filter="alpha(opacity="+(fadeopacity*100)+")";document.getElementById("overlay_inner_bildbigframe").style.opacity=fadeopacity;if(fadeopacity<1)
{fader=setTimeout("fadein()",25);}else if(slider!=null){clearTimeout(slider);slider=setTimeout("swap_big('bigimage')",7500);}}
function complete($img)
{if(document.getElementById($img).complete==false)
{fader=setTimeout("complete('"+$img+"')",5);}
else
{document.getElementById("overlay_preload").style.visibility="hidden";fader=setTimeout("fadein()",25);}}
function swap_image($img,$src){if(typeof(slider)!="undefined")
stop_slide();window.fotoakt=$src;document.getElementById("aktuellesbild").innerHTML=parseInt(window.fotoakt)+1;if(typeof(window.imgsuffix)=="undefined")
{window.imgsuffix="";}
if(window.fotos){$src=window.imgpath+window.fotos[$src]+window.imgsuffix;}
preloadImages.push($src);if(document.getElementById($img)){clearTimeout(fader);fader=setTimeout("fadeout('"+$img+"','"+$src+"')",25);}}
function swap_big($img,$richtung){if(typeof($richtung)=="undefined")
{$richtung=false;}
if($richtung==false)
{window.fotoakt++;}
else
{window.fotoakt--;}
if(window.fotoakt+1>window.fotos.length){window.fotoakt=0;}
if(window.fotoakt<0){window.fotoakt=window.fotos.length-1;}
if(typeof(window.imgsuffix)=="undefined")
{window.imgsuffix="";}
document.getElementById("aktuellesbild").innerHTML=parseInt(window.fotoakt)+1;$src=window.imgpath+window.fotos[window.fotoakt]+window.imgsuffix;preloadImages.push($src);if(document.getElementById($img)){clearTimeout(fader);fader=setTimeout("fadeout('"+$img+"','"+$src+"')",25);}}
var preloadImages=new Array();function MM_preloadImages(preloadImages){preloaded=new Array();if(typeof(preloadImages)=='object'&&preloadImages.length>0){for(index in preloadImages){preloaded[index]=new Image;preloaded[index].src=preloadImages[index];}}}
function makeSourceAddress(){anfahrtStrasse=document.getElementById('strasse');anfahrtPLZ=document.getElementById('plz');anfahrtOrt=document.getElementById('ort');startAdresse='';if(typeof(anfahrtStrasse)=='object'&&anfahrtStrasse!=null&&anfahrtStrasse.value!=''){startAdresse+=anfahrtStrasse.value+', ';}
if(typeof(anfahrtPLZ)=='object'&&anfahrtPLZ!=null&&anfahrtPLZ.value!=''){startAdresse+=anfahrtPLZ.value+' ';}
if(typeof(anfahrtOrt)=='object'&&anfahrtOrt!=null&&anfahrtOrt.value!=''){startAdresse+=anfahrtOrt.value;}
adressFeld=document.getElementById('saddr');if(typeof(adressFeld)=='object'&&adressFeld!=null){adressFeld.value=startAdresse;}
else{return false;}}
function entry_preview()
{alert(document.forms[0].gbuch_name.value);}
NEWSSHOW=function(obj,attr){var div_top;var div_down;var div_count=1;var fadeinopacity;var fadeoutopacity;this.start=function(start_delay){news_interval=setInterval(function(){setdiv(1);},start_delay);}
this.stop_news=function(){if(typeof news_interval!='undefined'){clearInterval(news_interval);}}
this.next=function(){setdiv(1);}
this.prev=function(){setdiv(-1);}
function setdiv(direction){div_top=attr.div_id+div_count;div_count+=1;if(div_count>attr.divs){div_count=1;}
div_down=attr.div_id+div_count;fadeinopacity=0;fadeoutopacity=1;news_fade=setInterval(function(){fadenews();},attr.fade_delay);}
function fadenews(){fadeinopacity+=0.1;fadeoutopacity-=0.1;if(fadeinopacity>1){if(typeof news_interval!='undefined'){clearInterval(news_fade);document.getElementById(div_top).style.filter="alpha(opacity=0)";document.getElementById(div_top).style.opacity=0;}
return;}
document.getElementById(div_top).style.filter="alpha(opacity="+(fadeoutopacity*100)+")";document.getElementById(div_top).style.opacity=fadeoutopacity;document.getElementById(div_down).style.filter="alpha(opacity="+(fadeinopacity*100)+")";document.getElementById(div_down).style.opacity=fadeinopacity;}}
function show_hometext(){var homebox=document.getElementById("homezusatz");if(homebox.style.display!="none"){homebox.style.display="none";}
else{homebox.style.display="block";}}
