﻿function clearForm() {
    $("[jq='field280']").val('');
    $("[jq='field458']").val('');
    $("[jq='field280']").attr("class", "tb280");
    $("[jq='field458']").attr("class", "tb458");
    $("[jq='validator']").hide();
    $("[jq='validator']").each(function () {
        this.isvalid = true;
    });

}
function validateClass() {
    if (typeof (Page_Validators) == "undefined") return;
    Page_ClientValidate('contact');
    $('[jq="validator"]').each(function () {
        if (this.isvalid == false) {
            $("#" + this.controltovalidate).addClass("error");
        }
    });
}

function validateText(sender) {
    if (typeof (sender.Validators) == "undefined") return;
    var areThereErrors = false;

    for (var i = 0; i < sender.Validators.length; i++) {
        if (sender.Validators[i].isvalid == false) {
            areThereErrors = true;
            break;
        }
    }
    
    var c = $("#" + sender.id);
    if (areThereErrors == false) {
        c.removeClass("error");
    }
    else {
        c.addClass("error");
    }
}

function validateCallSubject(source, args) {
    if ($("input[type=checkbox]").attr('checked')) {
        args.IsValid = true;
    }
    else {
        args.IsValid = false;
    }

}

function refreshLocations(sel) { var url = window.location.protocol + "//" + window.location.host + window.location.pathname + "?eid=" + sel.options[sel.selectedIndex].value + "&sp=1"; window.location = url; }
