/************************************************************************
* ºóÄ­ÀÌ¸é ÀÔ·ÂÇÏ¶ó°í ¾Ë¸².
************************************************************************/
function null_chk(obj,name) {
	str = obj.value;
	if( str == "" ) {
		alert(name+"Ç×¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		obj.value = "";
		obj.focus();
		return false;
	}
	return true;
}

/************************************************************************
* flash¸¦ ÀÚ¹Ù½ºÅ©¸³Æ®·Î ºÒ·¯¿Í¼­ »Ñ·ÁÁÜ. (¸¶¼Ò¿¡¼­ flash¸¦ html¿¡¼­ ¸øºÒ·¯¿À°ÔÇØ¼­ ±×·¸´Ù°íÇÔ)
************************************************************************/
function setEmbed()
{ 
  var obj = new String; 
  var parameter = new String; 
  var embed = new String; 
  var html = new String; 
  var allParameter = new String; 
  var clsid = new String; 
  var codebase = new String; 
  var pluginspace = new String; 
  var embedType = new String; 
  var src = new String; 
  var width = new String; 
  var height = new String; 
  var clsid = new String;
  var codebase = new String;
  var pluginspage = new String;
  var embedType = new String;
  var getType = new String;
  var id = new String;
    
  this.init = function( getType , s ,w , h ) { 
  	this.getType = getType;
      
      if ( getType == "flash") 
      { 
        this.clsid = "D27CDB6E-AE6D-11cf-96B8-444553540000";        
        this.codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"; 
        this.pluginspage = "http://www.macromedia.com/go/getflashplayer"; 
        this.embedType = "application/x-shockwave-flash"; 
		  parameter += "<param name='movie' value='"+ s + "'>\n";  
		  parameter += "<param name='quality' value='high'>\n";    
      } 
      /* type Ãß°¡ 
      else if ( ) 
      { 
      } 
      */ 
            
      
      this.src = s; 
      this.width = w; 
      this.height = h; 
  } 
  
  this.parameter = function( parm , value ) {      
      parameter += "<param name='"+parm +"' value='"+ value + "'>\n";        
      allParameter += " "+parm + "='"+ value+"'"; 
  }  
  
  this.show = function() { 
      if ( this.getType == "flash" ) 
      { 
        obj = "<object classid=\"clsid:"+ this.clsid +"\" codebase=\""+ this.codebase +"\" width='"+ this.width +"' height='"+ this.height +"'>\n"; 
	  	embed = "<embed src='" + this.src + "' pluginspage='"+ this.pluginspage + "' type='"+ this.embedType + "' width='"+ this.width + "' height='"+ this.height +";border:1px solid gray'"+ allParameter +" ></embed>\n";
	  } else if ( this.getType == "object" ) {
        obj = "<object type='"+ this.embedType +"' id='"+ this.id +"' classid=\"clsid:"+ this.clsid +"\" codebase=\""+ this.codebase +"\" style='width:"+ this.width +"; height:"+ this.height +";border:1px solid gray'>\n"; 
	  }
      
      if ( obj ) 
      { 
        embed += "</object>\n"; 
      } 
      
      html = obj + parameter + embed;
	  
	  document.write( html );  
	  //alert(html);
  } 
  
} 

//ÆäÀÌÁö³Ñ±â±â
function goPage( val) {
	var frm = document.paging;
	for(var i=0; i<frm.elements.length; i++) {
		var e = frm.elements[i];
		if(e.type == "hidden" && e.name == "page" ) e.value = val;
	}
	frm.submit();
}

//ÀÌ¹ÌÁö¿¡ ¸Â°Ô Ã¢ ¶ç¿ì±â
function imgPop(src) {
	var imgObj = new Image();
	imgObj.src = src;
	var wopt = "scrollbars=yes,status=no,resizable=no";
	wopt += ",width=" + imgObj.width;
	wopt += ",height=" + imgObj.height;
	var wbody = "<head><title>ÀÌ¹ÌÁöº¸±â</title>";
	wbody += "<script language='javascript'>";
	wbody += "function finalResize(){";
	wbody += "  var oBody=document.body;";
	wbody += "  var oImg=document.images[0];";
	wbody += "  var xdiff=oImg.width-oBody.clientWidth;";
	wbody += "  var ydiff=oImg.height-oBody.clientHeight;";
	wbody += "  window.resizeBy(xdiff,ydiff);";
	wbody += "}";
	wbody += "moveTo('0','0');";
	wbody += "</"+"script>";
	wbody += "</head>";
	wbody += "<body onLoad='finalResize()' style='margin:0'>";
	wbody += "<a href='javascript:window.close()'><img src='" + src + "' border=0></a>";
	wbody += "</body>";
	winResult = window.open("about:blank","",wopt);
	winResult.document.open("text/html", "replace");
	winResult.document.write(wbody);
	winResult.document.close();
	return;
}

//Åä±Û¸Þ´º
function toggleMenu(currMenu) {
		if (document.all) {
			thisMenu = eval("document.all." + currMenu + ".style")
			if (thisMenu.display == "block") {
				thisMenu.display = "none"
			} else {
				thisMenu.display = "block"
			}
			return false
		} else {
			return true
		}
}

//Åä±Û¸Þ´º
function controlMenu(currMenu, tog) {
	if (document.all) {
		thisMenu = eval("document.all." + currMenu + ".style")
		thisMenu.display = tog;
		return false
	} else {
		return true
	}
}

//½º¹«µå Åä±Û
function smoothToggle(el) { 
	if (el.style.display == 'none'){ 
		el.filters.blendTrans.Apply(); 
		el.style.display = ''; 
		el.filters.blendTrans.Play() 
	} else { 
		el.filters.blendTrans.Apply(); 
		el.style.display = 'none'; 
		el.filters.blendTrans.Play() 
	} 
}
/*
<span id='sch' style='display:none;width:100%;filter:blendTrans(Duration=0.5)'>
<table border=0 cellspacing=0 cellpadding=2>
<form method=get name=search action=/zboard/zboard.php><input type=hidden name=id value=0yougame><input type=hidden name=select_arrange value=headnum><input type=hidden name=desc value=asc><input type=hidden name=page_num value=20><input type=hidden name=selected><input type=hidden name=exec><input type=hidden name=sn value="off"><input type=hidden name=ss value="on"><input type=hidden name=sc value="off"><input type=hidden name=category value="">
	<tr>
		<td></td>
	</tr>
</form>
</table>
</span>
*/

// ·Î±×¾Æ¿ô¹öÆ°
function logoutConfirm() {
	if( confirm('·Î±×¾Æ¿ôÇÏ½Ã°Ú½À´Ï±î?') ) {
		location.replace("/gshop/login/logout.php?lpt=logout");
	} else { } 
}

//¿ìÆí¹øÈ£Ã£±â
function findZip(formName,fzip1,fzip2,faddr1,faddr2) {
	openWin("/util/zipCode.php?formName=" + formName + "&fzip1=" + fzip1 + "&fzip2=" + fzip2 + "&faddr1=" + faddr1 + "&faddr2=" + faddr2,"width=400,height=400,left=" + ( event.screenX - 200 ) + ",top=" + ( event.screenY - 200 ) + ",scrollbars=yes");
}

//ÆË¾÷Ã¢ ¿ÀÇÂ.
function openWin( url, arg ) {
	window.open( url, 'Win' , 'width=10,height=10,' + arg );
	// resizeTo(), moveTo()
}


// ´ÙÀÌ¾ó·Î±×Ã¢À¸·Î ÆË¾÷¶ç¿ì±â.
//¿¹½Ã) doModal("/interpark/common/searchZipCode.html", "dialogWidth=800px; dialogHeight=600px; status=no; help=no");
window.hasModal = false;
var modal = null;

function doModal(url, windowStyle) {
	window.hasModal = true;

	var returnValue = showModalDialog(url, window, windowStyle);

	window.hasModal = false;
	return returnValue;
}

window.closeModal = function() {
	if(window.hasModal && modal != null)
	modal.closeDlg();
}


/*------------------------------------------*/
// ÀÚµ¿À¸·Î Æû ³Ñ°ÜÁÖ´Â°Å ( Form size¿¡ ÀÇÁ¸ )  ->  
/*------------------------------------------*/
function autoskip( inputname, nextinputname) {

         if(inputname.type == 'text'){
                if((event.keyCode == 13) || (inputname.value.length >= inputname.size)) {

                        if(nextinputname.type == 'select-one' || nextinputname.type == 'select-multiple' || nextinputname.type == 'button'){
                        nextinputname.focus();
                        }else{
                        nextinputname.select();
                        }

                }
        }

        if(inputname.type == 'select-one' || inputname.type == 'select-multiple' || nextinputname.type == 'button'){
                if(event.keyCode == 13){
                  if(nextinputname.type == 'text'){
                  nextinputname.select();
                  }else{
                  nextinputname.focus();
                        }
                }
        }
        return;

}

/*------------------------------------------*/
// ÀÚµ¿À¸·Î Æû ³Ñ°ÜÁÖ´Â°Å ( Form maxlength¿¡ ÀÇÁ¸ )  ->  
/*------------------------------------------*/
function autoskip2( inputname, nextinputname) {

         if(inputname.type == 'text'){
                if((event.keyCode == 13) || (inputname.value.length >= inputname.maxLength)) {

                        if(nextinputname.type == 'select-one' || nextinputname.type == 'select-multiple' || nextinputname.type == 'button'){
                        nextinputname.focus();
                        }else{
                        nextinputname.select();
                        }

                }
        }

        if(inputname.type == 'select-one' || inputname.type == 'select-multiple' || nextinputname.type == 'button'){
                if(event.keyCode == 13){
                  if(nextinputname.type == 'text'){
                  nextinputname.select();
                  }else{
                  nextinputname.focus();
                        }
                }
        }
        return;

}

/*------------------------------------------*/
// ¼Ò¹®ÀÚ=> ´ë¹®ÀÚ·Î & autoskip (200101  ->  
/*------------------------------------------*/

function upper_mask(inputname, nextinputname)   {

                var orig =  inputname.value;
                if (orig.length == 7){
                inputname.value = orig.toUpperCase();
                }
                autoskip(inputname, nextinputname);
        }
/*------------------------------------------*/
// ¼Ò¹®ÀÚ=> ´ë¹®ÀÚ·Î & autoskip (200101  ->  
/*------------------------------------------*/

function upper_mask2(inputname, nextinputname)  {
                var orig =  inputname.value;

                if (orig.length == 6){
                inputname.value = orig.toUpperCase();
                }
                autoskip(inputname, nextinputname);
        }

/*------------------------------------------*/
//³¯ÀÚ Çü½Ä(yymm) & autoskip (200101  ->  
/*------------------------------------------*/

function mon_mask(inputname, nextinputname)     {

                var orig =  setDeGrouping(inputname.value);

                if (orig.length == 6){
                inputname.value =  disp_mon(orig);
                }
                aptoskip(inputname, nextinputname);
        }
/*------------------------------------------*/
//³¯ÀÚ Çü½Ä(yymmdd) & autoskip (200101  -> 2001/01
/*------------------------------------------*/
function date_mask(inputname, nextinputname)    {

                var orig =  setDeGrouping(inputname.value);
                if (orig.length == 8){
                    inputname.value =  disp_date(orig);

                    if( (event.keyCode == 50) || (event.keyCode == 51) ){

                    }else{
                       aptoskip(inputname, nextinputname);
                    }


                }

        }


/*------------------------------------------*/
//¿ìÆí¹øÈ£ Çü½Ä & autoskip (111222  -> 111-222
/*------------------------------------------*/

function post_mask(inputname, nextinputname)    {

                var orig =  setDeHyphen(inputname.value);

                if (orig.length == 6){
                inputname.value =  disp_postNo(orig);
                }
                autoskip(inputname, nextinputname);
        }


/*------------------------------------------*/
//ÀÚ¿¬½º·¯¿î ³¯Â¥ ÀÔ·ÂÀ» À§ÇÑ modify autoskip
/*------------------------------------------*/
function aptoskip( inputname, nextinputname) {

        if(inputname.type == 'text'){
                if((event.keyCode == 13) && (inputname.value.length >= inputname.size)) {

                        if(nextinputname.type == 'select-one' || nextinputname.type == 'select-multiple' || nextinputname.type == 'button'){
                        nextinputname.focus();
                        }else{
                        nextinputname.select();
                        }

                }


        }

        if(inputname.type == 'select-one' || inputname.type == 'select-multiple' || nextinputname.type == 'button'){
                if(event.keyCode == 13){
                  if(nextinputname.type == 'text'){
                  nextinputname.select();
                  }else{
                  nextinputname.focus();
                        }
                }
        }
        return;

}

/*------------------------------------------*/
//¿£ÅÍ¸¦ Ä¡°Å³ª  inputnameÀÌ lengthº¸´Ù Å©°Å³ª °°À¸¸é
//nextinputnameÀ¸·Î focus()ÀÌµ¿
/*------------------------------------------*/
function aptoskip2(inputname, nextinputname, length) {

                if((event.keyCode == 13) || (inputname.value.length >= length))
                        nextinputname.focus();

}

//"-" DeFormat
function setDeHyphen(str){

        if(str == null || str==" ") return "";
        if(str.indexOf("-") == -1) return str;
        var temp = "";
        for(var i = 0; i < str.length; i++){
                if((str.charAt(i) == '-')){

                continue;

                }else{

                temp += str.charAt(i);

                }
        }
        return temp;
}

//³¯Â¥ DeFormat
function setDeGrouping(str){

        if(str == null || str==" ") return "";
        if(str.indexOf(",") == -1 && str.indexOf("/") == -1) return str;
        var temp = "";
        for(var i = 0; i < str.length; i++){
                if((str.charAt(i) == ',') || (str.charAt(i) == '/')){

                continue;

                }else{

                temp += str.charAt(i);

                }
        }
        return temp;
}
/*------------------------------------------*/
// ³¯Â¥ value Á¸Àç¿Í À¯È¿°ª check
/*------------------------------------------*/

function IsDateCheck(object,obj_nm) {
            var obj = document.header.elements[object];
           var str =  setDeGrouping(obj.value);

                        if(( str == "") || ( str == null )){
                                                                 alert(obj_nm+"À» ÀÔ·Â ¹Ù¶ø´Ï´Ù.");
                                                                 obj.focus();
                                   return false;
                        }else if(!isValidDay(str)) {
                                                                 alert(obj_nm+"ÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù..");
                                                                 obj.focus();
                 return false;
      }
      return true;

}

/*------------------------------------------*/
//  ³¯Â¥ À¯È¿°ª check
/*------------------------------------------*/

function DateCheck(object,obj_nm) {
            var obj = document.header.elements[object];
            var str =  setDeGrouping(obj.value);

                        if(!isValidDay(str)) {
                                                                 alert(obj_nm+"ÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù..");
                                                                 obj.focus();
                 return false;
      }
      return true;

}


/*------------------------------------------*/
//      NullÀÎÁö Ã¼Å©
/*------------------------------------------*/
function IsNull(object,obj_nm) {
           var  obj = document.header.elements[object];

                        if(( obj.value == " ")||( obj.value == "") || ( obj.value == null )){
                                                alert(obj_nm+" ÀÔ·Â ¹Ù¶ø´Ï´Ù.");
                                                obj.focus();
                                   return false;
                        }
                return true;
}

function IsNullHidden(obj,obj_nm) {


                        if(( obj.value == " ")||( obj.value == "") || ( obj.value == null )){
                                                alert(obj_nm+" ÀÔ·Â ¹Ù¶ø´Ï´Ù.");
                                                obj.focus();
                                   return false;
                        }
                return true;
}

/*------------------------------------------*/
// value Á¸Àç¿Í ±æÀÌ check
/*------------------------------------------*/

function IsLengthCheck(obj,leng,obj_nm) {
                                // var obj = document.header.elements[object];

                        if(( obj.value == " ") ||( obj.value == "") || ( obj.value == null )){
                                                                 alert(obj_nm+"¸¦ ÀÔ·Â ¹Ù¶ø´Ï´Ù.");
                                                                 obj.focus();
                                                                 return false;
                        }else if(obj.value.length < leng) {
                                                                 alert(obj_nm+" "+leng+"ÀÚ¸®¸¦ ³Ö°í Á¶È¸¸¦ ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.");
                                                                 obj.focus();
                                             return false;
      }
      return true;
}

/*------------------------------------------*/
// ±æÀÌ check
/*------------------------------------------*/

function LengthCheck(obj,leng,obj_nm) {
                                //var obj = document.header.elements[object];
                                if(( obj.value == " ") ||( obj.value == "") || ( obj.value == null )){
                                                                 obj.focus();
                                                                 return true;
                            }else if(obj.value.length < leng) {
                                                                 alert(obj_nm+" "+leng+"ÀÚ¸®¸¦ ³Ö°í Á¶È¸¸¦ ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.");
                                                                 obj.focus();
                                             return false;
          }
      return true;
}

/*------------------------------------------*/
//³â¿ùÀÏ À¯È¿°ª check [javascript callÇÔ¼ö]
/*------------------------------------------*/

function isValidDay(_day)
    {

     MONTH = new Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) ;
         MAXDAY = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31) ;
         var  year, mon, day ;

            if ( _day.length == 6 )
            _day += "01";

            if ( _day.length != 8 ) return false ;

            year = eval(_day.substring(0, 4));
            mon  = eval(_day.substring(4, 6));
            day  = eval(_day.substring(6, 8));

            if ( year <= 0 ) return false ;
            if ( mon <= 0 || mon > 12 ) return false ;
            if ( day <= 0 ) {
                return false ;
            } else if (  MAXDAY[mon - 1 ] < day ) {
                if ( isYoonYear(year) && mon == 2 && day < 30) return true ;
                else return false ;
            } else {
                return true ;
            }

}

/*------------------------------------------*/
// À±´Þ check [javascript callÇÔ¼ö]
/*------------------------------------------*/

    function isYoonYear(_year)
    {

            if ( _year < 0 ) return false ;

            if (_year % 4 == 0)
                if (_year % 100 == 0)
                    if (_year % 400 == 0)
                        return true;
                    else
                        return false;
                else
                    return true ;
            else
                return false ;

    }

/*------------------------------------------*/
// Á¸ÀçÇÏ´ÂÁö ±×¸®°í °ø¹éÀÌ¾ø´Â ¼ýÀÚÀÎÁö  check
/*------------------------------------------*/

function IsNumCheck(object,obj_nm) {
            var obj = document.header.elements[object];
           var str =  setDeGrouping(obj.value);

                        if(( str == "") || ( str == null )){
                                                                 alert(obj_nm+"À» ÀÔ·Â ¹Ù¶ø´Ï´Ù.");
                                                                 obj.focus();
                              return false;
                        }else if(!IsInteger(str)) {
                                                                 alert(obj_nm+"¿¡ À¯È¿ÇÑ ¼ýÀÚ¸¦ ³Ö¾î ÁÖ¼¼¿ä.");
                                                                 obj.focus();
                 return false;
      }
      return true;

}

/*------------------------------------------*/
/*------------------------------------------*/

function IsInteger(st)
{
    if ( !IsEmpty(st) ){
          for (j=0; j<st.length; j++) {
             if (((st.substring(j, j+1) < "0") || (st.substring(j, j+1) > "9")))
                return false;
          }
    } else {
          return false ;
    }
    return true ;

}
/*------------------------------------------*/
/*------------------------------------------*/

function IsEmpty(toCheck)
{
     var chkstr = toCheck + "";
     var is_Space = true ;
     if ( ( chkstr == "") || ( chkstr == null ) )
           return false ;

     for ( j = 0 ; is_Space &&  ( j < chkstr.length ) ; j++){

             if( chkstr.substring( j , j+1 ) != " " )
               is_Space = false ;
     }

     return ( is_Space );
}


/*------------------------------------------*/
//   rolloverÀÌ¹ÌÁö ±¸Çö
/*------------------------------------------*/

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 disp_digit(code)
        {
                var rcode;
                var i = 0;
                var dat_num = 0;


                if(code.length ==0) return "";

                rcode="";

                dat_num=code.length;

                for(i=(code.length -1);i>=0;i--)
                {
                        if((code.length -i-1) != 0)
                        {
                                if((code.length -i-1)%3 == 0)
                                {
                                        if(code.charAt(i) != '-' && code.charAt(i+1) != '.' )
                                        {
                                                rcode = "," + rcode;
                                        }
                                }
                        }
                        rcode= code.charAt(i) + rcode;
                }

                return rcode;
        }

function dformat(form,code) {
	code = disp_notdigit(code);
	form.value = disp_digit(code);
}

/*------------------------------------------*/
//ÅëÈ­´ÜÀ§ Çü½ÄÀ» Á¦°Å (###,###,### -> #########)
/*------------------------------------------*/

function disp_notdigit(code)
        {
                var rcode;
                var i,dat_num;

                if (code.length == 0 ) return "";

                rcode="";

                dat_num = code.length;

                for ( i=(dat_num-1) ; i >= 0 ; i--)
                {
                        if( code.charAt(i) == ',' )
                        {
                                                i--;
                        }
                        rcode= code.charAt(i) + rcode;
                }

                return rcode;
        }



/*------------------------------------------*/
//³¯ÀÚ Çü½Ä  (20010101 -> 2001/01/01
/*------------------------------------------*/

function disp_date(date_type)
        {

                var date_type;

                if (date_type.length >= 8 ) {
                date_type = date_type.substring(0,4)+"/"+date_type.substring(4,6)+"/"+date_type.substring(6,8);
                return date_type;
                }
                return "0"

        }

/*------------------------------------------*/
//³¯ÀÚ Çü½Ä  (200101  -> 2001/01
/*------------------------------------------*/

function disp_mon(date_mon)
        {

                var date_mon;

                if (date_mon.length >= 6 ) {
                date_mon = date_mon.substring(0,4)+"/"+date_mon.substring(4,6);
                return date_mon;
                }
                return "0"

        }

/*------------------------------------------*/
//°í°´¹øÈ£ Çü½Ä  (11112222  -> 1111-2222)
/*------------------------------------------*/

function disp_custNo(no)
        {

                var no;

                if (no.length >= 8 ) {
                no = no.substring(0,4)+"-"+no.substring(4,8);
                return no;
                }
                return "0"

        }

/*------------------------------------------*/
//¿ìÆí¹øÈ£ Çü½Ä  (111222  -> 111-222)
/*------------------------------------------*/

function disp_postNo(no)
        {

                var no;

                if (no.length >= 6 ) {
                no = no.substring(0,3)+"-"+no.substring(3,6);
                return no;
                }
                return "0"

        }

/*------------------------------------------*/
//ÁÖ¹Î¹øÈ£ Çü½Ä  (7407041448817 -> 2001/01/01
/*------------------------------------------*/

function disp_jumin(jumin_type)
        {
                var jumin_type;

                if (jumin_type.length == 13 ) {
                jumin_type = jumin_type.substring(0,6)+"-"+jumin_type.substring(6,13);
                return jumin_type;
                }
                return "0"

        }

/*------------------------------------------*/
//ÁÖ¹Î¹øÈ£ Ã¼Å©  (20010515 -> 2001/01/01
/*------------------------------------------*/

function validJumin(juminno, textboxname){

                var obj = document.header.elements[textboxname];

                jumin = new Array();
                a = new Array();
                jumin = setDeHyphen(juminno) ;
                var j=1;

                for(var i=0;i<13;i++)
                a[i] = jumin.charAt(i);

                if(j)   {
                        j=a[0]*2+a[1]*3+a[2]*4+a[3]*5+a[4]*6+a[5]*7+a[6]*8+a[7]*9+a[8]*2+a[9]*3+a[10]*4+a[11]*5;
                        j=j%11;

                        var k=11-j;
                        if(k>9) k=k%10;

                        j=a[12];

                        if(j!=k) {
                                alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ Æ²·È½À´Ï´Ù.!\n\nÁÖ¹Îµî·Ï¹øÈ£¸¦ Á¤È®È÷ ÀÔ·ÂÇÏ¿©¾ß ÇÕ´Ï´Ù.!!");
                                obj.focus();
                                return false;
                        }
                }
                return true;
        }


function dateAble( form,form2,type ) {
	if( type == true ) {
		form.style.backgroundColor = "white";
		form.disabled = false;
		form2.disabled = false;
	} else {
		form.style.backgroundColor = "#cccccc";
		form.disabled = true;
		form2.disabled = true;
	}
}

function textAble( form, type ) {
	if( type == true ) {
		form.style.backgroundColor = "white";
		form.readOnly = false;
	} else {
		form.style.backgroundColor = "#cccccc";
		form.readOnly = true;
	}
}

function chkAble( form, type ) {
	if( type == true ) {
		form.disabled = false;
		form.checked = true;
	} else {
		form.disabled = true;
		form.checked = true;
	}
}


function trim(objValue) { 
	var oval=objValue;
	
	var myre1=/^(\s)+(\S*)/g; //ltrim 
	var myre2=/(\S*)(\s+)$/g; //rtrim 
	
	oval=myre1.test(oval) ? oval.replace(myre1,"$2") : oval; 
	oval=myre2.test(oval) ? oval.replace(myre2,"$1") : oval; 
	
	return oval;
//document.all.tg.value=oval; 
} 
function noQuot(obj5str) {
	var temp;
	var type=typeof(obj5str);
	var oval=type=="string" ? obj5str : obj5str.value;
	var temp=oval.replace(/'|"/g,'');
	if (type=="string") return temp;
	else obj5str.value=temp;
}
function noQuot2(obj5str) {
	var temp;
	var type=typeof(obj5str);
	var oval=type=="string" ? obj5str : obj5str.value;
	var temp=oval.replace(/'|"|\s/g,'');	//°ø¹é±îÁö
	if (type=="string") return temp;
	else obj5str.value=temp;
}


   function isNumber(formname) {
       var form = eval("document.reg_form." + formname);

      for(var i = 0; i < form.value.length; i++) {
         var chr = form.value.substr(i,1);
         if(chr < '0' || chr > '9') {            
            return false;
         }
      }
      return true;   
   }

function normalSearch( form ) {
	if( !form.kw.value ) {
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		return false;
	}
	return true;
}

function priceSearch( form ) {
	if( !form.price1.value || !form.price2.value ) {
		alert("°Ë»öÀ» ¿øÇÏ½Ã´Â °¡°Ý´ë¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		return false;
	}
	return true;
}

function flashit( args ) { 
	if (!document.all) { return }
	if (args.style.color == "white") { 
		args.style.color="red" 
	} else {
		args.style.color="white" 
	}
} 

function blink( args ) {
	setInterval("flashit(" + args + ")", 700) 
}