﻿// JScript File
loadjscssfile("Images/Banner/ScrollBanner.css","css");
document.write('<div id="divLeft" class="scroll_banner"> <iframe src="http://www.gialong.com.vn/Template/gialong/UserFiles/giovang/popup.html" frameborder="0" height="430" scrolling="no" width="620"></iframe></div>');
document.write('<div id="divRight" class="scroll_banner"> <//img alt="" src="Images/Banner/right.jpg" height="600" width="120"></div>');
resetAdv();

document.body.onscroll=autoScroll;
document.onscroll=autoScroll;
window.onresize=resetAdv;
document.body.onresize=resetAdv;

function resetAdv()
{
    var obDivLeft=document.getElementById("divLeft");
    var obDivRight=document.getElementById("divRight");
    if(GetWidth()>=1000+120*2)
    {
        obDivLeft.style.display="block";
        obDivRight.style.display="block";
        obDivLeft.style.left=0;
        obDivRight.style.left=GetWidth()-125;
    }else{
        obDivLeft.style.display="none";
        obDivRight.style.display="none";
    }
}

function autoScroll()
{
    var obDivLeft=document.getElementById("divLeft");
    var obDivRight=document.getElementById("divRight");
    obDivLeft.style.top=document.body.scrollTop;        
    obDivRight.style.top=document.body.scrollTop;
}

function GetWidth()
{
	  var x = 0;
	  if (self.innerHeight)
	  {
			  x = self.innerWidth;
	  }
	  else if (document.documentElement && document.documentElement.clientHeight)
	  {
			  x = document.documentElement.clientWidth;
	  }
	  else if (document.body)
	  {
			  x = document.body.clientWidth;
	  }
	  return x;
}