function prendiElementoDaId(id_elemento) {
	var elemento;
	if(document.getElementById)
		elemento = document.getElementById(id_elemento);
	else
		elemento = document.all[id_elemento];
	return elemento;
};
	
function assegnaXMLHttpRequest()
{
    var Ajax=null; 
    if(!Ajax && typeof XMLHttpRequest != "undefined")
    {
        Ajax=new XMLHttpRequest();
    }
    if (!Ajax)
    {
        try
        {
            Ajax=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch(e)
        {
            try
            {
                Ajax=new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch(oc)
            {
                Ajax=null
            }
        }
    }    
    return Ajax;
}
function chose(id, value) {
  var scelto=prendiElementoDaId("disegno").value;
  if (scelto!=0){
  scelto="c_"+scelto;
    prendiElementoDaId(scelto).className ="viewmodel";
  }
  prendiElementoDaId("disegno").value=value;
  prendiElementoDaId(id).className ="descrizione_s";
}
function selezionaCategoria(categoria){
  prendiElementoDaId("categoria").value=categoria;
}

function visualizzaCategorie(){
  var freccia="frecciacat";
  if(prendiElementoDaId("lista-categorie-esistenti").style.display=="none"){
    prendiElementoDaId("lista-categorie-esistenti").style.display="";
    prendiElementoDaId(freccia).innerHTML="&#9660;";
  }
  else {
    prendiElementoDaId("lista-categorie-esistenti").style.display="none";
    prendiElementoDaId(freccia).innerHTML="&#9658;";
  }
}
  sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

