/* 
Floats a description of the form item in a box above the mouse pointer.
Requires that you place this element somewhere in your right-hand column:

	<div id="floater">
	<p>This should be blank.</p>
	</div>
*/
function float_desc(evt, txt) {
	var noheight = 0;
	var floater = document.getElementById("floater");
	var message = "<p>" + txt + "</p>";
	if (floater.offsetHeight == 0) noheight = 1;
	floater.innerHTML = message;

	if (txt != undefined)
	{
/*
Get the coords of the mouse pointer. Firefox/Mozilla handles this differently from IE, hence the need for the conditional. Firefox requires an explicit passing of an event object as a parameter to the event handler.
*/
		var e = (window.event) ? window.event : evt;
		floater.style.display = "block";
		var xcoord = e.clientX;
		var ycoord = e.clientY + document.documentElement.scrollTop - floater.offsetHeight - 15;

		xcoord = xcoord + "px";
		ycoord = ycoord + "px";

	// Move the window into place and display the content.
		floater.style.left = xcoord;
		floater.style.top = ycoord;
	}
	else
	{
	// Hide the window and stick it where the sun don't shine.
		floater.innerHTML = "";
		floater.style.left = "-200px";
		floater.style.top = "-200px";
		floater.style.display = "none";
	}
}

//Validates the quick-subscribe form for BookLetters newsletters
function qs_validate() {
	if (document.getElementById('email').value == "")
	{
		alert("You must include an e-mail address in order to submit this form.")
		document.getElementById('email').focus();
		return false;
	}
	else
	{
		var i = 3;
		var checkselected = false;
		do
		{
			if (document.getElementById('qs_form').elements[i].checked == true)
			{
				checkselected = true;
			}
			i++;
		} while (i < document.getElementById('qs_form').length)
		if (!checkselected)
		{
			alert ("Please be sure to select at least one newsletter before clicking the Subscribe button.");
			return false;
		}
		else
		{
//			alert ("You're good to go.");
			return true;
		}
	}
}