
/************************************************************
*
*  JavaScript
*
************************************************************/

 //ex)<script type="text/javascript">flashX('slide.swf','462','495','slide');</script> <== html 사용시
function flashX(src,w,h,swfid){
swf_html = '';
swf_html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+w+'" height="'+h+'" id="'+swfid+'">';
swf_html += '<param name="allowScriptAccess" value="sameDomain">';
swf_html += '<param name="movie" value="'+src+'">';
swf_html += '<param name="quality" value="high">';
swf_html += '<param name="bgcolor" value="#FFFFFF">';
swf_html += '<PARAM NAME="wmode" VALUE="transparent">';
swf_html += '<embed src="'+src+'" quality="high" bgcolor="#FFFFFF" width="'+w+'" height="'+h+'" name="'+swfid+'" allowScriptAccess="always" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
swf_html += '</object>';
document.write(swf_html);
}


 //ex)<script type="text/javascript">playflash('/kt08/fla/KTmain.swf','100%','720','#ffffff','high','main_Index','');</script> <== html 사용시
function playflash(swf, width, height, bgcolor,quality, id, flashvars)
{

	var strFlashTag = new String();


	if (navigator.appName.indexOf("Microsoft") != -1)
    {

	strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';

	strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" ';
        strFlashTag += 'id="' + id + '" width="' + width + '" height="' + height + '">';
        strFlashTag += '<param name="movie" value="' + swf + '"/>';

        if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
        strFlashTag += '<param name="quality" value="'+quality+'"/>';
        strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
        strFlashTag += '<param name="menu" value="false"/>';
        strFlashTag += '<param name="salign" value="LT"/>';
        strFlashTag += '<param name="scale" value="noscale"/>';
        strFlashTag += '<param name="wmode" value="transparent"/>';
        strFlashTag += '<param name="allowScriptAccess" value="always"/>';
        strFlashTag += '</object>';
    }
    else
    {
        strFlashTag += '<embed src="' + swf + '" ';
        strFlashTag += 'quality="'+quality+'" ';
        strFlashTag += 'bgcolor="' + bgcolor + '" ';
        strFlashTag += 'width="' + width + '" ';
        strFlashTag += 'height="' + height + '" ';
        strFlashTag += 'menu="false" ';
        strFlashTag += 'scale="noscale" ';
        strFlashTag += 'id="' + id + '" ';
        strFlashTag += 'salign="LT" ';
        strFlashTag += 'wmode="transparent" ';
        strFlashTag += 'allowScriptAccess="always" ';
        if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
        strFlashTag += 'type="application/x-shockwave-flash" ';
        strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        strFlashTag += '</embed>';
    }

 document.write(strFlashTag);
}



function footerSwf(url,widthNum,hightNum,Access,bgColor,wMode,vars){
	var codeStr = "";
	codeStr += "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96B8-444553540000\"";
	codeStr += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9.0.47.0\" width=\""+widthNum+"\" height=\""+hightNum+"\" id=\"SMS_Utility\">";
	codeStr += "<param name=\"allowScriptAccess\" value=\""+Access+"\" />";
	codeStr += "<param name=\"movie\" value=\""+url+"\" />";
	codeStr += "<param name=\"flashvars\" value=\""+vars+"\" />";
	codeStr += "<param name=\"id\" value=\"SMS_Utility\" />";
	codeStr += "<param name=\"menu\" value=\"false\" />";
	codeStr += "<param name=\"quality\" value=\"high\" />";
	codeStr += "<param name=\"wmode\" value=\""+wMode+"\" />";
	codeStr += "<param name=\"bgcolor\" value=\""+bgColor+"\" />";
	codeStr += "<embed src=\""+url+"\" flashvars=\""+vars+"\" allowScriptAccess=\""+Access+"\" menu=\"false\" quality=\"high\" wmode=\""+wMode+"\"";
	codeStr += "devicefont=\"true\" bgcolor=\""+bgColor+"\"  width=\""+widthNum+"\" height=\""+hightNum+"\" align=\"middle\" type=\"application/x-shockwave-flash\" id=\"SMS_Utility\"";
	codeStr += "pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">";
	codeStr += "</embed>";
	codeStr += "</object>";
	document.write(codeStr);
}

function footerOpen() {
	document.getElementById("footer2").className = "Open";
}
function footerClose() {
	document.getElementById("footer2").className = "Close";
}

//  화면 정중앙에 POPUP WINODOW OPEN
function popCwin( url, name, w, h, scroll) {

  var wl = (window.screen.width/2) - ((w/2) + 10);
  var wt = (window.screen.height/2) - ((h/2) + 50);

  var option = "height="+h+",width="+w+",left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars="+scroll + ", status=yes";

  commonPopWin = window.open( url, name, option );
  commonPopWin.focus();
}

// 원하는 위치에 POPUP WINODOW OPEN
function popUwin( url, name, w, h, wl, wt, scroll) {

  var option = "status=no,height="+h+",width="+w+",resizable=no,left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars="+scroll;

  commonPopWin = window.open( url, name, option );
  commonPopWin.focus();
}

/************************************************************
* GoTop
************************************************************/
function GoTop() {
	window.scrollTo(0,0);
}



// scrolling layer
	var stmnLEFT = 968; // 왼쪽 여백
	var stmnGAP1 = 0; // 위쪽 여백
	var stmnGAP2 = 200; // 스크롤시 브라우저 위쪽과 떨어지는 거리
	var stmnBASE = 200; // 스크롤 시작위치
	var stmnActivateSpeed = 35;
	var stmnScrollSpeed = 20;
	var stmnTimer;

	function RefreshStaticMenu() {
		var stmnStartPoint, stmnEndPoint;
		stmnStartPoint = parseInt(document.getElementById('STATICMENU').style.top, 10);
		stmnEndPoint = Math.max(document.documentElement.scrollTop, document.body.scrollTop) + stmnGAP2;
		if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;
		if (stmnStartPoint != stmnEndPoint) {
			stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
			document.getElementById('STATICMENU').style.top = parseInt(document.getElementById('STATICMENU').style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount ) + 'px';
			stmnRefreshTimer = stmnScrollSpeed;
			}
		stmnTimer = setTimeout("RefreshStaticMenu();", stmnActivateSpeed);
		}
	function InitializeStaticMenu() {
		document.getElementById('STATICMENU').style.left = stmnLEFT + 'px';
		document.getElementById('STATICMENU').style.top = document.body.scrollTop + stmnBASE + 'px';
		RefreshStaticMenu();
		}

//scrolling layer end


/*************************************
** SELECT SHOW / HIDE
*************************************/
// Hide select boxes as they will 'peek' through the image in IE
function hideSelect(){
	selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "hidden";
	}
}
// make select boxes visible
function showSelect(){
	selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "visible";
	}
}


/* tab show hide */
function changeDivStyle(bid, id, total)
{
	for(var i = 1; i <= total; i++)
    {
		document.getElementById(bid+'Tab_'+i).style.display = 'none';
		document.getElementById(bid+'Cont_'+i).style.display = 'none';
    }
	document.getElementById(bid+'Tab_'+id).style.display = 'block';
	document.getElementById(bid+'Cont_'+id).style.display = 'block';
}

// div show/hide
function changeDivStyle2(bid, id, total)
{
	if(id){
		for(var i = 1; i <= total; i++)
		{
			document.getElementById(bid+"_Cont_"+i).style.display = 'none';
		}

		document.getElementById(bid+"_Cont_"+id).style.display = 'block';
	}
}

// 2Tab
function changeDivStyle3(bid, id, total)
{
	for(var i = 1; i <= total; i++)
    {
		document.getElementById(bid+"_Cont_"+i).style.display = 'none';
		document.getElementById(bid+"_Tab_"+i).className = '';
    }
	document.getElementById(bid+"_Cont_"+id).style.display = 'block';
	document.getElementById(bid+"_Tab_"+id).className = 'on';
}

// 3Tab
function changeDivStyle4(bid, id, total)
{
	var offNum;
	for(var i = 1; i <= total; i++)
    {
		document.getElementById(bid+"_Cont_"+i).style.display = 'none';
		document.getElementById(bid+"_Tab_"+i).className = '';
	}

		if (id != 1){
			offNum = id - 1;
			document.getElementById(bid+"_Tab_"+offNum).className = 'off';
			if (id > 2) {
				document.getElementById(bid+"_Tab_1").className = 'off1';
			} else {
				document.getElementById(bid+"_Tab_1").className = 'off2';
			}
		}

	document.getElementById(bid+"_Cont_"+id).style.display = 'block';
	document.getElementById(bid+"_Tab_"+id).className = 'on';
/*
	var offNum;
	for(var i = 1; i <= total; i++)
    {
		document.getElementById(bid+"_Cont_"+i).style.display = 'none';
		document.getElementById(bid+"_Tab_"+i).className = '';
	}

		if (id != 1){
			offNum = id - 1;
			document.getElementById(bid+"_Tab_"+offNum).className = 'off2'
		}

	document.getElementById(bid+"_Cont_"+id).style.display = 'block';
	document.getElementById(bid+"_Tab_"+id).className = 'on';
*/
}

// div 위치안내
function changeDivStyle5(bid, id, total)
{
	for(var i = 1; i <= total; i++)
    {
		document.getElementById(bid+"_Cont_"+i).style.display = 'none';
		document.getElementById(bid+"_Btn_"+i).src=document.getElementById(bid+"_Btn_"+i).src.replace("_.gif", ".gif");
    }

	document.getElementById(bid+"_Cont_"+id).style.display = 'block';
	document.getElementById(bid+"_Btn_"+id).src=document.getElementById(bid+"_Btn_"+id).src.replace(".gif", "_.gif");
}

// imgSWAP
function swapImg(bid,id) {
	document.getElementById(bid+"_Btn_"+id).src=document.getElementById(bid+"_Btn_"+id).src.replace(".gif", "_.gif");
}
function restoreImg(bid,id) {
	document.getElementById(bid+"_Btn_"+id).src=document.getElementById(bid+"_Btn_"+id).src.replace("_.gif", ".gif");
}


function showDiv(what,lpw,lph) {
	var ns = (navigator.appName.indexOf("Netscape") != -1);

	var CH=document.documentElement.clientHeight; //보이는화면Height
	var CW=document.documentElement.clientWidth; //보이는화면Width
	var ST=ns ? pageYOffset:document.documentElement.scrollTop;

	hideSelect()
	document.getElementById(what).style.display="";
	document.getElementById(what).style.left=((CW-lpw)/2) +"px";
	document.getElementById(what).style.top=(ST+(CH-lph)/2) +"px";
}
function hideDiv(what) {
	document.getElementById(what).style.display="none";
}

// div show/hide 수정할거-
function changeDivStyle6(bid, id, total){

	if(id){
		if(document.getElementById(bid+"Cont_"+id).style.display == 'none'){

			for(var i = 1; i <= total; i++){
				document.getElementById(bid+"Cont_"+i).style.display = 'none';
			}
			document.getElementById(bid+"Cont_"+id).style.display = 'block';

		}else{
			document.getElementById(bid+"Cont_"+id).style.display = 'none';
		}
	}
}

// FAQ 답변 보여주기
function fn_ShowAnswer( strDivKey ){
	var objAnswerTr = document.getElementById('answer_' + strDivKey);
	var objFaqImg , objFaqImgClo;

	var objFaqDiv = document.getElementById("faqTable");
	if( objFaqDiv ){
		var objInDiv = objFaqDiv.getElementsByTagName("div");
		var inLen = objInDiv.length;
		var objAnDiv = "";
		for(var i=0; i < inLen; i++){
			objAnDiv = objInDiv[i];
			if( (objAnDiv.id).indexOf("answer_") > -1 ){
				if( objAnswerTr.id != objAnDiv.id ) {
					objAnDiv.style.display = "none";
					objFaqImg 		= document.getElementById('faq_view_'+objAnDiv.id.substr(7));
					objFaqImgClo 	= document.getElementById('faq_view_close_'+objAnDiv.id.substr(7));
					objFaqImg.style.display	= "inline";
					objFaqImgClo.style.display 	= "none";
				}
			}
		}
	}
	objFaqImg 	= document.getElementById('faq_view_' + strDivKey);
	objFaqImgClo = document.getElementById('faq_view_close_'+strDivKey);
	if ( objAnswerTr.style.display == "none") {
		objAnswerTr.style.display 	= "inline";
		objFaqImg.style.display		= "none";
		objFaqImgClo.style.display 	= "inline";

	} else {
		objAnswerTr.style.display 	= "none";
		objFaqImg.style.display		= "inline";
		objFaqImgClo.style.display 	= "none";
	}
}


