//--------------------------------------------------------
//  日航関西空港  共通JavaScript
//--------------------------------------------------------
//-------------------------
//  宿泊間取り画像用
//-------------------------
function showLAYER(idName){ 
	
	if ( document.getElementById )
	document.getElementById( idName ).style.visibility = 'visible' 
	else if ( document.all ) document.all( idName ).style.visibility = 'visible' 
	else if ( document.layers ) document.layers[ idName ].visibility = 'show' 
	
}
function hideLAYER(idName){ 
	
	if ( document.getElementById )
	document.getElementById( idName ).style.visibility = 'hidden' 
	else if ( document.all ) document.all( idName ).style.visibility = 'hidden' 
	else if ( document.layers ) document.layers[ idName ].visibility = 'hide' 
	
}
function hideAllPhoto(){
//写真レイヤーの数にあわせて'#lay??'入れる
	hideLAYER('lay1');
	hideLAYER('lay2');
	hideLAYER('lay3');
	hideLAYER('lay4');
	hideLAYER('lay5');
}

function change(file){
	document.img.src = file;
}


function change(num)
{
	map = "img/access"+num+".gif";
	document.myIMG1.src = map;
}


//-------------------------
//  サブウインドウ
//-------------------------
function sub(){
win = window.open("","sub","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,copyhistory=0,width=670,height=650");
}

//-------------------------
//  スタイルシート
//-------------------------
function makeStyle()
{
	var vNum = navigator.appVersion.charAt(0);
	var bName = navigator.appName.charAt(0);

	if(navigator.appVersion.indexOf("Mac") > -1)
	{
		if( bName == "M")
		 {
			// MAC IE
			document.write("<STYLE TYPE='text/css'>\
a:link { color: #003AAD; text-decoration: none; }\
a:hover { color: #003AAD; text-decoration: none; background-color: #D7DDFF; }\
a:visited { color: #003AAD; text-decoration: none; }\
.white a:link {color: #FFFFFF; }\
.white a:hover {color: #003AAD; background-color: #D7DDFF; }\
.white a:visited {color: #FFFFFF; }\
.size11g { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #333333;}\
.size11b { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #00339B;}\
.size11 { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #353535;}\
.size11px { font-size: 11px; font-style: normal; line-height: 120%; color: #353535;}\
.size12r { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #FF0000;}\
.size12b { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #00339B;}\
.size12g { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #333333;}\
.size12w { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #FFFFFF;}\
.size12gpx { font-size: 13px; font-style: normal; line-height: 120%; color: #333333;}\
.size12 { font-size: 1.55ex; font-style: normal; line-height: 160%; color: #353535;}\
.size12 A:link { text-decoration:none;  color:#00339B;}\
.size12 A:visited {text-decoration:none;  color:#00339B;}\
.size12 A:active { text-decoration:none;  color:#00339B;}\
.size12 A:hover { color:#00339B; text-decoration: underline;}\
.size14 { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #353535;}\
.size14 A:link { text-decoration:none;  color:#00339B;}\
.size14 A:visited {text-decoration:none;  color:#00339B;}\
.size14 A:active { text-decoration:none;  color:#00339B;}\
.size14 A:hover { color:#00339B; text-decoration: underline;}\
.size14b { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #00339B;}\
.size14g { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #333333;}\
.size17g { font-size: 2.0ex; font-style: normal; line-height: 140%; color: #333333;}\
				</STYLE>");

		}else{

			// MAC NETSCAPE 4.x
			if( vNum < 5 ){
				document.write("<STYLE TYPE='text/css'>\
a:link { color: #003AAD; text-decoration: none; }\
a:hover { color: #003AAD; text-decoration: none; background-color: #D7DDFF; }\
a:visited { color: #003AAD; text-decoration: none; }\
.white a:link {color: #FFFFFF; }\
.white a:hover {color: #003AAD; background-color: #D7DDFF; }\
.white a:visited {color: #FFFFFF; }\
.size11g { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #333333;}\
.size11b { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #00339B;}\
.size11 { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #353535;}\
.size11px { font-size: 11px; font-style: normal; line-height: 120%; color: #353535;}\
.size12r { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #FF0000;}\
.size12b { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #00339B;}\
.size12g { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #333333;}\
.size12w { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #FFFFFF;}\
.size12gpx { font-size: 13px; font-style: normal; line-height: 120%; color: #333333;}\
.size12 { font-size: 1.55ex; font-style: normal; line-height: 160%; color: #353535;}\
.size12 A:link { text-decoration:none;  color:#00339B;}\
.size12 A:visited {text-decoration:none;  color:#00339B;}\
.size12 A:active { text-decoration:none;  color:#00339B;}\
.size12 A:hover { color:#00339B; text-decoration: underline;}\
.size13 { font-size: 1.625ex; font-style: normal; line-height: 140%; color: #353535;}\
.size14 { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #353535;}\
.size14 A:link { text-decoration:none;  color:#00339B;}\
.size14 A:visited {text-decoration:none;  color:#00339B;}\
.size14 A:active { text-decoration:none;  color:#00339B;}\
.size14 A:hover { color:#00339B; text-decoration: underline;}\
.size14b { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #00339B;}\
.size14g { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #333333;}\
.size17g { font-size: 2.0ex; font-style: normal; line-height: 140%; color: #333333;}\
				</STYLE>");

			// MAC NETSCAPE 6.x~
		 	}else{
				document.write("<STYLE TYPE='text/css'>\
a:link { color: #003AAD; text-decoration: none; }\
a:hover { color: #003AAD; text-decoration: none; background-color: #D7DDFF; }\
a:visited { color: #003AAD; text-decoration: none; }\
.white a:link {color: #FFFFFF; }\
.white a:hover {color: #003AAD; background-color: #D7DDFF; }\
.white a:visited {color: #FFFFFF; }\
.size11g { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #333333;}\
.size11b { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #00339B;}\
.size11 { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #353535;}\
.size11px { font-size: 11px; font-style: normal; line-height: 120%; color: #353535;}\
.size12r { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #FF0000;}\
.size12b { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #00339B;}\
.size12g { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #333333;}\
.size12w { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #FFFFFF;}\
.size12gpx { font-size: 13px; font-style: normal; line-height: 120%; color: #333333;}\
.size12 { font-size: 1.55ex; font-style: normal; line-height: 160%; color: #353535;}\
.size12 A:link { text-decoration:none;  color:#00339B;}\
.size12 A:visited {text-decoration:none;  color:#00339B;}\
.size12 A:active { text-decoration:none;  color:#00339B;}\
.size12 A:hover { color:#00339B; text-decoration: underline;}\
.size14 { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #353535;}\
.size14 A:link { text-decoration:none;  color:#00339B;}\
.size14 A:visited {text-decoration:none;  color:#00339B;}\
.size14 A:active { text-decoration:none;  color:#00339B;}\
.size14 A:hover { color:#00339B; text-decoration: underline;}\
.size14b { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #00339B;}\
.size14g { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #333333;}\
.size17g { font-size: 2.0ex; font-style: normal; line-height: 140%; color: #333333;}\
				</STYLE>");
		 	}
		 }

	}else{

		// WIN IE
		if( bName == "M"){
				document.write("<STYLE TYPE='text/css'>\
a:link { color: #003AAD; text-decoration: none; }\
a:hover { color: #003AAD; text-decoration: none; background-color: #D7DDFF; }\
a:visited { color: #003AAD; text-decoration: none; }\
.white a:link {color: #FFFFFF; }\
.white a:hover {color: #003AAD; background-color: #D7DDFF; }\
.white a:visited {color: #FFFFFF; }\
.size11g { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #333333;}\
.size11b { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #00339B;}\
.size11 { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #353535;}\
.size11px { font-size: 11px; font-style: normal; line-height: 120%; color: #353535;}\
.size12r { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #FF0000;}\
.size12b { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #00339B;}\
.size12g { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #333333;}\
.size12w { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #FFFFFF;}\
.size12gpx { font-size: 13px; font-style: normal; line-height: 120%; color: #333333;}\
.size12 { font-size: 1.55ex; font-style: normal; line-height: 160%; color: #353535;}\
.size12 A:link { text-decoration:none;  color:#00339B;}\
.size12 A:visited {text-decoration:none;  color:#00339B;}\
.size12 A:active { text-decoration:none;  color:#00339B;}\
.size12 A:hover { color:#00339B; text-decoration: underline;}\
.size14 { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #353535;}\
.size14 A:link { text-decoration:none;  color:#00339B;}\
.size14 A:visited {text-decoration:none;  color:#00339B;}\
.size14 A:active { text-decoration:none;  color:#00339B;}\
.size14 A:hover { color:#00339B; text-decoration: underline;}\
.size14b { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #00339B;}\
.size14g { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #333333;}\
.size17g { font-size: 2.0ex; font-style: normal; line-height: 140%; color: #333333;}\
				</STYLE>");

		}else{

			// WIN NETSCAPE 4.x
			if( vNum < 5 ){
				document.write("<STYLE TYPE='text/css'>\
a:link { color: #003AAD; text-decoration: none; }\
a:hover { color: #003AAD; text-decoration: none; background-color: #D7DDFF; }\
a:visited { color: #003AAD; text-decoration: none; }\
.white a:link {color: #FFFFFF; }\
.white a:hover {color: #003AAD; background-color: #D7DDFF; }\
.white a:visited {color: #FFFFFF; }\
.size11g { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #333333;}\
.size11b { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #00339B;}\
.size11 { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #353535;}\
.size11px { font-size: 11px; font-style: normal; line-height: 120%; color: #353535;}\
.size12r { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #FF0000;}\
.size12b { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #00339B;}\
.size12g { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #333333;}\
.size12w { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #FFFFFF;}\
.size12gpx { font-size: 13px; font-style: normal; line-height: 120%; color: #333333;}\
.size12 { font-size: 1.55ex; font-style: normal; line-height: 160%; color: #353535;}\
.size12 A:link { text-decoration:none;  color:#00339B;}\
.size12 A:visited {text-decoration:none;  color:#00339B;}\
.size12 A:active { text-decoration:none;  color:#00339B;}\
.size12 A:hover { color:#00339B; text-decoration: underline;}\
.size14 { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #353535;}\
.size14 A:link { text-decoration:none;  color:#00339B;}\
.size14 A:visited {text-decoration:none;  color:#00339B;}\
.size14 A:active { text-decoration:none;  color:#00339B;}\
.size14 A:hover { color:#00339B; text-decoration: underline;}\
.size14b { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #00339B;}\
.size14g { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #333333;}\
.size17g { font-size: 2.0ex; font-style: normal; line-height: 140%; color: #333333;}\
				</STYLE>");

			// WIN NETSCAPE 6.x~
			}else{
				document.write("<STYLE TYPE='text/css'>\
a:link { color: #003AAD; text-decoration: none; }\
a:hover { color: #003AAD; text-decoration: none; background-color: #D7DDFF; }\
a:visited { color: #003AAD; text-decoration: none; }\
.white a:link {color: #FFFFFF; }\
.white a:hover {color: #003AAD; background-color: #D7DDFF; }\
.white a:visited {color: #FFFFFF; }\
.size11g { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #333333;}\
.size11b { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #00339B;}\
.size11 { font-size: 1.40ex; font-style: normal; line-height: 120%; color: #353535;}\
.size11px { font-size: 11px; font-style: normal; line-height: 120%; color: #353535;}\
.size12r { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #FF0000;}\
.size12b { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #00339B;}\
.size12g { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #333333;}\
.size12w { font-size: 1.55ex; font-style: normal; line-height: 140%; color: #FFFFFF;}\
.size12gpx { font-size: 13px; font-style: normal; line-height: 120%; color: #333333;}\
.size12 { font-size: 1.55ex; font-style: normal; line-height: 160%; color: #353535;}\
.size12 A:link { text-decoration:none;  color:#00339B;}\
.size12 A:visited {text-decoration:none;  color:#00339B;}\
.size12 A:active { text-decoration:none;  color:#00339B;}\
.size12 A:hover { color:#00339B; text-decoration: underline;}\
.size14 { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #353535;}\
.size14 A:link { text-decoration:none;  color:#00339B;}\
.size14 A:visited {text-decoration:none;  color:#00339B;}\
.size14 A:active { text-decoration:none;  color:#00339B;}\
.size14 A:hover { color:#00339B; text-decoration: underline;}\
.size14b { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #00339B;}\
.size14g { font-size: 1.7ex; font-style: normal; line-height: 140%; color: #333333;}\
.size17g { font-size: 2.0ex; font-style: normal; line-height: 140%; color: #333333;}\
				</STYLE>");
			}
		}
	}
}


//-------------------------
//  クッキー処理
//-------------------------
function GetCookie (name)
{
	var arg  = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen)
		{
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
		}
	return null;
}

function getCookieVal (offset)
{
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset,endstr));
}

function CookieCheckPulldown1(){
	get_data = GetCookie("@ihonet");
	if(get_data==null){
		document.write("<option value=/>ホームページ</option>");
	}
}

function CookieCheckPulldown2(){
	get_data = GetCookie("@ihonet");
	if(get_data==null){
		document.write("<option value=->ご宿泊</option>");
		document.write("<option value=/fr-roommain.html>　|-メインぺージ</option>");
		document.write("<option value=/fr-roompack.html>　|-おすすめ宿泊プラン情報</option>");
		document.write("<option value=/fr-room.html>　|-客室紹介</option>");
		document.write("<option value=/fr-suite.html>　|-スイートルームのご紹介</option>");
		document.write("<option value=/fr-service.html>　|-客室サービスのご紹介</option>");
		document.write("<option value=/fr-roomservice.html>　|-ルームサービスメニュー</option>");
		document.write("<option value=/fr-tariff.html>　|-客室料金一覧表</option>");
		document.write("<option value=/fr-roomkakunin.html>　|-予約確認</option>");
		document.write("<option value=/fr-roomcancel.html>　|-予約キャンセル</option>");
		document.write("<option value=/fr-roomfaq.html>　ご宿泊に関するFAQ</option>");
	}
}

function CookieCheckRoomstay(){
	get_data = GetCookie("@ihonet");
	if(get_data==null){
		document.write("<a href=http://www.nikkokix.com/fr-roommain.html><img src=../../img/stay_mark.gif height=137 width=137 border=0></a>");
	}else{
		document.write("<img src=../../img/stay_mark.gif height=137 width=137 border=0>");
	}
}

function CookieCheckJmb(){
	get_data = GetCookie("@ihonet");
	if(get_data==null){
		document.write("<a href=http://www.nikkokix.com/fr-jmb.html><img src=../../img/milepage_linkbar.gif height=30 width=413 border=0></a>");
	}else{
		document.write("<a href=http://www.nikkokix.com/fr-jmb_member.html><img src=../../img/milepage_linkbar.gif height=30 width=413 border=0></a>");
	}
}


function CookieCheckTriplemile(){
	get_data = GetCookie("@ihonet");
	if(get_data==null){
		document.write("<tr height=84><td align=right width=24 height=84><img src=/20_mileagecampaign/img/3mile_butt_arrow.gif alt= height=17 width=24 border=0></td><td height=84><a href=/cgi-bin/webmainte/display_frame.cgi?Link=display_rooms.cgi,02,80 target=_self><img src=/20_mileagecampaign/img/3mile_butt01.jpg alt= height=68 width=68 border=0></a></td></tr>");
	}else{
		document.write("<tr height=84><td align=right width=24 height=84><img src=/img/spacer.gif alt= height=17 width=24 border=0></td><td height=84><img src=/img/spacer.gif alt= height=68 width=68 border=0></td></tr>");
	}
}


function CookieCheckTriplemile2(){
	get_data = GetCookie("@ihonet");
	if(get_data==null){
		document.write("<img src=/20_mileagecampaign/img/3mile_butt_arrow.gif alt= height=17 width=24 align=right border=0></font></td><td width=117><a href=/cgi-bin/webmainte/display_frame.cgi?Link=display_rooms.cgi,02,81 target=_self><img src=/20_mileagecampaign/img/3mile_butt01.jpg alt= height=68 width=68 border=0></a>");
	}else{
		document.write("<img src=../../img/spacer.gif alt= height=17 width=24 align=right border=0></font></td><td width=117><img src=../../img/spacer.gif alt= height=68 width=68 border=0></a>");
	}
}


function setCookie(){
	theDay   = 1;
	setDay = new Date();
	setDay.setTime(setDay.getTime()+(theDay*1000*60*60*24));
	expDay = setDay.toGMTString();
	var the_cookie ="@ihonet=member;" ;
	var the_cookie = the_cookie + "path=/;";
	var the_cookie = the_cookie + "domain=www.nikkokix.com;";
	document.cookie = the_cookie + "expires=" + expDay + ";";
}

function delCookie(){
	theDay   = 1;
	setDay = new Date();
	setDay.setTime(setDay.getTime()-(theDay*1000*60*60*24));
	expDay = setDay.toGMTString();
	var the_cookie ="@ihonet=member;" ;
	var the_cookie = the_cookie + "path=/;";
	var the_cookie = the_cookie + "domain=www.nikkokix.com;";
	document.cookie = the_cookie + "expires=" + expDay + ";";
}

