/* The following string represents the pattern for matching all special
   characters.  We don't want to allow special characters in the address. 
   These characters include ( ) < > @ , ; : \ " . [ ]  '  */
//var specialChars="\\(\\)<>@,;:\\\\\\\"'\\.\\[\\]";
/* The following string represents the range of characters allowed in a 
   username or domainname.  It really states which chars aren't allowed. */
//var validChars="\[^\\s" + specialChars + "\]";
//var validChars="\[" + specialChars + "\]";
var specialChars=":|;|\\.|\"|'|-|@|\\\\|\/|<|>|,";
var userPat=new RegExp(specialChars);
//var userPat=new RegExp("^" + validChars + "+$");
//var userPat = new RegExp("[a-z]|[A-Z]|d", "i");

// See if input is valid
//input must not have any special characters
function isValidInput (input) {
	//alert (input);
	//alert (userPat);
	//alert(input.match(userPat));
	if (input.match(userPat)) {
	    // user is not valid
	    //alert("The input is incorrect, please try again")
	    return false
	} else {
		return true;
	}
}

//Check if the str is number or not
function IsNum(str){
	var IsNum;
	IsNum = true;
	var len;
	var dot;
	dot=0;
	len = str.length;
	var i,tmpStr;
	for (i=0;i<len;i++){
		tmpStr = str.charAt(i);
		if(tmpStr=="."){dot=dot+1;
			if(dot>1) IsNum = false
		}
		else{
		 if(isNaN(parseInt(tmpStr))) IsNum = false
		}
	}
	return IsNum;
}
