function showAlertFor(element) {
    element.style.display = "";
}

function hideAlertFor(element){
	element.style.display="none";
}

function validateVideoCommentForm() {

    hideAlertFor($('videoComentAlert'));
	hideAlertFor($('maxVideoComentAlert'));
	hideAlertFor($('maxVideoTitleAlert'));

    if ($('videoComentTitle').value == '' || $('videoComentBody').value == '') {
        showAlertFor($('videoComentAlert'));
        return false;
    }

    if ($('videoComentBody').value.length > 1000) {
        showAlertFor($('maxVideoComentAlert'));
        return false;
    }

    if ($('videoComentTitle').value.length > 200) {
        showAlertFor($('maxVideoTitleAlert'));
        return false;
    }
    return true;
}

function submitVideoCommentForm(element) {
    if (!validateVideoCommentForm()) {
        return false;
    }
    element.submit();
    return false;
}
