var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

var remote;

function opendetailpic(url, width, height, windowname) {
	detailpicture = window.open(url, ((windowname) ? windowname : "Grossansicht"),"height="+(height+20)+",width="+(width+20)+",scrollbars=no");
}

function openBigSize(string) {
	PIC = window.open(string, "Grossansicht","height=650,width=650,scrollbars=no");
}

function pet_popup(string) {
	F = window.open(string,"Popup","height=650,width=600,scrollbars=yes");
}

function popup(string) {
	F = window.open(string,"Popup","height=600,width=400,scrollbars=yes");
}

function switch_on(img) {
	eval('document.images.'+img+'.src='+img+'_a.src');
}


function switch_off(img) {
	eval('document.images.'+img+'.src='+img+'_p.src');
}


function stuff(s) {
	document.msgForm.message.value = s;
}


function showDiv(target) {
	for (i=0;i<div.length;i++) {
		if(target != div[i] && div[i] != "") {
			document.getElementById(div[i]).style.visibility = "hidden";
		}
	}
	if (document.getElementById)
				document.getElementById(target).style.visibility = "visible";
}


function hideDiv (target) {
	if (document.getElementById)
				document.getElementById(target).style.visibility = "hidden";
}


function winOpen(url,w,h,name) {
	var l = (screen.availWidth - w) / 2;
	var t = (screen.availHeight - h) / 2;
	remote = window.open(url,name,"width="+w+",height="+h+",screenX="+l+",screenY="+t+",top="+t+",left="+l+",scrollbars=no, resizable=no");
	//remote.location.href = url;
		if (remote.opener == null) remote.opener = window;
	remote.opener.name = "opener";
}


function showNaehrwert() {
	if (document.getElementById)
			document.getElementById("divProdukteNaehrwert").style.visibility = "visible";
}


function hideNaehrwert() {
	if (document.getElementById)
		document.getElementById("divProdukteNaehrwert").style.visibility = "hidden";
}


//Function erm?glicht Ein- bzw. Ausblendung mithilfe eines Buttons
function shideNaehrwert() {
	if (document.getElementById) {
		if (document.getElementById("divProdukteNaehrwert").style.visibility == "visible") {
			document.getElementById("divProdukteNaehrwert").style.visibility = "hidden";
		} else {
			document.getElementById("divProdukteNaehrwert").style.visibility = "visible";
		}
	}
}


function avs_changeThese(classname, showOrHide)
{
	toChange = document.getElementsByClassName(classname);
	anz = toChange.length;
	for ( i = 0; i < anz; i++ )
	{
		toChange[i].style.visibility = showOrHide;
	}
}


function showLayer(target) {
	if (document.getElementById) {
			document.getElementById(target).style.visibility = "visible";
			// AVS:
			/*
				Korrektur
				da CSS-IDs im Dokument eindeutig sein müssen,
				kann getElementById nicht für mehrere Elemente
				verwendet werden.
			*/
			avs_changeThese("divContent2ColsRightLeft", "hidden");
			//document.getElementById("divContent2ColsRightLeft").style.visibility = "hidden";
	}
}


function hideLayer(target) {
	if (document.getElementById) {
		document.getElementById(target).style.visibility = "hidden";
		toShow = document.getElementsByClassName("divContent2ColsRightLeft");
		// AVS s. oben
		avs_changeThese("divContent2ColsRightLeft", "visible");
		//document.getElementById("divContent2ColsRightLeft").style.visibility = "visible";
	}
}





//Function erm?glicht Ein- bzw. Ausblendung mithilfe eines Buttons
function shideLayer(target) {
	if (document.getElementById) {
		if (document.getElementById(target).style.visibility == "visible") {
			document.getElementById(target).style.visibility = "hidden";
			avs_changeThese("divContent2ColsRightLeft", "visible");
		} else {
			document.getElementById(target).style.visibility = "visible";
			avs_changeThese("divContent2ColsRightLeft", "hidden");
		}
	}
}

function shideLayerBio(target) {
	if (document.getElementById) {
		if (document.getElementById(target).style.visibility == "visible") {
			document.getElementById(target).style.visibility = "hidden";
			avs_changeThese("divContent2ColsRightLeft", "visible");
		} else {
			document.getElementById(target).style.visibility = "visible";
			avs_changeThese("divContent2ColsRightLeft", "hidden");
		}
	}
}


//oeffnet das Wasser-Marsch-popup
function showWasser(){
			url = 'http://217.160.88.9/hosting/rhoensprudel/naturell/movie.php?jump=s5';
			win_special = window.open(url, 'popup', 'width=690, height=470, resizable=no, scrollbars=no, status=no');
		}


function vSetFocus(psName) {
	alert(psName);
	remote.focus()
}