function CheckForm(){
res = true;
$$('input','textarea').each(function(el){
  if(el.type=='text' || el.type=='textarea' || el.type=='file'){
		  val = el.value;
		  val_m = val.stripScripts().stripTags().strip().escapeHTML();
		  if(el.type!='file') el.value = val_m;
		  if(el.readAttribute('check')=='notnull'){
		       if(isBlank(el.value)){ res = false;el.focus();throw $break;}
			 }
		  if(el.readAttribute('check')=='int'){
		       if(!isInteger(el.value)){ res = false;el.focus();throw $break;}
			 }	
		  if(el.readAttribute('check')=='email'){
		       if(!isEmail(el.value)){ res = false;el.focus();throw $break;}
			 }	 
		  if(el.readAttribute('check')=='nocheck'){
		       el.value = val;
			 }
  }
});
return res;
}
function CheckForm1(){
res = true;
$$('input','textarea').each(function(el){
  if(el.type=='text' || el.type=='textarea' || el.type=='file'){
		  val = el.value;
		  val_m = val.stripScripts().stripTags().strip().escapeHTML();
		  if(el.type!='file') el.value = val_m;
		  if(el.readAttribute('check1')=='notnull'){
		       if(isBlank(el.value)){ res = false;el.focus();throw $break;}
			 }
		  if(el.readAttribute('check1')=='int'){
		       if(!isInteger(el.value)){ res = false;el.focus();throw $break;}
			 }	
		  if(el.readAttribute('check1')=='email'){
		       if(!isEmail(el.value)){ res = false;el.focus();throw $break;}
			 }	 
		  if(el.readAttribute('check1')=='nocheck'){
		       el.value = val;
			 }
  }
});
return res;
}
function isNull(val){return(val==null);}
function isBlank(val){if(val==null){return true;}for(var i=0;i<val.length;i++){if((val.charAt(i)!=' ')&&(val.charAt(i)!="\t")&&(val.charAt(i)!="\n")&&(val.charAt(i)!="\r")){return false;}}return true;}
function isInteger(val){if(isBlank(val)){return false;}for(var i=0;i<val.length;i++){if(!isDigit(val.charAt(i))){return false;}}return true;}
function isNumeric(val){return(parseFloat(val,10)==(val*1));}
function isArray(obj){return(typeof(obj.length)=="undefined")?false:true;}
function isDigit(num){if(num.length>1){return false;}var string="1234567890";if(string.indexOf(num)!=-1){return true;}return false;}
function isEmail(string_value){var reg_exp = /^[\w\.]*@[\w\.]+\.[a-z]{2,3}/i; return reg_exp.test(string_value);}
