// JavaScript Document
        function CheckValidLogin(thefield)
	{
		var validchars = "abcdefghijklmnopqrstuvwxyz0123456789_";
		var length = thefield.value.length;
		if (length >= 3) {
			for (var i=0; i<length; i++) {
				var letter = thefield.value.charAt(i).toLowerCase();
				if (validchars.indexOf(letter) != -1)
					continue;
				alert("Invalid Entry. Please Re-enter");
				thefield.focus();
				thefield.select();
				return 1;
				break;
			}
		}
		else {
			alert("Should be atleast 3 Characters ");
			thefield.focus();
			thefield.select();
			return 1;
		}
	}
	
	function CheckLength(thefield)
	{
		var length = thefield.value.length;
		if(length < 6)
		{
			alert("Password should be atleat 6 characters for Security reasons");
			thefield.focus();
			thefield.select();
			return 1;
		}
	}
	
	function CheckValidChars(thefield)
	{
		var validchars = "abcdefghijklmnopqrstuvwxyz ";
		var length = thefield.value.length;
		if (length >= 3) {
			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 3");
			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 ValidateMail(thefield)
   {
	    var str = thefield.value;
		//var	str=d.email.value;
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if(!filter.test(str))
		{
			alert("Please Enter Valid Email Id");
			thefield.focus();
			thefield.select();
			return 1;		
		}
   }

	
 function CheckValidNumbers1(thefield)
	{
		var validchars = "0123456789()-+ ";
		var length = thefield.value.length;
		for (var i=0; i<length; i++) {
				var letter = thefield.value.charAt(i).toLowerCase();
				if (validchars.indexOf(letter) != -1)
					continue;
				alert("Please enter a valid numbers (only numbers, space, + or - are allowed)");
				thefield.focus();
				thefield.select();
				return 1;
				break;
			   }
	}