﻿/*
 * Filename: searchBox.js
 * Description: This file contains functions used by the search box at the top of most pages
 *		on the FutureLogic website.
 */

/* variable that tracks the display state of the search string "Search this site". */
var showSearchString = new Boolean(true);
var searchString = new String("Search this site");

/* function that is run when a user clicks in the searchBox area. If the user has
 * not previously typed anything in the searchBox then the contents are cleared so
 * they can type something to search for.
 */
function searchBox_click(searchBox) {
	if (showSearchString) {
		searchBox.value = "";
		showSearchString = false;
	}
}

/* function that is run when a user clicks off of the searchBox area. If the user
 * has typed something in the search box then nothing happens, otherwise if the box
 * is left blank then the search string "Search this site" is placed in the searchBox.
 */
function searchBox_blur(searchBox) {
	if (!showSearchString && searchBox.value == "") {
		searchBox.value = searchString;
		showSearchString = true;
	}
}

