//================================================= Window Open
function opnRegistWin(isp) {
	if (isp=="NIFTY") {
		url = "https://contents.nifty.com/member/service/crystal_month/cgi-bin/monthly_on.cgi?S=2001&C=NIFTY";
		//url = "http://game3c.prohouse.co.jp/crystal_v02/asp/show_page.asp?n=reg";
	} else if (isp=="BIGLOBE") {
		url = "http://www.crystal-online.tv/biglobe/regist_big.html";
	} else {
		return false;
	}
	registWin = window.open(url, "registWin", "width=750,height=650,resizable=1,directories=0,menubar=0,status=0,location=1,scrollbars=1,toolbar=0");
	registWin.focus();
}

function opnLoginWin(isp) {
	if (isp=="NIFTY") {
		url = " https://contents.nifty.com/member/service/g-way/crystal_month/crystal/nifty/cgi/parkin.asp?S=2001&C=NIFTY";
	} else if (isp=="BIGLOBE") {
		url = "http://www.crystal-online.tv/biglobe/login_big.html";
	} else {
		return false;
	}
	loginWin = window.open(url, "loginWin", "width=750,height=650,resizable=1,directories=0,menubar=0,status=1,location=1,scrollbars=1,toolbar=0");
	loginWin.focus();
}

function opnCancelWin(isp) {
	if (isp=="NIFTY") {
		url = "https://contents.nifty.com/member/service/crystal_month/cgi-bin/monthly_off.cgi?S=2001&C=NIFTY";
	} else if (isp=="BIGLOBE") {
		url = "http://www.crystal-online.tv/biglobe/delid_big.html";
	} else {
		return false;
	}
	cancelWin = window.open(url, "cancelWin", "width=560,height=600,resizable=1,directories=0,menubar=0,status=1,location=0,scrollbars=1,toolbar=0");
	cancelWin.focus();
}

/*
function analysisBasisFor(pagename) {
	var ImageWidth  =  1;
	var ImageHeight =  1;
	var ScriptUrl   = 'http://www.prohouse.co.jp/cgi-bin/analysis/marugoto_av/log4.cgi';
	var CounterName = pagename;
	var Tag = '<img' +
				' src="'   + ScriptUrl   + '?' + CounterName + '@' + document.referrer + '"' +
				' width="'  + ImageWidth + '"' +
				' height="' + ImageHeight + '"' +
	          '>';
	document.write(Tag);
}
*/

//---------------------------- Sub Window ページ用
function subWin(path) {
	var msie4 = navigator.appVersion.indexOf('MSIE 4') != -1;
	url = path;
	window_option = "resizable=1,directories=1,menubar=0,status=1,location=0,scrollbars=1,toolbar=1,height=640,width=600";
	if(msie4){
		// for IE 4.*
		subcr= window.open(url, "_blank", window_option);
	}
	else{
		subcr = window.open(url, "subcr", window_option);
		subcr.focus();
	}
}

//----------------------------リフレッシュ
function refresh(){
	if(window.opener == null){return;}
	else{window.opener.location.reload();}
	
	timerID = setTimeout("selfclose()",1000);  //1000で1秒
	
}


//--------------------------sample load
if(navigator.userAgent.indexOf('MSIE 4')!=-1 && navigator.userAgent.indexOf('Mac')!=-1)
	document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="/smpl_member/sample_utf.js" CHARSET="UTF-8" TYPE="text\/javascript"><\/SCR' + 'IPT>');
else
	document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="/smpl_member/sample.js" CHARSET="Shift_JIS" TYPE="text\/javascript"><\/SCR' + 'IPT>');
function Load(str){
	if(navigator.appVersion.charAt(0)>=4){
		document.write(str);
	}
}

//--------------------------new load
if(navigator.userAgent.indexOf('MSIE 4')!=-1 && navigator.userAgent.indexOf('Mac')!=-1)
	document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="/common/up_utf.js" CHARSET="UTF-8" TYPE="text\/javascript"><\/SCR' + 'IPT>');
else
	document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="/common/up.js" CHARSET="Shift_JIS" TYPE="text\/javascript"><\/SCR' + 'IPT>');
function Load(str){
	if(navigator.appVersion.charAt(0)>=4){
		document.write(str);
	}
}

// ----------
function get_cookie(name){

	if (document.cookie) {
		var cookies = document.cookie.split("; ");
		for (var i = 0; i < cookies.length; i++){
			var str = cookies[i].split("=");
			if (str[0] == name){
				var cookie_value = unescape(str[1]);
				if (cookie_value != ""){
					return cookie_value;
				}
				break;
			}
		}
	}
	return null;
}

// ----------
function set_navi(){
	isp = get_cookie("ISP");
	if (isp == "NIFTY"){
	} else if (isp=="BIGLOBE") {
	} else {
		document.location = "/template/!error_isp.html";
		return;
	}
	if (get_cookie("uid")){
		var tag = document.getElementById("navi");
		if (tag){
			tag.style.display = "none";
		}
	}
}

function openRegist(){

	var isp;
	isp = get_cookie("ISP");
	if (isp == "NIFTY"){
		document.location = "/template/!regist_nifty.html";
	} else if (isp == "BIGLOBE"){
		document.location = "/template/!regist_biglobe.html";
	}
}

function openRegistWin() {
	var isp;
	isp = get_cookie("ISP");
	if (isp=="NIFTY") {
		url = "https://contents.nifty.com/member/service/crystal_month/cgi-bin/monthly_on.cgi?S=2001&C=NIFTY";
		//url = "http://game3c.prohouse.co.jp/crystal_v02/asp/show_page.asp?n=reg";
	} else if (isp=="BIGLOBE") {
		url = "http://www.crystal-online.tv/biglobe/regist_big.html";
	} else {
		return false;
	}
	registWin = window.open(url, "registWin", "width=750,height=650,resizable=1,directories=0,menubar=0,status=0,location=1,scrollbars=1,toolbar=0");
	registWin.focus();
}

function openLoginWin() {
	var isp;
	isp = get_cookie("ISP");
	if (isp=="NIFTY") {
		url = " https://contents.nifty.com/member/service/g-way/crystal_month/crystal/nifty/cgi/parkin.asp?S=2001&C=NIFTY";
	} else if (isp=="BIGLOBE") {
		url = "http://www.crystal-online.tv/biglobe/login_big.html";
	} else {
		return false;
	}
	loginWin = window.open(url, "loginWin", "width=750,height=650,resizable=1,directories=0,menubar=0,status=1,location=1,scrollbars=1,toolbar=0");
	loginWin.focus();
}

function openCancelWin() {
	var isp;
	isp = get_cookie("ISP");
	if (isp=="NIFTY") {
		url = " https://contents.nifty.com/member/service/crystal_month/cgi-bin/monthly_off.cgi?S=2001&C=NIFTY";
	} else if (isp=="BIGLOBE") {
		url = "https://logingw.sso.biglobe.ne.jp/gw/cp_gwcharge.php?GwShopCode=1236&GwGoodsCode=0002&Print=GoodsName&Params=U";
	} else {
		return false;
	}
	loginWin = window.open(url, "cancelWin", "width=560,height=600,resizable=1,directories=0,menubar=0,status=1,location=1,scrollbars=1,toolbar=0");
	loginWin.focus();
}

