<!-- BEGIN SNlibWindow.js, V1.0, 16.04.2001

// if: ffa (free for all) by www.sopnet.ch
// at: cs@sopnet.ch

// fn: SN_GetWin<property>() V1.0
// dc: Get the Window<property> 
// rm: For ie must be run after the body is loaded (onload)
//
function SN_GetWinHeight() {
  if (document.all) { // ie
    //alert("SN_GetWinHeight not working with IE");
    wsize = "IE??"; //wsize = document.body.clientHeight;
  } else  // ns
    wsize = window.outerHeight;
 return wsize;
}
function SN_GetWinWidth() {
  if (document.all) { // ie
    //alert("SN_GetWinWidth not working with IE");
    wsize = "IE??"; //wsize = document.body.clientWidth;
  } else // ns
    wsize = window.outerWidth;
 return wsize;
}

function SN_DispWinSize() {
  sizeH = SN_GetWinHeight();
  sizeW = SN_GetWinWidth();
  alert ('w-w=' + sizeW + '  w-h=' + sizeH);
}
// END fn: SN_GetWin....


// fn: SN_SetWin<property>(<args>) V1.0
// dc: Set the Window<property>
// rm: .
//
function SN_SetWinHeight(dsize) {
  if (screen.height < dsize)
    dsize=screen.height;

  if (document.all)  // ie
    document.body.clientHeight = dsize;
  else  // ns
    window.outerHeight = dsize;
}

function SN_SetWinWidth(dsize) {
  if (screen.width < dsize)
    dsize=screen.width;

  if (document.all)  // ie
    document.body.clientWidth = dsize;
  else  // ns
    window.outerWidth = dsize;
}

function SN_SetWinSize(dsizeW, dsizeH) {
 if (document.getElementById || document.all) {
   top.window.resizeTo(dsizeW, dsizeH);
 } else {  // NS4 (resizeTo ist falsch)
   SN_SetWinWidth(dsizeW);
   SN_SetWinHeight(dsizeH);
   location.reload();
 }
}

function SN_SetWinSizeOpt(dsizeWdef,dsizeHdef) {

  if (window.screen){
    var scrW = window.screen.availWidth;
    var scrH = window.screen.availHeight;
  } else {
    //alert("no windows?");
    return;
  }

  if (typeof(dsizeWdef) == "undefined")
    dsizeWdef = scrW;
  if (typeof(dsizeHdef) == "undefined")
    dsizeHdef = scrH;

  var winW = dsizeWdef;
  var winH = dsizeHdef;

  if (scrW < dsizeWdef)
    winW = scrW;
  if (scrH < dsizeHdef)
    winH = scrH;

  //alert("scr:" + scrW + "x" + scrH + "  win:" +  winW + "x" + winH + "  def:" + dsizeWdef + "x" + dsizeHdef);

  top.window.moveTo(0,0);
  SN_SetWinSize(winW, winH);

  //if (document.all)
  //IE
    //if (window.frameElement)
      //alert("FRAME! " + window.frameElement.src);
}
// END fn: SN_SetWin....


// fn: SN_OpenWin(winurl,wintitle,winoptions) V1.0
// dc: Open a window with url loaded
// rm: 
// ex: mywin = SN_OpenWin('../gb/guestbook.html','Guestbook','height=400,width=600,screenX=40,left=40,screenY=40,top=40,channelmode=0,dependent=1,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0');
function SN_OpenWin(winurl,wintitle,winoptions) {
  var mywin = null;
  mywin = window.open(winurl,wintitle,winoptions);
return mywin;
}
// END fn: SN_OpenWin

// fn: SN_CloseWin(mywin) V1.0
// dc: Close window
// rm: 
function SN_CloseWin(mywin) {
  if (mywin && mywin.open && !mywin.closed) mywin.close();
}
// END fn: SN_CloseWin


// END SNlibWindow.js  -->