//
//  Licensed Materials - Property of IBM
//  5724I83
//  (C) Copyright IBM Corp. 1995, 2006 All Rights Reserved.
//

// 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;

//HPB_SCRIPT_PLD_50
HpbImgPreload('_HPB_ROLLOVER1', 'hpimg/jireiimage.jpg', 'hpimg/jireiimage1.jpg');
HpbImgPreload('_HPB_ROLLOVER2', 'hpimg/fudoutinnka1.gif', 'hpimg/fudoutinnka11.gif');
HpbImgPreload('_HPB_ROLLOVER3', 'hpimg/JOGimage1.gif', 'hpimg/JOGimage11.gif');
HpbImgPreload('_HPB_ROLLOVER4', 'hpimg/sekoujirei.gif', 'hpimg/sekoujirei1.gif');
HpbImgPreload('_HPB_ROLLOVER6', 'hpimg/ronbunn.gif', 'hpimg/ronbunn1.gif');
HpbImgPreload('_HPB_ROLLOVER5', 'hpimg/yokuaru.gif', 'hpimg/yokuaru1.gif');
HpbImgPreload('_HPB_ROLLOVER11', 'hpimg/cyousa1.gif', 'hpimg/cyousa11.gif');
//
//  JavaScript
//
//  Licensed Materials - Property of IBM
//
//  5724I83
//
//  (C) Copyright IBM Corp. 1995, 2006 All Rights Reserved.
//
var hpb=new Object();
	hpb.ContentLoader=function(url, divId, onload) {
	this.url = url;
	this.divId=divId;
	this.request=null;
	this.onload=onload;
	this.onerror=this.defaultError;
	this.loadSiteMenu(url);
}
hpb.ContentLoader.prototype={
	loadSiteMenu:function(url){
		// non-IE
		if(window.XMLHttpRequest) {
			this.request = new XMLHttpRequest();
		// IE
		} else if(window.ActiveXObject) {
			try {
				this.request = new ActiveXObject ("Msxml2.XMLHTTP");
			} catch(e) {
				this.request = new ActiveXObject ("Microsoft.XMLHTTP");
			}
		}
		if(this.request) {
			try{
				var loader=this;
				this.request.onreadystatechange=function(){
					loader.onReadyState.call(loader);
				}
				this.request.open('GET',url, true);
				this.request.send(null);
			}catch( err) {
				this.onerror.call(this);
			}
		}
	},
	onReadyState:function(){
		var request = this.request;
		var readyState = request.readyState;
		if(readyState==4){
			var httpStatus=request.status;
			if(httpStatus==200 || httpStatus == 0) {
				this.onload.call(this);
			}else{
				this.onerror.call(this);
			}
		}
	},

	defautError:function() {
	}
}

function getMenu(){
	document.getElementById(this.divId).innerHTML = this.request.responseText;
}

function getHpbSiteMenu(menuURL, divId) {
	var loader=new hpb.ContentLoader(menuURL, divId, getMenu);

}
