function HideIndexElement(element){
    if(parent.document.getElementById(element))
	    parent.document.getElementById(element).style.visibility = "hidden";
}

function Passw(){ 
	var password = 'Bitte geben Sie hier Ihr Passwort ein!' 
	password=prompt('Passwortgeschuetzter Bereich. Ihr Passwort:',''); 
	//window.open(sUrl,title,'toolbar=no,location=no,status=no,directories=no,menubar=no,scrollbars='+scroll+',resizable=no,height='+iHeight+',width='+iWidth);
	window.open("oldpage/" + password + ".htm"); 
}

function newwin(sUrl,iWidth,iHeight,scroll){
	window.open(sUrl,'','toolbar=no,location=no,status=no,directories=no,menubar=no,scrollbars='+scroll+',resizable=no,height='+iHeight+',width='+iWidth);
}

function preloadImages(){
	var d=document; if(d.images){ if(!d.p) d.p=new Array();
	var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function writeToolsbox(){
	ToolsboxText = 				"<a href=\"mailto:KBuehne@gmx.net\"><img src=\"images/envelop.gif\" id=\"envelop\"></a><br>";
	ToolsboxText = ToolsboxText+"<a href=\"private.html\"><img src=\"images/key.gif\" id=\"symbol\"></a><br>";
	ToolsboxText = ToolsboxText+"<a href=\"http://www.nedstatbasic.net/stats?ACZ1NgdoTFcZ0PIlljVrSDCtqmvw\" target=\"_blank\"><img src=\"images/statistics.gif\" id=\"symbol\"></a><br>";

	document.getElementById("Toolsbox").innerHTML = ToolsboxText;
}

function getNav(currpage){

	var navpoints = new Array(
							new Array("Die Mitwirkenden", "mitwirkende", "menu1"),
							new Array("Die Partner", "partner", "menu2"),
							new Array("Der Streifzug", "streifzug", "menu3"),
							new Array("Der Kern", "kern", "menu4"),
							new Array("Das aktuelle Stück", "aktstueck", "menu5"),
							new Array("Videos", "videos", "menu6")
							/*new Array("Das Gästebuch", "guestbook", "menu7")*/
					);
	var navigation = 			"<div class=NavigationRow>";
	var standardlinktag;
	var linktext;
	for(i=0;i<navpoints.length;i++){
		link = navpoints[i][1] + ".html";
		if (i == 3){
			navigation = navigation + 	"</div>";
			navigation = navigation + 	"<div class=NavigationRow>";
		}
			link = link;
			effectclass = "";
			linktext = navpoints[i][0];
			standardlinktag = "<a href=" + link + " onmouseover=changeMenuItem('"+ navpoints[i][2] +"','over'); onmouseout=changeMenuItem('"+ navpoints[i][2] +"','out');" +effectclass+ ">" + linktext + "</a>";
		if(currpage){
			if (currpage == navpoints[i][2]){
				navigation = navigation + 		"<div id="+ navpoints[i][2] +" class=menuItem>"+ linktext +"</div>";
			}else{
				navigation = navigation + 		"<div id="+ navpoints[i][2] +" class=menuItem>" + standardlinktag + "</div>";
			}
		}else{
			navigation = navigation + 		"<div id="+ navpoints[i][2] +" class=menuItem>" + standardlinktag + "</div>";
		}
	}
	navigation = navigation + 	"</div>";
	//alert(navigation)
	
	document.getElementById('nagivationbox').innerHTML = navigation;
	if(currpage){changeMenuItem(currpage,'selected')}
	
	writeToolsbox();
}

function changeMenuItem(menuitem, mouseaction){
	//document.getElementById(menuitem).style.backgroundImage = "url(test/omover_bg.gif)";
	oMenuItem = document.getElementById(menuitem).style;
	if ((mouseaction == 'over')||(mouseaction == 'selected')){
		oMenuItem.border = "1px solid black";
		//oMenuItem.border = "dashed black 1px";
		//oMenuItem.background = "#B56444";
		//oMenuItem.padding = "2px 5px 2px 5px";
		//oMenuItem.background = "#BB5F33";
		//oMenuItem.filter = "alpha(opacity=100, finishopacity=40, style=1)";
		if (mouseaction == 'selected'){
			//oMenuItem.background = "gold";
		}
	}else{
		oMenuItem.border = "0px";
		//oMenuItem.background = "none";
		//oMenuItem.padding = "3px 6px 3px 6px";
	}
}

function createGallery(div,SubjectName,totImgs){
	var Gallery = "";
	for(i=1; i<totImgs+1;i++) {
		Gallery += "<a href='#' id='" + SubjectName + i + "' onclick=chgImg('" + div + "','" + SubjectName + "'," + i + "," + totImgs + ");><img src='images/galleries/" + SubjectName + "/" + i + "_tn.jpg'></a>&nbsp;"
	}
	document.getElementById(div).innerHTML = Gallery;
}

function chgImg(div,SubjectName,ImgNum,totImgs){
	if (ImgNum != 1){
		BackStr = "<<  <a href=javascript:chgImg('" + div + "','" + SubjectName + "'," + (ImgNum - 1) + "," + totImgs + ");>zurück</a>";
	}else{
		BackStr = " ";
	}
	if ((totImgs) != ImgNum){
		NextStr = "<a href=javascript:chgImg('" + div + "','" + SubjectName + "'," + (ImgNum + 1) + "," + totImgs + ");>weiter</a>  >>";
	}else{
		NextStr = " ";
	}
	document.getElementById(div).innerHTML = "<a href=javascript:location.reload();><img src=images/galleries/" + SubjectName + "/" + ImgNum + ".jpg></a><div id=GalleryNav>" + BackStr + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + NextStr + "</div>";
}

param_name=new Array();
param_value=new Array();

indirizzo=unescape(String(this.location));
chkqstring = indirizzo.indexOf("?",1)
if (chkqstring > 0) {
	params=indirizzo.split("?");
	param=params[1].split("&");
			
	for(i=0;i<param.length;i++){ 
		param_temp=param[i].split("="); 
		if(param_temp[1]!=""){
			param_name[i]=param_temp[0]; 
			param_value[i]=param_temp[1]; 
		}
		if(isNaN(param_value[i])) eval("var "+param_name[i]+"='"+param_value[i]+"';"); 
		else eval("var "+param[i]+";"); 
	}
}

HideIndexElement('advert');
