/// <summary>
/// application javascript functions
/// 
/// Copyright © 2002, NSW Department of Information Technology & Management 
/// Version: $Revision: 16 $
/// </summary>

	var agt			= navigator.userAgent.toLowerCase();
	var is_gecko	= (agt.indexOf('gecko') != -1);
	var is_ie		= ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	var is_nav		= ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
						&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
						&& (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
	var is_major	= parseInt(navigator.appVersion);
	var is_nav6up	= (is_nav && (is_major >= 5)); 

	var winW, winH



	function GetWinMetrics()
	{
		if (is_ie || is_nav6up)
		{
			winW = document.body.clientWidth;
			winH = document.body.clientHeight;
		}
		else
		{
			winW = window.innerWidth;
			winH = window.innerHeight;
		}
	}

	function goReturn(evt,ButtonToClick) 
	{
		if (is_ie)
		{
			getKey=window.event.keyCode;
		}
		else  
		{
   			getKey=evt.which;
		}
		if (getKey == 13)
		{
			if (is_ie) 
			{
				window.event.keyCode=0;
			}

			eval('document.forms[0].'+ButtonToClick).focus();
			eval('document.forms[0].'+ButtonToClick).click();
		}
	}

	function CheckForClicked()
	{
		if (is_nav6up || is_ie)
		{
		   if (document.getElementById('txtPayStatus').value == 'Clicked')
		   {
			 return false;
		   }
		}
		else if (is_nav)
		{
		    if (document.forms[0].elements['txtPayStatus'].value == 'Clicked')
		    {
			 return false;
		    }
		}
	}

	function MaximiseWindow()
	{
		top.window.moveTo(0,0);
		if (is_ie) 
		{
			top.window.resizeTo(screen.availWidth,screen.availHeight);
		}
		else if (is_nav) 
		{
			if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
			{
				top.window.outerHeight = screen.availHeight;
				top.window.outerWidth = screen.availWidth;
			}
		}
	}
