


if (document.layers)
{
	visible = 'show';
	hidden = 'hide';
}
else if (document.all || document.getElementById)
{
	visible = 'visible';
	hidden = 'hidden';
}

function Initialize(id)
{
	var TheObject;
	if (document.getElementById)
	{
		TheObject = document.getElementById(id).style;
		return TheObject;
	}
	else if (document.all)
	{
	    TheObject = document.all(id).style;
		return TheObject;
	}
	else
	//if (document.layers)
	{
	    TheObject = document.layers[id];
		return TheObject;
	}
}
function InitializeDHTML(id)
{
	var DHTMLObject;
	if (document.getElementById)
	{
		DHTMLObject = document.getElementById(id);
		return DHTMLObject;
	}
	else if (document.all)
	{
	    DHTMLObject = document.all(id);
		return DHTMLObject;
	}
	else
	//if (document.layers)
	{
	    DHTMLObject = document.layers[id];
		return DHTMLObject;
	}
}
//**************************************************************************************
//		Checks to see if the id exists on the page. Used to prevent errors.
//**************************************************************************************
function CheckValidID(checkID)
{
	if (document.getElementById)
	{
		if(document.getElementById(checkID)!= null)
			return true;
		else
			return false;
	}
	else if (document.all)
	{
	    if(document.all(checkID) != null)
			return true;
		else
			return false;
	}
}
function TurnOn(id,breakAfter)
{
	if(CheckValidID(id))
	{
		Initialize(id);
		if(breakAfter != false)
			TheObject.display = "Block";
		else
			TheObject.display = "inline";
	}
}
function TurnOff(id)
{
	if(CheckValidID(id))
	{
		Initialize(id);
		TheObject.display = "None";
	}
}

function OffAll()
{
	Initialize('about');
	TheObject.visibility = hidden;
}

function toggle(id) 
{
	var TheObject;
	if(CheckValidID(id))
	{
		TheObject = Initialize(id);
		/*if (TheObject.visibility == visible) {

			TheObject.visibility = hidden;

		} else {

			TheObject.visibility = visible;

		}*/
			if (TheObject.display.toLowerCase() == "inline" || TheObject.display.toLowerCase() == "block") {

				TheObject.display = "none";

		} else {

			TheObject.display = "inline";

		}
		lastMenu = TheObject;
	}
}
function ChangeColor(id)
{
	if(CheckValidID(id))
	{
		Initialize(id);
		if (TheObject.bgcolor="") {}
		TheObject.bgcolor="White";
		LastChange=TheObject;
	}
}

//**********************************************************************************************
//		Gets the elements that are selected in a list box and then returns the selected list
//**************************************************************************************
function getSelected(opt) 
{
	var selected = new Array();
	var index = 0;
	for (var intLoop = 0; intLoop < opt.length; intLoop++) 
	{
		if ((opt[intLoop].selected) || (opt[intLoop].checked)) 
		{
			index = selected.length;
			selected[index] = new Object;
			selected[index].value = opt[intLoop].value;
			selected[index].text = opt[intLoop].text;
			selected[index].index = intLoop;
		}
	}
	return selected;
}

function OpenWindow()
{
	if(window.name != 'resized')
	{
		window.open('/itsportal/DesktopDefault.aspx','resized','status,resizable,scrollbars,toolbar=no,menubar=no,location=no');
		if (window.opener == null) 
		{
			window.opener = self;
		}
		if(window.status=="Opened")
			window.close();
		else
			location.replace('newWindow.aspx');
		/*location='newWindow.aspx';*/
	}
	else if(!window.opener.closed)
	{
		//if(window.opener.status != null)
		window.opener.status="Opened";
	}
}
