//----------- Browser Detection -----------

var oldTimer = true;

if (parseInt(navigator.appVersion) >= 4) {
  oldTimer = false;
  var browserVar = navigator.platform;
  var isWin = browserVar.indexOf("Win") != -1;
  var isMac = browserVar.indexOf("Mac") != -1;
  if (document.layers) {
    var n4 = true;
  } else if (document.getElementById && !(document.all)) {
    var ns = true;
  } else if (document.getElementById && document.all) {
    var ie = true;
  } else if(document.all) {
    var i4 = true;
  }
}

//----------- OpenWindow -----------

function getAttr(height,width){

if (ns) {
         dialogleft = window.screenX + ((window.outerWidth - width) / 2);
         dialogtop = window.screenY + ((window.outerHeight - height) / 2);
         var attr = "screenX=" + dialogleft + ",screenY=" + dialogtop + ",width=" + width + ",height=" + height;
      } else if (ie){
         dialogleft = (screen.width - width) / 2;
         dialogtop = (screen.height - height) / 2;
         var attr = "left=" + dialogleft + ",top=" + dialogtop + ",width=" + width + ",height=" + height;
      } else {
      	 var attr = "width=" + width + ",height=" + height;
      }
      return (attr);
}


function OpenWindow(height,width){
	attr = getAttr(height,width);
	dialog = window.open('nir.html','NIR','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,' + attr);
	dialog.opener = this;
}
