// Browser Check -----------------------------------------------
var ns4 = (document.layers) ? true:false;
var ns6 = (document.getElementById) ? true:false;
var ie4 = (document.all) ? true:false;
var ie5 = false;

if (ie4)
{
  if (navigator.userAgent.indexOf('MSIE 5') > 0) 
    ie5 = true;

  if (ns6) 
    ns6 = false;
}

var Netscape4 = (navigator.appName == "Netscape" && navigator.appVersion.substring(0, 1) >= "4");
var Explorer4 = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0, 1) >= "4");

function sizer()
{
  if (ie4 || ie5)
  {
    var minS = 760;
    var maxS = 840;

    if (document.body.clientWidth >= maxS)
    {
      document.all.wire2.width = maxS;
    }
    else if (document.body.clientWidth <= minS)
    {
      document.all.wire2.width = minS;
    }
    else
    {
      document.all.wire2.width = document.body.clientWidth;
    }
  }
}

function stiliser()
{
  if (Netscape4)
    document.write('<LINK REL="stylesheet" HREF="../css/style_ns.css" TYPE="text/css">')
  else
    document.write('<LINK REL="stylesheet" HREF="../css/style_ie.css" TYPE="text/css">')
}

function myWinOpener(myUrl, myTitle, p_width, p_height)
{
  if (!p_width)
  {
    p_width = 600;
    p_height = 400;
  }

  if (Explorer4)
    myUrl = "/YKYeBranchLogon/includes/popup.asp?myUrl=" + myUrl + "&myTitle=" + myTitle;

  myWin = window.open(myUrl, "", "toolbar=0, width=" + p_width + ", height=" + p_height + ", location=0, directories=0, status=0, scrollbars=1, menubar=0, resizable=1, copyhistory=1");
  myWin.location.href = myUrl;
  myWin.focus();
}

function simpleWin(myUrl, p_width, p_height)
{
  if (!p_width)
  {
    p_width = 600;
    p_height = 400;
  }

  myWin = window.open(myUrl, "", "toolbar=0, width=" + p_width + ", height=" + p_height + ", location=0, directories=0, status=0, scrollbars=1, menubar=0, resizable=1, copyhistory=1");
  myWin.location.href = myUrl;
  myWin.focus();
}

function hizli(url)
{
  if (url != 'none')
    location.href = url;
}

var SeansOdamWinHandle;

function SeansOdamWin(url)
{
  if (SeansOdamWinHandle)
  {
    if (!SeansOdamWinHandle.closed)
    {
      SeansOdamWinHandle.focus();
      return;
    }
  }
  
  p_width = 790;
  p_height = 500;

  SeansOdamWinHandle = window.open(url, "SeansOdam", "toolbar=0, width=" + p_width + ", height=" + p_height + ", location=0, directories=0, status=1, scrollbars=0, menubar=0, resizable=0, copyhistory=0, left=0, top=0");
  SeansOdamWinHandle.location.href = url;
  SeansOdamWinHandle.focus();
}
