

		function ValidateEmail(entered) {
		     var regexp =  /^(\w+[\-\.])*\w+@(\w+\.)+[A-Za-z]+$/;
		     if(regexp.test(entered)==false)
		      {
		         alert("Invalid Email");
		         return false;
        
              }
			/* with (entered){
				mailChecker =  '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@.-_?+';
				for (i=0; i < entered.length; i++)
					if(mailChecker.indexOf(entered.charAt(i)) < 0){					
						alert('Invalid Email');
						return false;
					}
				apos=entered.indexOf("@");
				lpos=entered.lastIndexOf("@");
				dotpos=entered.lastIndexOf(".");
				lastpos=entered.length-1;
				if (apos<1 || (dotpos-apos)<2 || (lastpos-dotpos)>3 || (lastpos-dotpos)<2 || apos != lpos ){
					
					alert('Invalid Email');
					return false;
				}
				else{
					return true;
				}
			 }*///end with
			 
			} //end function	
		
		function onKeyNumbersOnly(e){	
			var unicode=e.charCode? e.charCode : e.keyCode;
			
			if(unicode == 46 && (e.charCode == null || e.charCode == 46)){
				return false;
			}

			if(e.charCode == null && (e.keyCode == 37 || e.keyCode == 39)){
				return false;
			}

			if(e.charCode != null && (e.charCode == 37 || e.charCode == 39) && e.keyCode == 0){
				return false;
			}

			if (unicode!=8) { //if the key isn't the backspace key (which we should allow)
				  if (unicode==9)  {
					var event=down;
					Tabnext(event);
				  } else if ((unicode<48||unicode>57) && unicode!=37 && unicode!=39 && unicode!=46){ //if not a number
					return false //disable key press
				  }
			}
		}
		
		function onKeyAlphabetsOnly(e){
			var unicode=e.charCode? e.charCode : e.keyCode
			//alert(unicode);
			/*var keychar = String.fromCharCode(unicode);
			alert("keycharkeychar:"+keychar);
				if(keychar=="%" && unicode==37){
				alert("keychar:"+keychar);
		     		return false
		     	}*/
			if (unicode!=8)
			{ //if the key isn't the backspace key (which we should allow)
			   if (unicode==9||unicode==46||unicode==37||unicode==39)
			    {
			     return true
			    }
			     else if (!((unicode>=65 && unicode<=90 )||(unicode>=97 && unicode<=122 ))) //if not a number
			     {
			     return false //disable key press
			     }
			     
			}
		}        

		function isAlpha(str,msg){
		  var re = /[a-zA-Z]/g
		  if (!re.test(str)){
		     alert(msg);
		  	 return false;
		  	}
		  return true;
		}		
		
		function TabNext(obj,event,len,next_field) {
			var phone_field_length=0;
			if (event == "down") {
				phone_field_length=obj.value.length;
				}
			else if (event == "up") {
				if (obj.value.length != phone_field_length) {
					phone_field_length=obj.value.length;
					if (phone_field_length == len) {
						next_field.focus();
						}
					}
				}
			}

	function isAlphaNumeric(val,msg)
		{
		if (val.match(/^[a-zA-Z0-9|\s]+$/))
		{
		return true;
		}
		else
		{
		alert(msg);
		return false;
		} 
	}	
	
	
	function goHome(){
		window.location="../jsp/AccountHomeDetails.jsp";
	}
	
	 