
//****************Ã³¸® ·¹ÀÌ¾î ***********************/
//setProgressEnd();
function setProgressStart(sMsg) {
	if (sMsg == "") {
		sMsg = "·ÎµùÁß...";
	}

	if (top.document.all.loadingBar == "[object]") {
		top.document.all.loadingMsg.innerHTML = sMsg;
		top.document.all.loadingBar.style.width = "100%";
		top.document.all.loadingBar.style.height = "100%";
		top.document.all.loadingBar.style.display = "block";
	}
}

function setProgressEnd() {
	if (top.document.all.loadingBar == "[object]") {
		top.document.all.loadingBar.style.display = "none";
	}
}

function setFrameAllSize() {
	var nIFrames = 0;
	var sFrame;
	var nHeight;

	nIFrames = document.frames.length;

	for (var i = 0; i < nIFrames; i++) {
		sFrame = document.frames[i].name;

		nHeight = document.frames[i].document.body.scrollHeight;
		if (nHeight > 0) {
			document.all[sFrame].style.height = nHeight;
		}
	}
}

function setFrameSizeOne(sFrm) {

	var nHeight;

	nHeight = document.all[sFrm].document.body.scrollHeight;
	if (nHeight > 0) {
		document.all[sFrm].style.height = nHeight;
	}

}

function setFrameSize(sFrm) {
	var nIFrames = 0;
	var sFrame;
	var nHeight;

	nIFrames = document.frames.length;

	for (var i = 0; i < nIFrames; i++) {
		sFrame = document.frames[i].name;

		if (sFrame.indexOf(sFrm) >= 0) {
			nHeight = document.frames[i].document.body.scrollHeight;
			if (nHeight > 0) {
				document.all[sFrame].style.height = nHeight;
			}
		}
	}
}

function setFramePartSize(sFrm) {
	var sFrm = sFrm.split(":");
	
	for (var i = 0; i < sFrm.length; i++) {
		setFrameSize(sFrm[i]);
	}
}

function setObject(id,w,h,classid,codebase){
	var tmp = "";
	tmp += "<OBJECT id="+id+" height="+h+" width="+w+" classid="+classid+" ";
	tmp += "CodeBase="+codebase+" VIEWASTEXT></OBJECT>";
	document.write(tmp);
}

function imgCheck(obj) {
	check = true
	
	pathpoint = obj.lastIndexOf('.');
	filepoint = obj.substring(pathpoint+1,obj.length);
	filetype = filepoint.toLowerCase();

	if (filetype=='jpg' || filetype=='gif') {
		return true;
	} else {
		return false;
	}
}

function GetTextByte(text) {
   str = new String(text);
   var strLen = str.length;
   var strByte = 0;
   for (var i=0; i<strLen; i++) {
       tmp = new String(str.charCodeAt(i));
       strByte++;
       if (tmp.length > 3) {
           strByte++;
       }
   }
   return strByte;
}

function IsNull(nval) {
   for (var i = 0 ; i < nval.length ; i++){
       tst = nval.substring(i,i+1)
       if ((tst != ' ')&&(tst != '\r')&&(tst != '\n')&&(tst != '\t')&&(tst != '\b')&&(tst != '\v')&&(tst != '\f')) {
          return false;
       }
   }
   return true;
}

function chkNum(chk) {
   var comp="0123456789";
   var string = chk.value;
   var len = string.length;

   for (i=0;i<len;i++) {
      if (comp.indexOf(string.substring(i,i+1))<0) {
           alert("¼ýÀÚ·Î¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À");
           chk.value = "";
           chk.focus();
           return;
      }
   }
}

function isAllowStr(str, allowStr) {
   var i;
   var ch;

   for (i=0;i<str.length;i++) {
       ch = str.charAt(i);

       if (allowStr.indexOf(ch) < 0) {
          return false;
       }
   }

   return true;
}

function checkEmail(ctrl) {
   str = ctrl.value;

   if (isAllowStr(str, "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@.-_") == false) {
       alert("À¯È¿ÇÑ EmailÀÌ ¾Æ´Õ´Ï´Ù!");
       ctrl.value="";
       ctrl.focus();
       ctrl.select();
       return false;
   }

   var atCnt = 0;
   var dotCnt = 0;

   for (i = 0; i < str.length ; i++) { 
       ch = str.charAt(i);

       if (ch == "@") {
          atCnt++;
       }

       if (ch == ".") {
          dotCnt++;
       }
   }

   if (atCnt != 1 || dotCnt < 1) {
      alert("À¯È¿ÇÑ EmailÀÌ ¾Æ´Õ´Ï´Ù.");
      ctrl.value="";
      ctrl.focus();
      ctrl.select();
      return false;
   }

   var atIndex = 0;
   atIndex = str.indexOf("@");

   if (atIndex <= 0) {
      alert("À¯È¿ÇÑ EmailÀÌ ¾Æ´Õ´Ï´Ù.");
      ctrl.value="";
      ctrl.focus();
      ctrl.select();
      return false;
   }

   return true;
}

function GetCookie(sName) {
  var aCookie = document.cookie.split("; ");

  for (var i=0; i < aCookie.length; i++) {
    var aCrumb = aCookie[i].split("=");

    if (sName == aCrumb[0]) {
        return unescape(aCrumb[1]);
    }
  }
  return null;
}

function setCookie(name, value, expiredays) {
   var todayDate = new Date();
   todayDate.setDate( todayDate.getDate() + expiredays );
   document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function CheckID(ctrl) {
	str = ctrl.value;	
    if (isAllowStr(str, "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") == false) {
        alert ("Çã°¡µÇÁö ¾ÊÀº ¹®ÀÚ¿­ÀÌ Æ÷ÇÔµÇ¾î ÀÖ½À´Ï´Ù!");
        ctrl.focus();
        ctrl.select();
        return false;
    }
   
	// Æ¯¼öÇÑ ÀÌ¸§Àº id·Î »ç¿ëÇÒ ¼ö ¾ø´Ù
	if (!checkSpecialID(str,"admin")) {
	    return false;
	} else if (!checkSpecialID(str,"admins")) {
	    return false;	
	} else if (!checkSpecialID(str,"master")) {
	    return false;	
	} else if (!checkSpecialID(str,"root")) {
	    return false;		
	} else if (!checkSpecialID(str,"webmaster")) {
	    return false;		
	} else {
        return true;
	}
}

function checkSpecialID(a,b) {	
	if (a.toUpperCase() == b.toUpperCase()) {
		alert("ID·Î " + b + "À»(¸¦) »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
		return false;
	}
	return true;
}

function CheckString(ctrl) {
	str = ctrl.value;	

    if (isAllowStr(str, "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") == false) {
        ctrl.value="";
        ctrl.focus();
        ctrl.select();
        return false;
    }
   
    return true;
}

//±æÀÌ Ã¼Å© ½ºÅ©¸³Æ®
function apg_length_chk(target, want_length)
{ 
   var len = 0; 
   if (target.value == null ) return 0; 
   for(var i=0;i<target.value.length;i++){ 
      var c = escape(target.value.charAt(i)); 
      if ( c.length == 1 ) len ++; 
      else if ( c.indexOf("%u") != -1 ) len += 2; 
      else if ( c.indexOf("%") != -1 ) len += c.length/3; 
   } 
   if (len > want_length)
  {
		kwant_length = want_length / 2
		alert("¿µ¹® "+want_length+"ÀÚ, ÇÑ±Û "+kwant_length+"ÀÚ ¾È¿¡¼­ ÀÔ·ÂÇÏ¿©ÁÖ¼¼¿ä.");
		target.value = "";
		target.focus();
		return false;
	}
	return true;
}
//¸®½ºÆ®¿¡¼­ ¸®ÇÃ±íÀÌ¿¡
function apg_title_length(title_content, title_step, title_len)
{ 
	var len = 0; 
	var title_result = ""
	if ( title_content == null ) return 0;
	if (title_step != 0)
		title_contentgth = (title_len -3) - title_step* 2;
	else
		title_contentgth = title_len;
	for(var i=0;i<title_content.length;i++)
	{ 
		if(len < title_contentgth)
		{
			var c = escape(title_content.charAt(i));
			title_result = title_result + title_content.charAt(i)
			if ( c.length == 1 ) len ++; 
			else if ( c.indexOf("%u") != -1 ) len += 2; 
			else if ( c.indexOf("%") != -1 ) len += c.length/3;
		}
		else
		{
			title_result = title_result + "...";
			break;
		}
	} 
	return title_result
} 
//¹®ÀÚ¿­¿¡¼­ ÇØ´çÇÏÁö ¾Ê´Â °ªÀÌ µé¾îÀÖ´ÂÁö Ã¼Å©ÇÏ±â
function apg_value_chk(contents, target)
{
	var i;
	var ch;   
	for (i=0;i<contents.length;i++) 
	{       
		ch = contents.charAt(i) ;       
		if (target.indexOf(ch) < 0) 
		{
			return false;
		}
	}
	return true;
}

//ÁÖ¹Îµî·Ï ¹øÈ£ Ã¼Å©
function CheckSSN(jumin1,jumin2) {
	var today = new Date();
	var chkYear1 = today.getYear();
	var chkYear2 = 0;

	if (chkYear1 < 2000) {
		chkYear1 += 1900;
	}

	var chk = 0;
	var chk2 = 0;
	var chk3 = 0;
	var yy = jumin1.substring(0,2);
	var mm = jumin1.substring(2,4);
	var dd = jumin1.substring(4,6);
    var chkSex = jumin2.substring(0,1);	

	if ((jumin1.length != 6) || (mm<1 || mm>12 || dd<1 || dd>31 )) {
		return false;
	}

	if ((chkSex != 1 && chkSex !=2 && chkSex !=3 && chkSex !=4) || (jumin2.length != 7)) {
		return false;
	}

	chkYear2 = parseInt(yy,10);

	if (chkSex <=2) {
		chkYear2 += 1900;
    } else {
		chkYear2 += 2000;
    }
	
	//if ((chkYear1 - chkYear2) < 12) { 
	//	return false;
	//} 

	// ÁÖ¹Îµî·Ï¹øÈ£ validation check
	for (var i = 0; i <=5 ; i++) { 
		chk = chk + ((i%8+2) * parseInt(jumin1.substring(i,i+1)))
	}

	for (var i = 6; i <=11 ; i++) { 
		chk = chk + ((i%8+2) * parseInt(jumin2.substring(i-6,i-5)))
	}

	chk = 11 - (chk %11)
	chk = chk % 10

	if (chk != jumin2.substring(6,7)) {
		return false;
	}  

	return true;
} 

function nextJumin(obj){
	if(obj.jumin1.value.length == 6){
		obj.jumin2.focus();
	}
}

function IsNumeric(oFrm){
	for(var i=0; i<oFrm.length;i++){
		if(oFrm.substring(i,i+1) < "0" || oFrm.substring(i,i+1) > "9"){
			return false;
		}
	 }
	return true;
}

function setMailList() {
	window.showModalDialog('/Includes/Mail_List.asp', "",  "status:no; help:no; dialogTop:10px; dialogLeft:10px; dialogWidth:606px; dialogHeight:366px;"); 
}

function post_find(seq, zip1, zip2, addr1, addr2) {
  window.open('/common/postcode.asp?seq='+seq+'&zip1='+zip1+'&zip2='+zip2+'&addr1='+addr1+'&addr2='+addr2,'postcode','resizable=no,scrollbars=yes, width=366,height=274'); 
}

function winPop(url, name ,sWidth, sHight, isScroll, isResize, isTool, isMenu) {
  window.open(url,name,'scrollbars='+isScroll+',resizable='+isResize+',toolbar='+isTool+',menubar='+isMenu+',location=no, width='+sWidth+',height='+sHight);
}

//¼ýÀÚ¸¸ ÀÔ·Â ¹Þ´Â ½ºÅ©¸³Æ®
function checkNum(obj){
	for(var i=0; i<obj.value.length;i++){
		if(obj.value.substring(i,i+1) < "0" || obj.value.substring(i,i+1) > "9"){
			alert("ÀÌ ÇÊµå´Â ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
			obj.value = "";
			obj.focus();
		return false;
		}
	 }
	return true;
}

function FormatPrice(Price) {
	Price = new String(Price)
	Price = Price.replace(/,/gi,"")
	
	fl=""
	if(isNaN(Price)) 
	{ 
		alert("¹®ÀÚ´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
		return 0;
	}
	if(Price == 0) 
	{
		return Price;
	}
	
	if (Price < 0)
	{ 
		Price = Price * (-1);
		fl = "-";
	}
	else
	{
		Price = Price * 1 //Ã³À½ ÀÔ·Â°ªÀÌ 0ºÎÅÍ ½ÃÀÛÇÒ¶§ ÀÌ°ÍÀ» Á¦°ÅÇÑ´Ù.
	}
	Price = new String(Price);
	temp = "";
	co = 3;
	Price_len = Price.length;
	while (Price_len>0)
	{
		Price_len = Price_len - co;
		if(Price_len<0)
		{
			co = Price_len + co;
			Price_len = 0;
		}
		temp = "," + Price.substr(Price_len,co) + temp
	}

	return fl + temp.substr(1)
}



// ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å© ·ÎÁ÷
    function check_ResidentNO(str_f_num,str_l_num){  
        var i3=0
        for (var i=0;i<str_f_num.length;i++){
         var ch1 = str_f_num.substring(i,i+1);
            if (ch1<'0' || ch1>'9') i3=i3+1;
        }
        if ((str_f_num == '') || ( i3 != 0 )) return false;
        var i4=0;
        for (var i=0;i<str_l_num.length;i++){
            var ch1 = str_l_num.substring(i,i+1);
            if (ch1<'0' || ch1>'9') i4=i4+1; 
        }
        if ((str_l_num == '') || ( i4 != 0 )) return false;
        if(str_f_num.substring(0,1) < 4) return false;
        if(str_l_num.substring(0,1) > 2) return false;
        if((str_f_num.length > 7) || (str_l_num.length > 8)) return false;
        if ((str_f_num == '72') || ( str_l_num == '18'))  return false;
                
        var f1=str_f_num.substring(0,1)
        var f2=str_f_num.substring(1,2)
        var f3=str_f_num.substring(2,3)
        var f4=str_f_num.substring(3,4)
        var f5=str_f_num.substring(4,5)
        var f6=str_f_num.substring(5,6)
        var hap=f1*2+f2*3+f3*4+f4*5+f5*6+f6*7
        var l1=str_l_num.substring(0,1)
        var l2=str_l_num.substring(1,2)
        var l3=str_l_num.substring(2,3)
        var l4=str_l_num.substring(3,4)
        var l5=str_l_num.substring(4,5)
        var l6=str_l_num.substring(5,6)
        var l7=str_l_num.substring(6,7)
        hap=hap+l1*8+l2*9+l3*2+l4*3+l5*4+l6*5
        hap=hap%11
        hap=11-hap
        hap=hap%10
        if (hap != l7) return false;
        return true; 
    }


	function hanCheck(x) {
		for(i=0;i<x.value.length;i++) {
		var a=x.value.charCodeAt(i);
			if (a > 128) {
			
			}else{
				alert('ÇÑ±Û ÀÌ¿Ü¿¡ ÀÔ·Â ±ÝÁö');
				x.value="";
				x.focus();
				return;
			}
		}
	}



//common.js¿¡¼­ ¿Å±ä
function openPopup(popup_name,url,width,height) {
	var winPop = window.open(url, popup_name, 'scrollbars=no,resizable=no,toolbar=no,menubar=no,top=10,left=10,location=no,width='+width+',height='+height);
	winPop.focus();
}


var imgObj = new Image();

function showImgWin(imgName) {
  imgObj.src = imgName;
  setTimeout("createImgWin(imgObj)", 3000);
}
function createImgWin(imgObj) {
  if (! imgObj.complete) {
    setTimeout("createImgWin(imgObj)", 3000);
    return;
  }
  var temp_width;
  var temp_height;
//alert(imgObj.width+","+imgObj.height);
  if(imgObj.width>1000){temp_width = 1000;}else{temp_width = imgObj.width;}
  if(imgObj.height>700){temp_height = 700;}else{temp_height = imgObj.height;}

  if(imgObj.width<2){temp_width = 1;}else{temp_width = imgObj.width;}
  if(imgObj.height<2){temp_height = 1;}else{temp_height = imgObj.height;}

  imageWin = window.open("", "imageWin","scrollbars=no,toolbar=no,location=no,directories=no,width="+temp_width+",height=" +temp_height+",resizable=yes,mebar=no,left=10,top=10");
  imageWin.document.write("<html><body style='margin:0' onload='this.focus();'>");
  imageWin.document.write("<img src='" + imgObj.src + "'>");
  imageWin.document.write("</body><html>");
  imageWin.document.title = "ÀÌ¹ÌÁöº¸±â";
}


// ¹ÙÀÌÆ® Ã¼Å©
function fc_chk_byte(aro_name,ari_max){

		var ls_str = aro_name.value; // ÀÌº¥Æ®°¡ ÀÏ¾î³­ ÄÁÆ®·ÑÀÇ value °ª
		var li_str_len = ls_str.length; // ÀüÃ¼±æÀÌ

		// º¯¼öÃÊ±âÈ­
		var li_max = ari_max; // Á¦ÇÑÇÒ ±ÛÀÚ¼ö Å©±â
		var i = 0; // for¹®¿¡ »ç¿ë
		var li_byte = 0; // ÇÑ±ÛÀÏ°æ¿ì´Â 2 ±×¹Ü¿¡´Â 1À» ´õÇÔ
		var li_len = 0; // substringÇÏ±â À§ÇØ¼­ »ç¿ë
		var ls_one_char = ""; // ÇÑ±ÛÀÚ¾¿ °Ë»çÇÑ´Ù
		var ls_str2 = ""; // ±ÛÀÚ¼ö¸¦ ÃÊ°úÇÏ¸é Á¦ÇÑÇÒ¼ö ±ÛÀÚÀü±îÁö¸¸ º¸¿©ÁØ´Ù.

		for(i=0; i< li_str_len; i++) {
			// ÇÑ±ÛÀÚÃßÃâ
			ls_one_char = ls_str.charAt(i);

			// ÇÑ±ÛÀÌ¸é 2¸¦ ´õÇÑ´Ù.
			if (escape(ls_one_char).length > 4)	{
				li_byte += 2;
			}
			// ±×¹ÜÀÇ °æ¿ì´Â 1À» ´õÇÑ´Ù.
			else {
				li_byte++;
			}

			// ÀüÃ¼ Å©±â°¡ li_max¸¦ ³ÑÁö¾ÊÀ¸¸é
			if(li_byte <= li_max){
				li_len = i + 1;
			}
		}

		// ÀüÃ¼±æÀÌ¸¦ ÃÊ°úÇÏ¸é
		if(li_byte > li_max) {
			alert( "¿µ¹® " + li_max + " ±ÛÀÚ, ÇÑ±Û " + li_max/2 + " ±ÛÀÚ¸¦ ÃÊ°ú ÀÔ·ÂÇÒ¼ö ¾ø½À´Ï´Ù. \n ÃÊ°úµÈ ³»¿ëÀº ÀÚµ¿À¸·Î »èÁ¦ µË´Ï´Ù. ");
			ls_str2 = ls_str.substr(0, li_len);
			aro_name.value = ls_str2;
		}
		aro_name.focus(); 
	}

//¸ÞÀÏÆË¾÷
function go_category(){		
	var str1 = "";
	var str2 = "";
	var winArgs = new Array(str1,str2);
	winArgs = window.showModalDialog('/includes/Mail_List.asp', "",  "status:no; help:no; dialogTop:10px; dialogLeft:10px; dialogWidth:400px; dialogHeight:316px;");
	if(winArgs == null){}
	else{	
		if(document.MainForm.sMailName.value.length > 0){
			document.MainForm.sMailName.value += ",";
			//document.MainForm.sMailName.value += ",";
		}
		document.MainForm.sMailName.value += winArgs[0];
		//document.MainForm.sMailName.value += winArgs[0];
		document.MainForm.sMailName.focus();
	}
}
//**************************************
// µå¸²À§¹ö¿¡¼­ Á¦°øÇÏ´Â ÇÔ¼ö¶óÀÌºê·¯¸®
//**************************************

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i>a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

MM_reloadPage(true);

////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
///////// ÀÌ¿µÀç Ãß°¡ //////////////////////////////////////////

// Áö¿ªÁ¤º¸ ·©Å·¾÷ ÅÇ 
var nowtab = 1; //ÇöÀç ¾ÕÀ¸·Î ³ª¿À´Â ÅÇ
	function ChangeTap(n) {
		document.getElementById('rankTap'+nowtab).style.display = "none";
		document.getElementById('rankTap'+n).style.display = "block";
		
		nowtab = n;
}


// ÇÃ·¡½Ã Ã³¸®
function embededFlash(i,s,w,h,b,a,vars) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+w+'" height="'+h+'" id="'+i+'" align="middle">');
	document.write('<param name="movie" value="'+s+'" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgColor" value="'+b+'" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<param name="scale" value="noscale" />');	
	document.write('<param name="salign" value="'+a+'" />');
	document.write('<param name="flashVars" value="'+vars+'" />');
	document.write('<param name="allowScriptAccess" value="always" />');
	document.write('<embed src='+s+' quality="high" bgcolor="'+b+'" width="'+w+'" height="'+h+'" name="'+i+'" wmode="transparent" scale="noscale" salign="'+a+'" align=middle  type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/go/getflashplayer showLiveConnect=true allowScriptAccess="always" />');
	document.write('</object>');
}


// °øÅë ·¹ÀÌ¾î ¾ÆÀÌÇÁ·¡ÀÓ³» È£Ãâ °ü·Ã ½ºÅ©¸³Æ®
function openLayer(w,h,url) { 
//alert( w + " " + h + " " + url );
	// iframe ¹æ½Ä. ÇÃ·¡½Ã µÚ·Î ¼û¾î¹ö¸²
		document.getElementById("JoinLayer").innerHTML = "<iframe name='popObject' id='popObject' frameborder='0' width='" + w + "' height='" + h + "' marginheight='0' marginwidth='0' scrolling='no' src='" + url + "' bgcolor='#FFFFFF'></iframe>";

	JoinLayer.style.display = 'block';

//		document.getElementById("popObject").focus();
}


//·¹ÀÌ¾îº¸ÀÌ±â,°¨Ãß±â
function Show(divid) { 
	divid.style.visibility = "visible"; 
} 

function Hide(divid) { 
   divid.style.visibility = "hidden"; 
}

// ·¹ÀÌ¾î Á¦¾î
function LayerHide(divid) { 
   parent.document.getElementById(divid).style.display = "none";
} 


//ÅÇÀÚµ¿ ¿Å°Ü°¡±â
function autoTab(thisValue,nextCtrl,n){
	control = document.getElementById(nextCtrl);
	if(thisValue.length==n){
		control.focus();
	}
}


// µ¿¿µ»ó
function MovieWrite(file, W, H) {
	document.write('<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2infcab#Version=5,1,52,701" id="MMPlayer1" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" width="'+W+'" height="'+H+'" VIEWASTEXT>');
	document.write('	<PARAM NAME="AudioStream" VALUE="1">');
	document.write('	<PARAM NAME="AutoPlay" VALUE="1">');
	document.write('	<PARAM NAME="AutoSize" VALUE="0">');
	document.write('	<PARAM NAME="AutoStart" VALUE="1">');
	document.write('	<PARAM NAME="AnimationAtStart" VALUE="0">');
	document.write('	<PARAM NAME="AutoRewind" VALUE="1">');
	document.write('	<PARAM NAME="Balance" VALUE="0">');
	document.write('	<PARAM NAME="BufferingTime" VALUE="1000">');
	document.write('	<PARAM NAME="CaptioningID" VALUE="">');
	document.write('	<PARAM NAME="ClickToPlay" VALUE="0">');
	document.write('	<PARAM NAME="CursorType" VALUE="32512">');
	document.write('	<PARAM NAME="CurrentPosition" VALUE="-1">');
	document.write('	<PARAM NAME="CurrentMarker" VALUE="0">');
	document.write('	<PARAM NAME="DefaultFrame" VALUE="">');
	document.write('	<PARAM NAME="DisplayBackColor" VALUE="16777215">');
	document.write('	<PARAM NAME="DisplayForeColor" VALUE="16777215">');
	document.write('	<PARAM NAME="DisplaySize" VALUE="4">');
	document.write('	<PARAM NAME="uiMode" VALUE="none">');
	document.write('	<PARAM NAME="stretchToFit" VALUE="0">');
	document.write('	<PARAM NAME="Enabled" VALUE="-1">');
	document.write('	<PARAM NAME="EnableContextMenu" VALUE="0">');
	document.write('	<PARAM NAME="EnablePositionControls" VALUE="-1">');
	document.write('	<PARAM NAME="EnableFullScreenControls" VALUE="1">');
	document.write('	<PARAM NAME="EnableTracker" VALUE="-1">');
	document.write('	<PARAM NAME="InvokeURLs" VALUE="-1">');
	document.write('	<PARAM NAME="Language" VALUE="0">');
	document.write('	<PARAM NAME="Mute" VALUE="0">');
	document.write('	<PARAM NAME="PlayCount" VALUE="1">');
	document.write('	<PARAM NAME="PreviewMode" VALUE="0">');
	document.write('	<PARAM NAME="Rate" VALUE="1">');
	document.write('	<PARAM NAME="SAMILang" VALUE="">');
	document.write('	<PARAM NAME="SAMIStyle" VALUE="">');
	document.write('	<PARAM NAME="SAMIFileName" VALUE="">');
	document.write('	<PARAM NAME="SelectionStart" VALUE="0">');
	document.write('	<PARAM NAME="SelectionEnd" VALUE="0">');
	document.write('	<PARAM NAME="SendOpenStateChangeEvents" VALUE="-1">');
	document.write('	<PARAM NAME="SendWarningEvents" VALUE="-1">');
	document.write('	<PARAM NAME="SendErrorEvents" VALUE="-1">');
	document.write('	<PARAM NAME="SendKeyboardEvents" VALUE="0">');
	document.write('	<PARAM NAME="SendMouseClickEvents" VALUE="0">');
	document.write('	<PARAM NAME="SendMouseMoveEvents" VALUE="0">');
	document.write('	<PARAM NAME="SendPlayStateChangeEvents" VALUE="1">');
	document.write('	<PARAM NAME="ShowCaptioning" VALUE="0">');
	document.write('	<PARAM NAME="ShowControls" VALUE="0">');
	document.write('	<PARAM NAME="ShowAudioControls" VALUE="0">');
	document.write('	<PARAM NAME="ShowDisplay" VALUE="0">');
	document.write('	<PARAM NAME="ShowGotoBar" VALUE="0">');
	document.write('	<PARAM NAME="ShowPositionControls" VALUE="0">');
	document.write('	<PARAM NAME="ShowTracker" VALUE="0">');
	document.write('	<PARAM NAME="TransparentAtStart" VALUE="0">');
	document.write('	<PARAM NAME="VideoBorderWidth" VALUE="0">');
	document.write('	<PARAM NAME="VideoBorderColor" VALUE="0">');
	document.write('	<PARAM NAME="VideoBorder3D" VALUE="0">');
	document.write('	<PARAM NAME="Volume" VALUE="600">');
	document.write('	<PARAM NAME="WindowlessVideo" VALUE="0">');
	document.write('    <param name="Filename" value="' + file + '">');
	document.write('</object>');

}

//ActiveX ÇÃ·¡½Ã
function setFlash(src, w, h) {
	var Flash_html = "";
	Flash_html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="param" width="'+w+'" height="'+h+'">';
	Flash_html += '<param name="movie" value="'+src+'">';
	Flash_html += '<param name="quality" value="high">';
	Flash_html += '<param name="wmode" value="transparent">';
	Flash_html += '<param name="swliveconnect" value="true">';
	Flash_html += '<embed src="'+src+'" quality=high width="'+w+'" height="'+h+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" ><\/embed>';
	Flash_html += '</object>';
	document.write(Flash_html);

    //FlashÀÇ ExternalInterface°¡ Form Tag³»¿¡¼­ ¿À·ù³ª´Â ¹ö±×¸¦ ÇØ°áÇÏ´Â ÄÚµå     
	eval("window.param = document.getElementById('param');");
}


//faq Åä±Û
function viewFAQ(id) {
  for(var i=1; i<=10; i++) { 
      if (i==0) {
	for(var j=1; j<=10; j++)  eval("faq" + j + ".style.display='none'");
      }
      if (i== id) eval("faq" + i + ".style.display='block'");
      else eval("faq" + i + ".style.display='none'");
  }
} 
//³»Áý¸¶·ÃÀýÂ÷ÀÇ faq Åä±Û
function viewUsFAQ(id) {
  for(var i=1; i<=5; i++) { 
      if (i==0) {
	for(var j=1; j<=5; j++)  eval("usFaq" + j + ".style.display='none'");
      }
      if (i== id) eval("usFaq" + i + ".style.display='block'");
      else eval("usFaq" + i + ".style.display='none'");
  }
} 

//as ¸®½ºÆ® Åä±Û
function viewAsDetail(id) {
  for(var i=1; i<=10; i++) { 
      if (i==0) {
	for(var j=1; j<=10; j++)  eval("AsD" + j + ".style.display='none'");
      }
      if (i== id) eval("AsD" + i + ".style.display='block'");
      else eval("AsD" + i + ".style.display='none'");
  }
} 


// ÀÌ¹ÌÁö ±³Ã¼ 
function showImg( imgname ) { 
  document.changimg.src = imgname; 
} 
