
var baseText = null;

function showPopup(w, h) {
    var snippetPopUp = document.getElementById("snippetPopUpContent");

    if (snippetPopUp.childNodes.length > 0) {

        var popUp = document.getElementById("popupcontent");

        if (popUp.childNodes.length > 0) {

            popUp.style.marginTop = ((screen.height / 2) - (h / 2)) + "px";

            popUp.style.marginLeft = ((screen.width / 2) - (w / 2)) + "px";

            popUp.style.width = w + "px";

            popUp.style.height = h + "px";


            if (baseText == null) baseText = popUp.innerHTML;

            popUp.innerHTML = baseText +

	"<div id=\"statusbar\"><img src ='/images/close.gif' onclick='hidePopup();' alt='Close' style='padding:0px; margin:0px; background:none;' /></div>";

            var sbar = document.getElementById("statusbar");

            var browser = navigator.appName;
            if (browser == "Microsoft Internet Explorer") {
                sbar.style.marginLeft = (parseInt(w) - 31) + "px";

                sbar.style.marginTop = (5 - parseInt(h)) + "px";
            }
            else {
                sbar.style.marginLeft = (parseInt(w) - 31) + "px";

                sbar.style.marginTop = (5 - parseInt(h)) + "px";
            }

            popUp.style.visibility = "visible";
            popUp.style.display = "block";
        }
    }
}


function hidePopup(){

	var popUp = document.getElementById("popupcontent");

	popUp.style.visibility = "hidden";
	popUp.style.display = "none";

}

