﻿//var p = new ModalPopup();
//var Content = "<table align='center'><thead ><tr ><td colspan='2' bgcolor='#FFFFFF'  align='right'><a href='javascript:p.popIn();'><font color='#00529C' face='Verdana, Arial, Helvetica, sans-serif'; style='text-decoration:none; padding-right:5px;' size='+2' ><b>Skip </b></font></a></td></tr> </thead><tbody><tr><td colspan='2' align='right'><embed src='SBNP800x400.swf' width='800' height='400' quality-'high' ></embed></td></tr></tbody></table>";
function pageLoad() {
    //BrowserHeightWidth();    
    //p.popOut(800, 400, '');
	return true;
}
function ModalPopup() {
    this.ModalDiv = null;
    this.backgroundDiv = null;
    this.popOut = function(Width, Height, HTMLpageName) {
        BrowserHeightWidth();
        this.backgroundDiv = document.createElement("div");
        this.backgroundDiv.className = "backgroundDiv";
        this.backgroundDiv.style.width = BodyWidth + 'px';
        this.backgroundDiv.style.height = '1000px';
        this.ModalDiv = document.createElement("div");
        this.ModalDiv.className = "ModalDiv";
        this.ModalDiv.style.left = Math.round((BodyWidth - Width) / 2).toString() + 'px';
        this.ModalDiv.style.top = Math.round((BodyHeight - Height) / 2).toString() + 'px';
        this.ModalDiv.id = 'Modals';
        this.ModalDiv.Code = this;
        document.body.appendChild(this.backgroundDiv);
        document.body.appendChild(this.ModalDiv);
        document.getElementById('Modals').innerHTML = Content.toString();
    }
    this.popIn = function() {
        if (this.ModalDiv != null) {
            document.body.removeChild(this.ModalDiv);
            this.ModalDiv = null;
        }
        if (this.backgroundDiv != null) {
            document.body.removeChild(this.backgroundDiv);
            this.backgroundDiv = null;
        }
    }
}


function BrowserHeightWidth() {
    if (self.innerHeight) {
        BodyWidth = self.innerWidth;
        BodyHeight = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight) {
        BodyWidth = document.documentElement.clientWidth;
        BodyHeight = document.documentElement.clientHeight;
    }
    else if (document.body) {
        BodyWidth = document.body.clientWidth;
        BodyHeight = document.body.clientHeight;
    }
}
