function doPost(url){
    if(url != "")
    {
        document.frm.action = url;
        document.frm.submit();
    }
    else
    {
        var email   = document.frm.email;
        AtPos       = email.value.indexOf("@");
        StopPos     = email.value.lastIndexOf(".");
        if(document.frm.naam.value == ""){
            alert ("U bent vergeten het volgende veld in te vullen: Naam");
            document.frm.naam.focus();
        }else if ( StopPos == -1 || StopPos < AtPos)
        {
            alert("U dient een correct e-mailadres in te vullen");
            document.frm.email.focus();
        }else{
            document.frm.action = "../templates/includes/offerteverwerk.inc.php";
            document.frm.submit();
        }
    }
}

function doPostOfferte(){
    var _email   = document.frm.email;
    AtPos       = _email.value.indexOf("@");
    StopPos     = _email.value.lastIndexOf(".");
    if(document.frm.naam.value == ""){
        alert ("U bent vergeten het volgende veld in te vullen: Naam");
        document.frm.naam.focus();
    }else if(document.frm.plaats.value == ""){
        alert ("U bent vergeten het volgende veld in te vullen: Woonplaats");
        document.frm.plaats.focus();
    }else if(document.frm.telefoon.value == ""){
        alert ("U bent vergeten het volgende veld in te vullen: Telefoonnummer");
        document.frm.telefoon.focus();
    }else if ( StopPos == -1 || StopPos < AtPos)
    {
        alert("U dient een correct e-mailadres in te vullen");
        document.frm.email.focus();
    }else{
        document.frm.action = "../templates/includes/offerteverwerk.inc.php";
        document.frm.submit();
    }
}

function isValidEmail(str) {
    return (str.indexOf(".") > 0) && (str.indexOf("@") > 0);
}

function buttonHover(id){
    document.getElementById(id).style.color="#666666";
    document.getElementById(id).style.cursor="pointer";
}

function buttonOut(id){
    document.getElementById(id).style.color="#000000";
}
