window.onresize= SetWidth; 

IE = (document.all); // Internet Explorer?
NC = (document.layers); // Netscape?
Opera = (document.getElementById); // Opera?

function getWidth() { // Получаем ширину рабочей области браузера
if (IE || Opera) send = document.body.clientWidth;
if (NC) send = window.innerWidth;
return send;
}



function SetWidth(){

	var d1=document.getElementById("tmain").style;
	var d2=document.getElementById("dmain").style;
	var w=(document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth);
	w=getWidth();
	var w1, w2, w3, hd;

	
	w1="100%"; w2="0%"; w3="1%"; hd="visible";
	
	if(w>900){w1="124%"; w2="-12%"; w3="1%"; hd="hidden";}
	if(w>1000){w1="112%"; w2="-6%"; w3="1%"; hd="hidden";}
	if(w>1100){w3="140px";}
	if(w>1200){w1="110%"; w2="-5%"; w3="253px";}
	if(w>1300){w1="106%"; w2="-3%"; w3="283px"; hd="hidden";}
	if(w>1500){w1="100%"; w2="0%"; w3="283px"; hd="hidden";}

	if(w<=1280){
		var k=238-((1280-w)/4);
		w3=k+"px";
	}
	else{w3="238px";}
	if(w<1000){w3="1px";}
	

	d1.width=w1;
	d1.left=w2;
	d2.overflow=hd;

}


