﻿// JScript File

function openwin(url, name)
{
  // Set a contstantWidthHeight
  //name = "NewWindow"
  w = 600;
  h = 300;
  // Fudge factors for window decoration space.
  // In my tests these work well on all platforms & browsers.
  w += 32;
  h += 96;
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;
  // IE5 and other old browsers might allow a window that is
  // partially offscreen or wider than the screen. Fix that.
  // (Newer browsers fix this for us, but let's be thorough.)
  if (wleft < 0) {
    w = screen.width;
    wleft = 0;
  }
  if (wtop < 0) {
    h = screen.height;
    wtop = 0;
  }
  var win = window.open(url,
    name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wleft + ', top=' + wtop + ', ' +
    'location=yes, ' +
    'menubar=yes, status=no, toolbar=no, scrollbars=yes, resizable=yes');
  // Just in case width and height are ignored
  // win.resizeTo(w, h);
  // Just in case left and top are ignored
  // win.moveTo(wleft, wtop);
  // win.focus();
}
   function openOutWin(url) {

        var isNav3 = false;

        var isIE5 = false;

        var feature = "toolbar=yes,directories=yes,status=yes,scrollbars=yes,resize=yes,resizable=yes,menubar=yes,location=yes";

        if (window.screen != null)

        {

                if (navigator.appName.substring(0,8) == "Netscape")

                {

                        w = window.innerWidth * 0.9;

                        h = window.innerHeight * 0.9;

                        feature = feature + ",width=" +w+ ",height=" +h;

                }

                else

                {
                        w = window.innerWidth * 0.9;

                        h = window.innerHeight * 0.9;

                        feature = feature + ",width=" +w+ ",height=" +h;

                /*
                        pos =navigator.appVersion.indexOf('MSIE');

                        if (parseInt(navigator.appVersion.charAt(pos+5)) > 4)

                        {

                                isIE5 = true;

                        }
                        
                  */     
                }

        }

        else

        {

        isNav3 = true;

        }

 

 

        newWin = window.open(url,"TheNewWin",feature);

 

        if (navigator.appName.substring(0,8) == "Netscape" || isIE5)

                newWin.focus();

 

 
         
        return false;

    }


function wopen(url, name, w, h)
{
 
  
  w = (screen.width * 0.85);
  h = (screen.height * 0.5);
  
  // Fudge factors for window decoration space.
  // In my tests these work well on all platforms & browsers.
  
  //w += 32;
  //h += 96;
  
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;
 
  // IE5 and other old browsers might allow a window that is
  // partially offscreen or wider than the screen. Fix that.
  // (Newer browsers fix this for us, but let's be thorough.)
  if (wleft < 0) {
    w = screen.width;
    wleft = 0;
  }
  if (wtop < 0) {
    h = screen.height;
    wtop = 0;
  }
  var win = window.open(url,
    name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wleft + ', top=' + wtop + ', ' +
    'location=no, menubar=yes, ' +
    'status=no, toolbar=yes, scrollbars=yes, resizable=yes');
  // Just in case width and height are ignored
  //win.resizeTo(w, h);
  // Just in case left and top are ignored
  //win.moveTo(wleft, wtop);
  //win.focus();
}


function HFPopUpWin(url) {
var iMyWidth;
var iMyHeight;
var iSWidth;
var iSHeight;
var iSWidth2;
var iSHeight2;

iSWidth = window.screen.width * 0.90
iSHeight = window.screen.height * 0.55

iSWidth2 = iSWidth / 2
iSHeight2 = iSHeight / 2

//half the screen width minus half the new window width (plus 5 pixel borders).

iMyWidth = (window.screen.width/2) - (iSWidth2 + 10);
//half the screen height minus half the new window height (plus title and status bars).
iMyHeight = (window.screen.height/2) - (iSHeight2 + 50);
//Open the window.
var win2 = window.open(url,"Window2","status=no,height=" + iSHeight + ",width=" + iSWidth + ",resizable=yes,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",toolbar=no,menubar=yes,scrollbars=yes,location=yes,directories=no");
win2.focus();
}


