﻿var popupStatus = 0;

function loadPopupPerson() {
    if (popupStatus == 0) {
        $("popupPersonBackground").setStyle("opacity", "0.7");
        $("popupPersonContainer").setStyle("display", "block");
        $("popupPersonBackground").setStyle("display", "block");
        popupStatus = 1;
    }
}

function loadFlashPopup()
{
    if (popupStatus == 0) {
        $("flashPopupBackground").setStyle("opacity", "0.7");
        $("flashPopupContainer").setStyle("display", "block");
        $("flashPopupBackground").setStyle("display", "block");
        popupStatus = 1;
    }
}

function centerFlashPopup() {
    var rootObject = (document.documentElement && document.compatMode == 'CSS1Compat') ? document.documentElement : document.body;
    var vpWidth = self.innerWidth ? self.innerWidth : rootObject.clientWidth; // viewport width
    var vpHeight = self.innerHeight ? self.innerHeight : rootObject.clientHeight; // viewport height 

    var windowWidth = document.documentElement.clientWidth;
    var windowHeight = document.documentElement.clientHeight;

    var popupHeight = $("flashPopupContainer").getStyle("height").toInt();
    var popupWidth = $("flashPopupContainer").getStyle("width").toInt();
    if (popupHeight == 0) popupHeight = 600;
    if (popupWidth == 0) popupWidth = 600;
    
    $("flashPopupContainer").setStyle("position", "absolute");
    $("flashPopupContainer").setStyle("top", rootObject.scrollTop + 20 + "px");
    $("flashPopupContainer").setStyle("left", ((vpWidth / 2) - (popupWidth / 2)) - (vpWidth / 35) + "px");
    //only need force for IE6
    $("flashPopupBackground").setStyle("height", windowHeight);
}


function disableFlashPopup() {
    
    
    document.getElementById("flashPopupContainer").style.display = 'none';
    document.getElementById("flashPopupBackground").style.display = 'none';}


function disablePopupPerson() {
    document.getElementById("popupPersonContainer").style.display = 'none';
    document.getElementById("popupPersonBackground").style.display = 'none';
    popupStatus = 0;
}

function centerPopupPerson() {
    var rootObject = (document.documentElement && document.compatMode == 'CSS1Compat') ? document.documentElement : document.body;
    var vpWidth = self.innerWidth ? self.innerWidth : rootObject.clientWidth; // viewport width
    var vpHeight = self.innerHeight ? self.innerHeight : rootObject.clientHeight; // viewport height 

    var windowWidth = document.documentElement.clientWidth;
    var windowHeight = document.documentElement.clientHeight;

    var popupHeight = $("popupPersonContainer").getStyle("height").toInt();
    var popupWidth = $("popupPersonContainer").getStyle("width").toInt();
    if (popupHeight == 0) popupHeight = 600;
    if (popupWidth == 0) popupWidth = 600;
    
    $("popupPersonContainer").setStyle("position", "absolute");
    $("popupPersonContainer").setStyle("top", rootObject.scrollTop + 20 + "px");
    $("popupPersonContainer").setStyle("left", ((vpWidth / 2) - (popupWidth / 2)) - (vpWidth / 35) + "px");
    //only need force for IE6
    $("popupPersonBackground").setStyle("height", windowHeight);
}