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 CookieCheck(){
	get_data = GetCookie("@ihonet");
	if(get_data==null){
		document.write("<a href=/ TARGET=_top><img src=/parts/ft_home.gif width=44 height=16 border=0></a>");
	}else{
		document.write("<img src=/image/spacer.gif width=44 height=16 border=0>");
	}
}

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-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 + ";";
}

