﻿var view;

function showLoading() {
    //eE(gE('ajax-loader'));
    //document.getElementById('ajax-loader').style.display = 'inline';
    $("#ajax-loader").toggle();
}

function hideLoading() {
    //cE(gE('ajax-loader'));
    $("#ajax-loader").toggle();
}

function clearMessages() {
    $('.error').html('');
    $('.message').html('');
}

function setClearMessageEvents() {
    $('.form-field').live('click', function() {
        clearMessages();
    });
    $('.iframe-uploader').live('focus', function() {
        clearMessages();
    });
}

function clearRequiredFields() {
    $('.form-field textarea, input[type="text"], input[type="password"], input[type="file"], input[type="submit"], select, table').each(function() {
        $(this).removeClass('required');
    });
}

function resetForm() {
    $('.form-field textarea, input[type="text"], input[type="password"], input[type="file"]').each(function () {
        $(this).val('');
    });

    $('.form-field select').each(function () {
        $(this).get(0).selectedIndex = 0;
    });

    $('.form-field input[type="checkbox"]').each(function () {
        $(this).attr('checked', false);
    });
}
