/*
** Redirects on a dropdown select
*/

function url_select(selid, url)
{
	sel=document.getElementById(selid);
	window.location = url + sel.options[sel.selectedIndex].value;	
}

/*
** shows the element with the given id
*/
function show_id(id)
{
	div = document.getElementById(id);
	if(div)
		div.style.display = 'block';
}

/*
** hides all elements with the given class
*/
function hide_class(className)
{
	divs = getElementsByStyleClass (className);
	for (var i = 0; i < divs.length; i++)
	{
		divs[i].style.display = 'none';	
	}
}

/*
** gets all elements with the given class and returns them as an array.
*/
function getElementsByStyleClass (className) {
	var all = document.all ? document.all : document.getElementsByTagName('*');
	var elements = new Array();
	for (var i = 0; i < all.length; i++)
	{ 
    	if (all[i].className == className) {elements[elements.length] = all[i];}
	}
	return elements;
}