// JavaScript Document

// serve a cambiare l'id dei link correnti nella pagina
function highlights( array )
	{
		for( i=0; i<array.length; i++)
		try 
			{
				elem = document.getElementById( array[i] );
				elem.id="activelink";
			}
			catch (e)
			{
			}
	}
	
	
// cambia il background degli input al focus	
	function elemFocus(campo)
	{
		campo.style.backgroundColor = "#ffffff";
		campo.style.borderColor = "#36c6f6";
	}

// cambia il background degli input al blur		
	function elemBlur(campo)
	{
		campo.style.backgroundColor = "#ededed";
		campo.style.borderColor = "#a4a8a7";
	}
	
// swap delle img da css
	function swapBg(img)
	{
		img.style.backgroundPosition = '0px 0px';
	}	
	
	function unswapBg(img)
	{
		img.style.backgroundPosition = '0px 100%';
	}	
	
// cambia l'immagine di background dell'input cerca
	function searchFocus()
	{
		document.getElementById("input_search").style.backgroundPosition = "100% 0px";
	}
	function searchBlur()
	{
		document.getElementById("input_search").style.backgroundPosition = "0px 0px";
	}
	
/*
 *	mostraElem: mostra/nasconde dei div nascosti, l'effetto e' quello di aprire/chiudere dei div
 *			Input: elemCorrente e' l'id del div da mostrare
 */
function mostraElem(elemCorrente) 
{
	//intShow=setInterval("mostraElem()",10)
	if (document.getElementById) 
	{
		questoElem = document.getElementById(elemCorrente).style; //recupero lo stato del div
		
		if (questoElem.display == "block") questoElem.display = "none"; //se il div e' mostrato(menu aperto), lo nascondo(div chiuso)
		else	questoElem.display = "block"; // altrimenti lo mostro
		
		return false;
	}
	else return true;
}

// mostra il div con info e ricerca nell'header
function showUtility()
  {
	document.getElementById('utility').style.display="block";
  }
   

