﻿//function testfunc() {
//    alert('yes');
//}

////SETTING UP OUR POPUP ************************************************************
////0 means disabled; 1 means enabled;
//var popupStatus = 0;


////loading popup with jQuery magic!
//function loadPopup(sID){
//    //loads popup only if it is disabled
//    if (popupStatus == 0) {
//        $("#hfLastPopupID").val(sID);
//        $("#backgroundPopup").css({
//            "opacity": "0.7"
//        });
//        $("#backgroundPopup").fadeIn("slow");
//        $("#" + sID).fadeIn("slow");
//        popupStatus = 1;
//    }
//}

////disabling popup with jQuery magic!
//function disablePopup(sID){
//    if(popupStatus==1){
//        $("#backgroundPopup").fadeOut("slow");
//        $("#" + $("#hfLastPopupID").val()).fadeOut("slow");
//        popupStatus = 0;
//    }
//}

////centering popup
//function centerPopup(sID){
//debugger;
//    //request data for centering
//    $("#hfLastPopupID").val(sID);
//    var windowWidth = document.documentElement.clientWidth;
//    var windowHeight = document.documentElement.clientHeight;
//    var popupHeight = $("#" + $("#hfLastPopupID").val()).height();
//    var popupWidth = $("#" + $("#hfLastPopupID").val()).width();
//    var leftPos = windowWidth/2-popupWidth/2;
//    var topPos = windowHeight/2-popupHeight/2;
//    if(leftPos < 0)
//    {
//        leftPos = 0;
//    }
//    if(topPos < 0)
//    {
//        topPos = 0;
//    }
//        
//    //centering
//    $("#" + $("#hfLastPopupID").val()).css({
//        "position": "absolute",
//        "top":topPos,
//        "left":leftPos
//        });
//        //only need force for IE6
//        $("#backgroundPopup").css({
//        "height": windowHeight
//        });
//}

//// load any events for the popup
//$(document).ready(function(){   
//    // close popup events
//    $(".popupContactClose").click(function() { disablePopup($("#hfLastPopupID").val()); });
//    $("#backgroundPopup").click(function() { disablePopup($("#hfLastPopupID").val()); });   
//    $(document).keypress(function(e){
//       if(e.keyCode==27 && popupStatus==1)
//       {
//           disablePopup($("#hfLastPopupID").val());   
//       }   
//    });
//});  