/* ################ 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 ''; 
} 

/* // 롤오버/롤아웃 // */
function imgOn(el) {

             el.src = el.src.replace(/\.gif$/i,"_on.gif");

}

function imgOut(el) {

             el.src = el.src.replace(/_on\.gif$/i,".gif");

}


/*###################### classname으로 개체찾기 ###########################*/
function getElementsByClass(_class, el_id) {
	var browser=navigator.appName;
	var getkey=navigator.appVersion;
	


  var parent, els, returnArr = new Array(), i = 0;
  parent = (el_id) ? document.getElementById(el_id) : document;
	
  els = parent.getElementsByTagName('*');
	
	if ((browser.substring(0, 9)=="Microsoft") && (getkey.substring(22, 23)=="5")) els = parent.all;

  for (i; i < els.length; i++) {
    if ((els[i].className == _class) || (els[i].className.indexOf(" "+_class) != -1 ) || (els[i].className.indexOf(_class+" ") != -1 )) {
      returnArr[returnArr.length] = els[i];
		}
	}
	
  return returnArr;


} 

/*###################### left navigation ###########################*/
function leftNavi(target,depth2) {
	var snbWrap = document.getElementById(target);
	var submenuWrap = getElementsByClass("depth2",target);


	if(depth2 != 0) targetSubmenu = submenuWrap[depth2 - 1];
	if(targetSubmenu) targetSubmenu.className += " selected";
	try
	{
		if(depth3 && targetSubmenu.getElementsByTagName("ul")) {
			targetSubmenu.getElementsByTagName("li")[depth3 - 1].className += " selected";
		}
	}
	catch (e) {}
	
}

/* ###################### 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;
		}

			
	}

}


/* 20090819 플래시부분 추가 */
function teleditFlash(add,width,height){	
	var id = "test";
	html = '';
	html += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="' + id + '" width="'+width+'" height="'+height+'" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">';
	html += '<param name="movie" value="'+add+'" \/>';
	html += '<param name="quality" value="high" \/>';
	html += '<param name="allowScriptAccess" value="always" \/>';
	html += '<param name="allowFullScreen" value="true"\/>';
	html += '<param name="wmode" value="transparent"\/>';
	html += '<embed  src="'+add+'" width="'+width+'" height="'+height+'" quality="high"  bgcolor="#000000" name="DCPlayer"  align="middle" play="true" loop="false" wmode="transparent" quality="high" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"> <\/embed> <\/object>';

	document.write(html);
//	alert(html);
}
