function chkReg() {

    //alert("A regisztráció még nem nyitott! Hamarosan!");
    //return false;
    
    var filter = /^.+@.+\..{2,6}$/;
    var kell = new Array('lastname','firstname','username','email','pass','pass1','birthdate','code');
    var hiba = false;
    var mailhiba = false;
    var hibapass = false;
    
    for(i=0;i<kell.length;i++) {
       if ($("#"+kell[i]).val()=="") {
           $("#"+kell[i]).addClass("inp_alert");
           hiba = true;
       } else {
           if (kell[i] == 'email' && !filter.test($("#"+kell[i]).val())) {
               $("#"+kell[i]).addClass("inp_alert");
               mailhiba = true;
           } else {
               $("#"+kell[i]).removeClass("inp_alert");
               if ($("#pass").val()!=$("#pass1").val()) {
                    $("#pass").addClass("inp_alert");
                    $("#pass1").addClass("inp_alert");
                    hibapass = true; 
               } 
           }
       }
    }
   
    if (!hiba) {
        if (hibapass) {
            window.alert('A jelszó mező nincs kitöltve, vagy nem egyeznek a beírt jelszavak!');
            return false;
        } else {
            if (mailhiba) {
                window.alert('A beírt email cím formátuma nem megfelelő!');
                return false;
            } else if ($("#szabaly").attr('checked')) return true;
                    else {
                        $("#szab_div").addClass("oline");
                        alert("A részvételi szabályzatot el kell fogadnod!");
                        return false;
                    }
        }
    } else {
        window.alert('Minden mező kitöltése kötelező!');
        return false;
    }
   
}

function reszveteli() {
    $.ajax({
        type: "POST",
        url: BASEURL+"ajax/fight.php",
        data: "command=reszveteli",
        cache: false,
        success:
            function(result){
                $("#hidden_popup").html(result); 
                $("#hidden_popup").modal({maxWidth:800});  
            }
      });    
}

function killPropagation(e)
{
    if (!e) var e = window.event;
    e.cancelBubble = true;
    if (e.stopPropagation) e.stopPropagation();
}

