
function jumb(from,to,size){

	var value=from.value;
	if(value.length>=size)
		to.focus();
}



var win = null;

				function NewWindow(mypage,myname,w,h,scroll){
				LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
				TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
				settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=0'+scroll+',resizable'
				win = window.open(mypage,myname,settings)

				}
							var whitespace = " \t\n\r";
					function ValidateInput(form){

						
						var defaultEmptyOK = false;

					//alert(form.ToE-Mail); 
							var s ;
																							
						s = form["fname"].value;	 
						if(isEmpty(s) || isWhitespace (s)  )
										{      
    								alert("Please enter Frist Name ." );
									form["fname"].focus();
	            						return false;
										}						
						
						s = form["lname"].value;
						if(isEmpty(s) || isWhitespace (s)  )
										{      
    								alert("Please enter Last Name ." );
									form["lname"].focus();
	            						return false;
										}	
						s = form["address"].value;
						if(isEmpty(s) || isWhitespace (s)  )
										{      
    								alert("Please enter Address ." );
									form["address"].focus();
	            						return false;
										}
						
						s = form["city"].value;
						if(isEmpty(s) || isWhitespace (s)  )
										{      
    								alert("Please enter City ." );
									form["city"].focus();
	            						return false;
										}
						s = form["state"].value;
						if(isEmpty(s) || isWhitespace (s)  )
										{      
    								alert("Please enter State ." );
									form["state"].focus();
	            						return false;
										}
						s = form["zip"].value;
						if(isEmpty(s) || isWhitespace (s)  )
										{      
    								alert("Please enter Zip ." );
									form["zip"].focus();
	            						return false;
										}
						s = form["zip"].value;
						if(isNaN(s))
										{      
    								alert("Zip must be a number ." );
									form["zip"].focus();
	            						return false;
										}
						s = form["zip"].value;
						if(s.length != 5)
										{      
    								alert("Zip must be a five numbers ." );
									form["zip"].focus();
	            						return false;
										}
										var ph1 = form["phone1"].value;
						var ph2 = form["phone2"].value;
						var ph3 = form["phone3"].value;
						if(isEmpty(ph1) || isWhitespace (ph1) || isEmpty(ph2) || isWhitespace (ph2) || isEmpty(ph3) || isWhitespace (ph3))
										{      
    								alert("Please enter Phone Number ." );
									form["phone1"].focus();
	            						return false;
										}
						
						if(ph1.length<3 || ph2.length<3 || ph3.length<4)
						{
							alert("Invalid phone format [xxx-xxx-xxxx]." );
							form["phone1"].focus();
							return false;
						}
						if(isNaN(ph1) || isNaN(ph2) || isNaN(ph3))
						{
							alert("Phone must be a number ." );
							form["phone1"].focus();
							return false;
						}
						
						s = form["email"].value;	
							
						if(isEmpty(s) || isWhitespace (s)  )
										{      
    								alert("Please enter E-Mail Address ." );
									form["email"].focus();
	            						return false;
										}	
										 
						if(!isEmail(s))
										{
										alert("Incorrect email format ." );
										form["email"].focus();
		   	      						return false;
										}
					return true;
					}
					//***************** This function for validate if the user let the filed empty  ******************
						function isEmpty(s)
						{  
						return ((s == null) || (s.length == 0))
						}
					//**************** end functtion 
					//********************* This function for validate if the user add space *********************
						function isWhitespace (s)
						{
						
						//  var i;
 						for (i = 0; i < s.length; i++)
 						{   
 							var c = s.charAt(i);
					 	       
							if (whitespace.indexOf(c) == -1) return false;
 						}
					 	   
							return true;
						}
					//****************************** end of function ************************

					// ************************* This function for email validation   ****************
					function isEmail(s)
							{ 
					           
									if (isWhitespace(s)) return false;
							var i = 1;
							var sLength = s.length;

							while ((i < sLength) && (s.charAt(i) != "@"))
							{ i++
							}
							if ((i >= sLength) || (s.charAt(i) != "@")) return false;
							else i += 2;
							while ((i < sLength) && (s.charAt(i) != "."))
							{ i++
							}
					 
					 
							if ((i >= sLength - 1) || (s.charAt(i) != "."))
									return false

							else 
							return true;
					}
