/** Generated by js.php */
/************************************************************************************************************
(C) www.dhtmlgoodies.com, November 2005

This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.

Terms of use:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.

Thank you!

www.dhtmlgoodies.com
Alf Magne Kalleland

************************************************************************************************************/
	window.inputHighlight = true;
	currentlyActiveInputRef = false;
	currentlyActiveInputClassName = false;

	highlightActiveInput = function ()
	{
		if(currentlyActiveInputRef){
			currentlyActiveInputRef.className = currentlyActiveInputClassName;
		}
		currentlyActiveInputClassName = this.className;
		//this.className = 'inputHighlighted';
		Element.addClassName(this,'inputHighlighted')
		currentlyActiveInputRef = this;


	}

	blurActiveInput = function()
	{
		//this.className = currentlyActiveInputClassName;
		Element.removeClassName(this,'inputHighlighted')
	}


	initInputHighlightScript = function()
	{
		var tags = ['INPUT','TEXTAREA'];

		for(tagCounter=0;tagCounter<tags.length;tagCounter++){
			var inputs = document.getElementsByTagName(tags[tagCounter]);
			for(var no=0;no<inputs.length;no++)
			{
				// on ne traite pas les champs déjà intialisés ou déjà affectés par des événements onblur et onfocus
				if(inputs[no].onfocus || inputs[no].onblur) continue;
				if(inputs[no].className && inputs[no].className=='doNotHighlightThisInput')continue;


				if(inputs[no].tagName.toLowerCase()=='textarea' || ((inputs[no].tagName.toLowerCase()=='input' && (inputs[no].type.toLowerCase()=='text' || inputs[no].type.toLowerCase()=='password'))))
				{
					inputs[no].onfocus = highlightActiveInput;
					inputs[no].onblur = blurActiveInput;
				}
			}
		}
	}

