    var DEFAULT = 0, NONNULL = 1, CONFIRM = 2;

    function Varchar(flags, dflt, len, val)
    {
        this.flags = flags;
        this.dflt = dflt;
        this.len = len;

        this.setValue = function(val) { this.val = (val == null || val.length == 0) ? this.dflt : val; };

        this.setValue(val);

        this.isValid = function(field)
        {
            this.val = ""; //??????????????????

            var value = getFieldValue(field);
            if(value == null) return true; //???????????????

            value = trimmed(value);

            var varLen = getByteLength(value) // ÇÑ±Û byte_lengthÃ³¸®.
            //alert("varLen=="+varLen);
            if(varLen == 0) {
                if((this.flags & NONNULL) != 0) {
                    alert(field.alt + " ÇÊµå´Â ÇÊ¼ö ÀÔ·Â »çÇ×ÀÔ´Ï´Ù.");
                    field.focus();
                    return false;
                }
            } else if(varLen > this.len) {
                alert(field.alt + " ÇÊµå¿¡´Â ÇÑ±Û " + this.len/2 + "ÀÚ¸®, ¿µ¹®/¼ýÀÚ " + this.len+ "ÀÚ¸®ÀÇ ¹®ÀÚ¸¸ Çã¿ëµË´Ï´Ù.");
                field.focus();
                return false;
            }

            this.setValue(value);
            return true;
        }

        this.initField = function( field )
        {
        	setFieldValue( field, this.val );
        }
    }

    function getByteLength(val)
    {
		var len = 0;
		if ( val == null ) return 0;

		for(var i=0;i<val.length;i++)
		{
			var char = escape(val.charAt(i));
			if ( char.length == 1 ) len ++;
			else if ( char.indexOf("%u") != -1 ) len += 2;
			else if ( char.indexOf("%") != -1 ) len += char.length/3;
		}

		return len;
	}

    function Id(flags, dflt, len, val)
    {
        this.flags = flags;
        this.dflt = dflt;
        this.len = len;

        this.setValue = function(val) { this.val = (val == null || val.length == 0) ? this.dflt : val; };

        this.setValue(val);

        this.isValid = function(field)
        {
            this.val = ""; //??????????????????

            var value = getFieldValue(field);
            if(value == null) return true; //???????????????

            value = trimmed(value);

            var varLen = getByteLength(value) // ÇÑ±Û byte_lengthÃ³¸®.
            if (varLen == 0) {
                if((this.flags & NONNULL) != 0) {
                    alert(field.alt + " ÇÊµå´Â ÇÊ¼ö ÀÔ·Â »çÇ×ÀÔ´Ï´Ù.");
                    field.focus();
                    return false;
                }
            } else if (varLen > this.len) {
                alert(field.alt + " ÇÊµå¿¡´Â ÇÑ±Û " + this.len/2 + "ÀÚ¸®, ¿µ¹®/¼ýÀÚ " + this.len+ "ÀÚ¸®ÀÇ ¹®ÀÚ¸¸ Çã¿ëµË´Ï´Ù.");
                field.focus();
                return false;
            } else if( /,/.test(value) ) {
                alert(field.alt + " ÇÊµå¿¡´Â ',' °¡ ¿Ã ¼ö ¾ø½À´Ï´Ù.");
                field.focus();
                return false;
            }

            this.setValue(value);
            return true;
        }

        this.initField = function( field )
        {
        	setFieldValue( field, this.val );
        }
    }

    function Radio(flags, dflt, val)
    {
        this.flags = flags;
        this.dflt = dflt;

        this.setValue = function(val) { this.val = (val == null || val.length == 0) ? this.dflt : val; };

        this.setValue(val);

        this.isValid = function(field)
        {
			for (var i = 0; i < field.length; i++) {
				if (field[i].checked) {
					this.val = field[i].value;
				}
			}

            return true;
        }

        this.initField = function( field )
        {
			for (var i = 0; i < field.length; i++) {
				if (this.val == field[i].value) {
					field[i].checked = true;
				}
			}
        }
    }

    function Checkbox(flags, dflt, val)
    {
        this.flags = flags;
        this.dflt = dflt;
        this.val = (val == null || val.length == 0) ? dflt : val;

        this.setValue = function(val) { this.val = (val == null || val.length == 0) ? this.dflt : val; };

        this.isValid = function(field)
        {
            if (field.checked)
                this.val = 1;
            else
                this.val = 0;

            return true;
        }

        this.initField = function( field )
        {
        	setFieldValue( field, (this.val == 1) );
        }
    }

    function Lvarchar(flags, dflt, val)
    {
        this.flags = flags;
        this.dflt = dflt;

        this.setValue = function(val) { this.val = (val == null || val.length == 0) ? this.dflt : val; };

        this.setValue(val);

        this.isValid = function(field)
        {
            this.val = ""; //??????????????????

            var value = getFieldValue(field);
            if(value == null) return true; //???????????????

            value = trimmed(value);
            if(value.length == 0) {
                if((this.flags & NONNULL) != 0) {
                    alert(field.alt + " ÇÊµå´Â ÇÊ¼ö ÀÔ·Â »çÇ×ÀÔ´Ï´Ù.");
                    field.focus();
                    return false;
                }
            }

            this.setValue(value);
            return true;
        };

        this.initField = function( field )
        {
        	setFieldValue( field, this.val );
        }
    }

    function Directory(flags, dflt, len, val)
    {
        this.flags = flags;
        this.dflt = dflt;
        this.dir = new Varchar( flags, dflt, len, val )

        this.setValue = function(val) { this.dir.setValue(val); this.val = this.dir.val; };

        this.setValue(val);

        this.isValid = function(field)
        {
        	if ( !this.dir.isValid(field) ) {
        	    return false;
        	} else if ( !(/^[\/\\]?[a-zA-Z_\/\\][a-zA-Z0-9_\/\\:]*$/.test(this.dir.val)) ) {
                alert(field.alt + " ÇÊµå¿¡´Â ¾ËÆÄºª°ú ¼ýÀÚ¸¸ ¿Ã ¼ö ÀÖ½À´Ï´Ù.");
                field.focus();
                return false;
        	}

            this.val = this.dir.val;
            return true;
        };

        this.initField = function( field )  { this.dir.initField( field ); }
    }


    function Integer(flags, dflt, len, val, min, max)
    {
        this.flags = flags;
        this.dflt = dflt;
        this.len = len;
        this.min = min;
        this.max = max;

        this.setValue = function(val) { this.val = (val == null || val.length == 0) ? this.dflt : val; };

        this.setValue(val);

        this.isValid = function(field)
        {
            this.val = ""; //??????????????????

            var value = getFieldValue(field);
            if(value == null) return true; //???????????????

            value = trimmed(value);
            if(value.length == 0) {
                if((this.flags & NONNULL) != 0) {
                    alert(field.alt + " ÇÊµå´Â ÇÊ¼ö ÀÔ·Â »çÇ×ÀÔ´Ï´Ù.");
                    field.focus();
                    return false;
                }
            } else if(value.length > this.len) {
                alert(field.alt + " ÇÊµå¿¡´Â " + this.len + "ÀÚ¸®±îÁöÀÇ ¼ýÀÚ¸¸ Çã¿ëµË´Ï´Ù.");
                field.focus();
                return false;
            } else if(!(/^\d+$/.test(value))) {
                alert(field.alt + " ÇÊµå¿¡´Â ¼ýÀÚ°ª¸¸ ¿Ã ¼ö ÀÖ½À´Ï´Ù.");
                field.focus();
                return false;
            } else if(this.min != null && value < this.min) {
                alert(field.alt + " ÇÊµå¿¡´Â " + this.min + " ÀÌ»óÀÇ °ª¸¸ Çã¿ëµË´Ï´Ù.");
                field.focus();
                return false;
            } else if(this.max != null && value > this.max) {
                alert(field.alt + " ÇÊµå¿¡´Â " + this.max + " ÀÌÇÏÀÇ °ª¸¸ Çã¿ëµË´Ï´Ù.");
                field.focus();
                return false;
            }

            this.setValue(value);
            return true;
        }

        this.initField = function( field )
        {
        	setFieldValue( field, this.val );
        }
    }

    function Numeric(flags, dflt, intval, dec, val)
    {
        this.flags = flags;
        this.dflt = dflt;
        this.intval = intval - dec;
        this.dec = dec;

        this.setValue = function(val) { this.val = (val == null || val.length == 0) ? this.dflt : val; };

        this.setValue(val);

        this.isValid = function(field)
        {
            this.val = ""; //??????????????????

            var value = getFieldValue(field);
            if(value == null) return true; //???????????????

            value = trimmed(value);
            if(value.length == 0) {
                if((this.flags & NONNULL) != 0) {
                    alert(field.alt + " ÇÊµå´Â ÇÊ¼ö ÀÔ·Â »çÇ×ÀÔ´Ï´Ù.");
                    field.focus();
                    return false;
                }
            } else if(value.length > this.len) {
                alert(field.alt + " ÇÊµå¿¡´Â " + this.len + "ÀÚ¸®±îÁöÀÇ ¼ýÀÚ¸¸ Çã¿ëµË´Ï´Ù.");
                field.focus();
                return false;
            } else if(!(new RegExp("^\\d{0," + this.intval + "}\\.?\\d{0," + this.dec + "}$")).test(value)) {
                alert(field.alt + " ÇÊµå¿¡´Â ¼Ò¼ýÁ¡ À§ " + this.intval + "ÀÚ¸®, ¼Ò¼ýÁ¡ ¾Æ·¡ " + this.dec + "ÀÚ¸®±îÁöÀÇ ½Ç¼ö°ª¸¸ ¿Ã ¼ö ÀÖ½À´Ï´Ù.");
                field.focus();
                return false;
            }

            this.setValue(value);
            return true;
        }

        this.initField = function( field )
        {
        	setFieldValue( field, this.val );
        }
    }

    function Numeric(flags, dflt, intval, dec, val, len)
    {
        this.flags = flags;
        this.dflt = dflt;
        this.intval = intval - dec;
        this.dec = dec;
        this.len = len;
        this.decInt = val.substring(0, ( val.lastIndexOf('.') == -1 ? val.length : val.lastIndexOf('.') ) ).length;

        this.setValue = function(val) { this.val = (val == null || val.length == 0) ? this.dflt : val; };

        this.setValue(val);

        this.isValid = function(field)
        {
            this.val = ""; //??????????????????


            var value = getFieldValue(field);
            if(value == null) return true; //???????????????

            value = trimmed(value);
            if(value.length == 0) {
                if((this.flags & NONNULL) != 0) {
                    alert(field.alt + " ÇÊµå´Â ÇÊ¼ö ÀÔ·Â »çÇ×ÀÔ´Ï´Ù.");
                    field.focus();
                    return false;
                }
            } else if(this.decInt > this.len) {
                alert(field.alt + " ÇÊµå¿¡´Â ¼Ò¼ýÁ¡ À§ " + this.intval + "ÀÚ¸®, ¼Ò¼ýÁ¡ ¾Æ·¡ " + this.dec + "ÀÚ¸®±îÁöÀÇ ½Ç¼ö°ª¸¸ ¿Ã ¼ö ÀÖ½À´Ï´Ù.");
                field.focus();
                return false;
            } else if(!(new RegExp("^\\d{0," + this.intval + "}\\.?\\d{0," + this.dec + "}$")).test(value)) {
                alert(field.alt + " ÇÊµå¿¡´Â ¼Ò¼ýÁ¡ À§ " + this.intval + "ÀÚ¸®, ¼Ò¼ýÁ¡ ¾Æ·¡ " + this.dec + "ÀÚ¸®±îÁöÀÇ ½Ç¼ö°ª¸¸ ¿Ã ¼ö ÀÖ½À´Ï´Ù.");
                field.focus();
                return false;
            }

            this.setValue(value);
            return true;
        }

        this.initField = function( field )
        {
        	setFieldValue( field, this.val );
        }
    }

    function Password( flags, dflt, len, val )
    {
        this.flags = flags;
        this.dflt = dflt;
        this.len = len;
        this.val = (val == null || val.length == "") ? dflt : val;

        this.setValue = function(val) { this.val = (val == null || val.length == 0) ? this.dflt : val; };

        this.isValid = function( field )
        {
            this.val = ""; //??????????????????

            var value = getFieldValue(field);
            if(value == null) return true; //???????????????

            value = trimmed(value);

            var varLen = getByteLength(value) // ÇÑ±Û byte_lengthÃ³¸®.
            if(varLen == 0) {
                if((this.flags & NONNULL) != 0) {
                    alert(field.alt + " ÇÊµå´Â ÇÊ¼ö ÀÔ·Â »çÇ×ÀÔ´Ï´Ù.");
                    field.focus();
                    return false;
                }
            } else if(varLen > this.len) {
                alert(field.alt + " ÇÊµå¿¡´Â ÇÑ±Û " + this.len/2 + "ÀÚ¸®, ¿µ¹®/¼ýÀÚ " + this.len+ "ÀÚ¸®ÀÇ ¹®ÀÚ¸¸ Çã¿ëµË´Ï´Ù.");
                field.focus();
                return false;
            }

            if ( (this.flags & CONFIRM) != 0 && field.form[field.name + "Confirm"].value != field.value ) {
                alert("ÆÐ½º¿öµå°¡ Á¤È®ÇÏÁö ¾Ê½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇÏ½Ê½Ã¿À.");
                //focus(field.form[this.confirmFieldName]);//this.confirmFieldName
                field.form[field.name + "Confirm"].focus();
                return false;
            }

            this.val = value;
            return true;
        }

        this.initField = function( field )
        {
        	setFieldValue( field, this.val );
        }
    }

    function Zipcode( flags, dflt, val )
    {
        this.flags = flags;
        this.dflt = dflt;
        if (val == null) {
        	  val = dflt;
	        this.zipCd1 = new Varchar( flags, "", 3, dflt.substring(0, 3));
	        this.zipCd2 = new Varchar( flags, "", 3, dflt.substring(3));
	  	  this.val = dflt;
        } else {
	        this.zipCd1 = new Varchar( flags, "", 3, val.substring(0, 3));
	        this.zipCd2 = new Varchar( flags, "", 3, val.substring(3));
        	  this.val = this.zipCd1.val + this.zipCd2.val;
        }

        this.setValue = function( val )
        {
        	if (val != null && val.length != 0) {
	        	this.zipCd1.setValue( val.substring(0, 3) );
	        	this.zipCd2.setValue( val.substring(3) );
	        	this.value = this.zipCd1.val + this.zipCd2.val;
	      } else {
			this.zipCd1.setValue( "" );
			this.zipCd2.setValue( "" );
	      	this.value = "";
	      }
        }

        this.isValid = function(field)
        {
            if (!this.zipCd1.isValid( field ) ||
                !this.zipCd2.isValid( field.form[field.name + "2"] ) )
            {
            	return false;
            }

            this.val = this.zipCd1.val + this.zipCd2.val;
            return true;
        }

        this.initField = function( field )
        {
        	setFieldValue( field, this.zipCd1.val );
        	setFieldValue( field.form[field.name + "2"], this.zipCd2.val );
        }
    }

    function Telephone( flags, dflt, val )
    {
        this.flags = flags;
        this.dflt = dflt;
        if (val != null) {
            var h1 = val.indexOf("-");
            this.telNo1 = new Varchar( flags, "", 4, val.substring(0, h1));
            var h2 = val.indexOf("-", h1 + 1);
            this.telNo2 = new Varchar( flags, "", 4, val.substring(h1 + 1, h2));
            var h3 = val.indexOf("-", h2 + 1);
            this.telNo3 = new Varchar( flags, "", 4, val.substring(h2 + 1));
            this.val = this.telNo1.val + "-" + this.telNo2.val + "-" + this.telNo3.val;
        } else {
            var h1 = dflt.indexOf("-");
            this.telNo1 = new Varchar( flags, "", 4, dflt.substring(0, h1));
            var h2 = dflt.indexOf("-", h1 + 1);
            this.telNo2 = new Varchar( flags, "", 4, dflt.substring(h1 + 1, h2));
            var h3 = dflt.indexOf("-", h2 + 1);
            this.telNo3 = new Varchar( flags, "", 4, dflt.substring(h2 + 1));
            val = dflt;
       }


        this.setValue = function ( val )
        {
		if (val != null && val.length != 0) {
	            var h1 = val.indexOf("-");
	            this.telNo1.setValue( val.substring(0, h1) );
	            var h2 = val.indexOf("-", h1 + 1);
	            this.telNo2.setValue( val.substring(h1 + 1, h2) );
	            var h3 = val.indexOf("-", h2 + 1);
	            this.telNo3.setValue( val.substring(h2 + 1) );

	            this.val = this.telNo1.val + "-" + this.telNo2.val + "-" + this.telNo3.val;
	       } else {
	       	this.val = "";
	       	this.telNo1.setValue( "" );
	       	this.telNo2.setValue( "" );
	       	this.telNo3.setValue( "" );
	       }
        }

        this.isValid = function(field)
        {
            if (!this.telNo1.isValid( field ) ||
                !this.telNo2.isValid( field.form[field.name + "2"] ) ||
                !this.telNo3.isValid( field.form[field.name + "3"] ) )
            {
            	return false;
            }

            this.val = this.telNo1.val + "-" + this.telNo2.val + "-" + this.telNo3.val;
            return true;
        }

        this.initField = function( field )
        {
        	setFieldValue( field, this.telNo1.val );
        	setFieldValue( field.form[field.name + "2"], this.telNo2.val );
        	setFieldValue( field.form[field.name + "3"], this.telNo3.val );
        }
    }

    // naming : if telNo is field name, second is telNo2.
    // each length is 4. each item linked with '-'
    function Telephone1( flags, dflt, val )
    {
        this.flags = flags;
        this.dflt = dflt;
        if (val != null) {
            var h1 = val.indexOf("-");
            this.telNo1 = new Varchar( flags, "", 4, val.substring(0, h1));
            var h2 = val.indexOf("-", h1 + 1);
            this.telNo2 = new Varchar( flags, "", 4, val.substring(h1 + 1, h2));
            var h3 = val.indexOf("-", h2 + 1);
            this.telNo3 = new Varchar( flags, "", 4, val.substring(h2 + 1, h3));
            var h4 = val.indexOf("-", h3 + 1);
            this.telNo4 = new Varchar( flags, "", 4, val.substring(h3 + 1));
            this.val = this.telNo1.val + "-" + this.telNo2.val + "-" + this.telNo3.val + "-" + this.telNo4.val;
        } else {
            var h1 = dflt.indexOf("-");
            this.telNo1 = new Varchar( flags, "", 4, dflt.substring(0, h1));
            var h2 = dflt.indexOf("-", h1 + 1);
            this.telNo2 = new Varchar( flags, "", 4, dflt.substring(h1 + 1, h2));
            var h3 = dflt.indexOf("-", h2 + 1);
            this.telNo3 = new Varchar( flags, "", 4, dflt.substring(h2 + 1, h3));
            var h4 = dflt.indexOf("-", h3 + 1);
            this.telNo4 = new Varchar( flags, "", 4, dflt.substring(h3 + 1));
            val = dflt;
       }

        this.setValue = function ( val )
        {
		if (val != null && val.length != 0) {
	            var h1 = val.indexOf("-");
	            this.telNo1.setValue( val.substring(0, h1) );
	            var h2 = val.indexOf("-", h1 + 1);
	            this.telNo2.setValue( val.substring(h1 + 1, h2) );
	            var h3 = val.indexOf("-", h2 + 1);
	            this.telNo3.setValue( val.substring(h2 + 1, h3) );
	            var h4 = val.indexOf("-", h3 + 1);
	            this.telNo4.setValue( val.substring(h3 + 1) );

	            this.val = this.telNo1.val + "-" + this.telNo2.val + "-" + this.telNo3.val + "-" + this.telNo4.val;
	      } else {
	      	this.telNo1.setValue( "" );
	      	this.telNo2.setValue( "" );
	      	this.telNo3.setValue( "" );
	      	this.telNo4.setValue( "" );
	      	this.val = "";
	      }
        }

        this.isValid = function(field)
        {
            if (!this.telNo1.isValid( field ) ||
                !this.telNo2.isValid( field.form[field.name + "2"] ) ||
                !this.telNo3.isValid( field.form[field.name + "3"] ) ||
                !this.telNo4.isValid( field.form[field.name + "4"] ) )
            {
            	return false;
            }

            this.val = this.telNo1.val + "-" + this.telNo2.val + "-" + this.telNo3.val + "-" + this.telNo4.val;
            return true;
        }

        this.initField = function( field )
        {
        	setFieldValue( field, this.telNo1.val );
        	setFieldValue( field.form[field.name + "2"], this.telNo2.val );
        	setFieldValue( field.form[field.name + "3"], this.telNo3.val );
        	setFieldValue( field.form[field.name + "4"], this.telNo4.val );
        }
    }

    // naming : if dateDt is first field(year), second is dateDt2(month), third is dateDt3(day)
    // year is 4 character, month and day is 2
    function Datetype( flags, dflt, val )
    {
        this.flags = flags;
        this.dflt = dflt;
        if (val != null ) {
	        this.date1 = new Integer( flags, "", 4, val.substring(0, 4), 0, 3000);
	        this.date2 = new Integer( flags, "", 2, val.substring(4, 6), 1, 12);
	        this.date3 = new Integer( flags, "", 2, val.substring(6, 8), 1, 31);
        	  this.val = this.date1.val + this.date2.val + this.date3.val;
	  } else {
	        this.date1 = new Integer( flags, "", 4, dflt.substring(0, 4), 0, 3000);
	        this.date2 = new Integer( flags, "", 2, dflt.substring(4, 6), 1, 12);
	        this.date3 = new Integer( flags, "", 2, dflt.substring(6, 8), 1, 31);
	        this.val = dflt;
	  }

        this.setValue = function ( val )
        {
		if (val != null && val.length != 0) {
	        	this.date1.setValue( val.substring(0, 4) );
	        	this.date2.setValue( val.substring(4, 6) );
	        	this.date3.setValue( val.substring(6, 8) );

	        	this.val = this.date1.val + this.date2.val + this.date3.val;
	      } else {
	      	this.date1.setValue( "" );
	      	this.date2.setValue( "" );
	      	this.date3.setValue( "" );
	      	this.val = "";
	      }
        }

        this.isValid = function(field)
        {
            if (!this.date1.isValid( field ) ||
                !this.date2.isValid( field.form[field.name + "2"] ) ||
                !this.date3.isValid( field.form[field.name + "3"] ) )
            {
            	return false;
            }

            if (this.date2.val.length == 1) { this.date2.val = "0" + this.date2.val; }
            if (this.date3.val.length == 1) { this.date3.val = "0" + this.date3.val; }

            this.val = this.date1.val + this.date2.val + this.date3.val;
            return true;
        }

        this.initField = function( field )
        {
        	this.date1.initField( field );
        	this.date2.initField( field.form[field.name + "2"] );
        	this.date3.initField( field.form[field.name + "3"] );
        }
    }

    function DateTime( flags, dflt, val )
    {
        this.flags = flags;
        this.dflt = dflt;
	  if ( val != null && val.length != 0) {
	        this.date = new Datetype( flags, "", val.substring(0, 8));
	        this.time = new Integer( flags, "", 2, val.substring(8, 10), 0, 24);
	        this.minute = new Integer( flags, "", 2, val.substring(10, 12), 0, 59);
	        this.val = this.date.val + this.time.val + this.minute.val + "00";
	  } else {
	        this.date = new Datetype( flags, "", dflt.substring(0, 8));
	        this.time = new Integer( flags, "", 2, dflt.substring(8, 10), 0, 24);
	        this.minute = new Integer( flags, "", 2, val.substring(10, 12), 0, 59);
	  	  	this.val = dflt;
	  }
        this.setValue = function ( val )
        {
	      if ( val != null  && val.length != 0) {
	        	this.date.setValue( val.substring(0, 8) );
	        	this.time.setValue( val.substring(8, 10) );
	        	this.minute.setValue( val.substring(10, 12) );
	        	this.val = this.date.val + this.time.val + this.minute.val + "00";
	      } else {
	      	this.date.setValue( "" );
	      	this.time.setValue( "" );
	      	this.minute.setValue( "" );
	      	this.val = "";
	      }
        }

        this.isValid = function(field)
        {
            if (!this.date.isValid( field ) || !this.time.isValid( field.form[field.name + "4"] )  || !this.minute.isValid( field.form[field.name + "5"] ))
            {
            	return false;
            }

            if (this.time.val.length == 1) { this.time.val = "0" + this.time.val; }
            if (this.minute.val.length == 1) { this.minute.val = "0" + this.time.val; }

		if ( (this.date.val != "") && (this.time.val != "") && (this.minute.val != "") ) {
            	this.val = this.date.val + this.time.val + this.minute.val + "00";
            } else {
            	this.val = "";
            }
            return true;
        }

        this.initField = function( field )
        {
			this.date.initField( field );
        	this.time.initField( field.form[field.name + "4"]);
        	this.minute.initField( field.form[field.name + "5"]);
        }
    }

    function Url(flags, dflt, len, val)
    {
        this.flags = flags;
        this.dflt = dflt;
        this.len = len;
        this.val = (val == null || val.length == 0) ? dflt : val;

        this.setValue = function(val) { this.val = (val == null || val.length == 0) ? this.dflt : val; };

        this.isValid = function(field)
        {
            this.val = ""; //??????????????????

            var value = getFieldValue(field);
            if(value == null) return true; //???????????????

            value = trimmed(value);

            var varLen = getByteLength(value) // ÇÑ±Û byte_lengthÃ³¸®.
            if(varLen == 0 || value == this.dflt) {
                if((this.flags & NONNULL) != 0) {
                    alert(field.alt + " ÇÊµå´Â ÇÊ¼ö ÀÔ·Â »çÇ×ÀÔ´Ï´Ù.");
                    field.focus();
                    return false;
                }
            } else if(varLen > this.len) {
                alert(field.alt + " ÇÊµå¿¡´Â ÇÑ±Û " + this.len/2 + "ÀÚ¸®, ¿µ¹®/¼ýÀÚ " + this.len+ "ÀÚ¸®ÀÇ ¹®ÀÚ¸¸ Çã¿ëµË´Ï´Ù.");
                field.focus();
                return false;
            }

            this.val = value;
            return true;
        }

        this.initField = function( field )
        {
        	setFieldValue( field, this.val );
        }
    }

    function isValid(obj)
    {
        var form = obj.form;
        var fields = obj.fields, field, fieldName, attr;
        for(var i = 0; i < fields.length; i++) {
        	fieldName = fields[i];
            field = form[fieldName];
            if(field == null || field.disabled) continue;
            attr = obj[fieldName];
            if(!attr.isValid(field)) return false;
        }
        return true;
    }

    function trimmed(value)
    {
        value = value.replace(/^\s+/, "");  // remove leading white spaces
        return  value.replace(/\s+$/g, ""); // remove trailing while spaces
    }

    function getFieldValue(field)
    {
        if(field == null) return null;

        if(field.type == "checkbox" || field.type == "radio") {
            return field.checked ? field.value : null;
        } else if(field.type == "text" || field.type == "password" || field.type == "textarea" || field.type == "hidden") {
            return field.value;
        } else if(field.type.indexOf("select") != -1) {
            var i = field.selectedIndex;
            return i == -1 ? null : field.options[i].value;
        }
    }

    function setFieldValue(field, v)
    {
        if(field == null) return;

        if(field.type == "checkbox" || field.type == "radio") {
            field.checked = field.value = v;
        } else if(field.type == "text" || field.type == "password" || field.type == "textarea" || field.type == "hidden") {
            field.value = v;
        } else if(field.type.indexOf("select") != -1) {
            for(var i = 0; i < field.options.length; i++)
                if(field.options[i].value == v) field.selectedIndex = i;
        }
    }

    function isDubleChk(obj, field)
	{
		var aa = 0;
		for(var  k=0 ; k < obj.length ; k++){
			if( trimmed(field.value) == trimmed(obj[k].value) ) {
				aa++;
				if(aa >1){
					 alert(field.alt + "´Â Áßº¹ ÀÔ·ÂÇÏ½Ç¼ö ¾ø½À´Ï´Ù.");
					 //if(field.type == "hidden")
					 //else field.focus();
					 obj[k].focus();
				 	return false;
				}
			}
		}
		return true;
	}
	// º¸Çè¸ô ¼Ò°³ ¹× ÀÌ¿ë¾È³»
	function funGoGuide() {
		window.location = "./insu_item_guide.jsp";
	}

	// µ¿¿µ»ó 100% È°¿ëÇÏ±â
	function funGoMovie() {
		window.location = "./insu_item_movie.jsp";
	}

	function getDictionary() {
		var width = 526;
		var height = 474;
/*
		if (ie7Check){
			width += 4;
			height += 24;
		}
*/
		MM_openBrWindow('DIC_INSU_ga.jsp','info','width='+width+',height='+height);
	}

	function getMailContact() {
		var width = 526;
		var height = 474;
/*
		if (ie7Check){
			width += 4;
			height += 24;
		}
*/
		openLogin('/shop/insu/pop_Email_Input.jsp', document.FRM_BODY, '3', width, height, 'no');
	}

// °øÁö»çÇ× ÆË¾÷À¸·Î ÀÌµ¿ÇÏ±â
	var noticeWin;
	function funViewNotice(seq_no, gbn){
		var width = 500;
		var height = 494;
/*
		if (ie7Check){
			width += 4;
			height += 24;
		}
*/

		if(noticeWin != '[object]'){
			noticeWin = window.open("POP_NOTICE_view.jsp?seq_no="+seq_no+"&NOTICE_GBN="+gbn,"pop","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+width+",height="+height+",top=" + ((screen.availHeight - 600) / 2) + ",left=" + ((screen.availWidth -600)/ 2));
		}else{
			noticeWin.close();
			noticeWin = window.open("POP_NOTICE_view.jsp?seq_no="+seq_no+"&NOTICE_GBN="+gbn,"pop","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+width+",height="+height+",top=" + ((screen.availHeight - 600) / 2) + ",left=" + ((screen.availWidth -600)/ 2));
		}
	}

	function funViewSaveNotice() {
		// Àû¸³±Ý °øÁö Hard Coding
		var width = 750;
		var height = 635;
/*
		if (ie7Check){
			width += 4;
			height += 24;
		}
*/
		if(noticeWin != '[object]'){
			noticeWin = window.open("saveNotice.jsp","pop","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+width+",height="+height+",top=" + ((screen.availHeight - 600) / 2) + ",left=" + ((screen.availWidth -600)/ 2));
		}else{
			noticeWin.close();
			noticeWin = window.open("saveNotice.jsp","pop","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+width+",height="+height+",top=" + ((screen.availHeight - 600) / 2) + ",left=" + ((screen.availWidth -600)/ 2));
		}
	}

	function funGoMoreNotice(gbn) {
		var width = 500;
		var height = 494;
/*
		if (ie7Check){
			width += 4;
			height += 24;
		}
*/

		noticeWin = window.open("POP_NOTICE_list.jsp?NOTICE_GBN="+gbn,"pop","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+width+",height="+height+",top=" + ((screen.availHeight - 600) / 2) + ",left=" + ((screen.availWidth -600)/ 2));
	}

	/*************************************
	 * º¸Çè»ç ·Î°í Å¬¸¯½ÃÀÇ ÀÌµ¿°æ·Î ( »óÇ°°Ë»öÆäÀÌÁöÀÇ º¸Çè»ç »óÇ°¸ñ·Ï À¸·Î )
	 *************************************/
	function goPItemlist(partner_code, categ_code) {
		window.location.href = "insu_item_search.jsp?PARTNER_CODE="+partner_code+"&CATEG_CODE="+categ_code;
	}

