﻿$(document).ready(function() {

    // display error message
displayMessage = function(url, title, message, width, height) {
        if (!width) width = 490;
        if (!height) height = 106;
        openThickbox(url, title, message, width, height);
        enableSubmit();
        initPage();
        return false;
    }

    // display error message
    displayMessageSSL = function(url, title, message, width, height) {
        if (!width) width = 490;
        if (!height) height = 106;
        openThickboxSSL(url, title, message, width, height);
        enableSubmit();
        initPage();
        return false;
    }


    // AJAX Updating Animation
    updatingGrid = function() {
        if ($("#updateProgressDiv").css('display') == 'none') {
            $("#updateProgressDiv").css('display', 'inline');
        }

    }

    // AJAX Updated Animation
    updatedGrid = function() {
        if ($("#updateProgressDiv").css('display') != 'none') {
            $("#updateProgressDiv").css('display', 'none');
        }
    }
});

// Expand & Collapse
function expandColapseDiv(objDiv, objImage) {
    var oDiv = document.getElementById(objDiv);
    var oImg = document.getElementById(objImage);

    if ($(oDiv).is(":hidden")) {
        $(oImg).attr("src", "../images/order/controls_contract.gif");
        $(oDiv).show();
    }
    else {
        $(oImg).attr("src", "../images/order/controls_expand.gif");
        $(oDiv).hide();
    }
}

// Scroll to top of page
function scrollTop() {
    window.document.body.scrollTop = 0;
    window.document.documentElement.scrollTop = 0;
}

