function goPage()
{
  pageNo = document.pager.goWhere.selectedIndex
  if (pageNo == 0 || pageNo == 5 || pageNo == 6) {
    top.location.href = document.pager.goWhere.options[pageNo].value } else {
    parent.location.href = document.pager.goWhere.options[pageNo].value
  }
}
function openWindow(url,width,height)
{
  var params="menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,dependent,top=0,left=0,width="+width+",height="+height;
  popupWin = window.open(url, 'popup',params);
  popupWin.focus();
}
function CalculatorWindow(filename)
{
  window.open(filename,'Calculators','menubar=no,location=no,menus=no,scrollbars,resizable=1,status=yes,top=5,width=540,height=570');
}
function NewWindow(filename)
{
  window.open(filename,'New','menubar=no,toolbar=no,location=no,menus=no,scrollbars,resizable=1,status=yes,top=5,width=630,height=580');
}

function csWindow(filename)
{
  window.open(filename,'csw','menubar=no,toolbar=no,location=no,menus=no,scrollbars,resizable=1,status=yes,top=5,width=800,height=600');
}
function privacy(filename)
{
  window.open(filename,'priv','menubar=no,location=no,menus=no,resizable=1,status=no,top=5,width=400,height=300');
}
function fsra(filename)
{
  window.open(filename,'fsra','menubar=no,location=no,menus=no,scrollbars,resizable=1,status=no,top=5,width=500,height=450');
}
function securitisation(filename)
{
  window.open(filename,'sec','menubar=no,location=no,menus=no,scrollbars=yes,resizable=1,status=no,top=5,width=500,height=450');
}
function DemoWindow(filename)
{
  window.open(filename,'demo','menubar=no,toolbar=no,location=no,menus=no,scrollbars=no,resizable=no,status=no,top=5,width=775,height=450');
}
function MLWindow(filename)
{
  window.open(filename,'MLWindow','menubar=yes,location=yes,menus=yes,scrollbars=yes,resizable=1,status=yes,width=770,height=480');
}

function Login(s) {
	for (var i = 0; i < document.login_form.selectlog.length; i++) {
		if (document.login_form.selectlog[i].checked) {
			var str = document.login_form.selectlog[i].value;
			break;
		}
	}
	var arrayOfURL = str.split(",");
	var URL1 = arrayOfURL[0];
	var URL2 = arrayOfURL[1];
	if (s == 1)
	{
		if (URL1 != "") window.location.href = URL1;
	}
  else
	{
		if (URL2 != "") window.location.href = URL2;
	}
}

//This script will fix the print screen problem on IE 4

var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1);

function printPage() {
  if (pr) // NS4, IE5
    window.print()
  else if (da && !mac) // IE4 (Windows)
    vbPrintPage()
  else // other browsers
    alert("Sorry, your browser doesn't support this feature.");
  return false;
}

if (da && !pr && !mac) with (document) {
  writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
  writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
  writeln('Sub window_onunload');
  writeln('  On Error Resume Next');
  writeln('  Set WB = nothing');
  writeln('End Sub');
  writeln('Sub vbPrintPage');
  writeln('  OLECMDID_PRINT = 6');
  writeln('  OLECMDEXECOPT_DONTPROMPTUSER = 2');
  writeln('  OLECMDEXECOPT_PROMPTUSER = 1');
  writeln('  On Error Resume Next');
  writeln('  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
  writeln('End Sub');
  writeln('<' + '/SCRIPT>');
}

//pops up the pdf for economic commentary etc.
function formHandler(form)
{
  var URL = document.form.site.options[document.form.site.selectedIndex].value;
  window.open(URL);
}
