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("Ungültige E-Mail Adresse")
           return false
        }

        if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
           alert("Ungültige E-Mail Adresse")
           return false
        }

        if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
            alert("Ungültige E-Mail Adresse")
            return false
        }

         if (str.indexOf(at,(lat+1))!=-1){
            alert("Ungültige E-Mail Adresse")
            return false
         }

         if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
            alert("Ungültige E-Mail Adresse")
            return false
         }

         if (str.indexOf(dot,(lat+2))==-1){
            alert("Ungültige E-Mail Adresse")
            return false
         }
        
         if (str.indexOf(" ")!=-1){
            alert("Ungültige E-Mail Adresse")
            return false
         }

          return true                    
    }

function ValidateForm(){
    
    var receiver_name = document.getElementById('receiver_name');
    var address = document.getElementById('address');
    var county = document.getElementById('county');
    var postal_code = document.getElementById('postal_code');
    var phone_local = document.getElementById('phone_local');
    var phone_mobile = document.getElementById('phone_mobile');
    var phone_fax = document.getElementById('phone_fax');
    
    var emailID=document.siparis.email;
    var city=document.siparis.city;
    
    if ((emailID.value==null)||(emailID.value=="")){
        alert("Bitte Geben Sie Ihre E-Mail Adresse Ein");
        emailID.focus()
        return false
    }
    if (echeck(emailID.value)==false){
        emailID.value=""
        emailID.focus()
        return false
    }

    if(receiver_name.value==null || receiver_name.value=="") {
        alert("Bitte Geben Sie Den Empfängernamen Ein!");
        receiver_name.focus()
        return false;
    }   
    if(address.value==null || address.value=="") {
        alert("Bitte Geben Sie Ihre Adresse Ein!");
        address.focus()
        return false;
    }
    if(county.value==null || county.value=="") {
        alert("Bitte Geben Sie Ihr Land Ein!");
        county.focus()
        return false;
    }
    if(postal_code.value==null || postal_code.value=="") {
        alert("Bitte Geben Sie Ihre Postleitzahl Ein!");
        postal_code.focus()
        return false;
    }
    if(phone_local.value==null || phone_local.value=="") {
        alert("Bitte Geben Sie Ihre Telefonnummer Ein!");
        phone_local.focus()
        return false;
    }
    if(city.value==null || city.value=="") {
        alert("Bitte Geben Sie Ihre City Ein!");
        phone_local.focus()
        return false;
    }

    return true
 }

