<!--

/* -------------------------------------- */
// Set element color
/* -------------------------------------- */
function setBg(obj, color)
{
	if ( !color || color == '' )
	{
		obj.style.backgroundColor = '';
		return false;
	}

	obj.style.backgroundColor = '#' + color;
}

/* -------------------------------------- */
// Toggle select color
/* -------------------------------------- */
function toggleSelect(objSelect, ishex)
{
	var objField;

	if ( objSelect.style.backgroundColor == '' )
	{
		for ( var x = 0; x<document.forms[0].elements.length; x++ )
		{
			objField = document.forms[0].elements[x];

			if ( objField.name != objSelect.name )
			{
				objField.style.backgroundColor = '';
			}
		}

		objSelect.style.backgroundColor = '#DEFF9B';
		objSelect.style.border = '1px solid black';
		fetch_object('selAttr').value = objSelect.getAttribute('id');
		fetch_object('colorobj').value = objSelect.getAttribute('id') + '_colorbar';

		if ( ishex )
		{
			setChartColor(objSelect.value);
		}
	}
}

/* -------------------------------------- */
// Set color chart
/* -------------------------------------- */
function setChartColor(hexval)
{
	fetch_object('color').value = hexval;
	inputBoxChanged();
}

/* -------------------------------------- */
// Show quick page selector
//
// @param	object		quick selector link
/* -------------------------------------- */
function show_pageselector(objlink)
{
	var ps = fetch_object('pageselector');
	
	ps.style.left = objlink.offsetLeft + 'px';
	ps.style.top  = (objlink.offsetTop + objlink.offsetHeight) + 'px';
	ps.style.display = '';

	return false;
}

/* -------------------------------------- */
// Fetch an object element
//
// @param	string		object name
// @return	object		element
/* -------------------------------------- */
function fetch_object(idname)
{
	if (document.getElementById)
	{
		return document.getElementById(idname);
	}
	else if (document.all)
	{
		return document.all[idname];
	}
	else if (document.layers)
	{
		return document.layers[idname];
	}
	else
	{
		return null;
	}
}

/* -------------------------------------- */
// Follow URL selection
//
// @param	object		select object
/* -------------------------------------- */
function urlselection(objsel)
{
	var url = objsel.options[objsel.selectedIndex].value;

	if ( url )
	{
		var urlsplit = url.split("_confirm:");

		if ( urlsplit[1] )
		{
			if ( !confirm([urlsplit[1]]) )
			{
				return false;
			}

			window.location = urlsplit[0];
			return true;
		}		

		window.location = url;
		return true;
	}

	return false;
}

/* -------------------------------------- */
// Open Navigation
//
// @param	int	navigation id
/* -------------------------------------- */
function openMenu(navid)
{
	var nav  = fetch_object('nav' + navid);
	var menu = fetch_object('menu' + navid);

	nav.style.left = (menu.offsetLeft - 5) + 'px';
	nav.style.top  = (menu.offsetTop + 15) + 'px';
	nav.style.display = '';
}

/* -------------------------------------- */
// Close Navigation
//
// @param	int	navigation id
/* -------------------------------------- */
function closeMenu(navid)
{
	fetch_object('nav' + navid).style.display = 'none';
}
-->
