var wf_url='';

function chkWebForm (kell) {
    var hiba = false;
    var mailhiba = false;
    
    for(i=0;i<kell.length;i++) {
       if ($('#'+kell[i]).val()=="") {
           $('#'+kell[i]).addClass("oline");
           hiba = true;
       } else {
           if (kell[i] == 'wf_email' && !mailCheck($('#'+kell[i]))) {
               mailhiba = true;
           } else {
               $('#'+kell[i]).removeClass("oline"); 
           }
       }
    }
    
    if (!hiba) {
        if (mailhiba) {
            window.alert('A beírt email cím formátuma nem megfelelő!');
            return false;
        } else {
            var p=postSerializeForm(document.getElementById("webForm"));
            p += "&command=register&module=webform";
            wf_url = p;
            postAjax("ajax.php",p, function(ret){
                                    $("#wf_container").html(ret);
                                });
        }
    } else {
        window.alert('A csillagozott mezők kitöltése kötelező!');
        return false;
    }
}

function sendUserMail() {
    wf_url += "&usermail=1";
    postAjax("ajax.php",wf_url, function(ret){
                        $("#own_mail_resp").html(ret);
                    });
    
}
