
var clsJsHelper=function(){var obj,obj2;this.returns=true;this.checkSpace=function(val){for(var i=0;i<val.length;i++){if(val.charAt(i)==' '){window.alert('°ø¹éÀº ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.');return false;}}
return true;};this.checkNull=function(val,msg){if(val.indexOf(" ")==0)
{window.alert('°ø¹éÀ¸·Î ½ÃÀÛÇÒ¼ö ¾ø½À´Ï´Ù.');return false;}
var tmp_val=val.replace(/^\s+|\s+$/g,"");if(tmp_val==""){window.alert(msg);return false;}
return true;};this.checkLen=function(objName,nlen,mlen){obj=document.getElementById(objName);var this_length=0;for(var i=0;i<obj.value.length;i++){var tmp=obj.value.charAt(i);if(escape(tmp).length>4){this_length=this_length+2;}else{this_length++;}}
if(this_length<nlen){window.alert('ÇÑ±Û '+parseInt(nlen/2)+'ÀÚ, ¿µ¹® '+nlen+'ÀÚ ÀÌ»ó ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');obj.focus();return false;}
if(this_length>mlen){window.alert('ÇÑ±Û '+parseInt(mlen/2)+'ÀÚ, ¿µ¹® '+mlen+'ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');obj.focus();return false;}
return true;};this.checkVal=function(objName,msg,space){obj=document.getElementById(objName);if(!this.checkNull(obj.value,msg)){obj.focus();return;}
if(space=="Y"){if(!this.checkSpace(obj.value)){obj.value="";obj.focus();return;}}
return true;};this.compare=function(objName,objName2,msg){obj=document.getElementById(objName);obj2=document.getElementById(objName2);if(obj.value!=obj2.value){window.alert(msg);obj.value="";obj2.value="";obj.focus();return false;}
return true;};this.compare2=function(objName,val,msg){obj=document.getElementById(objName);if(obj.value!=val){window.alert(msg);return false;}
return true;};this.bigerThan=function(objName,val,msg){obj=document.getElementById(objName);if(obj.value>val){window.alert(msg);obj.value="";obj.focus();return false;}
return true;};this.checkIndexOf=function(objName,sChar,msg){obj=document.getElementById(objName);if(obj.value.indexOf(sChar)>=0)
{window.alert(msg);obj.focus();return false;}
return true;};this.checkNotIndexOf=function(objName,sChar,msg){obj=document.getElementById(objName);if(obj.value.indexOf(sChar)==-1)
{window.alert(msg);obj.focus();return false;}
return true;};this.checkValNLen=function(objName,nlen,mlen,msg,space){obj=document.getElementById(objName);if(!this.checkNull(obj.value,msg)){obj.focus();return false;}
if(space=="Y"){if(!this.checkSpace(obj.value)){obj.value="";obj.focus();return false;}}
if(!this.checkLen(objName,nlen,mlen)){obj.focus();return false;}
return true;};this.checkNumber=function(objName,msg){obj=document.getElementById(objName);if(obj.value.match(/^[0-9]+$/gi)==null)
{window.alert(msg);obj.value="";obj.focus();return false;}
return true;};this.mailExp=/[a-z0-9]{2,}@[a-z0-9-]{2,}\.[a-z0-9]{2,}/i;this.checkEmail=function(objName){obj=document.getElementById(objName);if(!this.mailExp.test(obj.value)){window.alert('Á¤È®ÇÑ ¸ÞÀÏÁÖ¼Ò°¡ ¾Æ´Õ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä');obj.value="";obj.focus();return false;}
var alt_chk=0;var j_chk=0;for(var i=0;i<obj.value.length;i++){if(obj.value.charAt(i)=='@'){alt_chk++;}
if(obj.value.charAt(i)=="."){j_chk++;}}
if(alt_chk>1||j_chk>2){window.alert('Àß¸øµÈ ÀÌ¸ÞÀÏ Çü½ÄÀÔ´Ï´Ù.');obj.value="";obj.focus();return false;}
if(obj.value.toLowerCase().indexOf("hanmail.net")>0||obj.value.toLowerCase().indexOf("daum.net")>0){window.alert('ÇÑ¸ÞÀÏÀº »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.');obj.value="";obj.focus();return false;}
return true;};this.checkSpecialWord=function(objName,msg){obj=document.getElementById(objName)
for(var i=0;i<obj.value.length;i++){var chk=obj.value.substring(i,i+1);if(!chk.match(/[0-9|a-z|A-Z|¤¡-¤¾|¤¿-¤Ó|°¡-Èþ|\s]/)){window.alert(msg);obj.value="";obj.focus();return false;}}
return true;};this.checkEss=function(objName,flag){if(document.getElementById(objName))
{obj=document.getElementById(objName);if((obj.value!=""&&"Y"!=flag)||"Y"==flag)
{return true;}
else
{return false;}}
return false;};}
function onlyEngNum(obj)
{var e1=document.getElementById(obj);var num="abcdefghijklmnopqrstuvwxyz0123456789";event.returnValue=true;for(var i=0;i<e1.value.length;i++)
{if(-1==num.indexOf(e1.value.charAt(i)))
event.returnValue=false;}
if(!event.returnValue)
{e1.value="";e1.focus();window.alert('¿µ¹®(¼Ò¹®ÀÚ) ¹× ¼ýÀÚ¸¸ Àû¾îÁÖ¼¼¿ä');}}
function onlyNumber(obj)
{var e1=document.getElementById(obj);var num="0123456789";event.returnValue=true;for(var i=0;i<e1.value.length;i++)
{if(-1==num.indexOf(e1.value.charAt(i)))
event.returnValue=false;}
if(!event.returnValue)
{e1.value="";e1.focus();window.alert('¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');}}
function onlyNumber2(obj)
{var e1=document.getElementById(obj);var num="0123456789-";event.returnValue=true;for(var i=0;i<e1.value.length;i++)
{if(-1==num.indexOf(e1.value.charAt(i)))
event.returnValue=false;}
if(!event.returnValue)
{e1.value="";e1.focus();window.alert('¼ýÀÚ¿Í - ¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');}}
function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){oldonload();func();}}}
function returnThisTextLength(objName,targetName,max){var obj=document.getElementById(objName);var target=document.getElementById(targetName);var this_length;var cutChar='';var tmpChar='';var es='';this_length=0;if(obj.value!='')
{for(var i=0;i<obj.value.length;i++)
{cutChar=obj.value.charAt(i);es=escape(cutChar);if(escape(cutChar).length>4)this_length+=2;else this_length+=1;}}
else
{target.innerHTML='<span class="total2">'+0+'</span>/'+max+' bytes';}
if(this_length>max)
{this_length=0;for(var i=0;i<obj.value.length;i++)
{cutChar=obj.value.charAt(i);es=escape(cutChar);if(escape(cutChar).length>4)this_length+=2;else this_length+=1;if(this_length>max)
{if(escape(cutChar).length>4)this_length-=2;else this_length-=1;break;}
else tmpChar+=cutChar;}
window.alert('¿µ¹® '+max+'ÀÚ / ÇÑ±Û '+parseInt(max/2)+' ÀÚ±îÁö¸¸ °¡´ÉÇÕ´Ï´Ù');obj.value=tmpChar;obj.focus();}
target.innerHTML='<span class="total2">'+this_length+'</span>/'+max+' bytes';}
function enters(func){if(event.keyCode==13)
{func();}}