var defaultSearchBoxValue = "Type in your search terms to begin";

function hide(obj) { document.getElementById(obj).style.display = 'none'; }
function show(obj) { document.getElementById(obj).style.display = 'block' }

function switchContent(containerID) 
{   
    hide('welcomeContainer');
    hide('searchExamplesContainer');
    hide('featuredContainer');

    document.getElementById('welcomeContainerTab').className = 'welcome_tab_off';
    document.getElementById('searchExamplesContainerTab').className = 'search_examples_tab_off';
    document.getElementById('featuredContainerTab').className = 'featured_tab_off';
 
    show(containerID);

    if (containerID == 'featuredContainer') 
    {
        document.getElementById('welcomeContainerTab').className = 'welcome_tab_off_alt';
        document.getElementById('searchExamplesContainerTab').className = 'search_examples_tab_off_alt';
    } 
    else if (containerID == 'welcomeContainer') 
    {
         document.getElementById('searchExamplesContainerTab').className = 'search_examples_tab_off';
         document.getElementById('featuredContainerTab').className = 'featured_tab_off';
    }
        
        
    document.getElementById(containerID + 'Tab').className = document.getElementById(containerID + 'Tab').className.split('off')[0] + 'on';
}

function searchbox_onkeydown(){
	reset_sBG(false);
}
function init_sBG(noHint){
	var searchBox = document.getElementById("s");
	if(!searchBox) return;
	if(noHint){
		if(searchBox.value) reset_sBG(false);
	}
	else reset_sBG(!searchBox.value);
	setTimeout(function(){ searchBox.focus(); }, 0);	
}
function reset_sBG(fill){
    var sBG = document.getElementById("sBG");
	if(!sBG) return;
	var s = fill ? defaultSearchBoxValue : "";
	sBG.innerHTML = s;
}
function sBG_onfocus(){
	var searchBox = document.getElementById("s");
	if(!searchBox) return;
	searchBox.focus();
}

