document.domain = 'playauto.co.kr';

//---------------------------------------------------------
//  EC °ø¿ë Å¬·¡½º class - define
//---------------------------------------------------------

  //------------------------------
  //  »ý¼ºÀÚ
  //------------------------------
  function Common( Form_ ){

    var blank_img;
    var oPopup;
    var Max_size_w = 0;
    var Max_size_h = 0;
    this.Form_ = Form_;

				//  °ø¹éÀÌ¹ÌÁö°¡ ÇÊ¿äÇÒ°æ¿ì ¿©±â´Ù Á¤ÀÇÇÑ´Ù.
    this.blank_img_1 = "";
    this.blank_img_2 = "";

    // ¹Ì¸®º¸±â ÆË¾÷
    this.oPopup=window.createPopup();
  }

Common.prototype={
// class - Start

  //------------------------------------
  //   ÀüÃ¼ ¼±ÅÃ
  //------------------------------------
  Check_all : function(object,form_name,boxname){
    
    var form = eval("document."+form_name+".elements");
    for(i = 0; i < form.length; i++) 	{
      if(form[i].type == 'checkbox' && form[i].name==boxname && form[i].disabled!=true){
        if(object.checked == true){form[i].checked = true;	}
        else{form[i].checked = false;	}
      // if - End
      }
    // loop - End
    }

  // function - End
  },

  //-------------------------------------
  //  ¼±ÅÃµÈ ¸ñ·Ï »èÁ¦
  //-------------------------------------
  Delete_selected : function(formname,boxname,targetform){

    var retstr = "";

    var form = eval("document."+formname+".elements");
    var target = eval("document."+targetform);
    var formlength =  form.length;

    for(i = 0; i < formlength; i++) 	{

      if(form[i].type == 'checkbox' && form[i].name==boxname){

        if(form[i].checked == true){
          retstr = retstr+form[i].value+"|";
        }

      // if - End
      }
    // loop - End
    }

    if(retstr!=""){
      target.Str_list.value = retstr;
      target.submit();
    }
    else{
      alert("¼±ÅÃµÈ Ç×¸ñÀÌ ¾ø½À´Ï´Ù.");
    }
  },

  //-------------------------------------
  //  ¼±ÅÃµÈ ¸ñ·Ï ¹®ÀÚ¿­·Î ¸®ÅÏ 
		//  Selected To String : ¼±ÅÃµÈ Ç×¸ñÀ»
		//  ¿øÇÏ´Â ±¸ºÐÀÚ·Î ÇÕÇØ¼­ ¹®ÀÚ¿­·Î ¸®ÅÏ 
  //-------------------------------------
  STS : function(formname,boxname,sept){

				var retstr = "";
    var form = eval("document."+formname+".elements");
    var formlength =  form.length;

    for(i = 0; i < formlength; i++) 	{
      if(form[i].type == 'checkbox' && form[i].name==boxname){
        if(form[i].checked == true){ retstr = retstr+form[i].value+sept; }
      }
    }
				//  ²¿¸® Àß¶óÁÖ°í
				retstr = this.CutTail(retstr, sept, sept.length);
				return retstr;
  },

  //--------------------------------------------------
  //  Åä±Û
  //--------------------------------------------------
  ToggleField : function(form_name,value, pk_no){

    var form = eval("document."+form_name);
    form.Code_value.value = pk_no;
    form.Toggle_value.value = value;
    form.submit();

  // function - End
  },

  //--------------------------------------------------
  //  ÄÚµå Ã¼Å©Æû ¼¼ÆÃ
  //--------------------------------------------------
  CodeCheck : function (form_name, field){

    var CF = document.CodeForm;

    // Àü¼ÛÇÒ ÄÚµå°ª ¼¼ÆÃ
    CF.Code.value = field.value;
    CF.submit();

  // function - End
  },

  //--------------------------------------------------
  //  ÆË¾÷Ã¢ ¶ç¿öÁÖ´Â ³ð
  //  ¸¶¿ì½º ¿·¿¡´Ù°¡ ¶ç¿öÁØ´Ù.
  //--------------------------------------------------
  Open_Popup_Mousexy : function (Url_, Name_ , Width_, Height_){
				var popupNAME = Name_+Math.round(Math.random()*1000);
    window.open(Url_,popupNAME,'toolbar=no, scrollbars=no, top='+event.x+', left='+event.y+', width='+Width_+', height='+Height_);
  },

  //--------------------------------------------------
  //  ÆË¾÷Ã¢ ¶ç¿öÁÖ´Â ³ð
  //  ¿øÇÏ´Â À§Ä¡¿¡ ¶ç¿öÁØ´Ù.
  //--------------------------------------------------
  Open_Popup : function (Url_, Name_ , Width_, Height_, Left_ , Top_){
				var popupNAME = Name_+Math.round(Math.random()*1000);
				window.open(Url_,popupNAME,'scrolling=yes, toolbar=no, scrollbars=yes, top='+Top_+', left='+Left_+', width='+Width_+', height='+Height_);
				return popupNAME;
  },

  //--------------------------------------------------
  //  ÆË¾÷Ã¢ ¶ç¿öÁÖ´Â ³ð
  //  ¿øÇÏ´Â À§Ä¡¿¡ ¶ç¿öÁØ´Ù.
		//  ÆË¾÷Ã¢ ¿É¼ÇÇ®·Î ´ÙÄÑÁÜ
  //--------------------------------------------------
  Open_Popup_Full : function (Url_, Name_ , Width_, Height_, Left_ , Top_){
				var popupNAME = Name_+Math.round(Math.random()*1000);
    window.open(Url_,popupNAME,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=600,height=400,top=100,left=100');
  },

  //--------------------------------------------------
  //  ÆË¾÷Ã¢ ¶ç¿öÁÖ´Â ³ð
  //  ¿øÇÏ´Â À§Ä¡¿¡ ¶ç¿öÁØ´Ù.
		//  ÆË¾÷Ã¢ ¿É¼ÇÇ®·Î ´ÙÄÑÁÜ
  //--------------------------------------------------
  Open_Popup_ : function (Url_, Name_ ){
				var popupNAME = Name_+Math.round(Math.random()*1000);
    window.open(Url_,popupNAME,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=100%,height=100%,top=0,left=0');
  },

  //-------------------------------------------------
  //  ÆÄÀÏ µî·Ï ÇÊµå Ã¤¿ò
  // numÀÌ ¾øÀ» °æ¿ì ´ÜÀÏ ÆÄÀÏ µî·Ï
  //-------------------------------------------------
  Fill_filename : function (formname,num){

    if(num!=''){
      var form = eval("document."+formname);
      var img = form["Files[]"][num].value;
      var text = form["Files_[]"][num];
    }
    else{
      var form = eval("document."+formname);
      var img = form["Files"].value;
      var text = form["Files_"];
    }
    text.value = img;

  // function - End
  },

  //-------------------------------------------------------------------------------------------
  // ¼±ÅÃ ÇÑ³ð°ú ¼±ÅÃ ¾ÈÇÑ³ð Ã¼Å©ÇØ¼­ º¸ÀÌ°í °¡¸®°í
  //-------------------------------------------------------------------------------------------
  Show_tr : function(Obj,action){
				try {

						//  ¿ÀºêÁ§Æ®°¡ ¹è¿­ÇüÅÂÀÏ¶§
						if( !isNaN(Obj.length) ) {
								if(action == 'show'){ 	for(i=0;i<Obj.length;i++){ Obj[i].style.display='block'; } } // º¸ÀÌ±â
								else{ for(i=0;i<Obj.length;i++){ Obj[i].style.display='none'; } } // °¨Ãß±â
						}
						// ¿ÀºêÁ§Æ®°¡ ¹è¿­ÀÌ ¾Æ´Ò¶§
						else {
								if(action == 'show'){ 	Obj.style.display='block'; } // º¸ÀÌ±â
								else{ Obj.style.display='none'; } // °¨Ãß±â
						}
				
				}
				catch (e) { alert(e.message); }

		// function - End
  },

  //-----------------------------------------------------
  //  ÇÑ±Û¸¸
  //-----------------------------------------------------
  korean_only : function(value){
   if(event.keyCode < 128){event.returnValue=false;value.focus();}
   else{return false;}
  },

  //-----------------------------------------------------
  //  ¿µ¾î¸¸
  //-----------------------------------------------------
  english_only : function(value){
   if( ( event.keyCode >= 65 && event.keyCode <= 90) || ( event.keyCode >= 97 && event.keyCode <= 122 )  ){return false;}
   else{event.returnValue=false;value.focus();}
  },

  //-----------------------------------------------------
  //  ¿µ¾î¸¸(¼Ò¹®ÀÚ¸¸)
  //-----------------------------------------------------
  english_only_s : function(value){
   if( event.keyCode >= 97 && event.keyCode <= 122 ){return false;}
   else{event.returnValue=false;value.focus();}
  },

  //-----------------------------------------------------
  //  ¿µ¾î¸¸(´ë¹®ÀÚ¸¸)
  //-----------------------------------------------------
  english_only_b : function(value){
   if( event.keyCode >= 65 && event.keyCode <= 90 ){return false;}
   else{event.returnValue=false;value.focus();}
  },

  //-----------------------------------------------------
  //  IDÇü½Ä
  //-----------------------------------------------------
  id_only : function(value){
   if( ( event.keyCode >= 48 && event.keyCode <= 57) || ( event.keyCode >= 97 && event.keyCode <= 122 )  ){return false;}
   else{event.returnValue=false;value.focus();}
  },

  //-------------------------------------------------------------------------------------------------------------
  //  ¼ýÀÚ¸¸ style='ime-mode:disabled;' input type ÇÊµå¿¡ Ãß°¡
  //-------------------------------------------------------------------------------------------------------------
  num_only : function(){

   // ¼Ò¼öÁ¡ Çã¿ë ÇÏ·Á¸é  && (event.keyCode != 46) ºÙ¿©ÁØ´Ù.
    if(((event.keyCode<48) || (event.keyCode>57)) && (event.keyCode < 128) )
    {event.returnValue=false;}
  },

  //-----------------------------------------------------
  //  µµ¸ÞÀÎÇü½Ä
  //-----------------------------------------------------
  domain_only : function(value){
   if( ( event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 97 && event.keyCode <= 122 ) || event.keyCode==45 ){return false;}
   else{event.returnValue=false;value.focus();}
  },

  //-----------------------------------------------------------------------------
  //  ¹è¿­ ³»¿¡ value °¡ Á¸Àç ÇÏ´Â Áö °Ë»ç
  //-----------------------------------------------------------------------------
  in_array : function (array_, value_) {
				for (var i=0; i<array_.length; i++) {
						// array_ ³»¿¡ value_ °¡ ÀÖÀ¸¸é false ¸®ÅÏ
						if(array_[i] == value_){ return false; }
				// loop - End
				}
		  return true;
  // function - End
  },

  //-----------------------------------------------------------------------------
  //  ¿¡·¯ÀÌ¹ÌÁö Ãâ·Â
  //-----------------------------------------------------------------------------
  imgerr : function (img,section) {

    if (section=='1') {
      img.src=this.blank_img_1;
    // if - End
    }
    else {
      img.src=this.blank_img_2;
    }

  // function - End
  },
  //----------------------------------------------------------
  //  ÀÌ¹ÌÁö ¹Ì¸®º¸±â
  //----------------------------------------------------------
  View_img : function(img,width_,height_){

    // ÄíÆù ÀÌ¹ÌÁö ÃÖ´ë »çÀÌÁî
    this.Max_size_w = width_;
    this.Max_size_h = height_;

    if(img.trim()!=""){

      // ÀÌ¹ÌÁö »çÀÌÁî
      var img_size = this.Get_img_size(img.trim());

      // ÀÌ¹ÌÁö »çÀÌÁî°¡ ÃÊ°ú ÇÏÁö ¾ÊÀ»°æ¿ì
      if(img_size!=false){
        var img_ = "<IMG SRC='"+img+"'>";
        this.ShowpopupPreview(img_,'on',img_size);
      }
    }

  },

  //---------------------------------------------------------
  //  ÀÌ¹ÌÁö »çÀÌÁî ±¸ÇÏ±â
  //---------------------------------------------------------
  Get_img_size : function (img){

    var img_w;
    var img_h;
    var Newimg = new Image();
    var ret_array = new Array();

    Newimg.src = img;
    this.img_w = Newimg.width;
    this.img_h = Newimg.height;

  // function - End
  },

  //-----------------------------------------------------------------------------
  //  ÀÌ¹ÌÁö Å¬¸¯ÇÏ¸é ¹Ì¸®º¸±â ´Ý±â
  //-----------------------------------------------------------------------------
  close_preview : function () {
     this.oPopup.hide();
  // function - End
  },

		//-----------------------------------------------------------
		// ÀÌ¹ÌÁö ¹Ì¸®º¸±â ÆË¾÷
		//-----------------------------------------------------------
  ShowpopupPreview : function (text,action,img_size){

     if(action=='on'){
       var oPopBody=this.oPopup.document.body;
       oPopBody.style.backgroundColor='#FFFFFF';
       oPopBody.style.padding='0px';
       oPopBody.style.border='solid 0 gray';
       oPopBody.style.fontWeight='normal';
       oPopBody.style.color='gray';
       oPopBody.style.fontSize='9px';
       oPopBody.innerHTML=text;
       this.oPopup.show(event.x+20,event.y,this.img_w,this.img_h,document.body);
     }
     else{
       this.oPopup.hide();
     }

  // function - End
  },

		//-----------------------------------------------------------
		//  ±×³É ÆË¾÷ ·¹ÀÌ¾î¿¡ ±Û¾¾ ¶ç¿ì±â
		//-----------------------------------------------------------
  ShowPopupDiv: function(text,action,width_,height_){

     // ÆË¾÷ ¿­¶§
     if(action=='on'){

       var oPopup
       var oPopBody;

       if (width_ !="" || height_ !="") {
         this.width = width_;
         this.height= height_;
       }
       else {
         this.width = 68;
         this.height= 30;
       }

       this.oPopup=window.createPopup();
       this.oPopBody=this.oPopup.document.body;

       this.oPopBody.style.marginTop='0px';
       this.oPopBody.style.marginLeft='0px';
       this.oPopBody.style.backgroundColor='#FFFFE1';
       this.oPopBody.style.padding='10px';
       this.oPopBody.style.border='solid 1 gray';
       this.oPopBody.style.fontWeight='normal';
       this.oPopBody.style.color='#999999';
       this.oPopBody.style.fontSize='11px';
       this.oPopBody.style.filter='allpha(opacity=0)';
       this.oPopBody.innerHTML=text;
       this.oPopup.show(event.x+10,event.y+8,this.width,this.height,document.body);
       // this.oPopup.show(event.x+10,event.y+8,document.body.scrollWidth,document.body.scrollHeight,document.body);
     }else{ this.oPopup.hide(); }
  },

  //------------------------------------------------------------
  //  ÀÌ¹ÌÁö¸¦ ºí¸µÅ© Ã¢¿¡ ¶ç¿üÀ»¶§
  //  ÀÌ¹ÌÁö »çÀÌÁî¸¸Å­ Ã¢À» ¸®»çÀÌÁî
  //------------------------------------------------------------
    Resize_img : function(imgObj){
      var i_Width = imgObj.width;
      var i_Height = imgObj.height;
      top.window.resizeTo(i_Width,i_Height);
    },

  //------------------------------------------------------------
  //  ºí¸µÅ©Ã¢ ¸®»çÀÌÁî
  //------------------------------------------------------------
    Resize_self : function(){
      var i_Width = document.body.clientWidth;
      var i_Height = document.body.clientHeight;
      top.window.resizeTo('100%','100%');
    },

  //------------------------------------------------------------
  //  ÃÖ´ë ¼ýÀÚ Á¦ÇÑ
		// Maxvalue ==> ÃÖ´ë°ª
		// Value_ ÇØ´ç °ªÀÇ °´Ã¼ ==> ÀÎÀÚ·Î ³Ñ±æ¶§ this ·Î ³Ñ±â¸é µÈ´Ù.
  //------------------------------------------------------------
    BreakMax : function(Maxvalue, Value_){
				  if (Value_.value > Maxvalue ) { Value_.value = Maxvalue; }
				},

  /*-----------------------------------------------------------------------------
    ÇöÀç ÆûÀÇ °´Ã¼µéÁß »ç¿ëÀÚ°¡ Arrays_·Î
    Àü´ÞÇÑ ÇÊ¼ö Ç×¸ñÀÌ ³ÎÀÌ¸é °æ°íÃ¢ ¶ç¿öÁÜ
		  »ý¼ºÀÚ¿¡ »ý¼ºµÈ Æû¸í ÀÌ¿ÜÀÇ Æû¸íÀÌ ¿Í¾ßÇÒ°æ¿ì
		  this.Form_ <-- ÀÌ³ðÀÌ Æû ³×ÀÓÀÌ´Ï±î ÀÌ°É ¿ÜºÎ¿¡¼­ ¹Ù²ãÁÖ¸é µÈ´Ù.
		  html ÆíÁý±â¸¦ »ç¿ëÇÒ¶§´Â Contents = 1 ±×¿ÜÀÇ °æ¿ì 0À¸·Î ¼³Á¤
		
		  --------------------------------------
				                  ¡Ø »ç¿ë ¿¹Á¦ 
				--------------------------------------
				1. ¹è¿­ ¼±¾ð 
						var ArrayKorean = new Array();
						ArrayKorean['Agree'] = "¾à°üµ¿ÀÇ";
						ArrayKorean['u_name'] = "»ç¿ëÀÚ¸í";
						ArrayKorean['pubid1'] = "ÁÖ¹Î¹øÈ£ ¾ÕÀÚ¸®";
						ArrayKorean['pubid2'] = "ÁÖ¹Î¹øÈ£ µÞÀÚ¸®";
						var ArrayCheck = new Array('Agree','u_name','pubid1','pubid2');
				2. È£Ãâ 
						inst_Common.Check_submit(ArrayCheck,0);
		-----------------------------------------------------------------------------*/
  Check_submit : function(Arrays_,Contents ) {

   //  html ÆíÁý±â¸¦ »ç¿ëÇÏ´Â ÆûÀÏ °æ¿ì ¸¸
   if (Contents == '1') {
     var oEditor = FCKeditorAPI.GetInstance('Contents') ;
     var content = oEditor.GetXHTML(true);
   }

   var form = eval(this.Form_+".elements");

   for (var i=0; i<form.length; i++) {
					
					//  Ã¼Å©Ç×¸ñÀÎÁö ¿©ºÎ ÆÇ´Ü 
     var checkval = this.in_array(Arrays_, form[i].name);
					
					//  Ã¼Å©¹Ú½ºÀÏ°æ¿ì
					if (form[i].type=='checkbox') { 
							if (checkval == false && form[i].checked == false ) { 
									alert(ArrayKorean[form[i].name]+'´Â(Àº) ¹Ýµå½Ã Ã¼Å©ÇØÁÖ¼Å¾ß ÇÕ´Ï´Ù.'); 
									if (form[i].type!='hidden' && form[i].readOnly!=true) { form[i].focus(); }
									return false;
							}
					}

					//  ÀÏ¹Ý ÅØ½ºÆ® Å¸ÀÔÀÏ °æ¿ì
					else {  
							if (checkval == false && !form[i].value.trim() ) {
									alert(ArrayKorean[form[i].name]+'´Â(Àº) ¹Ýµå½Ã ÀÛ¼ºÇØÁÖ¼Å¾ß ÇÕ´Ï´Ù.'); 
									if (form[i].type!='hidden' && form[i].readOnly!=true) { form[i].focus(); }
									return false;								
								}
					}
   }
			
    if (Contents == '1' && content == "") { alert('HTML ³»¿ëÀ» ÀÛ¼ºÇØ ÁÖ¼Å¾ß ÇÕ´Ï´Ù.'); return false; }

    // ÆûÀü¼Û
    eval(this.Form_).submit();

    return true;

  // function - End
  },

  //-----------------------------------------------------------------------------
  //  È¸¿ø °¡ÀÔ½Ã ±âº» Ç×¸ñ Ã¼Å© 
		//  1. ºñ¹ø 
		//  2. ºñ¹øÈ®ÀÎ
		//  3. ÀÌ¸ÞÀÏ
		//  4. ¾ÆÀÌµð Áßº¹Ã¼Å© ¿©ºÎ 
  //-----------------------------------------------------------------------------
  MemBaseCheck : function(pass,passre,email,checkpoint,checkpoint2) {
    
				//  ºñ¹Ð¹øÈ£ Çü½ÄÃ¼Å©
				if (this.CheckFomat(pass,'pass')!=true) { return false; }
				if (this.CheckFomat(passre,'pass')!=true) { return false; }
				
				//  ºñ¹Ð¹øÈ£ È®ÀÎ ¿©ºÎ Ã¼Å© 
				if (pass.value!=passre.value) { alert('ºñ¹Ð¹øÈ£¸¦ È®ÀÎÇØÁÖ¼¼¿ä.'); return false; }
				
				//  ¾ÆÀÌµð Áßº¹ Ã¼Å©¿©ºÎ 
				if (checkpoint.value!='y') { alert('¾ÆÀÌµð Áßº¹Ã¼Å©¸¦ ÇØÁÖ¼¼¿ä.'); return false;}
    
  			//  OMP »ç¿ëÀÚ ¿©ºÎ È®ÀÎ  
				if (checkpoint2.value!='n') {
						if (checkpoint2.value!='y') { alert('OMP ¾÷Ã¼ÄÚµå Á¤º¸ È®ÀÎÀ» ÇØÁÖ¼¼¿ä.'); return false;}
				// if - End
				}
				// ÀÌ¸ÞÀÏ Çü½Ä Ã¼Å©
				if (this.CheckFomat(email,'mail')!=true) { return false; }
				
				return true;

		// function - End
  },

  //-----------------------------------------------------------------------------
  //  ¾ÆÀÌµð Áßº¹°Ë»ç 
  //-----------------------------------------------------------------------------
  SearchID : function(idcheckform ,ID) {
				idcheckform.SearchID.value = ID.value;
				idcheckform.submit();
  // function - End
  },

  //-----------------------------------------------------------------------------
  //  OMP °èÁ¤ Áßº¹°Ë»ç 
  //-----------------------------------------------------------------------------
  SearchIDOMP : function(Ompcheckform ,ID,CODE,PW) {
				
				Ompcheckform.ompcode.value = ID.value;
				Ompcheckform.ompid.value = CODE.value;
				Ompcheckform.omppw.value = PW.value;
				Ompcheckform.submit();

  // function - End
  },

  //-----------------------------------------------------------------------------
  //  ENT °èÁ¤ Áßº¹°Ë»ç 
  //-----------------------------------------------------------------------------
  SearchIDENT : function(Entcheckform ,ID,CODE,PW) {
				
				Entcheckform.entcode.value = ID.value;
				Entcheckform.entid.value = CODE.value;
				Entcheckform.entpw.value = PW.value;
				Entcheckform.submit();

  // function - End
  },

		//-----------------------------------------------------------------------------
  //  Çü½Ä Ã¼Å© 
  //-----------------------------------------------------------------------------
  CheckFomat : function(id,action) {
							
				// ID Çü½Ä Ã¼Å© 
				if (action == 'id') {
						var pattern = /^[a-zA-Z]{1}[a-zA-Z0-9_]{2,12}$/;
						if(pattern.test(id.value)==true){return true;}
						else { alert("4ÀÚÀÌ»ó 12ÀÚ ¹Ì¸¸,\n ¿µ¹®,¼ýÀÚ, _ ¹®ÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ¼ýÀÚ·Î ½ÃÀÛÇÒ ¼ö ¾ø½À´Ï´Ù."); id.focus(); }
				}
				// passwd Çü½Ä Ã¼Å© 
    else if (action == 'pass') {
						var pattern = /^[a-zA-Z0-9_]{3,12}$/;
						if(pattern.test(id.value)==true){ return true;}
						else { alert("4ÀÚÀÌ»ó 12ÀÚ ¹Ì¸¸,\n ¿µ¹®,¼ýÀÚ, _ ¹®ÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù."); id.focus(); }
				}
				//  ÀÌ¸ÞÀÏ Çü½Ä Ã¼Å© 
				else if(action=='mail'){
						var pattern = /^[_a-zA-Z0-9-\.]+@[\.a-zA-Z0-9-]+\.[a-zA-Z]+$/;
						if(pattern.test(id.value)==true){ return true;}
						else { alert("ÀÌ¸ÞÀÏ Çü½ÄÀÌ ¸ÂÁö ¾Ê½À´Ï´Ù."); id.focus();}
				}
  // function - End
  },

		//-----------------------------------------------------------------------------
		//  ¹®ÀÚ¿­ ²¿¸® ÀÚ¸£±â
		//  ÀÎÀÚ·Î ¹ÞÀº ¹®ÀÚ¿­°ú ÀÚ¸£±â¸¦ ¿øÇÏ´Â ²¿¸®°¡ ¹®ÀÚ¿­ÀÇ ²¿¸®¿¡ ÀÖ´ÂÁö ÆÇ´ÜÈÄ Á¦°Å
		//-----------------------------------------------------------------------------
		CutTail : function(StrVal, Tail, TailLength) {
				var TailStr = StrVal.substr(StrVal.length-1,TailLength);
				if (Tail == TailStr ) { return StrVal.substr(0,StrVal.length-1); }
				else { return StrVal; }
		// function - End
		},

		//-----------------------------------------------------------------------------
		//  ¹è¿­À» ÀÔ·Â ¹ÞÀº ¹®ÀÚ¿­À» ±¸¹®ÀÚ·Î °®´Â ¹®ÀÚ¿­·Î ¸®ÅÏÇØÁØ´Ù.
		//  ±âº» ¹è¿­¸¸ °¡´É ¹è¿­ÀÇ ¹è¿­ ÀÌ¿ë ºÒ°¡.
		//-----------------------------------------------------------------------------
		ArrayToString : function(array,SepStr) {
  		var RetStr = "";
				for (var i=0; i<array.length; i++) { RetStr = RetStr+array[i]+SepStr; }
				RetStr = this.CutTail(RetStr,SepStr,SepStr.length);
				return RetStr;
		// function - End
		},

  //-----------------------------------------------------------------------------
  //  number_format  :  °ø°³ ¼Ò½º
  //-----------------------------------------------------------------------------
  number_format : function(num) {

    var len,point,str;
    num = num+"";
    point = num.length%3
    len = num.length;
    str = num.substring(0,point);
    while( point < len){
      if( str != "" ) str += ",";
      str += num.substring( point , point+3);
      point +=3;
    }
    return str;

  // function - End
  },

		//-----------------------------------------------------------------------------
		//  str_replace  :  °ø°³ ¼Ò½º
		//  examples : var str = replace("2006-01-01", "-", "");
		//-----------------------------------------------------------------------------
		str_replace : function (str,s,d){
				
				var i=0;
				while(i > -1){
						i = str.indexOf(s);
						str = str.substr(0,i) + d + str.substr(i+1,str.length);
				}
				return str;

		//  function - End
		},

		//-----------------------------------------------------------------------------
		//  °Ë»ö³¯Â¥ ÁöÁ¤ 2008-03-13 : ³²ÇüÁø
		//-----------------------------------------------------------------------------
		SetDate : function(form,type) {

      dt1=new Date();

			var Y1=dt1.getYear();
			var M1=dt1.getMonth()+1;
			var D1=dt1.getDate();

			switch (type) {
				case 0:
  				dt=new Date(Y1,M1,D1);
				break;

				case 1:
	  			dt=new Date(Y1,M1,D1-1);
				  D1=dt1.getDate()-1;
				break;

				case 2:
	  			dt=new Date(Y1,M1,D1-15);
				break;

				case 3:
	  			dt=new Date(Y1,M1-1,D1+1);
				break;

				case 4:
	  			dt=new Date(Y1,M1-3,D1+1);
				break;
			}

			var Y=dt.getYear();
			var M=dt.getMonth();
			var D=dt.getDate();

			if (M < 10) M = "0"+M;
			if (D < 10) D = "0"+D;
			if (M1 < 10) M1 = "0"+M1;
			if (D1 < 10) D1 = "0"+D1;

			form.Start_time.value=Y+"-"+M+"-"+D;
			form.End_time.value=Y1+"-"+M1+"-"+D1;

		// function - End
		}

//----------------------------------
// class - End
//----------------------------------
}

  //-------------------------------------------------
  //  °ø¹é Á¦°Å trim
  //-------------------------------------------------
  // trim => »ç¿ë¹ý value.trim();
  String.prototype.trim=function(){
    var str=this.replace(/(\s+$)/g,"");
    return str.replace(/(^\s*)/g,"");
  }

  //------------------------------------------------------------
  //  ¹è¿­ ³»¿ëÀ» ÇÁ¸°Æ® ÇÏ±â À§ÇØ¼­
  //  »ç¿ë¹ý : document.write(array); ¶Ç´Â alert(array);
  //------------------------------------------------------------
  Array.prototype.toString = function() {
   var retStr = "[";
   for(var x in this) {
    if (isNaN(x)) {
     val = (typeof(this[x]) == 'string') ? "'"+this[x]+"'" : this[x];
     retStr+= x+":" + val + ", ";
    } else {
     val = (typeof(this[x]) == 'string') ? "'"+this[x]+"'" : this[x];
     retStr+= val + ", ";
    }
   }
     return retStr.substring(0,retStr.length-2) + "]";
  }

    //  ÇÁ·¹ÀÓ°£ÀÇ µ¥ÀÌÅÍ ±³È¯½Ã ¹öÆÛ·Î ¾²ÀÌ´Â ³à¼®µé
    var buffer_array;
    var buffer_count;
    this.buffer_array = new Array();
    this.buffer_count = 0;


