window.onload = function() {
 fixFrameSize();
}

function fixFrameSize() {
	if (window.parent) {
		var body = document.body;
		var width = body.scrollWidth;
		var height = 0;
		
		if(navigator.userAgent.indexOf("MSIE") != -1){
			height = body.scrollHeight;

		}else if(navigator.userAgent.indexOf("Opera") != -1){
			height = document.documentElement.offsetHeight ;

		}else if(navigator.userAgent.indexOf("Safari") != -1){
			height = body.scrollHeight;

		}else if(navigator.userAgent.indexOf("Firefox") != -1){ 
			height = body.clientHeight;

		}else{
			height = window.innerHeight;
		}

		var iframe = window.parent.document.getElementsByTagName("IFRAME")[0];
		iframe.style.width = 734;
		if(height > 578){
			iframe.style.height = height; 
		}else{
			iframe.style.height = 578;
		}
		iframe.scrolling = "no";
	}

}


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];
      }
    }
  }
}

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;
}

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_ROLLOVER1', 'pic/nav_home.GIF', 'pic/nav_home_on.GIF');
HpbImgPreload('_HPB_ROLLOVER2', 'pic/nav_about.GIF', 'pic/nav_about_on.GIF');
HpbImgPreload('_HPB_ROLLOVER3', 'pic/nav_works.GIF', 'pic/nav_works_on.GIF');
HpbImgPreload('_HPB_ROLLOVER4', 'pic/nav_rec.GIF', 'pic/nav_rec_on.GIF');
