//funzione per aprire i link esterni in una nuova finestra
function apri(pagina) {
	window.open(pagina,'cdf','scrollbars=yes,resizable=no,left=5,top=5,width=560,height=580,status=no,location=no,toolbar=no');
	}
//funzione per l'ingrandimento delle immagini in una pop up
function apri_img(url_foto,des_foto){
	addr="fullsize.htm?"+url_foto+"&amp;"+escape(des_foto)
	alt=600
	lar=800
	rszb=(document.layers)?1:0;
	props='height='+alt+',width='+lar+',top='+parseInt((screen.availHeight-alt)/2)+',left='+parseInt((screen.availWidth-lar)/2)+',scrollbars=0,resizable='+rszb+',toolbar=0,menubar=0,location=0,status=0';
	window.open(addr,'_blank',props);
	}
//funzione per il countdows dei caratteri in textarea
function conta(val) {
	max=200
       if (val.descrizione.value.length > max) {
	        val.descrizione.value = val.descrizione.value.substring(0,max)
		rest = 0
       } 
	else {
		rest = max - val.descrizione.value.length
		}
	val.num.value = rest
	}
//funzione per il refresh del primo menu a tendina in caso di categorie e sotto categorie
function refreshit()
	{
	document.forms[1].target="_self";
	document.forms[1].action="default.asp?";
	document.forms[1].submit();
	}
//funzione per il refresh del secondo menu a tendina in caso di categorie e sotto categorie
function refreshit2()
	{
	document.forms[2].target="_self";
	document.forms[2].action="default.asp?";
	document.forms[2].submit();
	}

//Mostra nascondi righe di tabella
function mostra_nascondi_row(id_riga){
	var IE=(window.navigator.userAgent.indexOf('MSIE')>-1)?1:0;
	document.getElementById(id_riga).style.display=(document.getElementById(id_riga).style.display=='none')?((IE)?'block':'table-row'):'none';
}	

function mostra_nascondi_div(id){
	var IE=(window.navigator.userAgent.indexOf('MSIE')>-1)?1:0;
    if(document.getElementById){ 
        var el=document.getElementById(id); 
        el.style.display = (el.style.display=="block") ? "none" : "block"; 
        el.style.visibility = (el.style.visibility=="visible") ? "hidden" : "visible"; 
    } 
	//document.getElementById(id).style.display=(document.getElementById(id).style.display=='none')?'block':'none';
}