/*
 *
 * Copyright (c) 2008 George Bonnes (george@olm1.com)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Version 1.0.1
 *
 * $LastChangedDate$
 * $Rev$
 *
 */

function expert_help_form_open() {
    $('#expert_help_form').css('display', 'block');
    
    expert_help_form_set_shim();
    
    $('#expert_help_form').centerElement()
                          .vCenterElement();
    $('#expert_help_form_shim').centerElement()
                               .vCenterElement();
                          
}

function expert_help_form_close() {
    $('#expert_help_form').css('display', 'none');
    $('#expert_help_form_shim').css('display', 'none');
}

function expert_help_form_set_shim() {
    var theform_container = document.getElementById('expert_help_form');
    var theshim = document.getElementById('expert_help_form_shim');
    theform_container.style.display = "block";
    theshim.style.top = theform_container.style.top;
    theshim.style.left = theform_container.style.left;
    theshim.style.width = theform_container.offsetWidth;
    theshim.style.height = theform_container.offsetHeight;
    //alert('container offsetHeight: ' + theform_container.style.height);
    theshim.style.zIndex = theform_container.style.zIndex + 1;
    theshim.style.display = "block";
}

function shopping_cart_product_summary_close() {
    $('#shopping_cart_product_summary').DropOutUp(300)
}


$(document).ready(function() {
    // initialize our loading div to listen for $.ajax broadcasts
    $("#loading").bind("ajaxSend", function(){
        $("#loading").centerElement()
                     .vCenterElement()
                     .jqmShow();
     }).bind("ajaxComplete", function(){
         if (ajax_error == 0) {
            $("#loading").jqmHide();
         }
     });            
     
     $("#loading").jqm({overlay: 30, trigger: false});
     
     $('.hide_on_load').css('display', 'none');
     $('.show_on_load').css('display', 'block');

     $('#hours_box').corner();
     $('#calculator_wrapper').corner();
     $('#navigation_products').corner();
     $('#link_calculators').corner();
     
     $('table.zone_details_prices_table tr:odd').not('[th]').css('background-color', '#EAEAEA');
     
     

    return false;
    
});  // end $(document).ready()




// ajax custom callbacks
function ajax_update_shopping_cart_product_summary_callback() {
    $('#shopping_cart_product_summary').css('display', 'block')
                                       .centerElement()
                                       .vCenterElement();
}

function ajax_form_expert_help_form_callback() {
    expert_help_form_open();
}

    