var highLighted = new Array();

//for use in hideShowElement
function hideElement(element){
	if (document.getElementById){
			document.getElementById(element).style.display = 'none';
	}
	else if (document.all){
			document.all['element'].style.display = 'none';
	}
}
//for use in hideShowElement
function showElement(element){
	if (document.getElementById){
			document.getElementById(element).style.display = 'block';
	}
	else if (document.all){
			document.all['element'].style.display = 'block';
	}
}

//actual function which is called onmouseclick
function hideShowElement(element)
{
	if (document.getElementById){
		if (document.getElementById(element).style.display == 'block')
		{
			hideElement(element);
		}
		else
		{
			showElement(element);
		}
	}
	else if (document.all){
		if (document.all['element'].style.display == 'block')
		{
			hideElement(element);
		}
		else
		{
			showElement(element);
		}
	}
}

function changeStyle(element, styleName, valueSpecified)
{
	if (document.getElementById){
		eval ('document.getElementById(\'' + element + '\').style.' + styleName + '=\'' + valueSpecified + '\'');
		
	}
	else if (document.all){
		eval ('document.all[\'' + element + '\'].style.' + styleName + '=\'' + valueSpecified + '\'');
	}
}

function changeStyleIfHighlight(element, styleName, valueSpecified, highlight)
{
	if (document.getElementById){
		if(!in_array(highLighted, element)){
			//alert (currentbackground + ' ' + highlight)
			changeStyle(element, styleName, valueSpecified);
		}
	}
	else if (document.all){
		if(!in_array(highLighted, element)){
			changeStyle(element, styleName, valueSpecified);
		}
	}
}

function highlight(element, styleName, valueSpecified, original)
{
	//alert(element);
	var highLights;
	if (!in_array(highLighted, element))
	{
		//alert('!in_array');
		highLighted[(highLighted.length+1)] = element;
		changeStyle(element, styleName, valueSpecified);
	}
	else
	{
		//alert('in_array');
		remove_array_element(highLighted, element);
		changeStyle(element, styleName, original);
	}
}

function in_array(array, value)
{
	var ret = false;
	var x;
	for(x in array)
	{
		if (array[x] == value) ret = true;
	}
	return ret;
}

function remove_array_element(array, value)
{
	var tmp = new Array();
	var x;
	for(x in array)
	{
		if (array[x] != value) tmp[(tmp.length+1)] = array[x];
	}
	highLighted = tmp;
}