function mostraNascondi(id)
{
	if (document.all)
	{
		var stato = eval("document.all." +id+ ".style.display");
		if (stato == 'none')
		{
			eval("document.all." +id+ ".style.display = ''");
			eval("document.all.div_nascosto_img.src = 'immagini/minus.png'");
		}
		else
		{
			eval("document.all." +id+ ".style.display = 'none'");
			eval("document.all.div_nascosto_img.src = 'immagini/plus.png'");
		}
		
		return;
	}
	
	if (document.layers)
	{
		var stato = document.layers[id].display;
		if (stato == 'none')
		{
			document.layers[id].display = '';
			document.layers['div_nascosto_img'].src = 'immagini/minus.png';
		}
		else
		{
			document.layers[id].display = 'none';
			document.layers['div_nascosto_img'].src = 'immagini/plus.png';
		}
		
		return;
	}
	
	if (document.getElementById &&!document.all)
	{
		var nodo = document.getElementById(id);
		var stato = nodo.style.display;
		if (stato == 'none')
		{
			nodo.style.display = '';
			var nodoImg = document.getElementById('div_nascosto_img');
			nodoImg.setAttribute('src', 'immagini/minus.png');
		}
		else
		{
			nodo.style.display = 'none';
			var nodoImg = document.getElementById('div_nascosto_img');
			nodoImg.setAttribute('src', 'immagini/plus.png');
		}
		
		return;
	}
}

/**
 *
 */
function drop_down_list()
{
	var stato_cat = $('#annuncio_categoria').val();
	if (stato_cat != undefined)
	{
		$.getScript("js/occupazioni/"+ stato_cat.toLowerCase() +".js", function()
		{
			populate(document.form.annuncio_occ_1);
			populate(document.form.annuncio_occ_2);
			populate(document.form.annuncio_occ_3);
		});
	}
}

$(document).ready(function()
{
	$("#annuncio_categoria").change(drop_down_list);
});
$(window).load(drop_down_list);
