var cw;

function lostPassword (eMail) {
	winPw = window.open ("/lostPw.php?addr="+eMail, "Passwort anfordern", "width=300,height=400,left=100,top=200"); 
}


function rC (cw) {
/*
fix case: right column is longest
*/
	oc = window.document.getElementById("centerColumn");
	ocp = window.document.getElementById("centerColumnPadding");
	of = window.document.getElementById("footerColumn");
	oh = window.document.getElementById("header");
	ocs = window.document.getElementById("columns");
	or = window.document.getElementById("rightColumn");
	orp = window.document.getElementById("rightColumnPadding");
	ol = window.document.getElementById("leftColumn");
	olp = window.document.getElementById("leftColumnPadding");
	ole = window.document.getElementById("legal");	

	if (cw==0) {
		res = false;
		xyz = oc.offsetHeight;
		if (olp.offsetHeight > xyz) { 
			if (olp.offsetHeight > orp.offsetHeight) {//left biggest:
			ocp.style.height = olp.offsetHeight+"px";
			orp.style.height = olp.offsetHeight+"px";
			res = true;
			}
		} 
		if ((orp.offsetHeight > xyz)&&(!res)) {//right biggest
			ocp.style.height = orp.offsetHeight+"px"; 
			olp.style.height = orp.offsetHeight+"px";
			res = true;
		} 
		if (res==false) { //center highest:
			ol.style.height = xyz+"px"; 
			olp.style.height = xyz-5+"px"; 
			or.style.height = xyz+"px"; 
			orp.style.height = xyz-5+"px"; 
		}
	}


	if (cw=="0") {
		cww = document.body.offsetWidth;
		oleOw = 200;
	}
	else {
		cww = cw;
		oleOw = ole.offsetWidth;	
	}


	/* footer */	
	if (!document.all) of.style.width = oh.offsetWidth+"px";
	else of.style.width = oh.offsetWidth+"px";

	wm = 580;
	cwc = ocp.offsetWidth;
	if (cwc<wm) {
		wt = wm+ol.offsetWidth+or.offsetWidth;
		oh.style.width = wt+"px";
		ol.style.position = "absolute"; 
		ocs.style.width = oh.style.width;
		oc.style.width = wm+"px";
		oc.style.position = "relative";
		oc.style.left = "0px";
		or.style.position = "relative";
		if (window.document.all) oc.style.top = -or.offsetHeight+"px";
		oleOw = ole.offsetWidth;
		if (window.document.all) {
			ole.style.position = "absolute";
			ole.style.left = (cww-ole.offsetWidth-20)+"px";
			ole.style.width = oleOw+"px";
		} else {
			ole.style.position = "absolute";
			ole.style.left = (cww-ole.offsetWidth-20)+"px";
			ole.style.width = oleOw+"px";
/*			alert ("mozilla ? "+ole.offsetLeft); */
		}
				
	} else {
		if (document.body.offsetWidth > cww) {
/*
			window.document.location = window.document.location;
			wt = document.body.offsetWidth; 
			oh.style.width = wt+"px";
			ocs.style.width = wt+"px";
			oc.style.width = wt-24-(ol.offsetWidth+or.offsetWidth); */
		}
	}
	return (document.body.offsetWidth);
}

function zoomImg (img,o,n) {
	imgS = document.getElementById(img).src;
	c = document.getElementById('content');
	
	nI = document.createElement('img');
	nI.style.margin = '0px';
	nI.style.padding = '0px';
	nI.style.spacing = '0px';



	if (document.all)
		topOf = document.body.scrollTop;
	else 
		topOf = window.pageYOffset;
	topOf+=20;

	if (!document.getElementById('zl')){
		zl = document.createElement('div');
		zl.setAttribute ('id','zl');
		zl.style.position = 'absolute';

		//change position regarding position in site
		zl.style.left = '15%';
		zl.style.top = topOf+"px";

		zl.style.border = '3px solid';
		zl.style.borderColor = '#527F33';
		zl.style.background = '#f2f2f2';
		zl.style.visibility = 'visible';

		cl = document.createElement('a');
		cl.setAttribute("href","javascript:hideZoom();");
		cl.style.position = 'absolute';
		cl.style.right = '5px';
		cl.style.top = '5px';
		cl.innerHTML='<img src="/elements/gfx/cls.gif" />';

		imgS = imgS.replace (o,n);
		nI.src = imgS;
		zl.appendChild(cl);
		zl.appendChild(nI);
		c.appendChild(zl);
	} else { 
	/*
	fix: switch image, position in visible area !!
	*/
		imgS = imgS.replace (o,n);
		nI.src = imgS;
		zl.appendChild(nI);

		//change position regarding position in site
		zl.style.left = '15%';
		zl.style.top = topOf+'px';

		document.getElementById('zl').style.visibility = 'visible';
	}
}

function hideZoom () {
	document.getElementById('zl').style.visibility="hidden";
	document.getElementById('zl').removeChild(nI);
}
