var helpWin; var helpWin2;

function customWin(url,sizeX,sizeY,scrollTF) {
	// calculator size: 616 x 470
	var posX = (screen.width - sizeX) / 2;
	var posY = (screen.height - sizeY) / 2;		
	winStyle = 'height='+sizeY+',width='+sizeX+',top='+posY+',left='+posX+',dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,';
	if (scrollTF == true) { winStyle += 'scrollbars=yes'; } else { winStyle += 'scrollbars=no'; }
	cwin = window.open(url, 'calc', winStyle);
	if (parseInt(navigator.appVersion) >= 4) { cwin.focus(); }};

function Is()
{
  var agent = navigator.userAgent.toLowerCase();
  this.win   = ( (agent.indexOf("win")!=-1) || (agent.indexOf("16bit")!=-1) );   //see if windows client
  this.mac = (agent.indexOf("mac")!=-1);   //see if mac client
  this.major = parseInt(navigator.appVersion);
  this.minor = parseFloat(navigator.appVersion);
  this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
  this.ns2 = (this.ns && (this.major == 2));
  this.ns3 = (this.ns && (this.major == 3));
  this.ns4 = (this.ns && (this.major == 4));
  this.ns5 = (this.ns && (this.major >= 5));
  this.ie   = (agent.indexOf("msie") != -1);
  this.ie3  = (this.ie && (this.major == 2));
  this.ie4  = (this.ie && (this.major == 4));
  this.ie5  = (this.ie && (this.major == 4) && (agent.indexOf("msie 5") != -1) );
  this.op3 = (agent.indexOf("opera") != -1);
  if (this.ns4) { nsDHTML = true; } else if (this.ie4) { ieDHTML = true; }
};

nsDHTML = false; ieDHTML = false; var DHTML = false;
var IE_DHTML = (document.all && document.getElementById) ? true : false;
var NS_DHTML = (document.getElementById && !document.all) ? true : false;
var IE4 = (document.all && !IE_DHTML) ? true : false;
var NS4 = (document.layers) ? true : false;
if (NS_DHTML || IE_DHTML)
  DHTML = true;

is = new Is();

if(nsDHTML)
{
  doc = "document";
  sty = "";
  htm = ".document"
  origWidth = innerWidth;
  origHeight = innerHeight;
  window.captureEvents(Event.RESIZE);
  window.onresize = reDo
}
else if(is.ie4) { doc = "document.all"; sty = ".style"; htm = ""; }
else if (DHTML)	{ }
else {
  if (is.ie3)  { location.replace("http://www.fiscalagents.com/oldbrows.shtml"); }
  else if (is.ns3)  { location.replace("http://www.fiscalagents.com/oldbrows.shtml"); }
  else  { location.replace("http://www.fiscalagents.com/oldbrows.shtml"); }
}

if (is.ie4 || is.ns4) {
  newLine =null;
  if (this.win) { newLine = "\r\n"; }
  else { newLine = "\n"; }
}
//re-sizes page for NS re-size bug avoidance
function reDo() {
  if (is.ns4) {
    if (innerWidth != origWidth || innerHeight != origHeight)
      location.reload();
  }
}
function makeScrollBars()
{
//document length - forces display of scrollbars in NS only
  if(is.ns4)  {
    var h = 0;
    for ( i = 0; i < document.layers.length; i++)  {
      h += document.layers[i].clip.height;
    }
    document.height = h + 50;
  }
};


// used by index.shtml
function openerWin(url)
{
	var sizeX = 640;
	var sizeY = 480;
	var posX = (screen.width - sizeX) / 2;
	var posY = (screen.height - sizeY) / 2;
	winStyle = 'height='+sizeY+',width='+sizeX+',top='+posY+',left='+posX+',dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no';
/*
	win = window.open(url, '', winStyle);
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
*/
	popWin = window.open(url, '', winStyle);
	if (parseInt(navigator.appVersion) >= 4) { popWin.window.focus(); }
};

// if the 'Close this Window' link is clicked in the help window
function closerWin()
{
  if (popWin)
    window.close();
};

function openerCalc(url)
{
	var sizeX = 616;
	var sizeY = 480;
	var posX = (screen.width - sizeX) / 2;
	var posY = (screen.height - sizeY) / 2;
	winStyle = 'height='+sizeY+',width='+sizeX+',top='+posY+',left='+posX+',dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no';
//	win = window.open(url, '', winStyle);
	win = window.open(url, 'calc', winStyle);
//	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	if (parseInt(navigator.appVersion) >= 4) { win.focus(); }
};

function openerQuiz(url)
{
	var sizeX = 600;
	var sizeY = 515;
	var posX = (screen.width - sizeX) / 2;
	var posY = (screen.height - sizeY) / 2;
	winStyle = 'height='+sizeY+',width='+sizeX+',top='+posY+',left='+posX+',dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no';
//	win = window.open(url, '', winStyle);
	win = window.open(url, 'calc', winStyle);
//	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	if (parseInt(navigator.appVersion) >= 4) { win.focus(); }
};


// used by moneyman, toolbox
function openHelp(url)
{
  if (helpWin)
    closeHelp();

	var sizeX = 240;
	var sizeY = 470;
	var posX = (screen.width - sizeX) / 20;
	var posY = (screen.height - sizeY) / 2;
	winStyle = 'height='+sizeY+',width='+sizeX+',top='+posY+',left='+posX+',dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no';
//	win = window.open(url, '', winStyle);
	helpWin = window.open(url, 'hw', winStyle);
//	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	if (parseInt(navigator.appVersion) >= 4) { helpWin.focus(); }
};

function openHelp2(url)
{
  if (helpWin2)
    closeHelp();
	var sizeX = 240;
	var sizeY = 470;
	var posX = (screen.width - sizeX) / 20;
	var posY = (screen.height - sizeY) / 2;
	winStyle = 'height='+sizeY+',width='+sizeX+',top='+posY+',left='+posX+',dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no';
//	win = window.open(url, '', winStyle);
	helpWin2 = window.open(url, 'hw2', winStyle);
//	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	if (parseInt(navigator.appVersion) >= 4) { helpWin2.focus(); }
};

// if the 'Close' image is clickied in the help window
function closerHelp()
{
    window.close();
};

// when new help page is displayed or a page is unloaded, close help window (if any open)
function closeHelp()
{
  if (nsDHTML)  {
    if (helpWin.closed == "false")  {
      helpWin.close();
    }
  }
  else if (ieDHTML)  {
    if (helpWin)  {
      helpWin.close();
    }
  }
  helpWin = "";
};

function openThanks(){ helpWin = window.open('/rates/iqa_thankyou.htm','','dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=530,height=507');
  helpWin.focus(); } var helpWin;