/*------------------------------------
ファンクション共通変数の設定
------------------------------------*/
var myHref = this.location.href;
var rootPath = new String();
var rootUrlArray = new Array(
	"kawamura-fc.com",
	"122.200.215.57",
	"www"
);
for(var i=0;i<rootUrlArray.length;i++){
	var strPos = myHref.indexOf(rootUrlArray[i]);
	if(strPos > -1){
		rootPath = myHref.substring(0,strPos+(rootUrlArray[i].length));
		break;
	}
}

/*------------------------------------
別ウィンドウ表示用ファンクション
------------------------------------*/
function popup(arg){
	//ポップアップ先の一覧を生成
	var popupArray = new Array();
	popupArray["contact"] = {
		href:"https://e3004.secure.jp/~e3004004/others/contact.php",
		width:540,
		height:600,
		scrollBar:"no"
	};
	popupArray["MailtoRKF_1"] = {
		href:"https://e3004.secure.jp/~e3004004/mailto/profedit.php",
		width:540,
		height:600,
		scrollBar:"yes"
	};
	popupArray["MailtoRKF_2"] = {
		href:"https://e3004.secure.jp/~e3004004/mailto/contact.php",
		width:540,
		height:620,
		scrollBar:"no"
	};
	popupArray["rkmessage"] = {
		href:"./rkmessage/index.html",
		width:540,
		height:640,
		scrollBar:"no"
	};
	//ウィンドウを開く
//	window.open(rootPath+popupArray[arg].href,"","width="+popupArray[arg].width+",height="+popupArray[arg].height+",scrollbars="+popupArray[arg].scrollBar+",resizable=yes");
	window.open(popupArray[arg].href,"","width="+popupArray[arg].width+",height="+popupArray[arg].height+",scrollbars="+popupArray[arg].scrollBar+",resizable=yes");
}﻿

/*------------------------------------
cookie操作ファンクション
------------------------------------*/
//　Cookieにデータを保存する
function setCookie(theName__,theValue__,theDay__){
	if ((theName__ != null) && (theValue__ != null))	{
//		var expDay__ = "Wed, 01 Jan 2020 18:56:35 GMT";
		var expDay__ = "";
		if (theDay__ != null){
			theDay__ = eval(theDay__);	//　文字列の場合でも数値にする（念のため）
			var setDay = new Date();
			setDay.setTime(setDay.getTime()+(theDay__*1000*60*60*24));
			expDay__ = setDay.toGMTString();
		}
//		document.cookie = theName__ + "="+escape(theValue__)+";expires="+expDay__+";path=/";
		document.cookie = theName__ + "="+escape(theValue__)+";path=/";
		return true;
	}
	return false;
}
//　Cookieから指定されたデータを抜きだす
function getCookie(theName__){
	theName__ += "=";	//　=を追加して検索の手抜きをする
	theCookie__ = document.cookie+";";	//　検索時最終項目で-1になるのを防ぐ
	start__ = theCookie__.indexOf(theName__);	//　指定された名前を検索する
	if (start__ != -1){
		end__ = theCookie__.indexOf(";",start__);
		return unescape(theCookie__.substring(start__+theName__.length,end__));
	}
	return false;
}
//　Cookieのデータを削除する
function deleteCookie(theName__){
	document.cookie = theName__ + "=;expires=Thu,01-Jan-70 00:00:01 GMT";
	return true;
}

/*------------------------------------
メンバーズログインの状態を判定して処理を分岐
------------------------------------*/
window.onload = function(){
	if(getCookie("RKFSCOOKIE_isLoggingIn")){
		$('logoMembers').style.display="block";
		$('logoNormal').style.display="none";
		if($('naviMembers')){
			$('naviMembers').style.display="block";
		}
		if($('naviLogin')){
			$('naviLogin').style.display="none";
		}
	}else{
		$('logoMembers').style.display="none";
		$('logoNormal').style.display="block";
		if($('naviMembers')){
			$('naviMembers').style.display="none";
		}
		if($('naviLogin')){
			$('naviLogin').style.display="block";
		}
	}
};


/*------------------------------------
メールマガジン登録・解除用ファンクション
------------------------------------*/
//登録ファンクション
function mailReg(_form){
	//送信先の指定
	_url = "https://regssl.combzmail.jp/adddel.cgi";
	//ウィンドウのポップアップと書き込み
	_w = window.open("about:blank","regWin","width=547,height=367");
	_w.document.open();
	_w.document.write("<form name=\"myForm\" method=\"post\" action=\""+_url+"\">");
	_w.document.write("<input type=\"hidden\" name=\"mode\" value=\"add\">");
	_w.document.write("<input type=\"hidden\" name=\"confirm\" value=\"on\">");
	_w.document.write("<input type=\"hidden\" name=\"magid\" value=\"m069\">");
	_w.document.write("<input type=\"hidden\" name=\"event\" value=\"hp\">");
	_w.document.write("<input type=\"hidden\" name=\"email\" value=\""+_form.email.value+"\">");
	_w.document.write("</form>");
	_w.document.close();
	_w.document.myForm.submit();
	return false;
}
//削除ファンクション
function mailQuit(_form){
	//送信先の指定
	_url = "https://regssl.combzmail.jp/adddel.cgi";
	//ウィンドウのポップアップと書き込み
	_w = window.open("about:blank","quitWin","width=547,height=367");
	_w.document.open();
	_w.document.write("<form name=\"myForm\" method=\"post\" action=\""+_url+"\">");
	_w.document.write("<input type=\"hidden\" name=\"mode\" value=\"del\">");
	_w.document.write("<input type=\"hidden\" name=\"confirm\" value=\"on\">");
	_w.document.write("<input type=\"hidden\" name=\"magid\" value=\"m069\">");
	_w.document.write("<input type=\"hidden\" name=\"email\" value=\""+_form.email.value+"\">");
	_w.document.write("</form>");
	_w.document.close();
	_w.document.myForm.submit();
	return false;
}
//変更ファンクション
function mailChange(_form){
	//送信先の指定
	_url = "https://regssl.combzmail.jp/adddel_chg.php";
	//ウィンドウのポップアップと書き込み
	_w = window.open("about:blank","regWin","width=547,height=367");
	_w.document.open();
	_w.document.write("<form name=\"myForm\" method=\"post\" action=\""+_url+"\">");
	_w.document.write("<input type=\"hidden\" name=\"magid\" value=\"m069\">");
	_w.document.write("<input type=\"hidden\" name=\"email\" value=\""+_form.email.value+"\">");
	_w.document.write("<input type=\"hidden\" name=\"email_new\" value=\""+_form.email_new.value+"\">");
	_w.document.write("</form>");
	_w.document.close();
	_w.document.myForm.submit();
	return false;
}
/*------------------------------------
メールマガジン（携帯用）登録・解除用ファンクション
------------------------------------*/
//登録ファンクション
function mailRegM(_form){
	//
	_url = "https://regssl.combzmail.jp/adddel.cgi?charset=UTF-8&mode=add&confirm=on&event=hp&magid=7i6i&email_account="+_form.email_account.value+"&email_domain="+_form.email_domain.value+"&submit=%93%C7%8E%D2%93o%98%5E";
	//ウィンドウのポップアップと書き込み
	_w = window.open(_url,"regWin","width=547,height=367");
	return false;
}
//削除ファンクション
function mailQuitM(_form){
	//送信先の指定
	_url = "https://regssl.combzmail.jp/adddel.cgi?charset=UTF-8&mode=del&confirm=on&magid=7i6i&email_account="+_form.email_account.value+"&email_domain="+_form.email_domain.value+"&submit=%89%F0%8F%9C";
	//ウィンドウのポップアップと書き込み
	_w = window.open(_url,"regWin","width=547,height=367");
	return false;
}
//変更ファンクション
function mailChangeM(_form){
	//送信先の指定
	_url = "https://regssl.combzmail.jp/adddel_chg.php";
	//ウィンドウのポップアップと書き込み
	_w = window.open("about:blank","regWin","width=547,height=367");
	_w.document.open();
	_w.document.write("<form name=\"myForm\" method=\"post\" action=\""+_url+"\">");
	_w.document.write("<input type=\"hidden\" name=\"charset\" value=\"UTF-8\">");
	_w.document.write("<input type=\"hidden\" name=\"magid\" value=\"7i6i\">");
	_w.document.write("<input type=\"hidden\" name=\"email_account\" value=\""+_form.email_account.value+"\">");
	_w.document.write("<input type=\"hidden\" name=\"email_domain\" value=\""+_form.email_domain.value+"\">");
	_w.document.write("<input type=\"hidden\" name=\"email_new_account\" value=\""+_form.email_new_account.value+"\">");
	_w.document.write("<input type=\"hidden\" name=\"email_new_domain\" value=\""+_form.email_new_domain.value+"\">");
	_w.document.write("</form>");
	_w.document.close();
	_w.document.myForm.submit();
	return false;
}

