    var contentWidth = document.getElementById("tblMain").offsetWidth;
    var widthQuangCao = document.getElementById("divAdLeft").offsetWidth;
    window.onresize=ShowAdDiv;
    
	function FloatTopDiv()
	{
		var mode = 1;
		var ns = (navigator.appName.indexOf("Netscape") != -1);		
		if(mode)
		{
			if(!ns) //IE
			{
			   
				startLX = ((document.body.clientWidth  -contentWidth)/2) - widthQuangCao, startLY = 0;
				startRX = ((document.body.clientWidth  -contentWidth)/2) + contentWidth , startRY = 0; 				
				
			}
			else
			{
			    
				startLX = ((document.body.clientWidth  -contentWidth)/2) - widthQuangCao, startLY = 0;
				startRX = ((document.body.clientWidth  - contentWidth)/2) + contentWidth , startRY = 0; 	
					
			}
		}
		else
		{		    
			if(!ns) //IE
			{
				startLX = document.body.clientWidth - 1007, startLY = 1;
				startRX = document.body.clientWidth - 892, startRY = 0; 
			}
			else
			{
				startLX = document.body.clientWidth - 1015, startLY = 1;
				startRX = document.body.clientWidth - 900, startRY = 0;
			}
		}		var d = document;
		function ml(id)
		{
			var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
			el.sP=function(x,y){this.style.left=x+"px";this.style.top=y+"px"; };
			el.x = startRX;
			el.y =startRY;
			return el;
		}
		function m2(id)
		{
			var e2=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
			e2.sP=function(x,y){e2.style.left=x+"px";e2.style.top=y+"px";};
			e2.x = startLX;
			e2.y = startLY;
			return e2;
		}
		window.stayTopLeft=function()
		{
		
			if (document.documentElement && document.documentElement.scrollTop)
				var pY =  document.documentElement.scrollTop;
			else if (document.body)
				var pY =  document.body.scrollTop;
			if (document.body.scrollTop > 30){startLY = 3;startRY = 3; } 
			else {startLY = 0;startRY = 0;};
			
			ftlObj.y += (pY+startRY-ftlObj.y)/8;
			ftlObj.sP(ftlObj.x, ftlObj.y);
			ftlObj2.y += (pY+startLY-ftlObj2.y)/8;
			ftlObj2.sP(ftlObj2.x, ftlObj2.y);
			setTimeout("stayTopLeft()", 1);
		}
		ftlObj = ml("divAdRight");			
		ftlObj2 = m2("divAdLeft");			
		stayTopLeft();
		
//		if(ns) // Firefox
//		{
//		    var left = ftlObj2.x + "px"; 
//		    ftlObj2.setAttribute("style","position:absolute;left:"+left);
//		    left = ftlObj.x + "px"; 
//		    ftlObj.setAttribute("style","position:absolute;left:"+left);
//		    
//		}
	}
	
	function ShowAdDiv()
	{
		var objAdDivRight = document.getElementById("divAdRight");
		var objAdDivLeft = document.getElementById("divAdLeft");		
		if (document.body.clientWidth < contentWidth + widthQuangCao*2)
		{
		    objAdDivRight.style.display = "none";
			objAdDivLeft.style.display = "none";
		}
		else
		{
			objAdDivRight.style.display = "block";
			objAdDivLeft.style.display = "block";
			FloatTopDiv();
		}
	}
	ShowAdDiv();