window.name = "del_view";

/** 전체메뉴보기*/
function initTopMenuAll() {
	var topmenuAll_show = document.getElementById('topmenuAll_show');
	var topmenuAll_hide = document.getElementById('topmenuAll_hide');
	topmenuAll_show.onclick = function() {
		document.getElementById('quickGo').style.display = "none";
		document.getElementById('bizGo').style.display = "none";
		document.getElementById('topmenuAll').style.display = "block";
		return false;
	}
	topmenuAll_hide.onclick = function() {
		document.getElementById('topmenuAll').style.display = "none";
		//var link = document.createElement("a");
		//document.getElementById('head').appendChild(link);
		//link.setAttribute("href","#");
		//link.focus();
	}
}

/** 바로가기보기*/
function initQuMenuAll() {
	var quickGo_show = document.getElementById('quickGo_show');
	var quickGo_hide = document.getElementById('quickGo_hide');
	quickGo_show.onclick = function() {
		document.getElementById('topmenuAll').style.display = "none";
		document.getElementById('bizGo').style.display = "none";
		document.getElementById('quickGo').style.display = "block";
		return false;
	}
	quickGo_hide.onclick = function() {
		document.getElementById('quickGo').style.display = "none";
		//var link = document.createElement("a");
		//document.getElementById('head').appendChild(link);
		//link.setAttribute("href","#");
		//link.focus();
	}
}

/**공단사업소개보기*/
function initBizMenuAll() {
	var bizGo_show = document.getElementById('bizGo_show');
	var bizGo_hide = document.getElementById('bizGo_hide');
	bizGo_show.onclick = function() {
		document.getElementById('topmenuAll').style.display = "none";
		document.getElementById('quickGo').style.display = "none";
		document.getElementById('bizGo').style.display = "block";
		return false;
	}
	bizGo_hide.onclick = function() {
		document.getElementById('bizGo').style.display = "none";
		//var link = document.createElement("a");
		//document.getElementById('head').appendChild(link);
		//link.setAttribute("href","#");
		//link.focus();
	}
}

/** 바로가기보기_서브*/
function initQuMenuAll_sub() {
	var quickGo_show = document.getElementById('quickGo_show');
	var quickGo_hide = document.getElementById('quickGo_hide');
	quickGo_show.onclick = function() {
		document.getElementById('bizGo').style.display = "none";
		document.getElementById('quickGo').style.display = "block";
		return false;
	}
	quickGo_hide.onclick = function() {
		document.getElementById('quickGo').style.display = "none";
		//var link = document.createElement("a");
		//document.getElementById('head').appendChild(link);
		//link.setAttribute("href","#");
		//link.focus();
	}
}

/**공단사업소개보기_서브*/
function initBizMenuAll_sub() {
	var bizGo_show = document.getElementById('bizGo_show');
	var bizGo_hide = document.getElementById('bizGo_hide');
	bizGo_show.onclick = function() {
		document.getElementById('quickGo').style.display = "none";
		document.getElementById('bizGo').style.display = "block";
		return false;
	}
	bizGo_hide.onclick = function() {
		document.getElementById('bizGo').style.display = "none";
		//var link = document.createElement("a");
		//document.getElementById('head').appendChild(link);
		//link.setAttribute("href","#");
		//link.focus();
	}
}


//Element ID 불러쓰기
function dEI(elementID){
	return document.getElementById(elementID);
}

// roundBox Layout
function initLayout(layoutEl,childEl) {
	var layoutId = dEI(layoutEl);
	var contentsId = dEI(childEl);
		
	//create and build div structure
	var bodyTH = document.createElement('div');
	var bodyLV = document.createElement('div');
	var bodyRV = document.createElement('div');
	var bodyBH = document.createElement('div');
	var bodyTL = document.createElement('div');
	var bodyTR = document.createElement('div');
	var bodyBL = document.createElement('div');
	var bodyBR = document.createElement('div');
	bodyTH.className = "bodyTH";
	bodyLV.className = "bodyLV";
	bodyRV.className = "bodyRV";
	bodyBH.className = "bodyBH";
	bodyTL.className = "bodyTL";
	bodyTR.className = "bodyTR";
	bodyBL.className = "bodyBL";
	bodyBR.className = "bodyBR";
	layoutId.appendChild(bodyTH);
	bodyTH.appendChild(bodyLV);
	bodyLV.appendChild(bodyRV);
	bodyRV.appendChild(bodyBH);
	bodyBH.appendChild(bodyTL);
	bodyTL.appendChild(bodyTR);
	bodyTR.appendChild(bodyBL);
	bodyBL.appendChild(bodyBR);
	bodyBR.appendChild(contentsId);
}


//Images Btn_KSS
function BtnOn(imgEl){
	imgEl.src = imgEl.src.replace(".gif", "_on.gif");
}
function BtnOut(imgEl){
	imgEl.src = imgEl.src.replace("_on.gif", ".gif");
}

// 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";
	}
}

//팝업띄우기
function openPop(url,idn,intWidth,intHeight,scroll) { 
	//alert("pop_scroll");
	window.open(url, idn,"width="+intWidth+", height="+intHeight+",resizable=0,scrollbars="+scroll) ;
}

// 이미지 롤오버
function imgRollover(imgBoxID){
	var MenuCounts = dEI(imgBoxID).getElementsByTagName("img");
	for (i=0;i<MenuCounts.length;i++) {
		var numImg=MenuCounts.item(i);
		var ImgCheck = numImg.src.substring(numImg.src.length-6,numImg.src.length);
		if (ImgCheck!="on.gif") {
				numImg.onmouseover = function () {
					this.src = this.src.replace(".gif", "on.gif");
				}
				numImg.onmouseout = function () {
					this.src = this.src.replace("on.gif", ".gif");
				}
			}
	}
}


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";
		}
	}
}


function initToggle(tabContainer) {
	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 = "";
				this.className="on";
				tabContainer.current = this;
			}
			return false;
		}
	}
}

//faq
function faq_layer(layer){
	var obj = document.getElementById("faq_"+layer);
	//var obj2= document.getElementById("faq_open_"+layer);
	//var obj3= document.getElementById("faq_close_"+layer);
	

	if (obj.style.display == "" || !obj.style.display) {
		obj.style.display = "none";
		//obj2.style.display = "inline";
		//obj3.style.display = "none";
		for (i=0; i<3; i++ ){
			obj.getElementsByTagName("td").item(i).style.borderBottom = "0"
		}
	}
	else {
		obj.style.display = "";
		//obj2.style.display = "none";
		//obj3.style.display = "inline";
	}
}
function url_question(){//자주 묻는 질문
    
	opener.top.location.href="http://www.hyundai.com/cs/Faq_List.aspx";
	self.close();
}

/*	글자확대축소 */	
var currentFontSize = 1;
			
function zoomUtil(state, e){
	var idx;
	var arrFontSize = new Array();

	arrFontSize[0] = "65%";
	arrFontSize[1] = "75%";
	arrFontSize[2] = "85%";
	arrFontSize[3] = "100%";
	arrFontSize[4] = "110%";
	arrFontSize[5] = "120%";
	arrFontSize[6] = "130%";
	
	var e = e || window.event;
	if (e) {
		if (state == "plus") {		
			if (currentFontSize < 6 ) {
				idx = currentFontSize + 1;
				currentFontSize = idx;
			}else{
				idx = 6;
				currentFontSize = idx;
			}			
		} else if (state == "default") {
			idx = 1;
			currentFontSize = idx;
		} else if (state == "minus") {			
			if ( currentFontSize >= 1) {
				idx = currentFontSize - 1;
				currentFontSize = idx;
			}else{
				idx = 0;
				currentFontSize = idx;
			}
		}		
	}
	document.body.style.fontSize = arrFontSize[idx];
	return false;
}

function downFile(fname, c) {
	location.href = "/web/kem_home/_common/ac_downFile.asp?f_name=" + escape(fname) + "&cc=" + escape(c);
}

function urlLink(u) {
	location.href = "/web/kem_home/introduce/business/" + u;
}