﻿// JScript File

function ShowPopUp(sURL,iHeight,iWidth){
	var iLeft=(screen.width-iWidth)/2;
	var iTop=(screen.height-iHeight)/2;
	var winDialog = open(sURL,"WELIS","height="+iHeight+",width="+iWidth+",left="+iLeft+",top="+iTop+",alwaysRaised=no,dependent=no,toolbar=no,resizable=no");
}

function GetUniqueTitle(){
    var currentDateTime = new Date();
    var DateTime = currentDateTime.getHours() * 1000 + currentDateTime.getMinutes() * 100 + currentDateTime.getSeconds() * 10 ;
    return(DateTime);
};

function OpenWebDemo(sURL, bShowToolbars, bShowScrollbars) {
    var iToolbar=0;
    var iLocation=0;
    var iStatus=0;
    var iMenuBar=0;
    var iScrollBar=0;
    if(bShowToolbars){
        iToolbar=1;
        iLocation=1;
        iStatus=1;
        iMenuBar=1;
    }
    if(bShowScrollbars){iScrollBar=1;}
    var percent = 0.9;
    var lLeft=(screen.width * (1-percent))/2;
    var lTop=(screen.height * (1-percent))/4;
    var lWidth=screen.width * percent;
    var iNumberOfBrowserToolbars=Math.max(iToolbar + iLocation + iStatus + iMenuBar, 1);
    var iBrowserToolbarOffset=iNumberOfBrowserToolbars * 30;
    var lHeight=screen.height * percent - iBrowserToolbarOffset;
    var sArgs = "top=" + lTop + ",left=" + lLeft + ",height=" + lHeight + ",width=" + lWidth + ",toolbar=" + iToolbar + ",location=" + iLocation + ",status=" + iStatus + ",menubar=" + iMenuBar + ",scrollbars=" + iScrollBar + ",resizable=1";
    if (bShowToolbars) {
        window.open(sURL);
    } else {
        var popUp = window.open(sURL, GetUniqueTitle(), sArgs);
    }   
}

