	function IsAlphaNum( str ) {
					// Return immediately if an invalid value was passed in
					if (str+"" == "undefined" || str+"" == "null" || str+"" == "")	
						return false;
					var isValid = false;
					// convert to a string for performing string comparisons.
   					str += "";	
					// Loop through length of string and test for any alpha numeric 
					// characters
   					for (i = 0; i < str.length; i++)
   					{
							// Alphanumeric must be between "0"-"9", "A"-"Z", or "a"-"z"
      					if ((str.charAt(i) >= "0") && (str.charAt(i) <= "9")) 
							{
								isValid = true;
								break;
							}	
   					} // END for   
				alert(isValid);
   					return isValid;
				}  // end IsAlphaNum
function IsInt(numstr, allowNegatives) {
						// Return immediately if an invalid value was passed in	
					if (numstr+"" == "undefined" || numstr+"" == "null" || numstr+"" == "")	
						return false;
						// Default allowNegatives to true when undefined or null
					if (allowNegatives+"" == "undefined" || allowNegatives+"" == "null")	
						allowNegatives = true;			
						var isValid = true;
					// convert to a string for performing string comparisons.
					numstr += "";	
					// Loop through string and test each character. If any
					// character is not a number, return a false result.
 					// Include special case for negative numbers (first char == '-').   
					for (i = 0; i < numstr.length; i++) {
    					if (!((numstr.charAt(i) >= "0") && (numstr.charAt(i) <= "9") || (numstr.charAt(i) == "-"))) {
					       	isValid = false;
       						break;
						} else if ((numstr.charAt(i) == "-" && i != 0) || 
								(numstr.charAt(i) == "-" && !allowNegatives)) {
       							isValid = false;
       							break;
						}		         	         	       
					} // END for   
				   	return isValid;
				}  // end IsInt
function AcceptNum(Obj)
{
	var strKeyword = Obj.value;
//	alert(IsInt(strKeyword,false));
	if(IsInt(strKeyword,false)==false)
		{
			Obj.value="";
	//		return false;
		}
	
}						
	function IsUndef( val ) {
	var isValid = false;
 	if (val+"" == "undefined")
 		isValid = true;
	return isValid;
}  // end IsUndef		
function IsNull( val ) {
	var isValid = false;
 	if (val+"" == "null")
 		isValid = true;
	return isValid;
}  // end IsNull			
function IsAlpha( str ) {
	if (str+"" == "undefined" || str+"" == "null" || str+"" == "")	
		return false;
	var isValid = true;
	str += "";	// convert to a string for performing string comparisons.
  	for (i = 0; i < str.length; i++) {
		// Alpha must be between "A"-"Z", or "a"-"z"
		if ( !( ((str.charAt(i) >= "a") && (str.charAt(i) <= "z")) ||
      			((str.charAt(i) >= "A") && (str.charAt(i) <= "Z")) ) ) {
         				isValid = false;
         				break;
      			}
   } // end for loop
	return isValid;
}  // end IsAlpha 	
function IsBlank( str ) {
	var isValid = false;

 	if ( IsNull(str) || IsUndef(str) || (str+"" == "") )
 		isValid = true;
		
	return isValid;
}  // end IsBlank		
function IsValidEmail(str) {
	// Return immediately if an invalid value was passed in
	if (str+"" == "undefined" || str+"" == "null" || str+"" == "")	
		return false;

	var isValid = true;

	str += "";

	namestr = str.substring(0, str.indexOf("@"));  // everything before the '@'
	domainstr = str.substring(str.indexOf("@")+1, str.length); // everything after the '@'

	// Rules: namestr cannot be empty, or that would indicate no characters before the '@',
	// domainstr must contain a period that is not the first character (i.e. right after
	// the '@').  The last character must be an alpha.
   	if (IsBlank(str) || (namestr.length == 0) || 
			(domainstr.indexOf(".") <= 0) ||
			(domainstr.indexOf("@") != -1) ||
			!IsAlpha(str.charAt(str.length-1)))
		isValid = false;
   
   	return isValid;
} 
