// JavaScript Document
	function CheckValidChars(thefield)
	{
		var validchars = "abcdefghijklmnopqrstuvwxyz";
		var length = thefield.value.length;
		if (length >= 5) {
			for (var i=0; i<length; i++) {
				var letter = thefield.value.charAt(i).toLowerCase();
				if (validchars.indexOf(letter) != -1)
					continue;
				alert("Invalid Name. Please Re-enter");
				thefield.focus();
				thefield.select();
				return 1;
				break;
			}
		}
		else {
			alert("Minimum Characters should atleast be 5");
			thefield.focus();
			thefield.select();
			return 1;
		}
	}
	
	function CheckValidNumbers(thefield)
	{
		var theInput = thefield.value;
		var theLength = theInput.length;
		
		if(theInput!= "") {
			for(var i=0; i < theLength; i++) {
				var theChar = theInput.substring(i,i+1);
				if((theChar < "0" || theChar > "9")) {
					alert("This does not appear to be a valid Number");
					thefield.focus();
					thefield.select();
					return 1;
				}
			}
			if(theInput == 0) {
				alert("This does not appear to be a valid Number");
				thefield.focus();
				thefield.select();
				return 1;
			}
		}
	}
	
	function iSMoney(thefield)
	{
		var theInput = thefield.value;
		var theLength = theInput.length;
		
		if(theInput!= "") {
			for(var i=0; i < theLength; i++) {

				var theChar = theInput.substring(i,i+1);
				if((theChar < "0" || theChar > "9") && (theChar != ".")) {
					alert("This does not appear to be a valid amount");
					thefield.focus();
					thefield.select();
					return 1;
				}
			}
			if(theInput == 0) {
				alert("This does not appear to be a valid amount");
				thefield.focus();
				thefield.select();
				return 1;
			}
		}
	}
	
	function iSMoney2(thefield)
	{
		var theInput = thefield.value;
		var theLength = theInput.length;
		var ctr = 0;
		
		//alert(decimallength);
		if(theInput!= "") {
			for(var i=0; i < theLength; i++) {

				var theChar = theInput.substring(i,i+1);
				if(theChar == ".") {
					var decimal = theInput.split(".");
					var decimallength = decimal[1].length;
					ctr++;					
				}
				
				if((theChar < "0" || theChar > "9") && (theChar != ".")) {
					alert("This does not appear to be a valid amount");
					thefield.focus();
					thefield.select();
					return 1;
				}
				
			}
			
			if(ctr > 1) {
				alert("This does not appear to be a valid amount");
				thefield.focus();
				thefield.select();
				return 1;
			}
			
			if(decimallength > 2) {
					alert("Only 2 Numbers Allowed After Decimal");
					thefield.focus();
					thefield.select();
					return 1;
			}
			
			if(theLength == 1 && ctr == 1) {
				alert("This does not appear to be a valid amount");
				thefield.focus();
				thefield.select();
				return 1;
			}
			
		}
	}
	
	function isDiscount(thefield)
	{
		var theInput = thefield.value;
		var theLength = theInput.length;
		var ctr = 0;
		
		if(theInput!= "") {
			for(var i=0; i < theLength; i++) {

				var theChar = theInput.substring(i,i+1);
				if(theChar == ".") {
					var decimal = theInput.split(".");
					var decimallength = decimal[1].length;
					ctr++;					
				}
				
				if((theChar < "0" || theChar > "9") && (theChar != ".")) {
					alert("This does not appear to be a valid amount");
					thefield.focus();
					thefield.select();
					return 1;
				}
			}
			
			if(ctr > 1) {
				alert("This does not appear to be a valid amount");
				thefield.focus();
				thefield.select();
				return 1;
			}
			
			if(decimallength > 2) {
					alert("Only 2 Numbers Allowed After Decimal");
					thefield.focus();
					thefield.select();
					return 1;
			}
			
			if(theLength == 1 && ctr == 1) {
				alert("This does not appear to be a valid amount");
				thefield.focus();
				thefield.select();
				return 1;
			}
			
		}
	}
	
	function validZip(theField)
	{
		var theInput=theField.value;
		var theLength=theInput.length;
		var goodZip=true;
		if(theLength !=5 && theLength!=0){
			goodZip=false;
		}
		if(theLength==5){
			for(var i=0;i<5;i++){
				var theChar=theInput.substring(i.i+1);
				if(theChar<"0"||theChar>"9"){
					goodZip=false;
				}
			}
		}
		if(goodZip==false){
			alert("this does not appear to be a valid zip coae.");
		}
	}
		