// mouseover topnavigation
var act = 1;
function over01(x){
	if(document.all) x.style.cursor = "hand";
	else x.style.cursor = "pointer";

	if(x.className=="high"){
		act = 0;
		return;
	}
	else{
		act = 1;
	}
	if(!x.childNodes) return;

	if(x.childNodes[0].innerHTML) x.innerHTML=x.childNodes[0].innerHTML;

	x.style.backgroundPosition = "0px -35px";
	x.style.color="#000000";
}

function out01(x){
	if(act==0) return;
	x.style.backgroundPosition = "0px 0px";
	x.style.color="#ffffff";
}



// mouseover leftnavigation
function over02(x){
	if(document.all) x.style.cursor = "hand";
	else x.style.cursor = "pointer";


	if(!x.style) return;
	oldcolor = x.style.backgroundColor;
	x.style.backgroundColor="#CDD9E2";
}

function out02(x){
	if(!x.style) return;
	x.style.backgroundColor=oldcolor;
}

//topnavigation & leftnavigation
function linkme(x){
if(x) document.location.href = x;
else document.location.href = "#";
}


//sitemap
function openSitemap(url) {
	satellit =window.open(url,"SiteMap","location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes");
	satellit.window.focus();
}
//kontakt
var height00 = 0;
if(document.layers){
height00 = 730;
}
else{
height00 = 700;
}

function openKontakt(url) {
	satellit =eval('window.open(url,"Form","location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,width=661,height='+height00+'")');
	satellit.window.focus();
}
//hotbutton
var height01 = 0;
if(document.layers){
height01 = 680;
}
else{
height01 = 650;
}
function openHotbutton(url) {
	satellit =eval('window.open(url,"Form","location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,width=661,height='+height01+'")');
	satellit.window.focus();
}
//zoom
function zoom(img,w,h)
{
	if (!w)
		w = 700;
	if (!h)
		h = 500;

	var features = "location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,width=" + w + ",height=" + h;
	satellit = window.open(img, "Form", features);
	satellit.window.focus();

}

//printview
function openPrint(url) {
	satellit =eval('window.open(url,"Printwindow","location=no,menubar=yes,resizable=yes,scrollbars=yes,status=no,toolbar=yes,width=661,height=600")');
	satellit.window.focus();
}

//language selector
function portme(){
var x = document.man_portals.portals.options;
	if (x[x.selectedIndex].value != '') {
		document.location.href=x[x.selectedIndex].value;
		x.selectedIndex = 0;
	}
}

//remove label text in input fields
function clearInitValue(el, initString)
{
	// clear text input value when input field is gaining focus for the first time
	if (el && initString && el.value == initString)
		el.value = "";
}

function impressum(openWhat) {
	Fenster=window.open(openWhat,'impressum','scrollbars=yes,height=670,width=700');
}

function klingeltoene(openWhat) {
	Fenster=window.open(openWhat,'klingel','scrollbars=yes,height=60,width=340');
}

function order(p, g) {
	if (p!=0 && g!=0) {
		
		redirPage	= document.getElementById("IdRedir").value;
		
		redirect	= redirPage + "&p="+p+"&g="+g;
		
		df			= document.forms[0];
		df.method	= "POST";
		df.action	= redirect;
		df.submit();
	}	
}

function refreshCart(selProd, act) {
	d	= document;

	redirPage	= d.getElementById("IdRedir").value;
	redirPage2	= d.getElementById("IdRedir2").value;

	if (selProd!="") {
		if (act==0)		
			d.getElementById("selProd").value	= selProd;
		else if (act==1)
			d.getElementById("delProd").value	= selProd;
		else if (act==5)
			d.getElementById("delCode").value	= selProd;

		if (act==4) {
			if (d.getElementById("id_agb").checked) {
				redirect	= redirPage2;
			} else {
				alert(noAgb);
				return false;
			}
		} else
			redirect	= redirPage;
		
		df			= d.forms["warenkorb"];
		df.method	= "POST";
		df.action	= redirect;

		if (act==3) {
			if (confirm(delCartTxt)) {
				d.getElementById("delCart").value	= selProd;
				df.submit();
			}
		} else {
			df.submit();
		}
	}
	
	return true;
}


function hideshow( elemID ) {
	var elem = document.getElementById( elemID );

	if( elem.style.display != '' ) {
		elem.style.display = '';
	} else {
		elem.style.display = 'none';
	}
}

function showForm(act) {
	d	= document;

	var elem	= d.getElementById( 'nonMember' );
	var elem1	= d.getElementById( 'member' );

	if (act==0) {
	
		if( elem.style.display != '' )
			elem.style.display = '';
		
		elem1.style.display = 'none';
		d.getElementById("err").innerHTML	= "";

	} else {
		if( elem1.style.display != '' )
			elem1.style.display = '';

		elem.style.display = 'none';
		d.getElementById("err").innerHTML	= "";
	}
}