//faq
function isView(divName,num){
	var ele = document.getElementById(divName);
	var titleEle=ele.getElementsByTagName('a');
	var contEle=ele.getElementsByTagName('p');

  for(var i=0;i<titleEle.length;i++){
		if(i==num){
			if(contEle[i].className=="onCont"){
				titleEle[i].className="";
				contEle[i].className="";
			}else{
				titleEle[i].className="onTitle";
				contEle[i].className="onCont";
			}
		}else{
			titleEle[i].className="";
			contEle[i].className="";
		}
	}
}

/* 따라다니는 레이어 */

 function positionMessage(){
	//dvSidebar menu id
	var elem=document.getElementById("quick");
	// 초기 top 위치 
	elem.style.top=document.documentElement.scrollTop + 125 + "px";
	setTimeout("moveElement()", 10); 
}

function moveElement(){
	var elem = document.getElementById("quick");
	start = parseInt (elem.style.top);
	end = document.documentElement.scrollTop + 125; // limit 정하기
	 
	//start 와 end 같으면 멈춘다.
	if ( start != end ) {
		scale =   Math.ceil( Math.abs( end - start ) / 10 );
		
		//스크롤이 상단으로 이동이시 마이너스값...
		if ( end < start ) {
			scale = -scale; // alert("end = "+end+" start = "+start);
		}
			elem.style.top = parseInt (elem.style.top)+ scale + "px"; 
	}
	setTimeout("moveElement()", 10);
}

/*맨 위로가가기*/
function topMove(){
	 document.documentElement.scrollTop = 0 +"px";
}

/* 이벤트 플래쉬 */
function eventOn() { 
	document.getElementById("content").style.zIndex = "100";
}
function eventOff() { 
	document.getElementById("content").style.zIndex = "1000";
}


// Tab Content
function initTabMenu(tabContainerID, order) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	var arr = new Array ();
	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
				} else {
					currentmenu.className = currentmenu.className.replace(" on", "");
				}
			}
			this.targetEl.style.display = "";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
			} else {
				this.className += "ov";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;

		arr[i] = new Array ( thismenu.href.split("#")[1], thismenu );
	}

	if ( order && order != '') {
		for ( i=0; i<arr.length; i++ ) {
			if ( arr[i][0] == order ) {
				arr[i][1].onclick();
				break;
			}
		}
	}
	else {
		if (tabContainer.first)
			tabContainer.first.onclick();
	}
}

/* 테팔리앙 팝업 2009-08-05 */
function open_Pop(seq) {
	var temp = document.getElementById("popTefalmania" + seq);
	temp.style.display = "block";
}
function close_Pop(seq) {
	var temp = document.getElementById("popTefalmania" + seq);
	temp.style.display = "none";
}