//////////////////////////////
// Obsługa formularzy komentarzy newsów
//////////////////////////////
function CheckAddNewsCommentForm(FormName){
    if(document.forms[FormName].comment_text.value==""){
        document.forms[FormName].comment_text.focus();
        window.alert("Wpisz treść komentarza.");
        return false;
    }
    if(document.forms[FormName].comment_user_name.value==""){
        document.forms[FormName].comment_user_name.focus();
        window.alert("Wpisz swoje imię.");
        return false;
    }
    if(document.forms[FormName].comment_user_email.value!=""){
        test_comment_user_email=/^[0-9a-zA-Z._-]+\@[0-9a-zA-Z_-]+\.[0-9a-zA-Z.]+$/;
        if(test_comment_user_email.test(document.forms[FormName].comment_user_email.value)==false){
            document.forms[FormName].comment_user_email.focus();
            window.alert("Wpisz poprawny adres email.");
            return false;
        }
    }
}
function CheckEditCommentForm(FormName){
    if(document.forms[FormName].new_comment_text.value==""){
        document.forms[FormName].new_comment_text.focus();
        window.alert("Wpisz treść komentarza.");
        return false;
    }
    if(document.forms[FormName].new_comment_user_name.value==""){
        document.forms[FormName].new_comment_user_name.focus();
        window.alert("Wpisz swoje imię.");
        return false;
    }
    if(document.forms[FormName].new_comment_user_email.value!=""){
        test_new_comment_user_email=/^[0-9a-zA-Z._-]+\@[0-9a-zA-Z_-]+\.[0-9a-zA-Z.]+$/;
        if(test_new_comment_user_email.test(document.forms[FormName].new_comment_user_email.value)==false){
            document.forms[FormName].new_comment_user_email.focus();
            window.alert("Wpisz poprawny adres email.");
            return false;
        }
    }
}

