function window_open(filename, x, y, target)
{
windowops = eval("'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=" + x + ",height=" + y + "'");
newwindow=window.open(filename, target, windowops);
newwindow.creator=self
newwindow.name=target
return;
}

function window_open_scroll(filename, x, y, target)
{
windowops = eval("'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=" + x + ",height=" + y + "'");
newwindow=window.open(filename, target, windowops);
newwindow.creator=self
newwindow.name=target
return;
}


function window_open_bar(filename, x, y, target)
{
windowops = eval("'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=" + x + ",height=" + y + "'");
newwindow=window.open(filename, target, windowops);
newwindow.creator=self
newwindow.name=target
return;
}

function cambia(x){
	if (x==1) document.hog.src="graphics/menu/hog_a.jpg"
	if (x==2) document.hog.src="graphics/menu/hog_b.jpg"
	if (x==3) document.gem.src="graphics/menu/gem_a.jpg"
	if (x==4) document.gem.src="graphics/menu/gem_b.jpg"
	if (x==5) document.dir.src="graphics/dir_a.jpg"
	if (x==6) document.dir.src="graphics/dir_b.jpg"
	if (x==7) document.roa.src="graphics/roa_a.jpg"
	if (x==8) document.roa.src="graphics/roa_b.jpg"
	if (x==9) document.lin.src="graphics/menu/lin_a.jpg"
	if (x==10) document.lin.src="graphics/menu/lin_b.jpg"
	if (x==11) document.hdl.src="graphics/menu/hdl_a.jpg"
	if (x==12) document.hdl.src="graphics/menu/hdl_b.jpg"
	if (x==13) document.eve.src="graphics/menu/eve_a.jpg"
	if (x==14) document.eve.src="graphics/menu/eve_b.jpg"
	if (x==15) document.soc.src="graphics/menu/soc_a.jpg"
	if (x==16) document.soc.src="graphics/menu/soc_b.jpg"
	if (x==17) document.ami.src="graphics/ami_a.jpg"
	if (x==18) document.ami.src="graphics/ami_b.jpg"
	if (x==19) document.gal.src="graphics/menu/gal_a.jpg"
	if (x==20) document.gal.src="graphics/menu/gal_b.jpg"
	if (x==21) document.gue.src="graphics/gue_a.jpg"
	if (x==22) document.gue.src="graphics/gue_b.jpg"
	if (x==23) document.mem.src="graphics/mem_a.jpg"
	if (x==24) document.mem.src="graphics/mem_b.jpg"
	if (x==25) document.sto.src="graphics/menu/sto_a.jpg"
	if (x==26) document.sto.src="graphics/menu/sto_b.jpg"
	if (x==27) document.ne.src="graphics/menu/new_a.jpg"
	if (x==28) document.ne.src="graphics/menu/new_b.jpg"
	if (x==29) document.home.src="graphics/menu/hom_a.jpg"
	if (x==30) document.home.src="graphics/menu/hom_b.jpg"
	if (x==31) document.icona.src="graphics/icona_a.jpg"
	if (x==32) document.icona.src="graphics/icona_b.jpg"
	if (x==33) document.elenco.src="graphics/elenconews_a.jpg"
	if (x==34) document.elenco.src="graphics/elenconews_b.jpg"
	
	if (x==35) document.scheda.src="graphics/soci/scheda_a.jpg"
	if (x==36) document.scheda.src="graphics/soci/scheda_b.jpg"
	if (x==37) document.email.src="graphics/soci/email_a.jpg"
	if (x==38) document.email.src="graphics/soci/email_b.jpg"	
	
	if (x==39) document.legenda.src="graphics/legenda_a.jpg"
	if (x==40) document.legenda.src="graphics/legenda_b.jpg"
	
	if (x==41) document.elenco.src="graphics/soci/elenco_a.jpg"
	if (x==42) document.elenco.src="graphics/soci/elenco_b.jpg"

	if (x==43) document.hom.src="graphics/menu/home_a.jpg"
	if (x==44) document.hom.src="graphics/menu/home_b.jpg"
	
	if (x==45) document.zoomsx.src="graphics/zoomsx_a.jpg"
	if (x==46) document.zoomsx.src="graphics/zoomsx_b.jpg"
	if (x==47) document.zoomdx.src="graphics/zoomdx_a.jpg"
	if (x==48) document.zoomdx.src="graphics/zoomdx_b.jpg"
	
	if (x==49) document.home.src="graphics/home_a.jpg"
	if (x==50) document.home.src="graphics/home_b.jpg"	
	
	if (x==51) document.gal.src="graphics/menu/gal1_a.jpg"
	if (x==52) document.gal.src="graphics/menu/gal1_b.jpg"
	
	if (x==53) document.lad.src="graphics/menu/lad_a.jpg"
	if (x==54) document.lad.src="graphics/menu/lad_b.jpg"
	if (x==55) document.gad.src="graphics/menu/gad_a.jpg"
	if (x==56) document.gad.src="graphics/menu/gad_b.jpg"
	if (x==57) document.con.src="graphics/menu/con_a.jpg"
	if (x==58) document.con.src="graphics/menu/con_b.jpg"
}

	function up(){
		siz = document.getElementById("contentDescrizione").style.fontSize;
		siz = siz.replace("px","");
		siz = Math.floor(eval(siz)+1);
		document.getElementById("contentDescrizione").style.fontSize=siz+"px";
	}
	function down(){
		siz = document.getElementById("contentDescrizione").style.fontSize;
		siz = siz.replace("px","");
		siz = Math.floor(eval(siz)-1);
		document.getElementById("contentDescrizione").style.fontSize=siz+"px";
	}	
	function stelline(v){
		starClick = 0;
		for(k=1;k<=v;k++){
			document.getElementById("star"+k).src='images/icn_star_full_11x11.gif';
		}
	}
	
	function stellineOut(){
		if(starClick == 0){
			for(k=1;k<=5;k++){
				document.getElementById("star"+k).src='images/icn_star_empty_11x11.gif';
			}	
		}
	}
	starClick = 0;
	function salvaVoto(contenutoid,valore){
		caricaTesto('voto','salvaVoto.php?id='+contenutoid+'&voto='+valore);
		starClick = 1;
			//for(k=1;k<=valore;k++){
			//	document.getElementById("star"+k).src='images/icn_star_full_11x11.gif';
			//}		
	}
	
	function validaCommento(){
			
		//voto = '';
		if(document.frmA.validazione.value!=document.frmA.chkvalidazione.value){
			alert('Numero immesso non valido!');
			return;
		}
		contenutoid = document.frmA.contenutoID.value;
		valore = document.frmA.commentoTesto.value;
		nome = document.frmA.nome.value;
		if(nome.length<3){alert('Specificare un nome valido');return;}
		document.frmA.commentoTesto.enabled=false;
		caricaTesto('LastComment','salvaCommento.php?id='+contenutoid+'&testo='+valore+'&nome='+nome);
		document.frmA.commentoTesto.value='';
		document.frmA.nome.value='';		
		document.frmA.validazione.value = '';
	}