// --- browser sniffer ---------------------------------------------------------
// Browser Sniffer
// sniffer_version = "1.1"
var so_agt=navigator.userAgent.toLowerCase();
var so_appVer = navigator.appVersion.toLowerCase();

// *** BROWSER VERSION 
var so_is_minor = parseFloat(so_appVer);
var so_is_major = parseInt(so_is_minor);

var so_iePos  = so_appVer.indexOf('msie');
if (so_iePos !=-1) {
	so_is_minor = parseFloat(so_appVer.substring(so_iePos+5,so_appVer.indexOf(';',so_iePos)));
	so_is_major = parseInt(so_is_minor);
}              

var so_is_getElementById   = (document.getElementById) ? "true" : "false";
var so_is_getElementsByTagName = (document.getElementsByTagName) ? "true" : "false";
var so_is_documentElement = (document.documentElement) ? "true" : "false";

var so_is_nav = ((so_agt.indexOf('mozilla')!=-1) && 
	(so_agt.indexOf('spoofer')==-1) && 
	(so_agt.indexOf('compatible') == -1) && 
	(so_agt.indexOf('opera')==-1) && 
	(so_agt.indexOf('webtv')==-1) && 
	(so_agt.indexOf('hotjava')==-1));

if ((navigator.vendor) 
	&& ((navigator.vendor=="Netscape6") 
	|| (navigator.vendor=="Netscape")) 
	&& (so_is_nav)) {
	so_is_major = parseInt(navigator.vendorSub);
	so_is_minor = parseFloat(navigator.vendorSub);
}

var so_is_nav4 		= (so_is_nav && (so_is_major == 4));
var so_is_nav4up 	= (so_is_nav && so_is_minor >= 4); 
var so_is_navonly	= (so_is_nav 
		&& ((so_agt.indexOf(";nav") != -1) 
		|| (so_agt.indexOf("; nav") != -1)) );
var so_is_nav6up 	= (so_is_nav && so_is_minor >= 6);
var so_is_nav5up 	= (so_is_nav && so_is_minor >= 5);
var so_is_nav7up 	= (so_is_nav && so_is_minor >= 7);
var so_is_ie   		= ((so_iePos!=-1));
var so_is_ie4   	= (so_is_ie && so_is_major == 4);
var so_is_ie4up 	= (so_is_ie && so_is_minor >= 4);
var so_is_ie5up 	= (so_is_ie && so_is_minor >= 5);
var is_firefox		= ((so_agt.indexOf("firefox") != -1));
//var so_is_ie5_5  	= (so_is_ie && (so_is_major == 4) && (so_agt.indexOf("msie 5.5") !=-1));
//Modified check for IE 5.5 because based on above expression minor would 5.5 and major would be 5
var so_is_ie5_5  	= (so_is_ie && so_agt.indexOf("msie 5.5") !=-1);
var so_is_ie6up 	= (so_is_ie && so_is_minor >= 6);

// *** PLATFORM 
var so_is_win   	= ((so_agt.indexOf("win")!=-1) || (so_agt.indexOf("16bit")!=-1));
var so_is_win95 	= ((so_agt.indexOf("win95")!=-1) || (so_agt.indexOf("windows 95")!=-1));
var so_is_winme 	= ((so_agt.indexOf("win 9x 4.90")!=-1));  
var so_is_win2k 	= ((so_agt.indexOf("windows nt 5.0")!=-1) || (so_agt.indexOf("windows 2000")!=-1));
var so_is_winxp 	= ((so_agt.indexOf("windows nt 5.1")!=-1) || (so_agt.indexOf("windows xp")!=-1));
var so_is_winxp_sp2 = ((so_is_winxp) && (so_agt.indexOf("sv1")!=-1));	//Currently only works in IE
var so_is_win98 	= ((so_agt.indexOf("win98")!=-1) || (so_agt.indexOf("windows 98")!=-1));
var so_is_winnt 	= ((so_agt.indexOf("winnt")!=-1) || (so_agt.indexOf("windows nt")!=-1));
var so_is_win32 	= (so_is_win95 
	|| so_is_winnt 
	|| so_is_win98 
	|| ((so_is_major >= 4) 
	&& (navigator.platform == "Win32")) 
	|| (so_agt.indexOf("win32")!=-1) 
	|| (so_agt.indexOf("32bit")!=-1));
var so_is_mac   	= (so_agt.indexOf("mac")!=-1);
var is_vista		= ((so_agt.indexOf("vista")!=-1) ||	(so_agt.indexOf("windows nt 6.0")!=-1));

// --- speed optimizer helper code ---------------------------------------------
var so_cookie_speed;
var so_speed_verified = false;
var so_is_wireless = false;
var so_activex_deployed = false;
var so_return_to_content = '';
var so_startOptimizationProcess = false;
var so_app_path = 'http://www2.verizon.net/help/fios_settings/include';
var so_img_path = 'http://www2.verizon.net/help/fios_settings/include/images';
var so_ssoLoginUrl = 'https://www.verizon.net/ssowebapp/VOLPortalLogin?TARGET=';
var so_helpFiosUrl = 'http://www2.verizon.net/help/';

/*
var so_package_speeds = new Array(
	"5M/2M", 
	"5M/5M", 
	"10M/2M", 
	"10M/10M", 
	"15M/2M", 
	"15M/15M", 
	"20M/5M", 
	"20M/15M", 
	"20M/20M", 
	"25M/25M", 
	"30M/5M", 
	"30M/15M", 
	"35M/10M", 
	"35M/20M", 
	"35M/35M", 
	"50M/5M", 
	"50M/10M", 
	"50M/20M", 
	"70M/20M", 
	"75M/25M"
);*/
// removed 5m/2m and 5m/5m because of hsi
var so_package_speeds = new Array(
	'10M/2M',
	'15M/2M',
	'15M/5M',
	'15M/15M',
	'20M/5M',
	'20M/15M',
	'20M/20M',
	'25M/15M',
	'30M/5M',
	'30M/15M',
	'35M/10M',
	'35M/20M',
	'50M/5M',
	'50M/10M',
	'50M/20M'
);

function getCookieValue( name, keyname )
{
	var nameEQ = name + "=";
	var keynameEQ = keyname + "=";
	
	var cookies = document.cookie.split(';');
	
	for(var i = 0; i < cookies.length; i++)
	{
		var cookie = cookies[i];
		
		while (cookie.charAt(0) == ' ') 
		{
			cookie = cookie.substring(1, cookie.length);
		}
		
		if (cookie.indexOf(nameEQ) == 0) 
		{
			var decoded_cookie = unescape(cookie.substring(nameEQ.length,cookie.length));
			var dc_kv_pairs = decoded_cookie.split('&');

			for (var j = 0; j < dc_kv_pairs.length; j++)
			{
				if (dc_kv_pairs[j].indexOf(keynameEQ) == 0)
				{
					return dc_kv_pairs[j].substring(keynameEQ.length, dc_kv_pairs[j].length);
				}
			}
		}
	}
	return null;
}

function setCookie( name, value, days )
{
	if( days || days != 0 )
	{
		var date = new Date();
		date.setTime( date.getTime() + ( days * 24 * 60 * 60 * 1000 ) );
		var expires = "; expires=" + date.toGMTString();
	}
	else 
	{
		var expires = "";
	}
	document.cookie = name + "=" + escape( value ) + expires + "; path=/";
}

function removeAlpha( theString )
{
	return theString.replace(/\D/g, "");
}

// --- speed optimizer code ----------------------------------------------------
function switchContent( theDiv, theContent )
{
	document.getElementById( theDiv ).innerHTML = '';
	document.getElementById( theDiv ).innerHTML = theContent;
	if( so_is_wireless && document.getElementById("wireless") != null )
	{
		document.getElementById("wireless").innerHTML = "WIRELESS ";
	}
	if( document.getElementById("what") != null )
	{
		if( !so_is_win && !so_is_ie6up )
		{
			document.getElementById("what").innerHTML = "Platform and Browser ";
		}
		else if( !so_is_ie6up )
		{
			document.getElementById("what").innerHTML = "Browser ";
		}
		else if( !so_is_win )
		{
			document.getElementById("what").innerHTML = "Platform ";
		}
	}
}

function startOptimizer()
{
	if (so_startOptimizationProcess)
	{
		try
		{
			so_is_wireless = IsAdapterWireless();
			so_cookie_speed = getCookieValue( 'user_profile', 'linespeed' );
			
			if(so_speed_verified == false)
			{
				chooseSpeedView();
			}
			else
			{
				var result = IsOptimized( so_cookie_speed );
				
				switch( result )
				{
					case 1:
						switchContent( 'so_content', is_optimized );
						break;
					case -1:
						switchContent( 'so_content', not_optimized );
						break;
					case -2:
						switchContent('so_content', activex_error);
						break;
					case -3:
						switchContent( 'so_content', speed_unknown );
						break;
					case -4:
						switchContent('so_content', activex_error);
						break;
				}
			}
		}
		catch (e)
		{
			// we ignore the error... as we already redirected to the ActiveX Error page
		}
	}
}

function doActiveXError()
{
	if ( getCookieValue('speedoptimizer', 'axerror') != 'true' )
	{
		setCookie( 'speedoptimizer', 'axerror=true', 0);
	}
	switchContent('so_content', activex_error);
}

function doSpeedUnknown()
{
	so_speed_verified = true;
	var selected = false;
	var temp = document.getElementById('speed')[document.getElementById('speed').selectedIndex].value;

	if (temp != '')
	{
		selected = true;
		setCookie( 'user_profile', 'linespeed=' + temp, 1);
		startOptimizer();
		return true;
	}
	
	if (!selected)
	{
		alert("Please select a FiOS package speed or log into your account!");
	}
	
	return false;
}

function doOptimize( speed )
{
	if ( Optimize( speed ) )
	{
		var str = 'Your system\'s settings were optimized.';
		if( so_is_winme  || so_is_win98 )
		{
			str = str +	'\n\nThis update will take effect once the system is restarted.';
		}
		switchContent( 'so_content', optimize_success );
		setCookie( 'optimizer', 'optimized=true', 1000 );
	}
	else
	{
		switchContent( 'so_content', optimize_failure );
	}
}

function doRestoreBackup()
{
	if( RestoreBackup() )
	{
		var str = 'Your system\'s settings were restored.';
		if( so_is_winme  || so_is_win98 )
		{
			str = str +	'\n\nThis update will take effect once the system is restarted.';
		}
		switchContent( 'so_content', restore_success );
		setCookie( 'optimizer', 'optimized=false', 1000 );
	}
	else
	{
		switchContent( 'so_content', restore_failure );
	}
}

function doTCPIP_MTU()
{
	if ( so_return_to_content != '' )
	{
		switchContent( 'so_content', so_return_to_content );
		so_return_to_content = '';
	} 
	else 
	{ 
		if (is_vista)
		{
			switchContent( 'so_content', app_entry + vista_platform);
		}
		else
		{
			switchContent( 'so_content', app_entry );
		}
	}
}

function doStartApp()
{
	so_speed_verified = false;
	so_startOptimizationProcess = true;
	if( !so_activex_deployed )
	{
		so_activex_deployed = true;
		switchContent( 'ax', ax_object );
	}
	else
	{
		startOptimizer();
	}
}

function doSSOLogin()
{
	var actualUrl = escape(location.href);
	location.href = so_ssoLoginUrl + actualUrl;
}

function chooseSpeedView()
{
	so_cookie_speed = getCookieValue( 'user_profile', 'linespeed' );
	var speed_inrange = false;
	var pre_cookie_speed = '';
	var post_cookie_speed = '';

	switchContent( 'so_content', speed_selection );

	if (so_cookie_speed != undefined && 
			so_cookie_speed != '' &&
			so_cookie_speed != null)
	{
		for (var i = 0; i < so_package_speeds.length; i++)
		{
			if (so_cookie_speed.toUpperCase() == so_package_speeds[i].toUpperCase())
			{
				speed_inrange = true;
			}
		}
		
		var temp = so_cookie_speed.split('/');

		if (temp.length == 2 && speed_inrange)
		{
			var theElement = document.getElementById('speed')
			var elementFound = false;
			
			for (var i = 0; i < theElement.length; i++)
			{
				if (theElement.options[i].value == so_cookie_speed.toUpperCase() && !elementFound)
				{
					theElement.options[i].text = theElement.options[i].text + " -- Recommended setting based on your detected account settings.";
					theElement.options[i].style.background = "#ffcccc";
					theElement.options[i].selected = true;
				}
			}
		}
		so_speed_verified = true;
	}
}

function IsOptimized( speed )
{
	var ACTIVEX_ERROR = -4;
	var UNKNOWN_SPEED = -3;
	var NO_PERMISSION = -2;
	var NOT_OPTIMIZED = -1;
	var OPTIMIZED 		= 1;
	
	var DOWNLOAD_SPEED	= 0;
	var UPLOAD_SPEED 		= 1;
	
	var speed_inrange = false;
	
	if (speed != undefined && 
			speed != '')
	{
		for (var i = 0; i < so_package_speeds.length; i++)
		{
			if (speed.toUpperCase() == so_package_speeds[i].toUpperCase())
			{
				speed_inrange = true;
			}
		}
		
		var temp = speed.split('/');
		
		if (temp.length == 2 && speed_inrange)
		{
			if (vzTCPConfig.IsAdmin())
			{
				if (vzTCPConfig.SetConnectionSpeed(removeAlpha(temp[DOWNLOAD_SPEED]), removeAlpha(temp[UPLOAD_SPEED])) == 1)
				{
					return vzTCPConfig.IsConfigured();
				}
			}
			else
			{
				// IsAdmin
				return NO_PERMISSION;
			}
		}
		else
		{
			// temp.length
			return UNKNOWN_SPEED;
		}
	}
	else
	{
		// undefined or ''
		return UNKNOWN_SPEED;
	}
}

function Optimize( speed )
{
	var DOWNLOAD_SPEED	= 0;
	var UPLOAD_SPEED 		= 1;
	
	if (speed != undefined && 
			speed != '')
	{
		var temp = speed.split('/');
		
		if (temp.length == 2)
		{
			if (vzTCPConfig.IsAdmin())
			{
				if (vzTCPConfig.SetConnectionSpeed(removeAlpha(temp[DOWNLOAD_SPEED]), removeAlpha(temp[UPLOAD_SPEED])) == 1)
				{
					try
					{
						result = vzTCPConfig.ConfigureTCP(0, 0, 0);
					}
					catch( error )
					{
						result = 0;
					}
					if (result == 1)
					{
						return true;
					}
					else
					{
						return false;
					}
				}
			}
			else
			{
				// IsAdmin
				return false;
			}
		}
		else
		{
			// temp.length
			return false;
		}
	}
	else
	{
		// undefined or ''
		return false;
	}
}

function IsAdapterWireless()
{
	if (vzTCPConfig.IsAdmin())
	{
		if(vzTCPConfig.IsDefaultAdapterWireless() == 1)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	else
	{
		// IsAdmin
		return false;
	}
}

function RestoreBackup()
{
	if (vzTCPConfig.IsAdmin())
	{
		if(vzTCPConfig.RestoreBackup() > 0)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	else
	{
		// IsAdmin
		return false;
	}
}

var ax_object =
	'<object id="vzTCPConfig" ' +
	' onerror="doActiveXError();" ' +
	'	onreadystatechange="window.setTimeout(\'startOptimizer();\', 1000);" ' +
	'	classid="CLSID:8B7D2210-CC81-4F59-A486-4409FB485D4A" ' +
	'	codebase="' + so_app_path + '/vzTCPConfig.CAB#version=2.9.0612.2" ' +
	'	width="0" height="0">' +
	'</object>';

var wrong_browser_platform = 
	'<div style="margin: 10px; padding: 10px; border: 2px solid #ff0000; font-weight: bold;">' +
	'The functionality you are trying to access requires Internet Explorer version 6 or higher ' +
	'on a Windows PC. You are currently using a <span id="what" style="font-size: larger;"></span> ' +
	'that\'s not supported. Please use Internet Explorer, version 6 or higher on a Windows PC, to access this functionality.<br />' +
	'</div><br /><center><a href="' + so_helpFiosUrl + '" target="_top"><img src="' + so_img_path + '/buttons/back_to_fios_help_topics.gif" alt="Back To FiOS Help Topics &gt;" width="154" height="18" border="0" /></a><br /></center>';

var vista_platform = 
	'<table border="1px" bordercolor="#ff0000"><tr><td style="mergin-left: 3px;">' +
	'<h3 style="color:#CC0000;">Attention Windows Vista users!</h3>' +
	'In order to run speed optimizer tool on Windows Vista, IE browser needs to be launched in administrator mode.' +
	'If you are not running your IE browser in "Adminstrator" mode, please follow these quick steps.<br /><br />' +
	'1) Right click on Internet Explorer icon on your desktop (or taskbar) and select the option "run as Administrator".<br /><br />' +
	'<img src="' + so_img_path + '/IE_ShortCut.JPG" width="214" height="85" alt="" /><br /><br />' +
	'2) Give permission for Internet Explorer to Run in Administrator mode. Please click on "Allow".<br /><br />' +
	'<img src="' + so_img_path + '/RequestUserApproval.JPG" width="277" height"222" alt="" /><br /><br />' +
	'3) Copy the entire URL below into IE browser window and follow the steps that appear on SpeedOptimizer wizard.<br />' +
	'<a href="' + window.top.location.href + '" target="_top">' + window.top.location.href + '</a>' +
	'</td></tr></table>';
	
var app_entry =
	'	Are you tapping into the full power of your FiOS connection? Use the Speed Optimizer tool to help you determine if certain ' +
	'	settings (<a href="#" onclick="switchContent( \'so_content\', tcpip_mtu ); if (is_vista) { so_return_to_content = app_entry + vista_platform; } else { so_return_to_content = app_entry; } return false;">TCP/IP and MTU</a>) ' +
	'	on your system are tuned for optimal performance.<br />' +
	'	<br />' +
	'	Ready to see if setting changes can be made to optimize the speed and performance of your Internet connection?<br />' +
	'	<br />' +
	'	<b>To use the tool:</b><br />' +
	'	1. Click the <b>Optimize My Connection</b> button below.<br />' +
	'	2. Click <b>Yes</b>, if prompted, to install and run ActiveX controls.<br />' +
	'	3. Results and options will be displayed on the next page.<br />' +
	'	<br />' +
	'	<a href="#" onclick="doStartApp(); return false;"><img src="' + so_img_path + '/buttons/optimize_my_connection.gif" alt="Optimize My Connection &gt;" width="154" height="18" border="0" /></a><br />' +
	'	<br />';

var tcpip_mtu =
	'	<b>What does the Speed Optimizer tool do?</b><br />' +
	'	There are several system parameters that can be altered on your PC in order to improve download speeds over the FiOS network.<br />' +
	'	<br />' +
	'	The Speed Optimizer tool modifies your TCP/IP configuration to allow your system to receive data at a faster rate.<br />' +
	'	<br />' +
	'	<b>What is TCP/IP?</b><br />' +
	'	TCP/IP Stands for Transmission Control Protocol/Internet Protocol and allows your system to communicate with other networked' +
	'	computers over the Internet. The standard TCP/IP configuration is optimized for communications over small local networks.<br />' +
	'	<br />' +
	'	<b>Which parameters and settings does the Speed Optimizer modify?</b>' +
	'	<ol>' +
	'		<li>TCP 1323 Extensions - This parameter enables enhancements to the TCP/IP protocol that provide improved performance over ' +
	'			high speed connections.<br />' +
	'			<br /></li>' +
	'		<li>TCP Receive Window - This parameter specifies the number of bytes a sender (the source you are downloading from) may ' +
	'			transmit without receiving an acknowledgment. Modifying it determines the maximum size offered by the system.<br />' +
	'			<br /></li>' +
	'		<li>MTU (Maximum Transmission Units) - The MTU defines the largest single unit of data that can be transmitted over your ' +
	'			connection. The FiOS network requires an MTU of 1492 bytes.<br />' +
	'			<br /></li>' +
	'	</ol>' +
	'	<a href="#" onclick="doTCPIP_MTU(); return false;"><img src="' + so_img_path + '/buttons/button_back.gif" alt="&lt; Back" width="47" height="18" border="0" /></a><br />' +
	'	<br />';

var is_optimized = 
	'<b>Your system\'s <span id="wireless"></span> settings are already optimized for Verizon FiOS Internet Service. There ' +
	'are no changes needed.</b><br />' +
	'<br />' +
	'<ul>' +
	'	<li>Please remember to run this tool on each system that you use to connect ' +
	'		to your FiOS service</li>' +
	'	<li>If you connect to FiOS from a system in both wired AND wireless configurations' +
	'		(such as with a laptop), please run the optimizer tool while connected in the' +
	'		wired configuration and while connected in the wireless configuration.' +
	'</ul>' +
	'Continue enjoying your blazing fast Verizon FiOS Internet Service!<br /><br />' +
	'<a href="' + so_helpFiosUrl + '" target="_top"><img src="' + so_img_path + '/buttons/back_to_fios_help_topics.gif" alt="Back To FiOS Help Topics &gt;" width="154" height="18" border="0" /></a><br /><br />' +
	'You also have the option of restoring the Microsoft Windows default settings by clicking the \'Next\' button.<br /><br />' +
	'<a href="#" onclick="switchContent( \'so_content\', restore_settings ); return false;"><img src="' + so_img_path + '/buttons/button_next.gif" alt="Next &gt;" width="45" height="18" border="0" /></a><br />';
	
var restore_settings =
	'<b>Restore your system\'s optimized <span id="wireless"></span> settings to the Microsoft Windows default settings.</b><br />' +
	'However, doing so could result in slowing down your Internet connection speed. ' +
	'<span style="color: #ff0000; font-weight: bold;">We strongly recommend that you leave your settings in ' +
	'their current state.</span><br /><br />' +
	'<a href="#" onclick="doRestoreBackup(); return false;"><img src="' + so_img_path + '/buttons/restore_settings.gif" alt="Restore Settings &gt;" width="116" height="18" border="0" /></a><br /><br />' +
	'<span style="font-size: smaller;">By clicking the restore settings button, you are granting Verizon permission to access and reset your PC\'s ' +
	'<a href="#" onclick="switchContent( \'so_content\', tcpip_mtu ); so_return_to_content = restore_settings; return false;">TCP/IP and MTU</a> ' +
	'settings back to the original Microsoft Windows default settings.</span><br />';

var not_optimized =
	'<b>Your system\'s <span id="wireless"></span> settings are not optimized for Verizon FiOS Internet Service.</b><br />' +
	'<br />' +
	'To update your settings so that they are optimized for FiOS, click the Update Now!* button.<br />' +
	'<br />' +
	'<a href="#" onclick="doOptimize( so_cookie_speed );"><img src="' + so_img_path + '/buttons/update_now.gif" alt="Update Now! &gt;" width="89" height="18" border="0" /></a><br />' +
	'<br />' +
	'<span style="font-size: smaller;">*By clicking the Update Now! Button, you are granting Verizon permission to access and reconfigure' +
	'	your PC\'s <a href="#" onclick="switchContent( \'so_content\', tcpip_mtu ); so_return_to_content = not_optimized; return false;">TCP/IP and MTU</a> settings.</span><br />';

function printSpeedOptions()
{
	var speedOptions = '';
	PACKAGE_SPEED_DOWN = 0;
	PACKAGE_SPEED_UP = 1;
	for (package in so_package_speeds)
	{
		var speeds = so_package_speeds[package].split("/");
		speedOptions += '	<option value="' + 
			so_package_speeds[package] + 
			'">Up to ' + removeAlpha(speeds[PACKAGE_SPEED_DOWN]) + 'Mbps / ' + removeAlpha(speeds[PACKAGE_SPEED_UP]) + ' Mbps</option>';
	}
	return speedOptions;
}

var speed_selection =
	'<b>Select Your Speed</b><br />' +
	'<br />' +
	'Please select the speed of your current plan. The speed optimizer tool tunes ' +
	'your system\'s TCP/IP address and MTU settings to match the FiOS speed ' +
	'package you subscribe to. Your Internet experience may degrade if the speed ' +
	'below is higher or lower than your FiOS package speed. Recommended settings are ' +
	'based on your detected account settings.<br />' +
	'<br />' +
	'<form name="speeds" id="speeds">' +
	'	<select name="speed" id="speed">' +
	'		<option style="background-color: #cc0000; font-weight: bold; color: white;" value="" selected="selected">Choose your speed</option>' +
	printSpeedOptions() +
	'	</select>' +
	'	<br /><span style="font-size: smaller;">Not all speeds are available in all areas.</span><br />' +
	'	<br />' +
	'	<a href="#" onclick="return doSpeedUnknown();"><img src="' + so_img_path + '/buttons/button_next.gif" alt="Next &gt;" width="45" height="18" border="0" /></a><br />' +
	'</form>' +
	'If you\'re unsure of the FiOS speed you purchased, you will need to <a href="#" onclick="doSSOLogin();">log into your account</a> so your speed can be determined.<br />' +
	'<br />';

var optimize_failure =	
	'<b>Optimization of your current system settings failed.</b><br />' +
	'<br />' +
	'<a href="javascript:location.reload();" target="_top"><img src="' + so_img_path + '/buttons/try_again.gif" alt="Try again &gt;" width="72" height="18" border="0" /></a><br />' +
	'<br />' +
	'<a href="' + so_helpFiosUrl + '" target="_top"><img src="' + so_img_path + '/buttons/back_to_fios_help_topics.gif" alt="Back To FiOS Help Topics &gt;" width="154" height="18" border="0" /></a><br />';

var restore_failure =	
	'<b>Restoration of your current system settings failed.</b><br />' +
	'<br />' +
	'<a href="javascript:location.reload();"><img src="' + so_img_path + '/buttons/try_again.gif" alt="Try again &gt;" width="72" height="18" border="0" /></a><br />' +
	'<br />' +
	'<a href="' + so_helpFiosUrl + '" target="_top"><img src="' + so_img_path + '/buttons/back_to_fios_help_topics.gif" alt="Back To FiOS Help Topics &gt;" width="154" height="18" border="0" /></a><br />';

var optimize_success =	
	'<b>Your system\'s <span id="wireless"></span> settings have been <i>optimized!</i></b><br />' +
	'Enjoy the blazing fast speed of FiOS.<br />' +
	'<br />' +
	'<ul>' +
	'	<li>Please remember to run this tool on each system that you use to connect ' +
	'		to your FiOS service</li>' +
	'	<li>If you connect to FiOS from a system in both wired AND wireless configurations' +
	'		(such as with a laptop), please run the optimizer tool while connected in the' +
	'		wired configuration and while connected in the wireless configuration.' +
	'</ul>' +
	'<br />' +
	'<b>Please Note:</b><br />' +
	'These updates will take effect the next time you restart your system.<br /><br />' +
	'<a href="' + so_helpFiosUrl + '" target="_top"><img src="' + so_img_path + '/buttons/back_to_fios_help_topics.gif" alt="Back To FiOS Help Topics &gt;" width="154" height="18" border="0" /></a><br />';

var restore_success =
	'<b>Your system\'s <span id="wireless"></span> settings have been <i>restored!</i></b><br />' +
	'<br />' +
	'<ul>' +
	'	<li>Please remember to run this tool on each system that you use to connect ' +
	'		to your FiOS service</li>' +
	'	<li>If you connect to FiOS from a system in both wired AND wireless configurations' +
	'		(such as with a laptop), please run the optimizer tool while connected in the' +
	'		wired configuration and while connected in the wireless configuration.' +
	'</ul>' +
	'<br />' +
	'<b>Please Note:</b><br />' +
	'These updates will take effect the next time you restart your system.<br /><br />' +
	'<a href="' + so_helpFiosUrl + '" target="_top"><img src="' + so_img_path + '/buttons/back_to_fios_help_topics.gif" alt="Back To FiOS Help Topics &gt;" width="154" height="18" border="0" /></a><br />';

document.write('<div id="so_content"></div>');
document.write('<div id="ax"></div>');

document.write('<scr' + 'ipt type="text/javascript" src="' + so_app_path + '/activex_error.asp" /></scr' + 'ipt>');

if ( so_is_win && so_is_ie6up )
{
	if (is_vista)
	{
		switchContent( 'so_content', app_entry + vista_platform);
	}
	else
	{
		switchContent( 'so_content', app_entry );
	}

	if ( getCookieValue('speedoptimizer', 'axerror') == 'true' )
	{
		so_activex_deployed = true;
		switchContent( 'ax', ax_object );
	}
}
else
{
	switchContent( 'so_content', wrong_browser_platform );
}



