﻿/*
URL             /net/scripts/scripts.js
Domain			Shared
Last Reviewed	2/15/11
Purpose			shared common javascript
See file ~/App_Code/scripts.js.notes.txt" for notes and comments
matching the tags in this file:  "See note iiKB-yyyy-mm-ddThh:mm:ss" 
*/

$(document).ready(function () {

    /* See Note iiKB-2009-11-27T04:50:42 */
    var myElem = document.getElementById("divFooterFiller");
    if (myElem) {
        $get("divFooterFiller").style.height = $(document).height() - $('#total_wrapper').height() + 15 + 'px';
    }

});


//Begin test popoup section 
//SETTING UP OUR POPUP
//0 means disabled; 1 means enabled;
var popupStatus = 0;

//loading popup with jQuery magic!
function loadPopup() {
    //loads popup only if it is disabled
    if (popupStatus == 0) {
        $("#backgroundPopup").css({
            "opacity": "0.7"
        });
        $("#backgroundPopup").fadeIn("slow");
        $("#popupContact").fadeIn("slow");
        popupStatus = 1;
    }
}

//disabling popup with jQuery magic!
function disablePopup() {
    //disables popup only if it is enabled
    if (popupStatus == 1) {
        $("#backgroundPopup").fadeOut("slow");
        $("#popupContact").fadeOut("slow");
        popupStatus = 0;
    }
}


//CONTROLLING EVENTS IN jQuery
$(document).ready(function () {

    //LOADING POPUP
    //Click the button event!
    $("#divButShowMenu").click(function () {
        //load popup
        loadPopup();
    });

    //CLOSING POPUP
    //Click the x event!
    $("#popupContactClose").click(function () {
        disablePopup();
    });
    $("#popupContactClose2").click(function () {
        disablePopup();
    });

    //Click out event!
    $("#backgroundPopup").click(function () {
        disablePopup();
    });

});

//end test popoup section
