function getBrowser()  // get the browser program name
  {
  if (navigator.appName == null || navigator.appName == "")
    return "other";
  else if (navigator.appName == "Netscape")
    return "netscape";
  else if (navigator.appName == "Microsoft Internet Explorer")
    return "ie";
  else
    return "other";
  }
 
function getBrowserVer(){
  if (navigator.appVersion == null || navigator.appVersion == "")
    return "n/a";
  // fix for IE 5.x appVersion bug, which returns 4.x instead of 5.x
  if (isIE() && navigator.userAgent.indexOf("5.") != -1)
    { 
    var verNum = "";
    var str = navigator.userAgent;
    var pos = str.indexOf("IE ");  // real version num follows "IE "
    for (pos=pos+3; pos<str.length; pos++)  // build verNum string
      if (str.charAt(pos) == "." || 
         (str.charAt(pos) <= "9" && str.charAt(pos) >= "0"))
        verNum += str.charAt(pos);
      else
        break;
    return verNum;
    }
  var verArray = navigator.appVersion.split(" ");
  return verArray[0];
  }
 
function getPlatform(){
  if (navigator.platform == null || navigator.platform == "")
    return "other";
  else if (navigator.platform.indexOf("Mac") >= 0)
    return "mac";
  else if (navigator.platform.indexOf("Win") >= 0)
    return "win";
  else if (navigator.platform.indexOf("Unix") >= 0)
    return "unix";
  else
    return "other";
  }
 
function isNetscape(){
  if (getBrowser() == "netscape")
    return true;
  else
    return false;
  }
 
function isIE(){
  if (getBrowser() == "ie")
    return true;
  else
    return false;
  }
 
function isVer3(){
  if (getBrowserVer() >= 3.0 && getBrowserVer() < 4.0)
    return true;
  else
    return false;
  }
 
function isVer4(){
  if (getBrowserVer() >= 4.0 && getBrowserVer() < 5.0)
    return true;
  else
    return false;
  }
 
function isVer4up(){
  if (getBrowserVer() >= 4.0)
    return true;
  else
    return false;
  }
 
function isVer5(){
  if (getBrowserVer() >= 5.0 && getBrowserVer() < 6.0)
    return true;
  else
    return false;
  }
 
function isMac(){
  if (getPlatform() == "mac")
    return true;
  else
    return false;
  }
 
function isWin(){
  if (getPlatform() == "win")
    return true;
  else
    return false;
  }
 
function isUNIX(){
  if (getPlatform() == "unix")
    return true;
  else
    return false;
  }
 
function isMac(){
  if (getPlatform() == "mac")
    return true;
  else
    return false;
  }
function PopUp( strURL, strWinName, intWidth, intHeight, strAddFeatures) {
var windowa = null;
var windowa_closed = false;
var w = 480;
var h = 340;
var theBrowser=getBrowser();
var theBrowserVer=getBrowserVer();
var theOS=getPlatform();

if (theOS=="mac"){ //macOs
     w = screen.availWidth;
     h = screen.availHeight;
     intWidth=intWidth + 100;
     intHeight=intHeight + 100;
}
if (theOS=="win"){ //winOS
 if (document.all){ //ie browser
     w = screen.availWidth;
     h = screen.availHeight;
     intWidth=intWidth;
     intHeight=intHeight;
  }
  else{ //netscape browser
     w = screen.availWidth;
     h = screen.availHeight;
     intWidth=intWidth;
     intHeight=intHeight;
   }  
}

var leftPos = (w-intWidth)/2;
var topPos = (h-intHeight)/2;

args = "Width=" + intWidth + "," + "Height=" + intHeight + "," + strAddFeatures + "," + "top=" + topPos + "," + "left=" + leftPos;
windowa = window.open( strURL,strWinName,args );

if (windowa_closed) {
        windowa_closed = false;
    }
}

function webcam( strURL, strWinName, intWidth, intHeight, strAddFeatures) {
var windowa = null;
var windowa_closed = false;
var w = 480;
var h = 340;
var leftOffSet=100;
var topOffSet=100;
var theBrowser=getBrowser();
var theBrowserVer=getBrowserVer();
var theOS=getPlatform();

if (theOS=="mac"){ //macOs
     w = screen.availWidth;
     h = screen.availHeight;
     intWidth=intWidth + 100;
     intHeight=intHeight + 100;
}
if (theOS=="win"){ //winOS
 if (document.all){ //ie browser
     w = screen.availWidth;
     h = screen.availHeight;
     intWidth=intWidth;
     intHeight=intHeight;
  }
  else{ //netscape browser
     w = screen.availWidth;
     h = screen.availHeight;
     intWidth=intWidth;
     intHeight=intHeight;
   }  
}

var leftPos = (w-intWidth)/2 - leftOffSet;
var topPos = (h-intHeight)/2 - topOffSet;

args = "Width=" + intWidth + "," + "Height=" + intHeight + "," + strAddFeatures + "," + "top=" + topPos + "," + "left=" + leftPos;
windowa = window.open( strURL,strWinName,args );

if (windowa_closed) {
        windowa_closed = false;
    }
}

function closeWin() {
    if (windowa != null) {
        if (!windowa_closed) {
            windowa_closed = true;
            windowa.close();
        }
    }
}

function stopError() {
      return true;
}
window.onerror = stopError;
