function get_next_object_by_tag(_s_tag, _objparent)
{
	var arr_children = _objparent.getChildren();
	for(var i = 0; i < arr_children.length; i++)
	{
		if (arr_children[i].get('tag') == _s_tag)
			return arr_children[i];
	}

	//we didnt found any, so we check in our childrens:
	for(var i = 0; i < arr_children.length; i++)
	{
		var obj_tmp = get_next_object_by_tag(_s_tag, arr_children[i]);
		if (obj_tmp != null) return obj_tmp;
	}

	return null;
}

window.addEvent('domready', function()
{
	//we first make sure the #searchcontainer is the same height as the #maincontent:
	if (
		$('maincontent') && 
		$('searchcontainer')
	)
	{
		//we get our sizes:
		var i_search_height = $('searchcontainer').getSize().y.toInt();
		var i_main_height = $('maincontent').getSize().y.toInt();

		//we then verify if the main is bigger than the search:
		if (i_main_height > i_search_height)
		{
			//we adjust the search height:
			$('searchcontainer').setStyle('height', i_main_height - 55);
		}
	}

	//we first make sure the #searchcontainer is the same height as the #maincontent-interior:
	if (
		$('maincontent-interior') && 
		$('searchcontainer')
	)
	{
		//we get our sizes:
		var i_search_height = $('searchcontainer').getSize().y.toInt();
		var i_main_height = $('maincontent-interior').getSize().y.toInt();

		//we then verify if the main is bigger than the search:
		if (i_main_height > i_search_height)
		{
			//we adjust the search height:
			$('searchcontainer').setStyle('height', i_main_height - 55);
		}
	}

	//we then adjust the opacity of our headlines tag(s):
	$$('.headlines').setStyle('opacity', 0.5);
});

sfHover = function() { 
	var sfEls = document.getElementsByTagName("LI"); 
		for (var i=0; i<sfEls.length; i++) { 
			sfEls[i].onmouseover=function() { 
			this.className+=" sfhover"; 
		} 
		sfEls[i].onmouseout=function() { 
			this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); 
		} 
	} 
}

if (window.attachEvent)
{
    window.attachEvent("onload", sfHover);
}

