//***************************************************************
// 遷移先サイトURL
//---------------------------------------------------------------
//【本番用】
 var http_root		= "http://www.product-search.jp/"
 var https_root		= "https://www.product-search.jp/"
//---------------------------------------------------------------
//【テスト用】
//var http_root		= "/"
//var https_root		= "/"
//var http_root		= "http://10.55.93.195/"
//var https_root		= "http://10.55.93.195/"
//***************************************************************


var submitFlg = false;

//---------------------------------------------------------------//
// 関数名：go_search_header
// 引　数：なし
// 説　明：共通ヘッダ向けスクリプト
// 　　　　検索ボタン押下時に、選択項目によって遷移先を決める
// 履　歴：2007/07/26	新規作成	INW) 安田
//---------------------------------------------------------------//
function go_search_header() {

//	if (!submitFlg) {
		var submitTarget = "_self";

		if (document.search_header.search[0].checked){
			document.search_header.action = http_root + "Keyword/pro_name_query.asp?qu=" + document.search_header.SearchString.value + "&chk=pro_name_query";
		}else if(document.search_header.search[1].checked){
			document.search_header.action = http_root + "Keyword/query.asp?qu=" + document.search_header.SearchString.value + "&chk=appliance";
		}else if(document.search_header.search[2].checked){
			submitTarget = "_sitesearch";
			document.search_header.action = http_root + "Keyword/query.asp?qu=" + document.search_header.SearchString.value + "&chk=sitesearch";
		}else if(document.search_header.search[3].checked){
			document.search_header.action = http_root + "Keyword/pro_query.asp?qu=" + document.search_header.SearchString.value + "&chk=pro_query";
		}else{
			return;
		}
		
		submitFlg = true;
		
		document.search_header.target=submitTarget;
		document.search_header.method="POST";
		document.search_header.submit();

//	}

}


//---------------------------------------------------------------//
// 関数名：go_search_footer
// 引　数：なし
// 説　明：共通フッタ向けスクリプト
// 　　　　検索ボタン押下時に、選択項目によって遷移先を決める
// 履　歴：2007/07/26	新規作成	INW) 安田
//---------------------------------------------------------------//
function go_search_footer() {

//	if (!submitFlg) {
		var submitTarget = "_self";

		if (document.search_footer.search[0].checked){
			document.search_footer.action = http_root + "Keyword/pro_name_query.asp?qu=" + document.search_footer.SearchString.value + "&chk=pro_name_query";
		}else if(document.search_footer.search[1].checked){
			document.search_footer.action = http_root + "Keyword/query.asp?qu=" + document.search_footer.SearchString.value + "&chk=appliance";
		}else if(document.search_footer.search[2].checked){
			submitTarget = "_sitesearch";
			document.search_footer.action = http_root + "Keyword/query.asp?qu=" + document.search_header.SearchString.value + "&chk=sitesearch";
		}else if(document.search_footer.search[3].checked){
			document.search_footer.action = http_root + "Keyword/pro_query.asp?qu=" + document.search_footer.SearchString.value + "&chk=pro_query";
		}else{
			return;
		}
		
		submitFlg = true;
		
		document.search_footer.target=submitTarget;
		document.search_footer.method="POST";
		document.search_footer.submit();

//	}

}


//---------------------------------------------------------------//
// 関数名：go_search_psmook
// 引　数：なし
// 説　明：トップ画面PS情報番号検索向けスクリプト
// 履　歴：2007/07/30	新規作成	INW) 安田
//---------------------------------------------------------------//
function go_search_psmook() {

	document.search_psmook.action = http_root + "Keyword/pro_query.asp?psmook=" + document.search_psmook.psmook_number.value + "&chk=pro_query";
	document.search_psmook.target="_self";
	document.search_psmook.method="POST";
	document.search_psmook.submit();

}


//---------------------------------------------------------------//
// 関数名：chk_login
// 引　数：なし
// 説　明：静的ページ向けスクリプト
// 　　　　表示される際、「ログイン」「ログアウト」出力を切替る
// 履　歴：2007/07/26	新規作成	INW) 安田
//---------------------------------------------------------------//
function chk_login(){

	str = location.hash;

	flg = false;
	
	var_str = str.split("+");

	if( var_str[0]=="#true" ){

		if (typeof login.textContent != "undefined"){
			login.textContent  = "ログアウト";
		} else {
			login.innerText  = "ログアウト";
		}

			loginHREF = https_root + "MY_LIB_logout.asp?Tran=logout";

		if (typeof var_str[1] != "undefined" ) {

			search_header.search[2].checked = true;

		}

	} else {
		
		if (var_str[0] != "" ) {

			search_header.search[2].checked = true;

		}
		
	}

}
