//Element ID 불러쓰기
function dEI(elementID){
	return document.getElementById(elementID);
} 

//팝업 레이어
function showPop(object) {
	if(document.getElementById(object).style.display == "none") {
		document.getElementById(object).style.display = "block";
	} else {
		document.getElementById(object).style.display = "none";
	}
 }

//팝업창 열기
function PopupOpen(strUrl,strWindowName,strWidth,strHeight) {
    var strWindowFeatures = "width="+strWidth+",height="+strHeight;
    var strWindowPopup = window.open(strUrl,strWindowName,strWindowFeatures);
  }

 /***********************************************************
 FAQ List
 ***********************************************************/
function toggleList(tabContainer) {
	var tabContainer=document.getElementById(tabContainer)
	var triggers = tabContainer.getElementsByTagName("a");

	for(i = 0; i < triggers.length; i++) {
		if (triggers.item(i).href.split("#")[1])
			triggers.item(i).targetEl = document.getElementById(triggers.item(i).href.split("#")[1]);

		if (!triggers.item(i).targetEl)
			continue;

		triggers.item(i).targetEl.style.display = "none";
		triggers.item(i).className="";
		triggers.item(i).onclick = function () {
			if (tabContainer.current == this) {
				this.targetEl.style.display = "none";
				this.className="";
				tabContainer.current = null;
			} else {
				if (tabContainer.current) {
					tabContainer.current.targetEl.style.display = "none";
					tabContainer.current.className="";
				}
				this.targetEl.style.display = "block";
				this.className="on";
				tabContainer.current = this;
			}
			return false;
		}
	}
	//triggers.item(0).targetEl.style.display = "block";
}
// first 예외처리 firstChild(블럭Id, 태그네임, 처리할 아이템 번호) // 아이템번호는 0번부터 반환
function firstChild(Elid, Etn, Num){
	if(Num==""){Num=0;}
	liEl = dEI(Elid).getElementsByTagName(Etn);
	if (liEl.item(Num)) {
		liEl.item(Num).className += " first-child";
	}
}

/***********************************************************
 Tab Content
 ***********************************************************/
function tabCheck(dotabid, num){
		var inum=parseInt(num)-1;
		var linkTab=dEI(dotabid).getElementsByTagName("a");
		for (i=0;i<linkTab.length;i++) {
			var tabimg = linkTab.item(i).getElementsByTagName("img").item(0);
			var  tabContents= dEI(dotabid+(1+i));
			if (i==inum) {
				if(tabContents.style.display!="block"){
					tabimg.src=tabimg.src.replace(".gif", "_on.gif");
					tabContents.style.display="block";
				}
		}else{
			tabimg.src=tabimg.src.replace("_on.gif", ".gif");
			tabContents.style.display="none";
		}
	}
}






