/* dreieck */
function init(scrolll) {
 window.scrollTo(0,scrolll);
 if (swf==1) {document.getElementById("flashbild").style.visibility="visible";}
 if (swf==0) {document.getElementById("gifbild").style.visibility="visible";}
}
/* drucken */
function drucken(a) {
 var xsize = screen.width
 var ysize = screen.height
 var breite=600;
 var hoehe=ysize*0.8;
 var xpos=(xsize-breite)/2
 var ypos=(ysize-hoehe)/2
 window.open("/print.php?"+a,"","scrollbars=yes,status=yes,toolbar=no,location=no,directories=no,resizable=no,menubar=yes,width="+breite+",height="+hoehe+",screenX="+xpos+",screenY="+ypos+",top="+ypos+",left="+xpos)
}
/* universal */
function getscroller() {
 if (br=="MS6" || br=="MS55" || br=="MS5" || br=="MS7") {Yscroller=document.body.scrollTop;}
 if (br=="FF1") {Yscroller=window.pageYOffset;}
 document.getElementById("universalcontainer").style.top=Yscroller;
 document.getElementById("blender").style.top=Yscroller-20;
}
function getPageSize(){

	var xScroll, yScroll;

	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
	return arrayPageSize;
}
/* platz galerie */
function nextgalerie() {
 bild++;
 if (bild==bilder.length) {bild=0;}
 showgalerie(bild);
}
function backgalerie() {
 bild--;
 if (bild<0) {bild=bilder.length-1;}
 showgalerie(bild);
}
function showgalerie(bild) {
 //alert(bild);
 var inhalt='<table style="margin:4px;" class="detailtable" width=574 border=0 cellspacing=0 cellpadding=0 bgcolor="#FEFCF8">';
 inhalt=inhalt+'<tr><td class="detailgruppe">Galerie</td></tr>';
 inhalt=inhalt+'<tr><td class="detailtdpic" align=center height=419><a href="javascript:closegalerie()"><img src="camp_bilder/'+bilder[bild]+'" border=0></a></td></tr>';
 inhalt=inhalt+'<tr>';
 inhalt=inhalt+'<td class="detailtdlr">';
 inhalt=inhalt+'<table border=0 cellspacing=1 cellpadding=0><tr>';
 inhalt=inhalt+'<td width=70 align=center bgcolor="#FBE8A3"><a href="javascript:closegalerie()" class="klein">schliessen</a></td>';
 inhalt=inhalt+'<td align=center width=434 class="klein">'+texte[bild]+'</td>';
 inhalt=inhalt+'<td width=35 bgcolor="#FBE8A3" align=center><a href="javascript:backgalerie()" class="klein">&#60;&#60;&#60;</a></td>';
 inhalt=inhalt+'<td width=35 bgcolor="#FBE8A3" align=center><a href="javascript:nextgalerie()" class="klein">&#62;&#62;&#62;</a></td>';
 inhalt=inhalt+'</table>';
 inhalt=inhalt+'</td>';
 inhalt=inhalt+'</tr>';
 inhalt=inhalt+'</table>';
 document.getElementById("universalcontainer").innerHTML=inhalt;
 if (br=="MS6" || br=="MS55" || br=="MS5" || br=="MS7") {
  scrollmenuw=document.body.scrollTop;
 } else {
  scrollmenuw=window.pageYOffset;
 }
 arrayPageSize = getPageSize()
 document.getElementById("blender").style.height=arrayPageSize[1];
 document.getElementById("blender").style.display="block";
 document.getElementById("universalcontainer").style.top=scrollmenuw;
 document.getElementById("universalcontainer").style.left="197";
 document.getElementById("universalcontainer").style.width="582";
 document.getElementById("universalcontainer").style.height="441";
 document.getElementById("universalcontainer").style.display="block";
 if (br=="FF1") {
  document.getElementById("blender").addEventListener("click",closegalerie,true);
 } else {
  document.getElementById("blender").attachEvent("onclick",closegalerie);
 }
}
function closegalerie() {
 document.getElementById("universalcontainer").style.display="none";
 document.getElementById("blender").style.display="none";
}
/* neues login */
function showlogin() {
 arrayPageSize = getPageSize()
 document.getElementById("blender").style.height=arrayPageSize[1];
 document.getElementById("blender").style.display="block";
 if (br=="MS6" || br=="MS55" || br=="MS5" || br=="MS7") {scrollmenuw=document.body.scrollTop;} else {scrollmenuw=window.pageYOffset;}
 document.loginl.scrolll.value=scrollmenuw;
 document.getElementById("logindiv").style.top=scrollmenuw+150;
 document.getElementById("logindiv").style.display="block";
 document.loginl.userl.focus();
}
function showloginfrommenu() {
 document.getElementById("logindiv").style.top=150;
 document.getElementById("logindiv").style.display="block";
 document.loginl.userl.focus(); 
}
function showlogingast() {
 document.loginl.userl.value="Gast";
 document.loginl.passwortl.value="gast";
 showlogin();
}
function closelogin() {
 document.getElementById("blender").style.display="none";
 document.getElementById("logindiv").style.display="none"; 
}
function closehelpsearch() {
 document.getElementById("helpsearchdiv").style.display="none";
}
function platzmerken(campid) {
 document.getElementById("merkerframe").src="/merkliste.php?add="+campid;
 document.getElementById("platzmerken"+campid).innerHTML='';
 document.getElementById("merkliste").style.display="block";
}
function addtofav() {
 document.getElementById("merkerframe").src="/merkliste.php?addtofav=1";
}
function countcamp(c) {   /* neuer counter */
 a=new Image();
 a.src="/count_platz.php?campid="+c+"&nc="+Math.random();
 return true;
}

