function validate()
{

	 if(isBlank(document.reg.LName.value)) 
                    { 
                     alert("Please enter Your Last Name"); 
                     document.reg.LName.focus();                      
                     return false; 
                    } 
         if(!isNaN(document.reg.LName.value)) 
                    { 
                     alert("The Last Name should not be Numeric"); 
		     document.reg.LName.value="";     
                     document.reg.LName.focus();                      
                     return false; 
                    } 

       	if(isBlank(document.reg.email.value)) 
		   { 
              	    alert("Please enter Your Email Address"); 
                    document.reg.email.focus();                      
                    return false; 
                    } 
        if(Email(document.reg.email.value) || emailName(document.reg.email.value)) 
                    { 
                     alert("Please enter the valid Email Address 'eg:info@company.com'"); 
		     document.reg.email.value="";     
                     document.reg.email.focus();                      
                     return false; 
                    } 
	   	if(isBlank(document.reg.Password.value)) 
		   { 
              	    alert("Please enter Your Password"); 
                    document.reg.Password.focus();                      
                    return false; 
                    }
	   	if(isBlank(document.reg.ConfirmPassword.value)) 
		   { 
              	    alert("Please enter the Confirm Password"); 
                    document.reg.ConfirmPassword.focus();                      
                    return false; 
                    }					
                    
                    
        if(document.reg.Inseam.value != '')
        {
			if(isNaN(document.reg.Inseam.value))
			{
				alert('Only Numeric Values allowed')
				document.reg.Inseam.focus()
				document.reg.Inseam.value=''
				return false
			}
        }         
        if(document.reg.Waist.value != '')
        {
			if(isNaN(document.reg.Waist.value))
			{
				alert('Only Numeric Values allowed')
				document.reg.Waist.focus()
				document.reg.Waist.value=''
				return false
			}
        }         
        if(document.reg.Hips.value != '')
        {
			if(isNaN(document.reg.Hips.value))
			{
				alert('Only Numeric Values allowed')
				document.reg.Hips.focus()
				document.reg.Hips.value=''
				return false
			}
        }         
        if(document.reg.Crotch.value != '')
        {
			if(isNaN(document.reg.Crotch.value))
			{
				alert('Only Numeric Values allowed')
				document.reg.Crotch.focus()
				document.reg.Crotch.value=''
				return false
			}
        }         
        if(document.reg.Thigh.value != '')
        {
			if(isNaN(document.reg.Thigh.value))
			{
				alert('Only Numeric Values allowed')
				document.reg.Thigh.focus()
				document.reg.Thigh.value=''
				return false
			}			
        }         
        if(document.reg.Neck.value != '')
        {
			if(isNaN(document.reg.Neck.value))
			{
				alert('Only Numeric Values allowed')
				document.reg.Neck.focus()
				document.reg.Neck.value=''
				return false
			}			
        }         
        if(document.reg.Chest.value != '')
        {
			if(isNaN(document.reg.Chest.value))
			{
				alert('Only Numeric Values allowed')
				document.reg.Chest.focus()
				document.reg.Chest.value=''
				return false
			}			
        }        
        if(document.reg.Height1.value != '')
        {
			if(isNaN(document.reg.Height1.value))
			{
				alert('Only Numeric Values allowed')
				document.reg.Height1.focus()
				document.reg.Height1.value=''
				return false
			}			
        }         
        if(document.reg.Height2.value != '')
        {
			if(isNaN(document.reg.Height2.value))
			{
				alert('Only Numeric Values allowed')
				document.reg.Height2.focus()
				document.reg.Height2.value=''
				return false
			}			
        }         
        if(document.reg.Coatsize.value != '')
        {
			if(isNaN(document.reg.Coatsize.value))
			{
				alert('Only Numeric Values allowed')
				document.reg.Coatsize.focus()
				document.reg.Coatsize.value=''
				return false
			}			
        }         
   
return true; 
} 
function Email(str)  
{ 
   
  var supported = 0; 
  if (window.RegExp)  
  { 
    var tStr = "a"; 
    var tReg = new RegExp(tStr); 
    if (tReg.test(tStr)) supported = 1; 
  } 
  if (!supported)  
    return (str.indexOf(".") <= 2) || (str.indexOf("@") < 0); 
    var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)"); 
    var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"); 
  return (r1.test(str) || !r2.test(str)); 
} 
function emailName(str) 
  { 
  if(str != "") 
      { 
 
        var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-@."; 
           for(var i=0; i <  str.length; i++) 
	       { 
                temp3=  str.substring(i,i+1); 
		if((chars.indexOf(temp3) == -1) ) 
			 { 
			  return true;   
			 } 
	       } 
    
       } 
 
  } 
function isBlank(p) 
{  
  var len = p.length; 
  var i; 
  for(i = 0; i < len ; ++i) 
  {  
   if (p.charAt(i) != ' ') return false; 
  } 
return true; 
} 
