// Define the search keywords textbox.
var divFavSearches = document.getElementById("favSearches");
var txtKeywords = document.getElementsByName("keywords").item(0);
var flag = true;

// Show favorite sarches when textbox is in focus.
txtKeywords.onfocus = function() {
	divFavSearches.style.visibility = "visible";
}

// Hide favorite searches AFTER A DELAY once the textbox is blurred.
txtKeywords.onblur = function() {
	if (flag) divFavSearches.style.visibility = "hidden";
	flag = true;
}

divFavSearches.onmousedown = function() {
	flag = false;
}

divFavSearches.onclick = function() {
	divFavSearches.style.visibility = "hidden";
	flag = true;
}