/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function checkForm(){
    var chk = true;
    chk = chk & checkField("name");
    chk = chk & checkField("firstname");
    chk = chk & checkField("street");
    chk = chk & checkField("zip");
    chk = chk & checkField("city");
    chk = chk & checkField("phone");    
    if(chk == 1){
        return true;
    }else{
        alert("Please, don't leave these fields blank");
        return false;
    }
}

function checkField(fid){
    var field = $(fid);    
    if(field.value.replace(/\s/, "").length == 0){
        field.style.backgroundColor = "rgb(239,80,23)";
        return false;
    }else{
        field.style.backgroundColor = "rgb(255,255,255)";
        return true;
    }
}



