/**  
 * @fileoverview This file contains functions for the search panel.
 * @author Mark Hendrickson <mhendric@bowdoin.edu>
 * @version 1.0
 */

/**
 * Focuses on the search box of a certain section so user can beging typing search term.
 * @param {String} section Section name
 */
function focusSearch(section)
{
	var text = $('search_'+section+'_text');
	text.focus();
}

/** 
 * Updates all of the search boxes with the value of the given section's search box.
 * @param {String} section Section name
 */
function updateSearchTexts(section)
{
	var text_value = $('search_'+section+'_text').value;
	var search_sections = new Array('bowdoin','directory','courses','google');

	for(var i=0; i<search_sections.length; i++)
	{
		if(search_sections[i] != section)
			$('search_'+search_sections[i]+'_text').value = text_value;
	}
}