﻿/// <reference path="jquery-1.3-vsdoc.js" />
/*
 *		FORMHELP.JS
 *
 *		Will assign a mouseover event on form elements to show help text in the "description" area of the box.
 *		Requires jQuery.
 */
 
$().ready(function() {
	$('#boxForm fieldset *[id]').focus(function(){ 
		var elementID;
		//let's override the help on these
		switch( this.id ){
			case "sortDesc":
			case "sortAsc":
				elementID = "ddlSortBy";
				break;
				
			case "dateEnd":
				elementID = "dateStart";
				break;	
				
			default:
				elementID = this.id;
		}
		showHelp(elementID); });	
});

//hides all help text, then shows the highlighted one
function showHelp(elementID) {
	
	$('#boxDescription div:not("#searchHints")').removeClass('showBlock').addClass('hide');
	$('#help' + elementID ).removeClass('hide').addClass('showBlock');
	
	//prevent bubbles
	return false;
}