	
	// POPUP
    function popup(URL,NOME,WIDTH,HEIGHT,PROPRIETA) 
    {
    	
    	//alert(PROPRIETA);
    	if(PROPRIETA == ''){
    		PROPRIETA = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0';
    	}
    	win = window.open(URL,NOME,PROPRIETA + ',width=' + WIDTH + ',height=' + HEIGHT + '');
    	
    	//qui ridimensiono il popup...così se lo stesso popup è già aperto gli cambio le dimensioni...
    	
    	// correggo l'altezza del popup in IE7
    	if (navigator.appVersion.indexOf('MSIE 7') != -1) {
    		H = parseInt(HEIGHT) + 81;
    	} else {
    		H = parseInt(HEIGHT) + 59;
    	}
    				 
    	W = parseInt(WIDTH) + 10;
    	win.resizeTo(W,H);
    	win.focus();
    }
	
	
	// mostra tutti i commenti sulla notizia
	function showHideCommenti() {
	
		var altriCommenti = document.getElementById('altriCommenti');
		
		if (altriCommenti.style.display == 'none') {
			
			altriCommenti.style.display = 'block';
			
		} else if (altriCommenti.style.display == 'block') {
		
			altriCommenti.style.display = 'none';
		
		}
	
	}
	
   
	
	// controlla i campi della form per commentare una notizia
	function checkCommento() {			
	
		var formCommento = document.formCommento;
		var  error = 0;
		
		var labelNome = document.getElementById('labelNome');
		var labelCitta = document.getElementById('labelCitta');
		var labelEmail = document.getElementById('labelEmail');
		var invalidFormat = document.getElementById('invalidFormat');
		var labelCommento = document.getElementById('labelCommento');
		var labelPrivacy = document.getElementById('labelPrivacy');
		var labelSecurityCode = document.getElementById('labelSecurityCode');
		
		labelNome.style.color = '#666666';
		labelCitta.style.color = '#666666';
		labelEmail.style.color = '#666666';
		invalidFormat.innerHTML = '&nbsp;';
		labelCommento.style.color = '#666666';
		labelPrivacy.style.color = '#666666';
		labelSecurityCode.style.color = '#666666';
		
		var RegExp  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
				
		if (formCommento.nome.value == '') {
			error = 1;
			labelNome.style.color = '#E60000';
		}
		
		if (formCommento.citta.value == '') {
			error = 1;
			labelCitta.style.color = '#E60000';
		}
		
		if (formCommento.email.value == '') {
			error = 1;
			labelEmail.style.color = '#E60000';			
		} else {						
			if (RegExp.test(formCommento.email.value) == false) {
    			error = 1;
    			labelEmail.style.color = '#E60000';
				invalidFormat.innerHTML = 'formato E-Mail non valido';			
			}					
		}		
		
		if (formCommento.commento.value == '') {
			error = 1;
			labelCommento.style.color = '#E60000';
		}	
		
		if (formCommento.privacy.checked == false) {
			error = 1;
			labelPrivacy.style.color = '#E60000';
		}
		
		if (formCommento.securityCode.value.length < 5) {
			error = 1;
			labelSecurityCode.style.color = '#E60000';
		}
		
		if (error == 0) {
			formCommento.submit();
		}		
				
			
	}
	
	// show
	function show(obj) {
	
		obj = document.getElementById(obj);
		obj.style.display = 'block';
	
	}
	
	
	// hide
	function hide(obj) {
	
		obj = document.getElementById(obj);
		obj.style.display = 'none';
	
	}