// JavaScript Document


function specList(){
	$("#spec-list").load('/common/data/speclst_eu.html', {limit: 3}, function(){
		$(load);
	});
}


function load () {
	markview();
	SelectSite();
}

function markview() {
	var arrMarkId   = new Array("mark01","mark02","mark03","mark04","mark05","mark06","mark07","mark08","mark09","mark10","mark11","mark12","mark13");
	var MarkLoop	= arrMarkId.length;
	var arrMarkName = new Array(MarkLoop);
	var arrImgSrc	= new Array(MarkLoop);
	for (var i = 0; i < MarkLoop; i ++){
		arrMarkName[i]	= document.getElementById(arrMarkId[i]).name;
		arrImgSrc[i]	= document.getElementById(arrMarkId[i]).href;
	}
	var arrID = new Array("GLHMISTR","GLHSLITE","GLHTEMPM","GLMISTRA","GLSTEMPM","GLTEMPLT");
	var mark = "";
	var nIDListCount = arrID.length;	//IDリストの数
	var nMarkListCount = arrMarkName.length;	//機能リストの数
	var nLoop1 = 0;
	var nLoop2 = 0;
	var idname;
	var imgid;
	var nLoop3 = 0;
	//リストボックスの表示と値の変更
	for (nLoop1 = 0; nLoop1 < nIDListCount; nLoop1++){
		if(document.getElementById(arrID[nLoop1]+"_mark")!=null){
			mark = document.getElementById(arrID[nLoop1]+"_mark").name;
			nLoop3 = 0;
			for (nLoop2 = 0; nLoop2 < nMarkListCount; nLoop2++){
				if(mark.indexOf(arrMarkName[nLoop2])!=-1){
					idname = arrMarkId[nLoop2] + "_" +arrID[nLoop1];
					imgid = arrID[nLoop1] + "_" + nLoop3;
					nLoop3++;
					document.getElementById(imgid).src = arrImgSrc[nLoop2];// イメージファイルのセット
					document.getElementById(imgid).alt = arrMarkName[nLoop2]; // ALT属性のセット
					document.getElementById(imgid).style.display = "inline"; // アイコンの表示
				}
			}
		}
	}
}

//リストボックスへの表示
var currentSiteName   = "住宅・マンション・ビル向けのガラス";
var currentPsiteName  = "結露・湿気";
var currentSiteID   = "n0101";
var arrSiteName1 = new Array("遮熱","断熱","結露対策","紫外線遮蔽","光拡散効果","防犯対策","安全対策","防火対策","防音対策","リフォーム","デザイン","ガラス工法ガラスシステム","窓・開口部");
var arrSiteName2 = new Array("遮熱","断熱","結露対策","紫外線遮蔽","光拡散効果","防犯対策","安全対策","防火対策","防音対策","リフォーム","デザイン","ガラス工法ガラスシステム","窓・開口部");
//リストボックスへの値
var arrSiteUrl1 = new Array("/wps/wcm/connect/gplib/navi/p_user/use/h/h01/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/h/h02/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/h/h03/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/h/h04/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/h/h05/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/h/h06/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/h/h07/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/h/h08/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/h/h09/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/h/h10/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/h/h11/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/h/h12/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/h/h13/?key=list");
var arrSiteUrl2 = new Array("/wps/wcm/connect/gplib/navi/p_user/use/nh/nh01/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/nh/nh02/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/nh/nh03/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/nh/nh04/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/nh/nh05/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/nh/nh06/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/nh/nh07/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/nh/nh08/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/nh/nh09/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/nh/nh10/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/nh/nh11/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/nh/nh12/?key=list","/wps/wcm/connect/gplib/navi/p_user/use/nh/nh13/?key=list");
var nListCount = 0;	//リストの数
var nLoop = 0;
var name = "";
//リストボックスの表示と値の変更
function Switch(nType){
	if(nType == 1) {
	nListCount = arrSiteName1.length;
	}else{
	nListCount = arrSiteName2.length;
	}
	document.forms["spec"].elements["speclst"].options[0].text = "お選びください";
	document.forms["spec"].elements["speclst"].options[0].value = "noselect";
	document.forms["spec"].elements["speclst"].options[0].selected = true;
	for (nLoop = 0; nLoop < nListCount; nLoop++){
		if (nType == 1){
			document.forms["spec"].elements["speclst"].options[nLoop+1].text = arrSiteName1[nLoop];
			document.forms["spec"].elements["speclst"].options[nLoop+1].value = arrSiteUrl1[nLoop];
			if(currentSiteName == arrSiteName1[nLoop] && currentPsiteName == "住宅"){
				document.forms["spec"].elements["speclst"].options[nLoop+1].selected = true;
			}
		}else{
			document.forms["spec"].elements["speclst"].options[nLoop+1].text = arrSiteName2[nLoop];
			document.forms["spec"].elements["speclst"].options[nLoop+1].value = arrSiteUrl2[nLoop];
			if(currentSiteName == arrSiteName2[nLoop] && currentPsiteName == "非住宅"){
				document.forms["spec"].elements["speclst"].options[nLoop+1].selected = true;
			}
		}
	}
}

function SelectSite(){
	//用途検索
	if(currentPsiteName != "非住宅") {
		document.spec.lr[0].click();
	}else{
		document.spec.lr[1].click();
	}
	//ニーズ検索
	if(document.getElementById(currentSiteID) != undefined){
		document.getElementById(currentSiteID).className = "current";
	}
}

function Jump(){
	if(document.spec.speclst.value == "noselect" ) {
		alert("機能性能を選択してください");
	}else{
		location.href=document.spec.speclst.value;
	}
}
