﻿function ShowElement(elemid) {
    $('#' + elemid).css({ 'display': 'block' });
}
function HideElement(elemid) {
    $('#' + elemid).css({ 'display': 'none' });
}

function CheckRequiredFieldSite(source, args) {
    if (args.Value.length > 0) {
        args.IsValid = true;
    }
    else {
        args.IsValid = false;
    }

    SetErrorClassSite(source.controltovalidate, args.IsValid);
}

function SetErrorClassSite(inputId, isValid) {
    var element = document.getElementById(inputId);
    if (isValid) {
        element.className = element.className.replace(' error', '');
        if (element.className == 'error') {
            element.className = '';
        }
    }
    else {
        element.className = element.className.replace(' error', '') + ' error';
    }
}

$(document).ready(function() {
    $("input:radio").addClass("star");
    $("input:radio").each(function(i) {
        //this.name = this.name.replace(/\$/g, "_");
    });
    SetReviewRating();

    // hide empty title div
    $('.title:empty').css('display', 'none');
    $('h1:empty').css('display', 'none');
});

