<!--
//*****************************************************************************************
//
// Common_OpenWin.js
// =================
// This file contains the universal javascript code that will be used for all window
// opening procedures. This file will eventually fully replace Common_GlobalVigJS.js
// as the only way to open windows, via the CDA generated pages. None of the code in
// here should be accessed manually. All variables passed to it, should be passed in
// lower case.
// Two new variables added (var Y and var N) to cater for the way CMA builds these functions
//  These additions should now allow the recognition of Y,y,N,n in the globalWindowOpen
// javascript function.
//
//
// Created:
// --------
// 1.00 - 16/10/2001 - RdF
//
// Modified:
// ---------
// 1.01 - 17/01/2002 - EL - Added 2 variables Y and N.
// v.vv - dd/mm/yyyy - XXX - Explination...
// v.vv - dd/mm/yyyy - XXX - Explination...
//
//*****************************************************************************************

//*****************************************************************************************
// Global Variables (if any)
//*****************************************************************************************

var yes = 1;
var Y = 1;
var no = 0;
var N = 0;

//*****************************************************************************************
// Main piece(s) of code
//*****************************************************************************************

function globalWindowOpen(targetURL, windowName, windowWidth, windowHeight, scrollBars,
	menuBar, toolbar, resizable, status, directories, location, leftPix, topPix)
{
	//*********************************************************************************
	// Local Variables (if any)
	//*********************************************************************************
	var strFeatures;
	var strCheckDefinition;

	//*********************************************************************************
	// Validate the "windowName" variable. If the windowName has not been passed
	// through to this function, then it will assign a date/time stamp as the
	// window name. This will allow the same link to spawn off many child windows.
	//*********************************************************************************
	strCheckDefinition = typeof windowName;
	if (strCheckDefinition == "undefined")
	{
		windowName = new Date();
		windowName = windowName.getTime();
		windowName = windowName.toString();
	}

	//*********************************************************************************
	// Build strFeatures list depending on what variables have been passed into this
	// function.
	//*********************************************************************************
	if ((isNaN(parseInt(windowWidth))) || (parseInt(windowWidth) == 0))
	{
		windowWidth = "700";
	}
	strFeatures = "width=" + parseInt(windowWidth);
	if ((isNaN(parseInt(windowHeight))) || (parseInt(windowHeight) == 0))
	{
		windowHeight = "500";
	}
	strFeatures += ",height=" + parseInt(windowHeight);
	if ((scrollBars == "no") || (scrollBars == "n") || (parseInt(scrollBars) == 0))
	{
		strFeatures += ",scrollbars=no";
	}
	else
	{
		strFeatures += ",scrollbars=yes";
	}
	if ((menuBar == "no") || (menuBar == "n") || (parseInt(menuBar) == 0))
	{
		strFeatures += ",menubar=no";
	}
	else
	{
		strFeatures += ",menubar=yes";
	}
	if ((toolbar == "no") || (toolbar == "n") || (parseInt(toolbar) == 0))
	{
		strFeatures += ",toolbar=no";
	}
	else
	{
		strFeatures += ",toolbar=yes";
	}
	if ((resizable == "no") || (resizable == "n") || (parseInt(resizable) == 0))
	{
		strFeatures += ",resizable=no";
	}
	else
	{
		strFeatures += ",resizable=yes";
	}
	if ((status == "no") || (status == "n") || (parseInt(status) == 0))
	{
		strFeatures += ",status=no";
	}
	else
	{
		strFeatures += ",status=yes";
	}
	if ((directories == "no") || (directories == "n") || (parseInt(directories) == 0))
	{
		strFeatures += ",directories=no";
	}
	else
	{
		strFeatures += ",directories=yes";
	}
	if ((location == "no") || (location == "n") || (parseInt(location) == 0))
	{
		strFeatures += ",location=no";
	}
	else
	{
		strFeatures += ",location=yes";
	}
	if (isNaN(parseInt(leftPix)))
	{
		strFeatures += ",left=" + (screen.width/2 - parseInt(windowWidth)/2);
	}
	else
	{
		strFeatures += ",left=" + parseInt(leftPix);
	}
	if (isNaN(parseInt(topPix)))
	{
		strFeatures += ",top=" + (screen.height/2 - parseInt(windowHeight)/2);

	}
	else
	{
		strFeatures += ",top=" + parseInt(topPix);
	}
	strFeatures += ",channelmode=no";

	//*********************************************************************************
	// Open the new window
	//*********************************************************************************

	window.open(targetURL, windowName, strFeatures);
}

//-->

function ext_href (url,winName,winWidth,winHeight,sBars,menuBar,toolbar,resizable,status,dir,loc,lPix,tPix) {
  if (url=="") {url="http://www.national.com.au"};
  if (winName==null) {winName="3rd_party_disclaimer"};
  if (winWidth==null) {winWidth="100"};
  if (winHeight==null) {winHeight="500"};
  if (sBars==null) {sBars="1"};
  if (menuBar==null) {menuBar="1"};
  if (toolbar==null) {toolbar="1"};
  if (resizable==null) {resizable="1"};
  if (status==null) {status="1"};
  if (dir==null) {dir="1"};
  if (loc==null) {loc="1"};
  if (lPix==null) {lPix="1"};
  if (tPix==null) {tPix="1"};

  url= "/disclaimer/3rd_party_disclaimer.html?"+url+","+winName+","+winWidth+","+winHeight+","+sBars+","+menuBar+","+toolbar+","+resizable+","+status+","+dir+","+loc+","+lPix+","+tPix;
  globalWindowOpen(url,'winName',400,400,0,0,0,0,0,0,0,20,100);
}