//
//      standard_library
//
//      Standard A17's JS helper
//      Copyright 2007 Area 17. All rights reserved.
//

//  Browser Detection

function BrowserDetectLite()
{
  var agent = navigator.userAgent.toLowerCase();

  // Browser version.
  this.versionMajor = parseInt(navigator.appVersion);
  this.versionMinor = parseFloat(navigator.appVersion);

  // Browser name.
  this.gecko        = (agent.indexOf("firefox") != -1) || (agent.indexOf("camino") != -1);
  this.webkit       = (agent.indexOf("webkit") != -1);
  this.ie     = (agent.indexOf("msie") != -1);

  // Platform type.
  this.win   = (agent.indexOf("win")!=-1 || agent.indexOf("16bit")!=-1);
  this.mac   = (agent.indexOf("mac")!=-1);
}

var is = new BrowserDetectLite();

//  Pop-up window opening

function pop(url, name, width, height) {
  var style = (style == null) ? "standard" : style;
  var x = 0; var y = 0; var offset = 30;
  if (screen) { x = (screen.availWidth - width) / 2 };
  if (screen) { y = (screen.availHeight - height) / 2 };
  var popped = window.open(url,'popup','width='+width+',height='+(height)+',status=no,menubar=no,scrollbars=no,resizable=no,screenX='+x+',screenY='+y+',left='+x+',top='+y);
  if (!popped.opener) { popped.opener = window; }
  popped.focus();
}