<!-- Begin to hide script contents from old browsers.
function alertfocus( control, message ) { 
    alert( message );
    if( FOCUSABLE ) control.focus();
}

function isNothing( formName ) {
    var thisvalue = formName.value;
    if( thisvalue.length == 0 ) {
        alert( "º» ³»¿ë¿¡´Â ¹Ýµå½Ã °ªÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù." );
        if( FOCUSABLE ) formName.focus();
        return( true ); 
    }
    spacecount = 0;
    for( var i = 0; i < thisvalue.length; i++ ) {
        thischar = thisvalue.charAt( i );
        if( thischar == ' ' ) spacecount++;
    }
    if( spacecount == thisvalue.length ) {
	    alert( "º» ³»¿ë¿¡´Â ¹Ýµå½Ã °ªÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù." );
        if( FOCUSABLE ) formName.focus();
	    return( true ); 
	}
	return( false );
}

function isEqual( formName1, formName2 ) {
    return( formName1.value == formName2.value );
}

function isZero( formName ) { 
    if( formName.value.length == 0 || parseInt(formName.value, 10) == 0 ) { 
        alert( "º» ³»¿ë¿¡´Â ¹Ýµå½Ã °ªÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù." );
        if( FOCUSABLE ) formName.focus();
        return( true ); 
    } else {
        return( false ); 
    }
}

function onlyEng( formName ) {
	var inText = formName.value;
	var ret;
	for (var i = 0; i < inText.length; i++) {
		ret = inText.charCodeAt(i);
		if ((ret > 122) || (ret < 48) || (ret > 57 && ret < 65) || (ret > 90 && ret < 97)) {
			alert("¿µ¹®ÀÚ¿Í ¼ýÀÚ¸¸À» ÀÔ·ÂÇÏ¼¼¿ä");
			if( FOCUSABLE) formName.focus();
			return( true );
		}
	}
	return( false ) ;
}

function isNumeric( formName ) {
    var charDetected = 0, markDetected = 0, dotCount = 0;
    var numeric = formName.value;
    if( numeric == null || numeric == "" || numeric.length == 0 ) {
		if( FOCUSABLE ) formName.focus();
        return( false );
    }
    for( var i = 0; i < numeric.length; i++ ) {
      thischar = numeric.charAt( i );
      if( !((thischar >= '0') && (thischar <= '9')) ) {
		if( FOCUSABLE ) formName.focus();
        return( false );
        }
    } //end of for
    return( true );
}

function isValidNumeric( formName, minimum, maximum ) {
    var numeric = formName.value;
    if( isNumeric( formName ) == false ) {
        alert( "º» ³»¿ë¿¡´Â ¹Ýµå½Ã ¼öÄ¡·Î µÈ °ªÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù." );
        return( false );
    }
    var quantity = parseInt( numeric, 10 );
    if( minimum == -1 || maximum == -1 ) //range not defined
        return( true );
    if( (quantity < minimum) || (quantity > maximum) ) {
        alert( "Value must be in a range (" + minimum + ") to (" + maximum + "), Please reenter!" );
        return( false );
    }
    return( true );
}

function getExactCount( formName ) {
    var thisvalue = formName.value;
    var byte1count = 0, byte2count = 0;
    var specialset = " `~!@#$%^&*()_+|\\=-[]{};':\",./<>?";
    for( var i = 0; i < thisvalue.length; i++ ) {
        thischar = thisvalue.charAt( i );
        if( ((thischar >= '0') && (thischar <= '9')) ||
            ((thischar >= 'A') && (thischar <= 'Z')) ||
            ((thischar >= 'a') && (thischar <= 'z')) ||
            ((thischar == '-') || (thischar == '_')) )
            byte1count++;
        else if( thischar == '(' || thischar == ')' ) {
        	byte1count++;
        	//byte1count++;
        }
        else if( specialset.indexOf(thischar) != -1 )
            byte1count++;
        else
            byte2count++;
    }
    return( byte1count + byte2count * 2 );
}

function isValidID( formName, minimum, maximum ) {
    var thisvalue = formName.value;
    if( thisvalue.length == 0 ) {
        alert( "º» ³»¿ëÀº À¯È¿ÇÑ °ªÀÌ ¹Ýµå½Ã ÀÖ¾î¾ß ÇÕ´Ï´Ù." );
        if( FOCUSABLE ) formName.focus();
        return( false ); 
    }
    var exactcount = 0;
    var specialset = " `~!@#$%^&*()_+|\\=-[]{};':\",./<>?";
    for( var i = 0; i < thisvalue.length; i++ ) {
        thischar = thisvalue.charAt( i );
        if( specialset.indexOf(thischar) != -1 ) {
	        alert( "º» ³»¿ë¿¡´Â Æ¯¼öÇÑ ¹®ÀÚ¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù." );
	        if( FOCUSABLE ) formName.focus();
	        return( false ); 
            }
    }
    exactcount = getExactCount( formName );
    if( minimum == -1 || maximum == -1 ) //range not defined
        return( true );
    if( (exactcount < minimum) || (exactcount > maximum) ) {
        alert( "ÃÖ¼Ò(" + minimum + ") ¿¡¼­ ÃÖ´ë(" + maximum + ") ÀÚ ÀÌ³»ÀÇ °ªÀ¸·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù. ÇÑ±Û ¶Ç´Â Æ¯¼ö¹®ÀÚ´Â ÇÏ³ª´ç 2ÀÚ·Î ÀÎ½ÄµË´Ï´Ù.");
		if( FOCUSABLE ) formName.focus();
        return( false );
    }
    return( true );
}


function isValidLength( formName, minimum, maximum ) {
    var thisvalue = formName.value;
    if( thisvalue.length == 0 ) {
        alert( "º» ³»¿ëÀº À¯È¿ÇÑ °ªÀÌ ¹Ýµå½Ã ÀÖ¾î¾ß ÇÕ´Ï´Ù." );
        if( FOCUSABLE ) formName.focus();
        return( false ); 
    }
	exactcount = getExactCount( formName );
    if( minimum == -1 || maximum == -1 ) //range not defined
        return( true );
    if( (exactcount < minimum) || (exactcount > maximum) ) {
        alert( "ÃÖ¼Ò(" + minimum + ") ¿¡¼­ ÃÖ´ë(" + maximum + ") ÀÚ ÀÌ³»ÀÇ °ªÀ¸·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù. ÇÑ±Û ¶Ç´Â Æ¯¼ö¹®ÀÚ´Â ÇÏ³ª´ç 2ÀÚ·Î ÀÎ½ÄµË´Ï´Ù.");
		if( FOCUSABLE ) formName.focus();
        return( false );
    }
    return( true );
}

function isLeapYear(yyyy){
    if( (yyyy % 400) == 0 ) return( true );
    if( (yyyy % 100) == 0 ) return( false );
    if( (yyyy % 4 ) == 0 ) return( true );
    return( false );
}

function isValidDate( birthyear, birthmon, birthday) {
    var yyyy = birthyear.value;
    var mm = birthmon.value;
    var dd = birthday.value;
    
    if( !isNumeric(birthyear) || yyyy < 1800) return(false);
    switch (mm){
    case "0" : return( false );
    case "1" : case "3" : case "5" : case "7" : case "8" :
    case "10": case "12": 
        if( dd > 0 && dd <= 31) return( true );
        return( false );
    case "4" : case "6" : case "9" : case "11":
        if( dd > 0 && dd <= 30 ) return( true );
        return( false );
    default : // February
        var LeapYearFlag = isLeapYear(yyyy);
        if( LeapYearFlag ){
            if( dd <= 29 && dd > 0 ) return( true );
            return( false );
        }
        if( dd <= 28 && dd > 0 ) return( true );
        return( false );
    }
}

function isValidBlob( formName, maxlength ) { 
	var exactcount = getExactCount( formName );
    if( exactcount > maxlength ) { 
        alert( "³»¿ëÀÌ ³Ê¹« Å©¹Ç·Î " + (exactcount-maxlength) + "ÀÚ ÀÌ»óÀ» ÁÙÀÌ½Å ÈÄ ´Ù½Ã ½ÃµµÇÏ½Ê½Ã¿À.");
        if( FOCUSABLE ) formName.focus();
        return( false ); 
    } else {
        return( true ); 
    }
}

function isEmail( formName ){
	var str = formName.value;
	if (str == "") {
		alert( "º» ³»¿ë¿¡´Â ¹Ýµå½Ã °ªÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù." );
		if( FOCUSABLE ) formName.focus();
		return( false );
	} else {
		if(str.indexOf('@') == -1) {
			alert("¿Ã¹Ù¸¥ e-mailÇü½ÄÀÌ ¾Æ´Õ´Ï´Ù.\r\n´Ù½ÃÀÔ·ÂÇÏ¼¼¿ä.")
			if( FOCUSABLE ) formName.focus();
			return( false );
		} else {	
			return( true );
		}
	}
}

function isSocial(id1, id2){
	var id, i, j, tot, totstr;
	  
	tot = 0;
	i = "234567892345";
   
	id = id1.value + id2.value;
      
	for (j = 0; j <= 11; j++)
	{
		tot = tot + parseInt(id.slice(j, j+1)) * parseInt(i.slice(j, j+1));
	}
	tot = 11 - (tot % 11);
	totstr = tot.toString(10);
	if( totstr.slice(totstr.length-1, totstr.length) != id.slice(id.length-1, id.length) ){
		alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ Æ²·È½À´Ï´Ù.\r\n´Ù½Ã È®ÀÎ ÇÏ¼¼¿ä. ");
		if( FOCUSABLE ) id1.focus();
		return( false );
	} else {
		return( true );
	}
}


function selectAll( form, buttonset ) {
	var singlecheck = 0;
    for( i = 0; i < buttonset.length; i++ ) {
        thisset = buttonset[i];
        thisset.checked = true;
        singlecheck++;
    }
    if( singlecheck == 0 ) { //if there is nothing checked, we should check through the form
		for( i = 0; i < form.length; i++ ) {
			if( form[i].type == "checkbox" )
				form[i].checked = true;
		}
	}
}

function deselectAll( form, buttonset ) {
	var singlecheck = 0;
    for( i = 0; i < buttonset.length; i++ ) {
        thisset = buttonset[i];
        thisset.checked = false;
        singlecheck++;
    }
    if( singlecheck == 0 ) { //if there is nothing checked, we should check through the form
		for( i = 0; i < form.length; i++ ) {
			if( form[i].type == "checkbox" )
				form[i].checked = false;
		}
	}
}

function reverseAll( form, buttonset ) {
	var singlecheck = 0;
    for( i = 0; i < buttonset.length; i++ ) {
        thisset = buttonset[i];
        if( thisset.checked ) thisset.checked = false;
        else thisset.checked = true;
        singlecheck++;
    }
    if( singlecheck == 0 ) { //if there is nothing checked, we should check through the form
		for( i = 0; i < form.length; i++ ) {
			if( form[i].type == "checkbox" )
				form[i].checked = !form[i].checked;
		}
	}
}

function getCheckedCount( form, buttonset ) {
    var checkedcount = 0, singlecheck = 0;
    for( i = 0; i < buttonset.length; i++ ) {
        thisset = buttonset[i];
        if( thisset.checked ) checkedcount++;
        singlecheck++;
    }
    if( singlecheck == 0 ) { //if there is nothing checked, we should check through the form
		for( i = 0; i < form.length; i++ ) {
			if( form[i].type == "checkbox" && form[i].checked == true )
				checkedcount++;
		}
	}
    return( checkedcount );
}

function getToggledString( buttonset ) {
    checkValue = "";
    for( i = 0; i < buttonset.length; i++ ) {
        thisSet = buttonset[i];
        if( thisSet.checked ) checkValue = thisSet.value;
    }
    return( checkValue );
}

function setToggledString( buttonset, button ) {
    toggledString = getToggledString(buttonset);
    button.value = "" + toggledString;
}

function isNullEnv( formName ) { 
    if( formName.value.length == 0 ) { 
        alert( "Operation must be done in the QUALIFIED WEB PAGE!" );
        return( true ); 
    } else {
        return( false ); 
    }
}

// This stops the javascript from hiding -->