/*
Utilities.js

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/


/**
 * Clear a text input box if it recieves focus for the first time.
 * This function should be the event handler for the onfocus event.  
 * @param elemTextInput The element (<input type="text" ...)
 * @param defaultString The default text displayed by the element.
 */    
function clearTextInput(elemTextInput, defaultString)
	{
	// if this is the first time we're entering a value in the text box
	// then clear its default contents
	if (defaultString == elemTextInput.value)
		elemTextInput.value = '';
	}



/**
 * Clear a text area when it recieves focus for the first time.
 * This function should be the event handler for the onfocus event.  
 * @param elemTextArea The element (<textarea ...)
 * @param defaultString The default text displayed by the element.
 */    
function clearTextArea(elemTextArea, defaultString)
	{
	// if this is the first time we're entering a value in the text area 
	// then clear its default contents
	if (defaultString == elemTextArea.childNodes[0].nodeValue)
		elemTextArea.childNodes[0].nodeValue = '';
	}





