function check()
{  
		   var x=0
           var display =' '
           
                           
		if (x==0)
			{
             if(document.reg.email.value==0)
				{
					display="Email is required"
					x=1
					
                }
			}


		if(x==0)
			{ 
			 var theInput = document.reg.email.value;
			 var sp1=0
             var at=0
             for (i=0;i< theInput.length;i++)
				{
					d= theInput.charAt(i)
					if (d == ' ')
					{sp1++}
					if (d == '@')
					{at++}
				}
			if ((sp1 > 0)||(at>1)||(at==0)) 
			    {
					display="This is not a valid email address"
					x=1
				}
	        }

		       if (display != ' ')
           {
            alert(display)
			document.reg.email.focus();

            return false
           }
if (document.reg.cname.value=="")
   {
    alert("Please Enter Contact Name !!");
    document.reg.cname.focus();
	return false;			   
	}
if (document.reg.country.value=="")
   {
    alert("Please Select Country !!");
    document.reg.country.focus();
	return false;			   
	}	
if (document.reg.state.value=="")
   {
    alert("Please Enter State !!");
    document.reg.state.focus();
	return false;			   
	}	
if (document.reg.city.value=="")
   {
    alert("Please Enter City !!");
    document.reg.city.focus();
	return false;			   
	}	
	return true;
   }