//------------------------------------------------------------------------
/**
  * Project:    SecureScopeWeb
  *
  * Author:     Matt Friedlander
  * 
  */
//------------------------------------------------------------------------

//------------------------------------------------------------------------
/**
  * This method opens the url parameter in the same window.
  */
//------------------------------------------------------------------------
function openURL(url)
{
	window.open(url, "_self");
}

//------------------------------------------------------------------------
/**
  * This method toggle the display style between 'none' and 'block'.
  */
//------------------------------------------------------------------------
function toggleDisplayState(id)
{
	var objStyle = eval("document.all." + id + ".style");

	if (objStyle.display == "none")
	{
		objStyle.display = "block";
	}
	else
	{
		objStyle.display = "none";
	}
}

//------------------------------------------------------------------------
/**
  * This method toggles the image source of a given img tag.
  */
//------------------------------------------------------------------------
function toggleImageSource(imgID, imgSrc1, imgSrc2)
{
	var imgObj = eval("document.all." + imgID);
	
	if (imgObj.src.substring(imgObj.src.lastIndexOf('/'), imgObj.src.length) == imgSrc1.substring(imgSrc1.lastIndexOf('/'), imgSrc1.length))
	{
		setImageSource(imgID, imgSrc2);
	}
	else
	{
		setImageSource(imgID, imgSrc1);
	}
}

//------------------------------------------------------------------------
/**
  * This method sets the image source of a given img tag.
  */
//------------------------------------------------------------------------
function setImageSource(imgID, imgSrc)
{
  var imgObj = eval("document.all." + imgID);
  imgObj.src = imgSrc;
}

//------------------------------------------------------------------------
/**
  * This method gives a specified object focus.
  */
//------------------------------------------------------------------------
function giveFocus(id)
{
	var obj = eval("document.all." + id);
	
	// Give this object focus.
	obj.focus();
}

//------------------------------------------------------------------------
/**
  * This method changes an objects style
  */
//------------------------------------------------------------------------
function changeStyle(s,newstyle)
{
	//alert("style:" + newstyle);
	s.className = newstyle;
	//s.style.color = "#FC0";

}
