
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail Address")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail Address")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail Address")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail Address")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail Address")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail Address")
		    return false
		 }

		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail Address")
		    return false
		 }

 		 return true
	}

function Validate_Form(){
//var emailID=document.reg_new_user.email1;
//var countryID = document.reg_new_user.country;

  if (document.buyer_details.firstname.value == "") {
    alert( "Please enter your first name." )  ;
    document.buyer_details.firstname.focus() ;
    return false ;
  }
  if (document.buyer_details.lastname.value == "") {
    alert( "Please enter your surname." );
    document.buyer_details.lastname.focus() ;
    return false ;

  }
  if (document.buyer_details.address1.value == "") {
    alert( "Please enter your street and number." );
    document.buyer_details.address1.focus() ;
    return false ;

  }

  if (document.buyer_details.town.value == "") {
    alert( "Please enter your town." );
    document.buyer_details.city.focus() ;
    return false;

  }

  if (document.buyer_details.postcode.value == "") {
    alert( "Please enter your postcode." );
    document.buyer_details.postcode.focus() ;
    return false;

  }
  if (document.buyer_details.state.value == "") {
    alert( "Please enter your state." );
    document.buyer_details.state.focus() ;
    return false;

  }
 // var country1 = document.reg_new_user.elements['country'].value;
  if (document.buyer_details.country.value == "") {
    alert( "Please enter your country." );
    document.buyer_details.country.focus() ;
    return false;

  }
  if (document.buyer_details.email.value == "") {
    alert( "Please enter your email." );
    document.buyer_details.email.focus() ;
    return false;

  }
  if (document.buyer_details.telephone.value == "") {
    alert( "Please enter your telephone." );
    document.buyer_details.telephone.focus() ;
    return false;

  }
  if (document.buyer_details.password1.value == "") {
    alert( "Please enter your password." );
    document.buyer_details.password1.focus() ;
    return false;

  }

 /* 	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email Address");
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value="";
		emailID.focus()
		return false
	}                                          //    [Select your Country]
 if (form.elements['country'] && (form.elements[country].type != "hidden") ) {
    var country1 = form.elements['country'].value;

    if (country1 == "[Select your Country]") {
      alert("* Please select your Country");
      return false;
    }
  }

  if (document.buyer_details.newsletter.checked == false) {
    alert( "Sorry. We cannot accept your application if you cannot agree to our terms." );
    document.buyer_details.newsletter.focus();
    return false ;
  }   */
	return true;
 }
