	
var currentlyActiveInputRef = false;
var currentlyActiveInputClassName = false;

function highlightActiveInput()
{
	if(currentlyActiveInputRef){
		currentlyActiveInputRef.className = currentlyActiveInputClassName;
	}
	currentlyActiveInputClassName = this.className;
	this.className = this.className+' inputHighlighted';
	currentlyActiveInputRef = this;
	
	
}

function blurActiveInput()
{
	this.className = currentlyActiveInputClassName;
	
	
}


function initInputHighlightScript()
{
	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++){
			if(inputs[no].className && inputs[no].className=='donothilightthis')continue;
			if(inputs[no].tagName.toLowerCase()=='textarea' || (inputs[no].tagName.toLowerCase()=='input' && inputs[no].type.toLowerCase()=='text')){
				if(inputs[no].id!="searchbox"){
					inputs[no].onfocus = highlightActiveInput;
				}
				if(inputs[no].className && inputs[no].className!='mandatoryField'){
					if(inputs[no].id!="searchbox"){
						inputs[no].onblur = blurActiveInput;
					}
				}
			}
		}
	}
}

function clearField(myField){
	if(myField.value=="")
	{
		myPathname=window.location.pathname;
		if(myPathname.search(/^\/english/i)!=-1){
			myField.value="Search";
		}
		else if(myPathname.search(/^\/italiano/i)!=-1){
			myField.value="Cercare";
		}
		else if(myPathname.search(/^\/francais/i)!=-1){
			myField.value="Recherche";
		}
		else{
			myField.value="Suchen";
		}
	}
	else{
		if(myField.value=='Suchen'||myField.value=='Recherche'||myField.value=='Cercare'||myField.value=='Search'){
			myField.value="";
		}
	}
}