﻿/* ################ bg 이미지를 이용한  rollover 시 flickering 현상을 방지하기 위한 스크립트 ################# */
try {
document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

/*###################### ie의 PNG 이미지 표현 함수 ###########################*/
function setPng24(obj) { 
    obj.width=obj.height=1; 
    obj.className=obj.className.replace(/\bpng24\b/i,''); 
    obj.style.filter = 
    "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
    obj.src='';  
    return ''; 
} 

/*###################### 레프트 로그인 영역 ######################*/
//tfield_dft : id, pwd 텍스트가 있는 기본적인 형태
//tfield_over : 포커싱되었을때 (텍스트없는 배경이미지와 테두리색변경)
//tfield_empty : 빈칸인채 포커스가 없어졌을때 (tfield_dft와 함께 쓰임)
function chkLogin_focus(el) {
	el.className = el.className.replace("tfield_empty","");
	el.className = el.className.replace("tfield_dft","tfield_over");

}
function chkLogin_blur(el) {
	 if(el.value == "") el.className = "tfield_empty " + el.className;
	 el.className = el.className.replace("tfield_over","tfield_dft");
}

/* ######################탭###################### */
function initTabMenu(tabContainerID,action_exp) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

for(i=0; i<tabAnchor.length; i++) {
		var chk_var = tabAnchor.item(i).className;
		if ( chk_var.indexOf("tab") != -1)
			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);
		if(action_exp == "click") {
			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", "_off.gif");
						currentmenu.className = currentmenu.className.replace(" selected", "");
					} else {
						currentmenu.className = currentmenu.className.replace(" selected", "");
					}
				}
				this.targetEl.style.display = "";
				if (this.imgEl) {
					this.imgEl.src = this.imgEl.src.replace("_off.gif", "_on.gif");
					this.className += " selected";
				} else {
					this.className += " selected";
				}
				this.container.current = this;


				return false;
			};
		} else {
			thismenu.onmouseover = 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", "_off.gif");
						currentmenu.className = currentmenu.className.replace(" selected", "");
					} else {
						currentmenu.className = currentmenu.className.replace(" selected", "");
					}
				}
				this.targetEl.style.display = "";
				if (this.imgEl) {
					this.imgEl.src = this.imgEl.src.replace("_off.gif", "_on.gif");
					this.className += " selected";
				} else {
					this.className += " selected";
				}
				this.container.current = this;


				return false;
			};
		}

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	

	try
	{
		
		if(action_exp == 'click') {
			if (tabContainer.first)
				tabAnchor.item(individual).onclick();
		} else {
			if (tabContainer.first)
				tabAnchor.item(individual).onmouseover();
		}
	}
	catch (e)
	{
		alert(e);
		if(action_exp == 'click') {
			if (tabContainer.first)
				tabContainer.first.onclick();
		} else {
			if (tabContainer.first)
				tabContainer.first.onmouseover();
		}
	}
}
 
/* ###################### FAQ ###################### */
function faqFoldup(el){
	var objBoxQ = el.getElementsByTagName("dt");
	var objBoxA = el.getElementsByTagName("dd");

	var temp = 0;
	for(i=0;i<objBoxQ.length;i++){
		objBoxQ[i].targetEl = objBoxA[i];
		if(!objBoxQ[i].targetEl) 
			continue;

		objBoxQ[i].targetEl.style.display = "none";
		objBoxQ[i].onclick = function () {
			if (el.current == this) {
				this.className = "";
				this.targetEl.style.display = "none";
				el.current = null;
			} else {
				if (el.current) {
					el.current.className = "";
					el.current.targetEl.style.display = "none";
				}
				this.className = "selected"
				this.targetEl.style.display = "block";
				el.current = this;
			}
			return false;
		}

			
	}

}

/* 디자인확인용 함수들 */
function cmtlistfolder(el) {
	var target1 = el.parentNode.parentNode;
	if(target1.className == "cmtlist_wrap cmtlist_open_wrap") target1.className = "cmtlist_wrap";
	else target1.className = "cmtlist_wrap cmtlist_open_wrap";
}

//SWF 사용하기
function useSwf(swfUrl,swfW,swfH,wmode,id)
{
	if(id){idStr=''}else{idStr='id='+id}
	if(wmode){
		wmodeStr1='<param name="wmode" value="transparent" />'
		wmodeStr2='wmode=transparent'
	} else {
		wmodeStr1='<param name="wmode" value="opaque" />';
		wmodeStr2='wmode=opaque';
	}
	document.writeln('<object id="House" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" '+idStr+' width='+swfW+' height='+swfH+'>')
	document.writeln('<param name="movie" value="'+swfUrl+'" />')
	document.writeln('<param name="menu" value="false" />')
	document.writeln('<param name="allowScriptAccess" value="always" />')
	document.writeln('<param name="quality" value="best" />')
	document.writeln(wmodeStr1)
	document.writeln('<embed src="'+swfUrl+'" width='+swfW+' height='+swfH+' '+idStr+' '+wmodeStr2+' menu=false allowScriptAccess=always quality=best type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />')
	document.writeln('</object>')
}

//점선효과 없애기
function bluring(){ 
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=bluring;