function EmailPage()
{
	window.open("EmailPage.aspx?pageUrl=" + encodeURIComponent(document.URL), "_blank", "toolbars=no");
}
function DoSearch()
{
	var keyword;
	var url;
	keyword = document.getElementById("txtSearch").value;
	if(document.getElementsByName("rdoSearchType")[0].checked)
	{
		url = "http://sitesearch.tacomapubliclibrary.org/search?restrict=&ie=&site=my_collection&output=xml_no_dtd&client=my_collection&lr=&proxystylesheet=my_collection&oe=&q=";
	}
	else
	{
		url = "http://topcat.tacomapubliclibrary.org/uhtbin/cgisirsi.exe/x/0/0/5?searchdata1=";
	}
	url += keyword;
	location.href = url;
	return false;
}
function CheckKey()
{
	if (window.event.keyCode == "13")
	{
		DoSearch();
		window.event.returnValue = false;
	}	
}
function ChangeSpotlight(ordinal)
{
	var table1 = document.getElementById(grid1);
	var table2 = document.getElementById(grid2);

	var next = current + ordinal;
	
	if(next > count - 1)
	{
		next = 0;
	}
	
	if(next < 0)
	{
		next = count - 1;
	}
	
	current = next;
	
	for(var i = 0; i < count; i++)
	{
		var Row1 = table1.tBodies[0].rows[i];
		var Row2 = table2.tBodies[0].rows[i];
		if(i != next)
		{
			Row1.style.display = 'none';
			Row2.style.display = 'none';
		}
		else
		{
			Row1.style.display = '';
			Row2.style.display = '';
		}
	}
	timer = 0;
}
function UpdateTimer()
{
	if(timer == 4)
	{
		ChangeSpotlight(1);
	}
	else
	{
		timer += 1;
	}
	
	setTimeout("UpdateTimer()", 6000);
}
