function showContextHelp( obj )
{
	popUpWindow( 550, 360, 'context', 'http://netservices.verizon.net/portal/help/popup.jsp?' + obj, 0, 1 );
}

// opens a flash window, playing the .swf specified in 'path'
// note, path is the root-relative UNC path - kjr
function showTutorial( title, movie ) {
	popUpWindow(570,408,'FlashTutorial','http://netservices.verizon.net/portal/help/flash.jsp?title='+title+'&player=http://onlinehelp.verizon.net/consumer/bin/flash/FlashTutorials/VOLHelp_Player.swf&flashvars='+escape('SubMovieURL='+movie+'&SubMovieName='+title)+'&width=550&height=380&bgcolor=E2EBF1',0,0);
}

// opens a flash window, playing the .swf specified in 'movie' in the player .swf at 'player'
// note, movie and player are the root-relative UNC paths - kjr

function showTutorialCustom( flashvars, player, width, height, bgcolor ) {
	popUpWindow( width, height, 'FlashTutorial', 'http://netservices.verizon.net/portal/help/flash.jsp?player='+escape(player)+'&width='+width+'&height='+height+'&bgcolor='+bgcolor+'&flashvars='+escape(flashvars), 0, 0 );
}

function showTutorialContents( title, movie ) {
	popUpWindow(570,408,'FlashTutorial','http://netservices.verizon.net/portal/help/flash.jsp?title='+title+'&player=http://onlinehelp.verizon.net/consumer/bin/flash/FlashTutorials/VOLHelp_Player.swf&flashvars='+escape('SubMovieURL='+movie+'&SubMovieName='+title)+'&width=550&height=380&bgcolor=E2EBF1',0,0);
}

// opens a flash window, playing the .swf specified in 'movie' in the player .swf at 'player'
// note, movie and player are the root-relative UNC paths - kjr

function showTutorialCustomContents( flashvars, player, width, height, bgcolor ) {
	popUpWindow( width, height, 'FlashTutorial', 'http://netservices.verizon.net/portal/help/flash.jsp?player='+escape(player)+'&width='+width+'&height='+height+'&bgcolor='+bgcolor+'&flashvars='+escape(flashvars), 0, 0 );
}

function isHSTCompliant()
{
	if (!is_mac && !is_nav) 
	{
		if (is_win32 && !is_win95)
		{
			if ( (is_ie6up) )
			{
				return true;
			}
		}
	}
	return false;
}

/*
Check the HST installation and redirect the user to proper
*/
var help_isHSTInstallStatusChecked = false;
var help_isHSTInstalled = false;
// the flag to indicate whether to save current page in the navigation history
var help_saveToHistory = true;
function help_checkHSTInstallStatus()
{
	if (help_isHSTInstallStatusChecked == true)
		return help_isHSTInstalled;
	
	// not yet checked
	try
	{
		help_isHSTInstalled = true;
		// create the objects
		document.write('<object id="SecurityManager2" classid="CLSID:CEDDF50D-9FA7-41A8-BCD0-6350D1ED2306" width="0" height="0">');
		document.write('<param name="SecurityInfoURL" value="/help/motive/TrustInhouse.dll" />');
		document.write('</object>');
		document.write('<object	id="tempAx2" classid="clsid:DB0474CC-8EF6-47FC-905B-23FC58A70817" width="0" height="0"></object>');
	
		if (document.SecurityManager2.IsTrusted())
		{
			var vendor = "Verizon";
			var objBase = new ActiveXObject("MotiveBrowser.vzMotive.1");
			var mdir = objBase.GetMotiveDirectory();
			var mclient	= mdir.GetClient(vendor);
			var hstInstallResult = document.tempAx2.GetValue("InstallResult").toString();
			hstInstallResult = hstInstallResult.substring(0, 3);
			if (hstInstallResult != "990")
				help_isHSTInstalled = false;
		}
		else
		{		
			help_isHSTInstalled = false;
		}
	}
	catch (e)
	{
		help_isHSTInstalled = false;
	}
	
	help_isHSTInstallStatusChecked = true;

	return help_isHSTInstalled;
}

/*
Check the HST installation and go to the target page.
Note that currently this function is only used for HST chat.  If HST is not installed, go to AnswerWeb
*/
function help_gotoHST(target_URL) 
{
	/*
	if (isHSTCompliant() == false) {
		alert("We are sorry, but the Help & Support Toolkit does not support the system or browser you are using.");
		return true;
	}
	*/
	var next_page_URL;
	if (help_checkHSTInstallStatus() == false) {
		next_page_URL = motive_answerweb_URL;
		//next_page_URL = '/portal/help/HSTRedirect.jsp?beanDesc=help_hstwebinstall&viewID=default&returnURL=' + escape(target_URL);
	}
	else {
		next_page_URL = target_URL;
	}
	
	if (help_saveToHistory == true)
		window.location.href = next_page_URL;
	else
		window.location.replace(next_page_URL);
	
	return true;
}

// for checking the Motive Wrapper object
var gIsMotiveWrapperInstalled = true;
function mccWrapperNotAvailable()
{
	gIsMotiveWrapperInstalled = false;
}
// try to instantiate the wrapper control when the help page is loaded
document.write('<OBJECT ID="__MCCWrapper" ONERROR="mccWrapperNotAvailable()" CLASSID="CLSID:63BAECA2-9E3C-45DE-B2B1-BBC5FA99958E">');
document.write('<PARAM NAME="AppKey" Value="Verizon">');
document.write('</OBJECT>');


// Script added inorder to redirect certain urls that is displayed from oneCMs response: DTR40208
function oneCMS_Redirector(sURL)
{
        document.location.href = sURL;
}



// Script to redirect to the trouble ticket page: DTR 40206
function LinkToeRepair()
{
//Uncommenting document.lo.....  &  commenting out window.open... as Vz eRepair initiative went on Hold long back
//		window.open ("/portal/help/popup_repair.jsp", "_blank",
//                        "location=0,status=1,scrollbars=1,width=400,height=350");
	document.location.href = "https://www22.verizon.com/foryourhome/fttprepair/nr/common/MainMenu.aspx?FIOSSupport";
}