	/**
	* toggles a image between two states
	* call like this: onMouseOver="gfxToogle(this, 'active.gif', 'inactive.gif')" onMouseOut="gfxToogle(this, 'active.gif', 'inactive.gif')"
	* image paths and current state are determined automatically.
	*
	* @access	public
	* @param	object		gfx			a DOM object with a .src parameter
	* @param	string		active		the filename (no path!) to the active-state image
	* @param	string		inactive	the filename (no path!) to the inactive-state image
	* @return	void
	*/
	function gfxToggle(gfx, active, inactive) {

		if (typeof gfx == 'object' && gfx.src) {

			var matches = gfx.src.match(/^(.*)\/([^\/]+)$/);

			switch (matches[2]) {
				case active:
					gfx.src = matches[1] + '/' + inactive;
					break;

				case inactive:
					gfx.src = matches[1] + '/' + active;
					break;

				default:
			} /* end: switch */
		} /* end: if */
	}

	/**
	* toggles visibility of an object
	* call like this:
	* // for making an object visible
	* showHideObject('objctId', true)
	*
	* // for making an object invisible
	* showHideObject('objctId', false)
	*
	* // for making an object flexible to a checkbox
	* // if checkbox checked than show else hide
	* <input type="checkbox" onChange="showHideObject('objctId', this.checked)">
	*
	* @access	public
	* @param	string		objectid	of the element to be shown or hidden
	* @param	boolean		visibility	of the element to be shown or hidden
	* @return	void
	*/
	function showHideObject(objId, visibility) {

		if (objId) {
			var object = document.getElementById(objId);

			if (object) {

				switch (visibility) {
					case false:
						object.style.visibility = 'hidden';
						object.style.display = 'none';
						break;

					case true:
						object.style.visibility = 'visible';
						object.style.display = 'block';
						break;
				} // end: switch

			} /* end: if */


		} /* end: if */
	}

	/**
	* Clear the form elements
	* 
	* @access	public
	* @param	Object	formObj		jQuery Form Object 
	* @return	void
	*/
	 function clearFormElements(formObj) {
		 $(formObj).find(':input').each(function() {
           switch(this.type) {
               case 'select-multiple':
               case 'select-one':
            	   $(this).get(0).selectedIndex = 0;
            	   break;
               case 'password':
               case 'text':
               case 'textarea':
            	   $(this).val('');
            	   break;
               case 'checkbox':
               case 'radio':
                   this.checked = false;
           }//end: switch
		 });
	  } // end: function clearFormElements
