/* ---------------------------------------------------------- */
/*  PokeNet 汎用JavaScript 外部ファイル                       */
/*          This file was written by Lightning.               */
/* ---------------------------------------------------------- */

myDecode();	// 配列Fmに、GET情報代入
getCookie();	// 配列Cookieに、クッキー情報代入

/* ---------------------------------------------------------- */

// ■ target="_blank" 回避関数
//	使い方
//	<a href="*" onclick="newLinkWin(this);" onkeydown="newLinkWin(this);">リンクテキスト</a>

function newLinkWin(set){
	addr = set.href;
	window.open(addr);
	return false;
}

/* ---------------------------------------------------------- */

// ■ GETメソッド専用デコーダー
//	使い方
//	in = myDecode();

function myDecode(){
	Fm = new Array();
	items = new Array();
	input = location.search.substr(1).split('&');
	
	for(pair in input) {
		items = input[pair].split('=');
		Fm[items[0]] = items[1];
	}
	return Fm;
}

/* ---------------------------------------------------------- */

// ■ Cookieセッター,ゲッター
//	使い方
//	setCookie(key,value);
//	Cookie = getCookie();

function setCookie(key,value){
	set = key + "=" + escape(value) + "; expires=Tue, 31-Dec-2030 23:59:59; ";
	document.cookie = set;
}
function getCookie(){
	Cookie = new Array();
	return Cookie;
}

/* ---------------------------------------------------------- */
