
/***************************************************/
/* start - pop up code                             */
/***************************************************/

//OPERA LINK
function operaLink(url)
{
//FUNCTION START
 

	function checkIt(string)
	{
		place = detect.indexOf(string) + 1;
		thestring = string;
		return place;
	}

var isOFF = "n";
var macsafariV3URL="/_site/technical/onlineservicing/checks/macsafariv3.html";
var winsafariV3_1URL="/_site/technical/onlineservicing/checks/winsafariv3_1.html";
var firefox_notV3URL="/_site/technical/onlineservicing/checks/firefoxv3.html";
var winoperaURL="/_site/technical/onlineservicing/checks/opera.html";

//****UNCOMMENT THE 2 LINES BELOW TO HIDE THE OPERA APPLICATION, BY FORCING THE LINK TO REDIRECT TO A HOLDING PAGE
//url="/_site/technical/holding/opera-updating.html";
//isOFF = "y";


//IF#1
if(isOFF=="n")
{
// FUNCTIONALITY IS SWITCHED ON, SO PERFORM BROWSER CHECKS

	var detect = navigator.userAgent.toLowerCase();
	var OS,browser,version,firefox;
	var app1 = navigator.appName.toLowerCase();
	var vers = navigator.appVersion

	if (checkIt('macintosh')) {OS = "Mac"}else{OS = "NOT Mac"}

	if (checkIt('msie')) {browser = "ie"}
	if (checkIt('firefox')) {browser = "firefox"}
	if (checkIt('safari')) {browser = "safari"}
	if (checkIt('chrome')) {browser = "chrome"} //Note: this MUST come after the safari check as chrome also has the safari label
	if (checkIt('opera')) {browser = "opera"}

	if (checkIt('version/3')) {version = "3"}

	if (checkIt('firefox/1')) {firefox = "1"}
	if (checkIt('firefox/2')) {firefox = "2"}


//alert(detect);
//alert(OS + ", " + browser + ", " + version + ", " + firefox);

	// FIREFOX CHECKS

	//
	// Error screen if the browser is safari but not version 3
	//
	//if (firefox == "1" || firefox == "2")
	//{
			//alert("firefox not v3 on any computer");
	//		window.location=firefox_notV3URL;
	//}
	// TN - Removed FF3 check, as requested by LM 021008

	// SAFARI CHECKS


	//else if (browser == "safari")

	if (browser == "safari")
	{

		//
		// Error screen if the browser is safari v3 on a MAC
		//
		//if(OS == "Mac" && version == "3")
		if(OS == "Mac")
		{
			//alert("safari v3 on mac");
			window.location=macsafariV3URL;
		}

		//
		// Error screen if the browser is safari on PC
		//
		else if(OS == "NOT Mac")
		{
			//alert("safari, not mac");
			window.location=winsafariV3_1URL;
		}

	}

	else if (browser == "opera")
	
	{
			//alert("opera");
			window.location=winoperaURL;
	
	}
	


	//
	// Show the application
	//
	else
	{
	//alert("ok");
	window.location=url;
	}


}//IF#1 ELSE
else
{
// FUNCTIONALITY IS SWITCHED OFF
	window.location=url;
//IF#1 END
}

//FUNCTION END
}
