// BEGIN CLIENTSCRIPTFORALLPAGES.JS

// This client script contains general utitlity functions for using on pages within
// the DocsOnline application


function fsNavigateToggleImage(Image)
{
	var strCurrentImage = Image.src;
	var nCurrentLength = strCurrentImage.length;
	var strType = strCurrentImage.substr(nCurrentLength-5, 1);
	if (strType == "G")
		Image.src = strCurrentImage.substr(0, nCurrentLength-5) + "C.gif";
	else
		Image.src = strCurrentImage.substr(0, nCurrentLength-5) + "G.gif";
}

//
// modified toggle image to display a message in the window status
//
function fsNavigateToggleImageMsg(Image, comment)
{
	var strCurrentImage = Image.src;
	var nCurrentLength = strCurrentImage.length;
	var strType = strCurrentImage.substr(nCurrentLength-5, 1);
	if (strType == "G")
		Image.src = strCurrentImage.substr(0, nCurrentLength-5) + "C.gif";
	else
		Image.src = strCurrentImage.substr(0, nCurrentLength-5) + "G.gif";
	
	window.status = comment;		
}

function fsButtonToggleImageMsg(Image)
{
	var strCurrentImage = Image.src;
	var nCurrentLength = strCurrentImage.length;
	var strType = strCurrentImage.substr(nCurrentLength-6, 2);
	if (strType == "on")
		Image.src = strCurrentImage.substr(0, nCurrentLength-6) + "of.gif";
	else
		Image.src = strCurrentImage.substr(0, nCurrentLength-6) + "on.gif";
	
	// window.status = comment;		
}


// The variable strHelpOptions2 is used to define the window
// paramaters
// for calling the full WebHelp help system for the web site or
// application  ***** -->
  var strHelpOptions2 = "location=no";
  strHelpOptions2 += ",toolbar=yes";
  strHelpOptions2 += ",menubar=no";
  strHelpOptions2 += ",status=no";
  strHelpOptions2 += ",scrollbars=yes";
  strHelpOptions2 += ",resizable=yes";
  strHelpOptions2 += ",top=40";
  strHelpOptions2 += ",left=40";
  strHelpOptions2 += ",width=720";
  strHelpOptions2 += ",height=400";

//<!-- ***** The function ShowHelp2 is used to create the full WebHelp
//system      ***** -->
//<!-- ***** help window, based on the parameters in the variable
//srtHelpOptions2 ***** -->

function getContextSenHelp(idvalue)
{
	var strConToAdd = "";
	// If you don't want your page to have help, then add an entry to this list.
	if (idvalue.length > 0)
	{
		// There is context sensitive help for this page...
		strConToAdd = "#" + idvalue + ".htm";
	}
	
	return strConToAdd;
}


function ShowHelp2()
{
	objTitleCollection = document.getElementsByTagName("head");
	objTitle = objTitleCollection[0];
	objIDValue = objTitle.getAttribute("id");

	var page = "help/default.htm";
	if (objIDValue)
	{
		page += getContextSenHelp(objIDValue);
	}

	window.open( page, "Help2", strHelpOptions2);
}

function fsToggleDisplay(ID)
{
	var element = document.getElementById(ID);
	if (element != null)
	{
		window.alert("hello");
		if (element.style.display == 'inline')
			element.style.display = 'none';
		else
			element.style.display = 'inline';
	}
}

function FSIsNetScape6()
{
	if (document.all)
  		return false;
	else if (document.getElementById)
  		return true;
}


function ChangeSelection(Name)
{
	var Image = document.getElementById(Name + "i");
	var Text = document.getElementById(Name + "t");

	// Toggle underline
	if (Text.style.textDecorationUnderline == true)
		Text.style.textDecorationUnderline = false;
	else
		Text.style.textDecorationUnderline = true;

	// Toggle image
	var strCurrentImage = Image.src;
	var nCurrentLength = strCurrentImage.length;
	var strType = strCurrentImage.substr(nCurrentLength-5, 1);
	var strExt = strCurrentImage.substr(nCurrentLength-4, 4);
	if (strType == "G")
		Image.src = strCurrentImage.substr(0, nCurrentLength-5) + "C" + strExt;
	else
		Image.src = strCurrentImage.substr(0, nCurrentLength-5) + "G" + strExt;
}


// END CLIENTSCRIPTFORALLPAGES.JS
