/* ################ 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 ''; 
} 
/*######################FAQ######################*/
function qnaClick(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 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;
	}
	if(action_exp == 'click') {
		if (tabContainer.first)
			tabContainer.first.onclick();
	} else {
		if (tabContainer.first)
			tabContainer.first.onmouseover();
	}

	try
	{
		if(individual != "" ) tabAnchor.item(individual).onclick();
	}
	catch (e)
	{
	}
}


/* ////////////////디자인 테스트용////////////////////// */
/* 플로팅 액션 */
function test_floatAction(el) {
	var target = document.getElementById("floating_star");
	if(target.className =="floating_star_dft") {
		target.className = "floating_star_open";
		el.innerText = "STAR CLOSE";
		el.title = "STAR CLOSE";
	} else {
		target.className = "floating_star_dft";
		el.innerText = "STAR OPEN";
		el.title = "STAR OPEN";
	}
}