/*
 *		description:	Maintain editability in Contribute.
*/
if(/MSIE/.test(navigator.userAgent))
{
	//	MSIE compatibility.
	//document.styleSheets[0].addRule("#flash_text", "visibility: hidden;");
}
else
{
	//	Firefox, Mozilla, Opera and all others compatibility.
	//document.styleSheets[0].insertRule("#flash_text {visibility: hidden;}", document.styleSheets[0].cssRules.length);
}



/*		description:	Open a popup window with a percent value relative to screen dimensions.
 *		url				A string representing an absolute or relative url.
 *		percent			A number between 1 to 100 representing a percent 
 *						value which the popup window will be resized to.
*/
function openWindow( url, percent ){
		percent = (percent)?percent:70;	// Default percent value

		var width = window.screen.width * (percent/100);
		var height = window.screen.height * (percent/100);
		var left = (window.screen.width-width)/2;
		var top = (window.screen.height-height)/2;

		window.open(url,'','width=' + width + ', height=' + height + ', left=' + left + ', top=' + top + ',status, menubar, resizable, scrollbars, toolbar');

}

/*		description:	Shortcut to return an element by its id.
 *		element			Id of the element.
*/

function $(element) {
	return (typeof element == 'string') ? document.getElementById(element) : false;
}

/*
Fix

Methods to select and deselect a menu option.

*/
function applyBackground(element, color)
{
	element.style.backgroundColor = color;	
}

function select(option)
{
	applyBackground(option, '#5C2D91');
}

function deselect(option)
{
	applyBackground(option, '#616265');
}