window.onload = function ()
{
data = new Array("http://leisurehotel-fund.jp/img/gnavi_top_on.gif","http://leisurehotel-fund.jp/img/gnavi_about_on.gif","http://leisurehotel-fund.jp/img/gnavi_product_on.gif","http://leisurehotel-fund.jp/img/gnavi_corporate_on.gif","http://leisurehotel-fund.jp/img/gnavi_recruit_on.gif","http://leisurehotel-fund.jp/img/gnavi_seminar_on.gif","http://leisurehotel-fund.jp/img/header_fontsize_minus_on.gif","http://leisurehotel-fund.jp/img/header_fontsize_reset_on.gif","http://leisurehotel-fund.jp/img/header_fontsize_plus_on.gif","http://leisurehotel-fund.jp/img/lnavi_greeting_on.gif","http://leisurehotel-fund.jp/img/lnavi_philosophy_on.gif","http://leisurehotel-fund.jp/img/lnavi_brand_on.gif","http://leisurehotel-fund.jp/img/lnavi_work_on.gif","http://leisurehotel-fund.jp/img/lnavi_corporate_on.gif","http://leisurehotel-fund.jp/img/lnavi_recruit_on.gif","http://leisurehotel-fund.jp/img/lnavi_invite_on.gif","http://leisurehotel-fund.jp/img/lnavi_important_on.gif","http://leisurehotel-fund.jp/img/lnavi_execution_on.gif","http://leisurehotel-fund.jp/img/lnavi_privacy_on.gif","http://leisurehotel-fund.jp/img/lnavi_info_on.gif","http://leisurehotel-fund.jp/img/lnavi_inquiry_on.gif","http://leisurehotel-fund.jp/img/lnavi_customer_on.gif","http://leisurehotel-fund.jp/img/lnavi_charge_on.gif","http://leisurehotel-fund.jp/img/lnavi_product_on.gif","http://leisurehotel-fund.jp/img/lnavi_associated_on.gif","http://leisurehotel-fund.jp/img/lnavi_isplus_on.gif","http://leisurehotel-fund.jp/img/lnavi_cooperation.gif","http://leisurehotel-fund.jp/img/lnavi_antisocial_on.gif");
prImg= new Array();
for (i=0; i<data.length; i++)
{
prImg[i] = new Image(); prImg[i].src = data[i];
}
}


function chgOnImg(onId){
var onImgId = onId+"_img";
var objOn = "http://leisurehotel-fund.jp/img/"+onId+"_on.gif";
document.getElementById(onImgId).src = objOn;
}
function chgOutImg(outId){
var outImgId = outId+"_img";
var objOut = "http://leisurehotel-fund.jp/img/"+outId+".gif";
document.getElementById(outImgId).src = objOut;
}


//-- ロールオーバー
function initRollOvers() {
	if (!document.getElementById){
		return;
	}
	
	var preLoads = new Array();
	var allImages = document.getElementsByTagName('img');

	for (var i = 0; i < allImages.length; i++) {		
		if (allImages[i].className == 'rov') {
			var src = allImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var oSrc = src.replace(ftype, '_on'+ftype);

			//-- スワップ元、スワップ先画像の登録
			allImages[i].setAttribute('pSrc', src);
			allImages[i].setAttribute('oSrc', oSrc);

			//-- イメージのプリロード
			preLoads[i] = new Image();
			preLoads[i].src = oSrc;

			//-- イベントの設定
			allImages[i].onmouseover = function() {
				this.setAttribute('src', this.getAttribute('oSrc'));
			}
			allImages[i].onmouseout = function() {
				this.setAttribute('src', this.getAttribute('pSrc'));
			}
		}
	}
}

function addOnload(func){
	if ( typeof window.addEventListener != "undefined" ){
		window.addEventListener( "load", func, false );
	}else if ( typeof window.attachEvent != "undefined" ) {
		window.attachEvent( "onload", func );
	}else{
		if ( window.onload != null ){
			var oldOnload = window.onload;
			window.onload = function ( e ) {
			oldOnload( e );
			window[func]();
		};
	}else
		window.onload = func;
	}
}
addOnload(initRollOvers);		
