//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) ;
}

//ÆË¾÷¶ç¿ì±â1-1
function openPop1(url,idn,intWidth,intHeight,scroll) { 
	//alert("pop_scroll");
	window.open(url, idn,"width="+intWidth+", height="+intHeight+","+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");
				}
			}
	}
}


/********************************************************************************
*******                     Download½Ã ÀúÀå¿©ºÎ¸¦ È®ÀÎÇÏ±âÀ§ÇÑ ½ºÅ©¸³Æ®              *******
********************************************************************************/

function Download_Confirm(fileDir,fileName)
{
	
      document.frmDown.action = "/FileDownloadConfirm.do";
      document.frmDown.hidFolderName.value = fileDir;
      document.frmDown.hidFileName.value = fileName;
      document.frmDown.submit();
}


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;
		}
	}
}

//2008-11-19 FAQÅÜ ¼öÁ¤»çÇ×
function onCheck(dotabid, num){
		var inum=parseInt(num);
		var linkTab=dEI(dotabid).getElementsByTagName("a");
		for (i=1;i<=linkTab.length;i++) {
			//var tabimg = linkTab.item(i).getElementsByTagName("img").item(0);
			var aa= dotabid+i;
			var tabContents=dEI(dotabid+i);
			if (i==inum) {
				if(tabContents.style.display!="block"){
					tabContents.style.display="block";
				}
		}else{
			tabContents.style.display="none";
		}
	}
}


//2009-02-18 FAQÅÜ sim ¸µÅ© °É±â À§ÇÔ. 
function onCheck2(dotabid, num, size){
		var inum=parseInt(num);
	
		for (i=1;i<=size;i++) {
			var aa= dotabid+i;
			var tabContents=dEI(dotabid+i);
			if (i==inum) {
				if(tabContents.style.display!="block"){
					tabContents.style.display="block";
				}
		}else{
			tabContents.style.display="none";
		}
	}
}

//GNB ¼³Á¤
function gnb(mnum){
	var gnbWrite="<h1 class=\"logo\"><a href=\"../index.html\"><img src=\"../images/common/logo.jpg\" alt=\"WYZ070\" \/><\/a></h1><ul id=\"gnb\">";
	gnbWrite=gnbWrite+"<li class=\"first-child\"><a href=\"intro.html\"><img src=\"../images/common/gnb_01.gif\" alt=\"¿ÍÀÌÁîÈ¨ ¼Ò°³\" /><\/a><\/li>";
	gnbWrite=gnbWrite+"<li><a href=\"charge.html\"><img src=\"../images/common/gnb_02.gif\" alt=\"¿ä±Ý\" /><\/a><\/li>";
	gnbWrite=gnbWrite+"<li><a href=\"phone.html\"><img src=\"../images/common/gnb_03.gif\" alt=\"ÀüÈ­±â\" /><\/a><\/li>";
	gnbWrite=gnbWrite+"<li><a href=\"number.html\"><img src=\"../images/common/gnb_04.gif\" alt=\"¹øÈ£ÀÌµ¿°ú ¿ÍÀÌÁîÈ¨\" /><\/a><\/li>";
	gnbWrite=gnbWrite+"<li><a href=\"event.html\"><img src=\"../images/common/gnb_05.gif\" alt=\"°¡ÀÔÀÌº¥Æ®\" /><\/a><\/li>";
	gnbWrite=gnbWrite+"<li><a href=\"https://www.samsung070.com/index_frame.html\" target=\"_blank\"><img src=\"../images/common/gnb_06.gif\" alt=\"°í°´¼¾ÅÍ\" /><\/a><\/li><\/ul>";
	document.write(gnbWrite);

	var menuPos=Number(mnum)-1;
	var menuOn=dEI("gnb").getElementsByTagName("a").item(menuPos);
	menuOn.className="on";
	menuOn.getElementsByTagName("img").item(0).src=menuOn.getElementsByTagName("img").item(0).src.replace(".gif", "on.gif");
	imgRollover("gnb");
	footerWrite();
}

//Footer
/*
function footerWrite(){
	//if(dEI("footer")) {
	var footerWrite="<div>";
		footerWrite=footerWrite+"<img src=\"images/common/logo_footer.gif\" alt=\"»ï¼º³×Æ®¿÷½º\" class=\"logo\" />";
		footerWrite=footerWrite+"<address> <img src=\"images/common/address.gif\" alt=\"»ï¼º³×Æ®¿÷½º(ÁÖ)´ëÇ¥ÀÌ»ç ¹Ú¾ç±Ô | »ç¾÷ÀÚµî·Ï¹øÈ£ 214-86-49528 | Åë½ÅÆÇ¸Å¾÷½Å°í¹øÈ£ Á¦ °­³²-1986È£ (135-798)¼­¿ï½Ã °­³²±¸ »ï¼ºµ¿ 159-1 ¹«¿ª¼¾ÅÍ ¾Æ¼ÀÅ¸¿ö 8~11Ãþ | T.1577-0300 | E Mil.cscenter@samsung.com Copyright&copy;2000-2008 SAMSUNG NETWORKS INC. All rights reserved\" class=\"copy\" /><\/address>";
		footerWrite=footerWrite+"<p class=\"menu\"><img src=\"images/common/footer_menu.gif\" alt=\"\" /><\/p><\/div>";
		dEI("footer").innerHTML=footerWrite;
		//}
	}
*/


// first ¿¹¿ÜÃ³¸® listFirst(ºí·°Id, ÅÂ±×³×ÀÓ, Ã³¸®ÇÒ ¾ÆÀÌÅÛ °¹¼ö) // ¾ÆÀÌÅÛ¹øÈ£´Â 0¹øºÎÅÍ ¹ÝÈ¯
function listFirst(Elid, Etn, Num){
	liEl = dEI(Elid).getElementsByTagName(Etn);
	for(i=0; liEl.length>i; i=i+Num){
		liEl.item(i).className += " first";
	}
}

// ¿ÍÀÌÁîÈ¨ Ã¼Çè°ü¿¡¼­ »ç¿ëÀÚ¸Þ´º¾ó´Ù¿î·Îµå
function fileDown(downId) {
	//alert(downId+'´Ù¿î·ÎµåÆÄÀÏ');
	Download_Confirm('/wyzhome/download/manual','H250_manual.pdf')
	//»ç¿ëÀÚ¸Þ´º¾ó´Ù¿î·Îµå : manual;
}
