/* codice relativo alla gestione degli errori*/
// Eliminare il commento alla riga successiva per attivare il tracciamento degli errori js 
//window.onerror = storeOnError 
msgArray = new Array();
urlArray = new Array();
lnoArray = new Array();
var er_agent = navigator.userAgent;
var host = window.location.host;
var xurl='';
function storeOnError(msg, url, lno) 
{ 
	msgArray[msgArray.length] = msg ; // Memorizza errore,url e numero di riga negli array
  msg = msg.replace(new RegExp(/[\;|\:|\"|\/|\s|\)|\(|\-|\$|\+]/g),'');
  urlArray[urlArray.length] = url ;
  lnoArray[lnoArray.length] = lno ;
 
  er_agent = er_agent.replace(new RegExp(/[\;|\:|\"|\/|\s|\)|\(|\-]/g),'_');
  host = host.replace(new RegExp(/[\;|\:|\"|\/|\s|\)|\(|\-]/g),'_');

  var ris = window.screen.width+'x'+window.screen.height;
  
	dt=new Date();


	xurl="http://clickserver.libero.it/ck/"+dt.getTime()+"/"+escape('zeSTG')+"/"+escape('stg_internet_'+lno)+"/"+escape(msg)+"/_f_/"+escape(location.host+location.pathname)+"/_t_/"+escape(location.host)+"/"+er_agent+"_"+ris;
	x=new Image();
 	x.src=xurl;
 
  return true ;
}

// Popup video verso Libero Video
function videoPopup(theID) {
	vPopup = window.open("about:Blank","videopopupid","width=420,height=353,status=no,menubar=no,resizable=no,scrollbars=no,toolb	ar=no,location=no,directories=no");
	vPopup.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
	vPopup.document.write('<html xmlns="http://www.w3.org/1999/xhtml">');
	vPopup.document.write('<head>');
	vPopup.document.write('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');
	vPopup.document.write('<title>infostrada.it</title>');
	vPopup.document.write('</head>');
	vPopup.document.write('<body>');
	vPopup.document.write('<object width="400" height="333"><param name="movie" value="http://video.libero.it/static/swf/eltvplayer.swf?id='+ theID +'&ap=1" /><embed src="http://video.libero.it/static/swf/eltvplayer.swf?id='+ theID +'&ap=1" width="400" height="333" type="application/x-shockwave-flash"></embed></object>');
	vPopup.document.write('</body>');
	vPopup.document.write('</html>');
}

/****************************************************/
/*Funzione duplicata... da unificare*/
function toggle_visibility (obj_state,obj_toggle) {
	
	if(obj_toggle.style.display=='block') 
		obj_toggle.style.display='none'; 
	else 
		obj_toggle.style.display='block';
		
}

function toggle(element) {
document.getElementById(element).style.display = (document.getElementById(element).style.display == "none") ? "block" : "none";
}
/****************************************************/

function optionToggle(element,imgId) {
	document.getElementById(element).style.display = (document.getElementById(element).style.display == "none") ? "block" : "none";
	
	if(document.getElementById(imgId).src.indexOf('/img43/static/img1024/arrow-down.gif')>-1) 
		 document.getElementById(imgId).src = '/img43/static/img1024/arrow-up.gif';
	else 
	 	 document.getElementById(imgId).src = '/img43/static/img1024/arrow-down.gif';
}
	


