<!--

//ÇÑ±Û¹× Æ¯¼ö¹®ÀÚ Ã¼Å©
function checkstr(val){
	var len = val.length;

	if (len >= 4 && len <= 15) {
		for(i=0;i<len;i++){
			var code = val.charCodeAt(i);
			var str = val.substr(i,1).toUpperCase();

			code = parseInt(code);
			if((str < "0" || str > "9") && (str < "A" || str > "Z") && (str < "a" || str > "z")){
				return false;
			}
		}
	}
	return true;
}

//¹®ÀÚ±æÀÌÃ¼Å© - ³×ÀÌ¹öºí·Î±×
function CheckLen(name)
{
	var temp;
	var count;
	count = 0;
	len = name.value.length;
	for(k=0;k<len;k++){
		temp = name.value.charAt(k);
		if(escape(temp).length > 4)
			count += 2;
		else
			count++;
	}
	
	if(count>70){
		alert("Æ÷½ºÆ® Á¦¸ñÀº ÇÑ±Û35(¿µ¹®70)ÀÚ ±îÁö °¡´ÉÇÕ´Ï´Ù.");
		name.value = name.value.substring(0,name.value.length-1);
	    name.focus();
	    return 0;
	}
  
  return 1;

}


//¹®ÀÚ±æÀÌ ¹× Æ¯¼ö¹®ÀÚ »ç¿ëºÒ°¡
function bytelength(fe,bstr,mx) 
{
	len = bstr.length;
	for (ii=0; ii<bstr.length; ii++){
		xx = bstr.substr(ii,1).charCodeAt(0);
		if (xx > 127) { len++; }
	}

	// Å¬°æ¿ì ¸Þ½ÃÁö »Ñ¸®±â
	if (mx < len){
		alert('ÀÔ·ÂÇÑ ±ÛÀÌ ±æ¾î¼­ Àß¸±¼ö ÀÖ½À´Ï´Ù.\n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.\nÀÔ·Â±Û¼ö :'+ len);
		fe.focus();
		fe.select();
	}

	if(bstr.indexOf("'")!= -1 || bstr.indexOf("\"")!= -1) {
		alert(" '³ª \"µî µû¿ÈÇ¥¸¦ »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
		fe.focus();
		fe.select();
	}

	if(bstr.indexOf("\&")!= -1) {		
		alert(" \&¸¦ »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
		fe.focus();
		fe.select();
	}

	return len;
}

//Æ¯¼ö¹®ÀÚ »ç¿ëºÒ°¡
function check_grammar(fe,bstr) 
{
	if(bstr.indexOf("'")!= -1 || bstr.indexOf("\"")!= -1) {
		alert(" '³ª \"µî µû¿ÈÇ¥¸¦ »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
		fe.focus();
		fe.select();
	}

	if(bstr.indexOf("\&")!= -1) {		
		alert(" \&¸¦ »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
		fe.focus();
		fe.select();
	}
}

// ÆÄÀÏ¾÷·Îµå ¸·±â
extArray = new Array(".gif", ".jpg", ".png");
function LimitAttach(form, file) {
	
	allowSubmit = false;

	if (!file) return;
	
	while (file.indexOf("\\") != -1)
		file = file.slice(file.indexOf("\\") + 1);
		ext = file.slice(file.indexOf(".")).toLowerCase();
	
	for (var i = 0; i < extArray.length; i++) {
		if (extArray[i] == ext) { allowSubmit = true; break; }
	}

	if (allowSubmit) form.submit();
	else
	alert("¾Æ·¡ ÇüÅÂÀÇ ÆÄÀÏ¸¸ ¾÷·Îµå ÇÒ ¼ö ÀÖ½À´Ï´Ù:  " 
	+ (extArray.join("  ")) + "\n´Ù½Ã ¼±ÅÃ ÇØ ÁÖ¼¼¿ä");
}

//¾÷·Îµå ÆÄÀÏ À¯Çü Ã¼Å©
var regExt =/(\.[^\.]*$)/;
function fileExtCheck(imgaesStr) {
	allowSubmit = false;
	fileStr = imgaesStr;	
	filename = fileStr.replace(regExt, "");	
	strExt = fileStr.replace(filename,"");	
	//alert(strExt);
	if (strExt == ".jpg" || strExt == ".JPG" || strExt == ".gif" || strExt == ".GIF") {
		allowSubmit = true;
		//alert("CheckOK");
	}
	else {
		allowSubmit = false;
		//alert("¼±ÅÃÇÏ½Å ÆÄÀÏÀº ¿Ã¸±¼ö¾ø½À´Ï´Ù..");
	}
	return allowSubmit;
}



//-->