// browser size fixed brobackground image script

function resizer(){
if(document.all){
	xscale = window.document.documentElement.clientWidth/1536;
	yscale = window.document.documentElement.clientHeight/1024;
}
else {
	xscale = window.innerWidth/1536;
	yscale = window.innerHeight/1024;
	}
	fixscale = Math.max(xscale, yscale);
	fixWidth = Math.ceil(1536*fixscale);
	document.getElementById("bgimage").width = fixWidth;
	document.getElementById("bgimage").style.visibility = "visible";
}
window.onload = resizer;
window.onresize = resizer;

// HpbImgPreload:

function HpbImgPreload()
{
  var appVer=parseInt(navigator.appVersion);
  var isNC=false,isN6=false,isIE=false;
  if (document.all && appVer >= 4) isIE=true; else
    if (document.getElementById && appVer > 4) isN6=true; else
      if (document.layers && appVer >= 4) isNC=true;
  if (isNC||isN6||isIE)
  {
    if (document.images)
    {
      var imgName = HpbImgPreload.arguments[0];
      var cnt;
      swImg[imgName] = new Array;
      for (cnt = 1; cnt < HpbImgPreload.arguments.length; cnt++)
      {
        swImg[imgName][HpbImgPreload.arguments[cnt]] = new Image();
        swImg[imgName][HpbImgPreload.arguments[cnt]].src = HpbImgPreload.arguments[cnt];
      }
    }
  }
}

// HpbImgFind:

function HpbImgFind(doc, imgName)
{
  for (var i=0; i < doc.layers.length; i++)
  {
    var img = doc.layers[i].document.images[imgName];
    if (!img) img = HpbImgFind(doc.layers[i], imgName);
    if (img) return img;
  }
  return null;
}

// HpbImgSwap:

function HpbImgSwap(imgName, imgSrc)
{
  var appVer=parseInt(navigator.appVersion);
  var isNC=false,isN6=false,isIE=false;
  if (document.all && appVer >= 4) isIE=true; else
    if (document.getElementById && appVer > 4) isN6=true; else
      if (document.layers && appVer >= 4) isNC=true;
  if (isNC||isN6||isIE)
  {
    if (document.images)
    {
      var img = document.images[imgName];
      if (!img) img = HpbImgFind(document, imgName);
      if (img) img.src = imgSrc;
    }
  }
}
var swImg; swImg=new Array;
//-->

HpbImgPreload('HPB_ROLLOVER11', 'index/huutou.png', 'index/huutou_RO.png');
HpbImgPreload('HPB_ROLLOVER12', 'index/home.png', 'index/home_RO.png');
HpbImgPreload('HPB_ROLLOVER6', 'index/gallery.png', 'index/gallery_RO.png');
HpbImgPreload('HPB_ROLLOVER7', 'index/company.png', 'index/company_RO.png');
HpbImgPreload('HPB_ROLLOVER8', 'index/contact.png', 'index/contact_RO.png');
HpbImgPreload('HPB_ROLLOVER9', 'index/recruit.png', 'index/recruit_RO.png');
HpbImgPreload('HPB_ROLLOVER13', 'index/huutou.png', 'index/huutou_RO.png');


