﻿    function openCustomDimensionWindow(Uri,WinName,WinWidth,WinHeight,scrolls)
    {
        var ScSize = getScreenSizes();
        var sFea="height="+ WinHeight +",width="+ WinWidth +",scrollbars="+ scrolls +",status=no,toolbar=no,menubar=no,location=no,left=" + ((ScSize[0]/2) - (WinWidth/2)) + ",top=" + ((ScSize[1]/2) - (WinHeight/2));
        //var sFea="height="+ WinHeight +",width="+ WinWidth +",status=no,toolbar=no,menubar=no,location=no,left=0,top=0";
        window.open(Uri,WinName,sFea);
    }
    
    function getScreenSizes()
    {
        var winWidth;
        var winHeight;
        var xOffset;
        var yOffset;
        if (screen)
        { 
            winWidth = screen.availWidth;
            winHeight = screen.availHeight;
            xOffset = document.body.scrollLeft;
            yOffset = document.body.scrollTop;
        }
        if(document.documentElement.clientWidth)
        {
            //alert(document.documentElement.clientWidth +" "+winWidth);
            winWidth = document.documentElement.clientWidth;
            winHeight = document.documentElement.clientHeight;
            xOffset = document.documentElement.scrollLeft;
            yOffset = document.documentElement.scrollTop;
        }
        return [winWidth,winHeight,xOffset,yOffset];
    }
    
    function openFullWin(Uri,WinName)
    {
        var winWidth;
        var winHeight;
        if (screen)
        { 
            winWidth = screen.availWidth;
            winHeight = screen.availHeight;
        }
        if(document.documentElement.clientWidth)
        {
            //alert(document.documentElement.clientWidth +" "+winWidth);
            winWidth = document.documentElement.clientWidth;
            winHeight = document.documentElement.clientHeight;
        }
        //if (navigator.appName.indexOf("Microsoft")!=-1) 
        //   winHeight-=30;
        var sFea="height="+ winHeight +",width="+ winWidth +",status=no,toolbar=no,menubar=no,location=no,left=0";
        window.open(Uri,WinName,sFea);
    }