/******************************************************************************/
/*                  Global functions for paulofierro.com                      */
/******************************************************************************/

// -----------------------------------------------------------------------------
// Method that shows/hides specific element
// -----------------------------------------------------------------------------
function showHide(element){
	var status = document.getElementById(element).style.display;
	if(status == "block" || status == ""){
 		document.getElementById(element).style.display = "none";
 	}
 	else{
 		document.getElementById(element).style.display = "block";
 	}
}
// -----------------------------------------------------------------------------
// Method that initializes other elements
// -----------------------------------------------------------------------------
function init() {
	var searchForm = document.getElementById("searchForm");
	// In case user clicks the form early
	if(searchForm.onclick != null) {
		searchForm.q.value = "Search...";
	}
}
// -----------------------------------------------------------------------------
// Method that clears the contents of the search box on click
// -----------------------------------------------------------------------------
function clearSearchbox(f) {
	var form = f;
	form.q.value = "";
	form.onclick = null;
}
// -----------------------------------------------------------------------------
// Method that performs a search for JavaScript capable browsers
// -----------------------------------------------------------------------------
function doSearch(f) {
	var query = f.q.value;
	document.location = "/search/title,body/" + query;
	return false;	
}
