var SwImg; SwImg = new Array;



/* HEAD MENU */

/* トップ */

ImgPreload('HOME', './img/hm_home.gif', './img/hm_home_c.gif');

ImgPreload('NEWS', './img/hm_news.gif', './img/hm_news_c.gif');

ImgPreload('ENGLISH', './img/hm_english.gif', './img/hm_english_c.gif');

ImgPreload('FAQ', './img/hm_faq.gif', './img/hm_faq_c.gif');

ImgPreload('CONTACT', './img/hm_contact.gif', './img/hm_contact_c.gif');

ImgPreload('SITEMAP', './img/hm_sitemap.gif', './img/hm_sitemap_c.gif');

ImgPreload('RECRUIT', './img/hm_part.gif', './img/hm_part_c.gif');



/* 2階層目 */

ImgPreload('HOME2', '../img/hm_home.gif', '../img/hm_home_c.gif');

ImgPreload('NEWS2', '../img/hm_news.gif', '../img/hm_news_c.gif');

ImgPreload('ENGLISH2', '../img/hm_english.gif', '../img/hm_english_c.gif');

ImgPreload('FAQ2', '../img/hm_faq.gif', '../img/hm_faq_c.gif');

ImgPreload('CONTACT2', '../img/hm_contact.gif', '../img/hm_contact_c.gif');

ImgPreload('SITEMAP2', '../img/hm_sitemap.gif', '../img/hm_sitemap_c.gif');

ImgPreload('HOME_EN2', '../img/hme_home.gif', '../img/hme_home_c.gif');

ImgPreload('RECRUIT2', '../img/hm_part.gif', '../img/hm_part_c.gif');



/* CATEGORY MENU */

/* トップ */

ImgPreload('GUIDE', './img/cm_guide_top.gif', './img/cm_guide_top_c.gif');

ImgPreload('CALENDAR', './img/cm_calendar_top.gif', './img/cm_calendar_top_c.gif');

ImgPreload('ADMISSIONFEE', './img/cm_admissionfee_top.gif', './img/cm_admissionfee_top_c.gif');

ImgPreload('ACCESS', './img/cm_access_top.gif', './img/cm_access_top_c.gif');

ImgPreload('COUPON', './img/cm_coupon_top.gif', './img/cm_coupon_top_c.gif');

ImgPreload('STAY', './img/cm_stay_top.gif', './img/cm_stay_top_c.gif');



/* 2階層目 */

ImgPreload('GUIDE2', '../img/cm_guide.gif', '../img/cm_guide_c.gif');

ImgPreload('CALENDAR2', '../img/cm_calendar.gif', '../img/cm_calendar_c.gif');

ImgPreload('ADMISSIONFEE2', '../img/cm_admissionfee.gif', '../img/cm_admissionfee_c.gif');

ImgPreload('ACCESS2', '../img/cm_access.gif', '../img/cm_access_c.gif');

ImgPreload('COUPON2', '../img/cm_coupon.gif', '../img/cm_coupon_c.gif');

ImgPreload('STAY2', '../img/cm_stay.gif', '../img/cm_stay_c.gif');





/* MAP TAB */

ImgPreload('ADVDOME', './img/map_advdome.gif', './img/map_advdome_o.gif');

ImgPreload('ADVLAGOON', './img/map_advlagoon.gif', './img/map_advlagoon_o.gif');

ImgPreload('THRILL', './img/map_thrill.gif', './img/map_thrill_o.gif');

ImgPreload('FAMILYSPORTS', './img/map_familysports.gif', './img/map_familysports_o.gif');

ImgPreload('ZENTAI', './img/map_zentai.gif', './img/map_zentai_o.gif');

ImgPreload('ENT', '../guide/img/ent/tab_goods.gif', '../guide/img/ent/tab_goods_o.gif');

ImgPreload('REST', '../guide/img/ent/tab_rest.gif', '../guide/img/ent/tab_rest_o.gif');







/* GUIDE TAB */

/* ADVDOME */

ImgPreload('ADVDOME_POOLATR', './img/advdome/poolatr.gif', './img/advdome/poolatr_o.gif');

ImgPreload('ADVDOME_SERVICE', './img/advdome/service.gif', './img/advdome/service_o.gif');

ImgPreload('ADVDOME_RESTSHOP', './img/advdome/restshop.gif', './img/advdome/restshop_o.gif');

/* ADVLAGOON */

ImgPreload('ADVLAGOON_POOLATR', './img/advlagoon/poolatr.gif', './img/advlagoon/poolatr_o.gif');

ImgPreload('ADVLAGOON_SERVICE', './img/advlagoon/service.gif', './img/advlagoon/service_o.gif');

ImgPreload('ADVLAGOON_RESTSHOP', './img/advlagoon/restshop.gif', './img/advlagoon/restshop_o.gif');

/* THRILL */

ImgPreload('THRILL_POOLATR', './img/thrill/poolatr.gif', './img/thrill/poolatr_o.gif');

ImgPreload('THRILL_SERVICE', './img/thrill/service.gif', './img/thrill/service_o.gif');

ImgPreload('THRILL_RESTSHOP', './img/thrill/restshop.gif', './img/thrill/restshop_o.gif');





function ImgPreload() {

	var N = ImgPreload.arguments[0];

	SwImg[N] = new Image();

	SwImg[N][0] = new Image();

	SwImg[N][0].src = ImgPreload.arguments[1];

	SwImg[N][1] = new Image();

	SwImg[N][1].src = ImgPreload.arguments[2];

}



function ImgChange() {

	var ID = ImgChange.arguments[0];

	var N  = ImgChange.arguments[1];

	document.images[ID].src = SwImg[ID][N].src;

}





/* Pagetop */

var scrj = 1;

function pageTop() {

   if(navigator.appName == "Microsoft Internet Explorer" && document.compatMode == "CSS1Compat") {

      var scdist = document.body.parentNode.scrollTop;

   } else {

      var scdist = document.body.scrollTop;

   }

   if(scrj<50 && scdist) {

      scdist = (scdist>2) ? Math.ceil(scdist*.2) : 1;

      scrj++;

      scrollBy(0,-scdist);

      setTimeout("pageTop()",20);

   } else {

      scrollTo(0,0);

      scrj = 1;

   }

}



/* ph-up */

function openWin( w, h ){

       wo=window.open("","ph","resizable=yes,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width="+w+",height="+h);

wo.resizeTo(w,h);

wo.focus();}


/* ===============================================
# class="imgover" の要素に、マウスオーバーで
　"_o.gif" の画像と入れ替える
=============================================== */
function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_o'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}
window.onload = initRollovers;
try{
	window.addEventListener("load",initRollovers,false);
}catch(e){
	window.attachEvent("onload",initRollovers);
}
