var twLoad='<script src="http://widgets.twimg.com/j/2/widget.js"></script>';
document.write(twLoad);


/*TOP_LINK_SWAP*/
function logoSwap(Switch){
	if(Switch==1){
		document.getElementById("logoSwap").style.backgroundPosition="0px 84px";
	}else if(Switch==2){
		document.getElementById("logoSwap").style.backgroundPosition="0px 28px";
	}else{
		document.getElementById("logoSwap").style.backgroundPosition="0px 0px";
	}
}


/*TAB_BUTTON_CLICK_CONTROLL*/
function tabClicks(targetObj,changeImage){
	var tabLinks=new Array("tabLink01","tabLink02","tabLink03","tabLink04");
	for(i=0;i<tabLinks.length;i++){
		if(document.getElementById(tabLinks[i])){
			document.getElementById(tabLinks[i]).className="tabOddstyle";
		}
	}
	targetObj.className="tabSelected";
	document.images['imagePhoto'].src=changeImage;
}

function tabFloors(targetObj,changeLays){
	var tabLinks=new Array("tabLink01","tabLink02","tabLink03","tabLink04","tabLink05");
	var floorList=new Array("floor1","floor2","floor3","floor4","floor5");
	for(i=0;i<tabLinks.length;i++){
		if(document.getElementById(tabLinks[i])){
			document.getElementById(tabLinks[i]).className="tabOddstyle";
		}
		document.getElementById(floorList[i]).style.display="none";
	}
	targetObj.className="tabSelected";
	document.getElementById(changeLays).style.display="block";
}

/*PULL_DOWN_MENU_CONTROLL*/
function pullDown(targetObj,menuList){
	if(document.getElementById(menuList).style.visibility==''){
		document.getElementById(menuList).style.visibility="hidden";
		document.getElementById(menuList).style.display="none";
	}

	if(document.getElementById(menuList).style.visibility=="hidden"){
		changeClass(targetObj,"pdof");
		document.getElementById(menuList).style.display="block";
		document.getElementById(menuList).style.visibility="visible";
	}else{
		changeClass(targetObj,"pdon");
		document.getElementById(menuList).style.display="none";
		document.getElementById(menuList).style.visibility="hidden";
	}
}

function initMenu(ancherList,menuList){
	var menuArray=new Array();
	var ancherArray=new Array();
	menuArray=menuList.split(/:/);
	ancherArray=ancherList.split(/:/);

	for(i=0;i<menuArray.length;i++){
		document.getElementById(ancherArray[i]).className="pdon";
		document.getElementById(menuArray[i]).style.display="none";
		document.getElementById(menuArray[i]).style.visibility="hidden";
	}
}

function treeMenu(clickAncherObj,openClass,closeClass,subMenuID,defaultView,clickImageName,openImage,closeImage){
	//ブラウザによって状態が取得できない場合があるので、その回避処理
	with(document.getElementById(subMenuID)){
		if(style.display=="" || style.display=="undefined" || style.display==null){
			style.display=defaultView;
		}
	}

	//画像のプリロード処理
	if(clickImageName){
		var il=new Array(openImage,closeImage);
		var pi=new Array();
		for(i=0;i<il.length;i++){
			pi[i]=new Image();
			pi[i].src=il[i];
		}
	}

	//表示切り替え処理
	if(document.getElementById(subMenuID).style.display=="none"){
		document.getElementById(subMenuID).style.display="block";
		if(clickImageName){document.images[clickImageName].src=openImage;}
		if(clickAncherObj){changeClass(clickAncherObj,openClass);}
	}else{
		document.getElementById(subMenuID).style.display="none";
		if(clickImageName){document.images[clickImageName].src=closeImage;}
		if(clickAncherObj){changeClass(clickAncherObj,closeClass);}
	}
}

/*CLASS_CHANGER*/
function changeClass(targetObj,changeClass){
	targetObj.className=changeClass;
}

/*SSL_FORM*/
function sslPopup(U,T,W,H,S){
	var nowURL=location.host;
	if(nowURL.indexOf("test.")==-1){
		var U="https://iwaki-alios.jp"+U;
	}
	opWindow(U,T,W,H,S);
}

/*POPUP_WINDOW*/
function opWindow(U,T,W,H,S){
	if(U!=""){
		var O="width="+W+",height="+H+",scrollbars="+S+",menubar=no,toolbar=no,status=no,resizable=yes,location=no,directories=no";
		var popUp=window.open(U,T,O);
	}
}