var sStandardValue	= "uw zoekterm";
			
/**
 * clears the value in the searchbox
 * 
 * @param oObject
 * @param sValue
 * @param bFocus
 * @return
 */
function clearSearchbox(oObject, sValue, bFocus)
{
	if (bFocus && (sValue == sStandardValue))
	{
		oObject.value = "";
	} else if (!bFocus && (sValue == "" || sValue == " "))
	{
		oObject.value = sStandardValue;
	}
}
			
var sActiveTabID;

/**
 * hide all the elements in the tabcontainer and start the executer to laod tabs by hash
 * @param sTabContainer
 * @param sTabToLoad
 * @return void
 */
function initTabs(sTabContainer, sTabToLoad)
{
	//hide all the elements in the tabcontiainer
	$(sTabContainer).childElements().each(function(oElement){oElement.style.display = 'none';})

	var aURI = window.location.hash.split("#");
	
	//set default hash if none is available
	if(!aURI[1])
	{
		window.location.hash = "#"+sTabToLoad;
	}
	
	new PeriodicalExecuter(changeTab, 0.005);
}

/**
 * loads a tab with help of the hash, and hides the active one
 * 
 * @return void
 */
function changeTab()
{
	var aURI = window.location.hash.split("#");
	
	var sTabID = aURI[1];
	
	hideActiveTab();
	
	showTab(sTabID);
	
	sActiveTabID = sTabID;
}

/**
 * hide the active tab if available
 * @return void
 */
function hideActiveTab()
{
	if(sActiveTabID)
	{
		$(sActiveTabID).style.display = 'none';
		$('button_'+sActiveTabID).removeClassName('selected');
	}
}

/**
 * show a tab
 * 
 * @param sTabID
 * @return void
 */
function showTab(sTabID)
{
	$(sTabID).style.display = 'block';
	$('button_'+sTabID).addClassName('selected');
}
