//コメント
function searchButton_onClick(VstrKeywords){
	PAFuncLib.returnValueFalse();
	if(200 < VstrKeywords.length){
		window.alert("検索するキーワードが長すぎます。200文字以内に絞ってください。");
		return;
	}
	jumpSearchResultPage(VstrKeywords);
}

function jumpSearchResultPage(VstrKeywords){
	//strKeyword = extractKeyword(VstrKeywords);
	//strLinkURL = "http://www.eisai.jp/wellness-finder/index.html?word=" + escape(strKeyword);
	//createCookie("PAKeywords",escape(VstrKeywords),1);
	setCookie(VstrKeywords);
	strLinkURL = "http://www.eisai.jp/wellness-finder/index.html"
	location.href = strLinkURL;
}

function extractKeyword(VstrKey){
	var reg = VstrKey.match(/\?(.*?)&/i);
	if(reg == null){
	    return VstrKey;
	}
	var cutString = new String(RegExp.$1);
	var splitAry = new Array;
	splitAry = cutString.split("=");
	return splitAry[1];
}


function setCookie(VstrKeywords){
//	createCookie("PAKeywords",escape(VstrKeywords),1);
//	createCookie("PAKeywords",encodeURIComponent(VstrKeywords),1);
	var strKeywords = getConvertString(VstrKeywords);
	createCookie("PAKeywords",encodeURIComponent(strKeywords),1);
}

function getConvertString(VstrText){
	var strText = VstrText;
//	strText = strText.toUpperCase();
	strText = strText.replace(/;/g,"；");
	strText = strText.replace(/</g,"＜");
	strText = strText.replace(/>/g,"＞");
	strText = strText.replace(/\(/g,"（");
	strText = strText.replace(/\)/g,"）");
	strText = strText.replace(/\'/g,"’");
	strText = strText.replace(/\"/g,"”");
	strText = strText.replace(/\*/g,"＊");
	strText = strText.replace(/\+/g,"＋");
	strText = strText.replace(/\-/g,"－");
	strText = strText.replace(/\//g,"／");
	strText = strText.replace(/%/g,"％");
	strText = strText.replace(/\$/g,"＄");
	strText = strText.replace(/\&/g,"＆");
	strText = strText.replace(/\!/g,"！");
	strText = strText.replace(/\|/g,"｜");
	strText = strText.replace(/\{/g,"｛");
	strText = strText.replace(/\}/g,"｝");
	strText = strText.replace(/\./g,"．");
	strText = strText.replace(/\\/g,"￥");
	return strText;
}
