// Data su top
function giornodata()
{
	var time = new Date();
	
	var giorno = time.getDate();
	var mese = time.getMonth()+1;
	var anno = time.getYear();
	
	var giorni = new Array('Domenica','Luned&igrave;','Marted&igrave;','Mercoled&igrave;','Gioved&igrave;','Venerd&igrave;','Sabato');
	//var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
	var nome_giorno = giorni[time.getDay()];
	//var days_name = days[time.getDay()];
	
	var mesi = new Array('Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno','Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre');
	//var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
	var nome_mese = mesi[time.getMonth()];
	//var month_name = months[time.getMonth()];
	
	if (navigator.appName == "Netscape")
		anno = 1900 + anno;
	
	document.write(nome_giorno + " " + giorno + " " + nome_mese + " " + anno);		   
}

// Nome scritto nel basso di explorer
function MsgStatus(msgStr)
{
  status=msgStr;
  document.MM_returnValue = true;
}


// Aggiungi ai preferiti
function preferiti(url, title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
    window.external.AddFavorite(url,title);
  }
}


// Apre il sito in un'altra finestra
function showSite (siteURL){
	recordURL = escape (siteURL);
	siteURL = window.open(siteURL,'win' + Math.floor(1000*Math.random()),'menubar,toolbar,location,status,scrollbars,resizable');
}


// Apri finestra popup (MsSite)
var hWnd 
function popup(url,windowname,sizex, sizey, left,top) 
{
	popupE(url,windowname,sizex, sizey, left,top, "yes") 
}
function popupE(url,windowname,sizex, sizey, left,top, scrollbars) 
{
	url=url+"&sysRpqz="+Math.random();
	hWnd = window.open(	url,
						windowname,
						"toolbar=no,width=" + sizex+ ",left=" + left + ",top=" + top + ",height=" + sizey + ",directories=no,status=no,statusbar=no,resizable=no,menubar=no,scrollbars=" + scrollbars);

	hWnd.focus();
	hWnd.opener = self;
}


// Apri finestra popup
var win = null;
function NewWindow(mypage,myname,w,h,scroll)
{
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(mypage,myname,settings)
	if(win.window.focus){win.window.focus();}
}


// Function to handle dynamically altering the contents of the selectFiglio List box
function handleChange(indiceArrayPadre,arrayPadre,selectFiglio,voceSelectedValue)
{   
	var NumEntries, i, y;

	// Delete all entries in the selectFiglio list box
	for (i = selectFiglio.length; i > 0; i--)
	{
		selectFiglio.options[i-1] = null;
	}
	
	if (indiceArrayPadre >= 0)
	{
		NumEntries = arrayPadre[indiceArrayPadre].length / 2;
		y = 0;
		for (i = 0; i < NumEntries; i++)
		{
			selectFiglio.options[i] = new Option((arrayPadre[indiceArrayPadre])[y],(arrayPadre[indiceArrayPadre])[y+1]);
			y = y + 2;
			if (selectFiglio.options[i].value==voceSelectedValue){
				selectFiglio.selectedIndex = i;
			}
		}
	}
	else
	{
		selectFiglio.options[0] = new Option(" ",0)
	}
}


// Cambia target iframe
function changeObject(that,myurl){	
	var iframeobj=document.getElementById(that)
	iframeobj.src= myurl
}

var old = null;
// Cambia la classe di un oggetto
function changeClass(that,newclass){	
	that.className = newclass;
	if (old != null)
		old.className = 'ttteeemmmppp';
	old = that;
}

function oscuraDiv(div){	
	obj=document.getElementById(div);
	if (obj != null)
		obj.style.display = 'none';
}


function visualizzaDiv(div){
	obj=document.getElementById(div);
	if (obj != null)
		obj.style.display = 'block';
}