 function popnews(ord, idnews) {

 	url ="notizia.popup.php?idnews="+idnews+"&ord="+ord ;
	
	w0 =  400 ;
	h0 = 400 ;
	sbar = 0 ;
	
	topleft = pos_indw (w0,h0) ;	
	wim = window.open (url, "anteprima", "top="+topleft[1]+",left="+topleft[0]+",width="+w0+",height="+h0+",scrollbars="+sbar+",resizable=0") ;
	wim.focus() ;
	
 }
 
 function pos_indw (w,h) {

	postura = new Array() ;
	postura[0] = Math.round((screen.width - w)/2)	;
	postura[1] = Math.round((screen.height - h)/2) ;
	
	return postura ;

}

function nospam (user,domain) {

	location.href="mailto:"+user+"@"+domain ;

}


function voter() {

	if (navigator.cookieEnabled) {

		idsond = document.forms["sondaggio"].elements["idsond"].value ;
		validvoter = true ;
		Cookie_array = document.cookie.split("; ");
		for ( i=0; i < Cookie_array.length; i++) {
			Cookie_crumb = Cookie_array[i].split("=");
			if (Cookie_crumb[0] == "VS"+idsond && unescape(Cookie_crumb[1])==1) { 
			
				validvoter = false ;
				break ;
				
			}			
		}
		
		if (validvoter) {
		
			chkvote = false ;
			for (i=0 ; i< document.forms["sondaggio"].elements["voto"].length ; i++) {
				
				if (document.forms["sondaggio"].elements["voto"][i].checked == true ) {
					chkvote = true;
					break ;
				
				}
			
			}
			if (chkvote) {
				document.forms["sondaggio"].action = 'votasondaggio.php' ;
				document.forms["sondaggio"].method = 'post' ;
				document.forms["sondaggio"].submit() ;
			} else alert ("SELEZIONARE UNA OPZIONE !!");
		} else alert ("QUESTO COMPUTER HA GIA' VOTATO !!");
		
	} else alert ("PER POTER VOTARE IL BROWSER DELL'UTENTE DEVE ACCETTARE I COOKIE !") ;
 
}

function selopt(NR) {

	if (navigator.cookieEnabled) {

		document.forms["sondaggio"].elements["voto"][NR].checked = true ;

		} else alert ("PER POTER VOTARE IL BROWSER DELL'UTENTE DEVE ACCETTARE I COOKIE !") ;
 
}


function newplayer(url) {

	topleft = pos_indw (640,489) ;
	mplayer = window.open (url, "anteprima", "top="+topleft[1]+",left="+topleft[0]+",width=640,height=489,scrollbars=0,resizable=1") ;
	mplayer.focus() ;

}
