var mainLinkColor = "#FFB620";

var dimDiv;
var popupDiv;
var popupIFrame;
var centerDiv;


function getVPHeight() {

var vpHeight;

 if (typeof window.innerWidth != 'undefined')
 {
      vpHeight = window.innerHeight
 }
 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
   vpHeight = document.documentElement.clientHeight
 }
 else
 {
   vpHeight = document.getElementsByTagName('body')[0].clientHeight
 }

return vpHeight;
}

function defV() {
    d = document;
    dimDiv = d.getElementById("dimDiv");
    popupDiv = d.getElementById("popupDiv");
    popupIFrame = d.getElementById("popupIFrame");
    centerDiv = d.getElementById("centerDiv");
}

function openPopup(url, width, height) {
    
    if (!dimDiv) {
    defV();
    }

    popupIFrame.src = url;
    popupIFrame.style.width = width + "px";
    popupIFrame.style.height = height + "px";
    popupDiv.style.width = width + "px";
    popupDiv.style.height = (height + 18) + "px";

    vpHeight = getVPHeight();
    scrollTop = window.pageYOffset || document.documentElement.scrollTop || 0;

    newTop = Math.round((vpHeight - (height + 28)) / 2);
    if (newTop < 0) newTop = 0;
    newTop = newTop + scrollTop;
    popupDiv.style.top = newTop + "px";
    
    dimDiv.style.visibility = "visible";
    
    centerDiv.style.visibility = "visible";
    return false;
}

function closePopup() {
    popupIFrame.src = "";

    centerDiv.style.visibility = "hidden";
    dimDiv.style.visibility = "hidden";

    return false;
}