	
	
	/*nguyen van hiep-config*/
    var objAdDivLeft  = document.getElementById("divAdLeft");    
	var objAdDivRight = document.getElementById("divAdRight");	
	var  sitewidth=800;/*do rong cua site*/
	var advwidth=100;
	var dif=0;/*chi so chenh lech(pixel) giua firefox va IE*/
	if (navigator.appName=='Netscape'){ dif=0;}/*lay thong so ve trinh duyet*/
	else {dif=0;}
function FloatTopDiv()
	
	{
		
		startX =document.body.clientWidth-((document.body.clientWidth-sitewidth)/2)-dif;
		
		 startY = 0;
		var ns = (navigator.appName.indexOf("Netscape") != -1);

		var d = document;
		

		function ml(id)

		{

			var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];

			if(d.layers)el.style=el;

			el.sP=function(x,y){			    
			    if(y < getPageSizeWithScroll()[1] - objAdDivLeft.clientHeight)			    
			    {			    
			        this.style.left=x;
			        this.style.top=y;
			    }
			};

			el.x = startX;

			el.y = startY;

			return el;

		}

		

		window.stayTopLeft=function()

		{

		

			if (document.body.clientWidth < 980)

			{

				ftlObj.x = - 115;ftlObj.y = 0;	ftlObj.sP(ftlObj.x, ftlObj.y);

			}

			

			else

			{

			if (document.documentElement && document.documentElement.scrollTop)

				var pY = ns ? pageYOffset : document.documentElement.scrollTop;

			else if (document.body)

				var pY = ns ? pageYOffset : document.body.scrollTop;



			if (document.body.scrollTop > 0){startY = 0} else {startY = 0};



			if (document.body.clientWidth >= 1024)

			{

				ftlObj.x = startX;
				ftlObj.y += (pY + startY - ftlObj.y)/3;
				ftlObj.sP(ftlObj.x, ftlObj.y);

			}

			else

			{

			

			

			ftlObj.x  = startX;

			ftlObj.y += (pY + startY - ftlObj.y)/1;

			ftlObj.sP(ftlObj.x, ftlObj.y);

			}

			}

			setTimeout("stayTopLeft()", 1);

		}

		

		ftlObj = ml("divAdRight");

		stayTopLeft();

		

	}



/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////



function FloatTopDiv2()

	{
		
		startX2 = (document.body.clientWidth-sitewidth-2*advwidth)/2-dif;
		startY2 = 0;
		
		var ns2 = (navigator.appName.indexOf("Netscape") != -1);

		var d2 = document;

		function ml2(id)

		{

			var el2=d2.getElementById?d2.getElementById(id):d2.all?d2.all[id]:d2.layers[id];

			if(d2.layers)el2.style=el2;

			el2.sP=function(x,y){
			    if(y < getPageSizeWithScroll()[1] - objAdDivRight.clientHeight)			    
			    {
			    this.style.left=x;this.style.top=y;
			    }
			};

			el2.x = startX2;

			el2.y = startY2;

			return el2;

		}

		

		window.stayTopLeft2=function()

		{

			if (document.body.clientWidth < 980)

			{

				ftlObj2.x = - 115;ftlObj2.y = 0;	ftlObj2.sP(ftlObj2.x, ftlObj2.y);

			}

			else

			{

			if (document.documentElement && document.documentElement.scrollTop)

				var pY2 = ns2 ? pageYOffset : document.documentElement.scrollTop;

			else if (document.body)

				var pY2 = ns2 ? pageYOffset : document.body.scrollTop;



			if (document.body.scrollTop > 0){startY2 = 3} else {startY2 = 0};



			if (document.body.clientWidth >= 1024)

			{

				ftlObj2.x =  startX2;ftlObj2.y += (pY2 + startY2 - ftlObj2.y)/3;
				ftlObj2.sP(ftlObj2.x, ftlObj2.y);

			}

			else

			{			

			



			

			ftlObj2.x  = startX2;

			ftlObj2.y += (pY2 + startY2 - ftlObj2.y)/1;

			ftlObj2.sP(ftlObj2.x, ftlObj2.y);

			}

			}

			setTimeout("stayTopLeft2()", 1);

		}

		

		ftlObj2 = ml2("divAdLeft");

		stayTopLeft2();

		

	}





	function ShowAdDiv()

	{


		if (document.body.clientWidth < 980)

		{

			objAdDivLeft.style.left  = - 100;

			objAdDivRight.style.left = - 100;

		}

		

		else

		{

			objAdDivLeft.style.left  = 0;

			objAdDivRight.style.left = document.body.clientWidth - 100;

		}

		FloatTopDiv();

		FloatTopDiv2();
        
	}

	ShowAdDiv();
	
	function getPageSizeWithScroll(){
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  	}
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
	return arrayPageSizeWithScroll;
}