var ldir="";
var lh=1;
var lclosecnt=0;
var firstload=true;
var aktnavy=-1;
var newnavy=-1;
var objCNL=undefined;
function adjustMain(){
	if(navigator.appName.indexOf("Microsoft")==-1)
	{
		IE=false;
	}else{
		IE=true;
	}
	sw=document.body.clientWidth;
	sh=document.body.clientHeight;
	if(sw<1000){
		sw=1000;
	}
	if(sh<735){
		sh=735;
	}
	objM=document.getElementById("MAIN");
	objM.style.left=Math.round((sw-900)/2)+"px";
	objM.style.height=(sh-70)+"px";
	objC=document.getElementById("CONTENT");
	//objC.style.height=(sh-100-203)+"px";
	objC.style.height=(sh-100-178)+"px";
	objF=document.getElementById("FOOTER");
	objF.style.top=(sh-100)+"px";
	objM.style.visibility="visible";
	objS=document.getElementById("SPO");
	if(objS!=undefined){
		objS.style.top=(sh-240-138)+"px";
	}
	if(firstload){
		firstload=false;
		setInterval("doLoginWindow()",50);
		objCNLF=document.getElementById("CONTENT_NAV_LINEFIXED");
		objCNL=document.getElementById("CONTENT_NAV_LINE");
		if(objCNL!=undefined){
			objCNLF.style.top=aktnavy+"px";
			objCNL.style.top=aktnavy+"px";
		}
		setInterval("doNavLine()",25);
	}
}
function doNavLine(){
	if(objCNL!=undefined && newnavy!=aktnavy){
		if(newnavy<aktnavy){
			aktnavy=aktnavy-5;
			if(aktnavy<newnavy){
				aktnavy=newnavy;
			}
			objCNL.style.top=aktnavy+"px";
		}else if(newnavy>aktnavy){
			aktnavy=aktnavy+5;
			if(aktnavy>newnavy){
				aktnavy=newnavy;
			}
			objCNL.style.top=aktnavy+"px";
		}
	}
}
function doLoginWindow()
{
	objW=document.getElementById("LOGINWINDOW");
	if(ldir=="" && lh>1){
		lclosecnt++;
		if(lclosecnt==200){
			lclosecnt=0;
			ldir="close";
		}
	}
	if(ldir=="open"){
		objW.style.visibility="visible";
		if(lh<70){
			lh=lh+10;
			if(lh>70){
				lh=70;
			}
			objW.style.height=lh+"px";
		}
		if(lh==70){
			ldir="";
		}
	}
	if(ldir=="close"){
		if(lh>1){
			lh=lh-10;
			if(lh<1){
				lh=1;
			}
			objW.style.height=lh+"px";
		}
		if(lh==1){
			objW.style.visibility="hidden";
			ldir="";
		}
	}	
}
function passit(ip){
var np=ip.cloneNode(true);
np.type='password';
ip.parentNode.replaceChild(np,ip);
setTimeout("document.getElementById('l_pass').focus()",10);
}
window.onload=adjustMain;
window.onresize=adjustMain;
