  // EPL general javascript functions
// ********************************

	// This code check for flash on the user's computer
	// #############################################
	// these are the user defined globals
	// modify the following variables to customize the inspection behaviour

	var requiredVersion = 4;			// version the user needs to view site (max is 5, min is 2)
	var useRedirect = true; 			// "true" loads new flash or non-flash page into browser
										// "false" embeds movie or alternate html code into current page

	// set next three vars if useRedirect is true...

	var upgradePage = "upgrade.html"	// send user here if we detect an old plugin
	// #############################################



	// *************
	// everything below this point is internal until after the body tag
	// do not modify! 
	// *************

	// system globals
	var flash2Installed = false;		// boolean. true if flash 2 is installed
	var flash3Installed = false;		// boolean. true if flash 3 is installed
	var flash4Installed = false;		// boolean. true if flash 4 is installed
	var flash5Installed = false;		// boolean. true if flash 5 is installed
	var flash6Installed = false;		// boolean. true if flash 5 is installed
	var maxVersion = 6;					// highest version we can actually detect
	var actualVersion = 0;				// version the user really has
	var hasRightVersion = false;		// boolean. true if it's safe to embed the flash movie in the page
	var jsVersion = 1.0;				// the version of javascript supported

	// check the browser...we're looking for ie/win
	var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;		// true if we're on ie
	var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true if we're on windows

	// this is a js1.1 code block, so make note that js1.1 is supported.
	jsVersion = 1.1;

	// write vbscript detection if we're not on mac.
	if(isIE && isWin){ // don't write vbscript tags on anything but ie win
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');
		document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
		document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
		document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
		document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');	
		document.write('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
	}

	// next comes the standard javascript detection that uses the navigator.plugins array
	// we pack the detector into a function so it loads before we run it
    
 

    
	
	

//********************************************************
// ANZ ONLINE SERVICES section - Log on Application & Registration
//********************************************************

function doValidate(action)
{	
	var newWin
	if (action == "LogIn") 
	{
		switch (document.frm01.MarketsOnline[document.frm01.MarketsOnline.selectedIndex].value)
		{
			case "empty":
						return(alert("Please select a service."));
			case "CMOnline":
						return(window.open('https://cm.online.anz.com', 'CMOnline').focus());
			case "FXOnline-Asia/Pacific":
						return(window.open('https://fxonline.au.anz.com/FX/ANZlogin/', 'FXOnline','height=600,width=800').focus());
			case "FXOnline-UK/Europe":
						return(window.open('http://fxonline.anz.com/', 'FXResearch').focus());
			case "Markets Research":
						return(window.open('http://www.anz.com/Markets/Research/Research.asp?setID=0,1,1', 'Markets').focus());
			case "FX Online Sphinx":
						return(window.open('https://services.anz.com/fxonline/sphinx/login.asp', 'FXOnlineSphinx').focus());
			case "ANZ FX Online-VTH":
						return(window.open('https://markets.online.anz.com/sdppp', 'ANZFXEasy').focus());
			case "eMatching":
						if (document.location.hostname == "anz.dev.anz")
						{
							return(window.open('http://ematching1.dev.anz/', 'eMatching').focus());
						}
						else
						{
							return(window.open('http://ematching.anz.com', 'eMatching').focus());		
						}	
		}						
	}	
	else if (action == "Reg")
	{
		switch (document.frm01.MarketsOnline[document.frm01.MarketsOnline.selectedIndex].value)
		{
			case "empty":
						return(alert("Please select a service."));
			case "CMOnline":
						location.href = "mailto:CapitalMarketsOnline@anz.com";
						return;
			case "FXOnline-Asia/Pacific":
						location.href = "mailto:FXOnline@anz.com";
						return;
			case "FXOnline-UK/Europe":
						location.href = "mailto:FXOnline@anz.com";
						return;
			case "Markets Research":
						location.href = "mailto:anzmarkets@anz.com";
						return;
			case "FX Online Sphinx":
						location.href = "mailto:FXOnline@anz.com";
						return;
		}	
	}
			
	else if (action == "Demo")
	{
		switch (document.frm01.MarketsOnline[document.frm01.MarketsOnline.selectedIndex].value)
		{
			case "empty":
						//Development
									
						//Production
						return(window.open('http://www.anz.com/business/corporatebanking/demo.asp', 'general_Demo').focus());
			case "FXOnline-Asia/Pacific":
						return(window.open('http://demo.fxonline.anz.com/', 'CMResearch_Demo', 'height=600,width=800').focus());
			case "FXOnline-UK/Europe":
						return(window.open('http://demo.fxonline.anz.com/', 'CMResearch_Demo').focus());
			//case "ANZ FX Online-VTH":
			//			return(window.open('http://Markets.onlinedemo.anz.com/', 'CMResearch_Demo').focus());
		}           
	 }
	         
	 else if (action == "FlashDemo")
	{
		switch (document.frm01.MarketsOnline[document.frm01.MarketsOnline.selectedIndex].value)
		{
			case "CMOnline":
						return(window.open('http://www.anz.com/Business/investment_banking/global_capital_markets/stream/default.asp', 'CMResearch_Demo').focus());
									
			case "FXOnline-UK/Europe":
						//Development
									
						//Production
						return(window.open('http://www.anz.com/Business/Investment_Banking/Foreign_Exchange/Stream/', 'CMResearch_Demo').focus());

		}           
	 }
	document.frm01.submit();
}



	


