//<!--
///////////////////////////////////////////////////////////////////
// This script was designed for Pointe Technologies, Inc. 
// by John E. Pearson  (© Pointe Technologies, Inc.)
///////////////////////////////////////////////////////////////////
function LoadPage()
{
	LoadMenu('Products');
	LoadMenu('Services');
	LoadMenu('General');
	LoadMenu('Reports');
	LoadMenu('Incidents');
	LoadMenu('Searches');
	LoadMenu('Releases');
	LoadMenu('Profile');
	LoadMenu('Operations');
	LoadMenu('Administration');
	LoadMenu('AddUserToPointe');
	LoadMenu('AddUserToSupport');
	LoadMenu('FinanceAccounting');
	LoadMenu('HumanResources');
	LoadMenu('InformationTechnology');
	LoadMenu('SalesService');
	LoadMenu('Marketing');
	LoadMenu('Sales');
	LoadMenu('Service');
	LoadMenu('Development1');
	LoadMenu('Education');
	LoadMenu('Development2');
	LoadMenu('QA');
	LoadMenu('Implementation');
	LoadMenu('OurClients');
	LoadMenu('CTBTO');
	LoadMenu('FAO');
	LoadMenu('IAEA');
}

function LoadMenu(sVal)
{
	var iAppNameIndex = window.navigator.appName.indexOf('Explorer');
	var iMSIEIndex = window.navigator.appVersion.indexOf('MSIE');
	var sAppVersion = window.navigator.appVersion.substring(iMSIEIndex + 5, iMSIEIndex + 8);
	//if ( iAppNameIndex >= 0 && sAppVersion >= 6 )
	//{
		if ( document.getElementById(sVal) )
		{
			if ( GetCookie(sVal) == 0 )
			{
				MenuMin(document.getElementById(sVal));
			}
		}
	//}
}

/////////////////////////////////////////////////////////////////////////////////
// this function will go away after conversion to new product web site
/////////////////////////////////////////////////////////////////////////////////
function ChangeProject(s)
{
	Elements = s.value.split("~");
	
	Client  = Elements[0];
	Product = Elements[1];
	Project = Elements[2];

	window.location = "ProjectConf.asp?Client=" + Client + "&Product=" + Product + "&Project=" + Project;
}
/////////////////////////////////////////////////////////////////////////////////

function OpenWindow(sURL, iWidth, iHeight)
{
	var sParameters = '';
	sParameters += 'toolbar=yes,';
	sParameters += 'location=no,';
	sParameters += "directories=no,";
	sParameters += "status=no,";
	sParameters += 'menubar=no,';
	sParameters += 'scrollbars=yes,';
	sParameters += 'resizable=yes,';
	sParameters += 'width=' + iWidth.toString() + ',';
	sParameters += 'height=' + iHeight.toString() + ',';
	sParameters += 'top=20,';
	sParameters += 'left=20,';
	sParameters += "screenx=0,";
	sParameters += "screeny=0,";
	win = window.open(sURL, '', sParameters);
}

function window.onBeforePrint()
{
	SetNone('OptionsMenu');
	SetNone('NavButtons');
	SetNone('ItemButtons1');
	SetNone('ItemButtons2');
	SetNone('TOC');
	SetNone('TOC1');
	SetNone('TOC2');
	SetNone('TOC3');
	SetNone('TOC4');
	SetNone('TOC5');
	SetNone('TOC6');
	SetNone('TOC7');
	SetNone('TOC8');
	SetNone('TOC9');
	SetNone('TOC10');
	SetNone('TOC11');
	SetNone('TOC12');
	SetNone('TOC13');
	SetNone('TOC14');
	SetNone('TOC15');
	SetNone('TOC16');
	SetNone('TOC17');
	SetNone('TOC18');
	SetNone('TOC19');
	SetNone('TOC20');
	SetNone('TOC21');
	SetNone('TOC22');
	SetNone('TOC23');
	SetNone('TOC24');
	SetNone('TOC25');
	SetNone('TOC26');
	SetNone('TOC27');
	SetNone('TOC28');
	SetNone('TOC29');
	SetNone('TOC30');
	SetNone('TOC31');
	SetNone('TOC32');
	SetNone('TOC33');
	SetNone('TOC34');
	SetNone('TOC35');
	SetNone('TOC36');
}

function window.onAfterPrint()
{
	SetInline('OptionsMenu');
	SetInline('NavButtons');
	SetInline('ItemButtons1');
	SetInline('ItemButtons2');
	SetInline('TOC');
	SetInline('TOC1');
	SetInline('TOC2');
	SetInline('TOC3');
	SetInline('TOC4');
	SetInline('TOC5');
	SetInline('TOC6');
	SetInline('TOC7');
	SetInline('TOC8');
	SetInline('TOC9');
	SetInline('TOC10');
	SetInline('TOC11');
	SetInline('TOC12');
	SetInline('TOC13');
	SetInline('TOC14');
	SetInline('TOC15');
	SetInline('TOC16');
	SetInline('TOC17');
	SetInline('TOC18');
	SetInline('TOC19');
	SetInline('TOC20');
	SetInline('TOC21');
	SetInline('TOC22');
	SetInline('TOC23');
	SetInline('TOC24');
	SetInline('TOC25');
	SetInline('TOC26');
	SetInline('TOC27');
	SetInline('TOC28');
	SetInline('TOC29');
	SetInline('TOC30');
	SetInline('TOC31');
	SetInline('TOC32');
	SetInline('TOC33');
	SetInline('TOC34');
	SetInline('TOC35');
	SetInline('TOC36');
}
function SetNone(oObject)
{
	if (document.getElementById(oObject))
		document.getElementById(oObject).style.display = 'none';
}

function SetInline(oObject)
{
	if (document.getElementById(oObject))
		document.getElementById(oObject).style.display = 'inline';
}

function ToggleMenu(oObject)
{
	if (oObject.innerHTML)
	{
		if (oObject.innerHTML.indexOf('<LI>') < 0)
		{
			MenuMax(oObject);
		}
		else
		{
			MenuMin(oObject);
		}
	}
	else
	{
		return void(0);
	}
}

// minumises menu list
function MenuMin(oObject)
{
	if (oObject.id && oObject.innerHTML)
	{
		oObject.data = oObject.innerHTML;
		//oObject.innerHTML = '<font size=1 color=#666666>(Click ' + oObject.id.substring(0,9) + ' for more)</font>';
		oObject.innerHTML = '<img border=0 src="http://www.pointe.com/images/bullet0.gif">';
		SetCookie(oObject.id, 0, Date() + 30);
	}
}

// maximises menu list
function MenuMax(oObject)
{
	if (oObject.id && oObject.innerHTML)
	{
		oObject.innerHTML = oObject.data;
		SetCookie(oObject.id, 1, Date() + 30);
	}
}

// Create a cookie with the specified name, value and date.
function SetCookie(sName, sValue, sDate)
{
	document.cookie = sName + "=" + escape(sValue) + ";expires=" + sDate;
}

// Retrieve the value of the cookie with the specified name.
function GetCookie(sName)
{
	// cookies are separated by semicolons
	var aCookie = document.cookie.split("; ");
	for (var i = 0; i < aCookie.length; i++)
	{
		// a name/value pair (a crumb) is separated by an equal sign
		var aCrumb = aCookie[i].split("=");
		if (sName == aCrumb[0])
		{
			return unescape(aCrumb[1]);
		}
	}
	return null;
}

function ToggleRowColor(oObject, sColor)
{
	if (oObject.bgColor)
	{
		switch (sColor)
		{
			case '#ffffdd' || '#dddddd' || '#004894':
			{
				oObject.style.cursor = 'auto';
				oObject.bgColor = sColor;
				break;
			}
			default:
			{
				oObject.style.cursor = 'hand';
				oObject.bgColor = sColor;
				break;
			}
		}
	}
}

String.prototype.trim = trimString;

function trimString()
{
	var s = this.toString();

	while( s.charAt(0) == " " )
		s =s.substring(1);

	while( s.charAt(s.length - 1) == " " )
		s = s.substring(0, s.length-2);
	return s;
}
//-->
