var sw=0;
var sh=0;
function adjustMain(){
	if(navigator.appName.indexOf("Microsoft")==-1)
	{
		IE=false;
	}else{
		IE=true;
	}
	if(IE==true)
	{
		sw=document.body.clientWidth;
		sh=document.body.clientHeight;
	}else{
		sw=window.innerWidth;
		sh=window.innerHeight;
	}
	if(sw<800){
		sw=800;
	}
	if(sh<600){
		sh=600;
	}
	var neww=Math.round((sh/3)*4);
	if(neww>sw-100){
		neww=sw-100;
	}
	objM=document.getElementById("MAIN");
	objM.style.width=neww+"px";
	objM.style.left=Math.round((sw-neww)/2)+"px";
	objM.style.height=(sh-100)+"px";
	objI1=document.getElementById("IMG1");
	objI1.style.visibility="hidden";
	objI1.src="/img/img.php?f=top&w="+neww;
	
	objI2=document.getElementById("IMG2");
	objI2.style.top=((sh-100)-(Math.round((neww/3100)*180)))+"px"
	objI2.style.visibility="hidden";
	objI2.src="/img/img.php?f=bottom&w="+neww;
	
	var contenth=((sh-100)-Math.round((neww/3100)*370)-Math.round((neww/3100)*180));
	var logow=Math.round((neww/3100)*2400);
	
	objIL=document.getElementById("IMGLOGO");
	objIL.style.visibility="hidden";
	objIL.style.top=Math.round((contenth/100)*15)+"px";
	objIL.style.left=Math.round((neww-logow)/2)+"px";
	objIL.src="/img/img.php?f=logo&w="+neww;
	
	objC=document.getElementById("CONTENT");
	objC.style.width=neww+"px";
	objC.style.top=Math.round((neww/3100)*370)+"px";
	objC.style.height=contenth+"px";
	
	objF=document.getElementById("FOOTER");
	objF.style.width=neww+"px";
	objF.style.top=((sh-100)-(Math.round((neww/3100)*180))-30)+"px";
	objF.style.width=neww-(Math.round((neww/3100)*180)-15)+"px";
	
	objM.style.visibility="visible";
}
window.onload=adjustMain;
window.onresize=adjustMain;
