function MainMenuMouseOver(t){
	t.style.background='#faafaf';
	t.style.border= '1px solid #ff0000';
}

function MainMenuMouseOut(t){
	t.style.background='transparent';
	t.style.border= '1px solid transparent';
}

function RAMenuMouseOver(t){
	t.style.background='#33CCFF';
}

function RAMenuMouseOut(t){
	t.style.background='#dddddd';
}

function MostraOggetto(IDOggetto) {
//rende visibile un oggetto
	document.getElementById(IDOggetto).style.display="inline";
}

function NascondiOggetto(IDOggetto) {
//rende invisibile un oggetto
	document.getElementById(IDOggetto).style.display="none";
}

function ApriFinestra(url, name, w, h) {
//apre una finestra pop-up con i parametri: pagina da aprire, nome della pagina, larghezza, altezza
  l = (screen.availWidth-10 - w) / 2;
  t = (screen.availHeight-20 - h) / 2;

  features = "width="+w+",height="+h+",left="+l+",top="+t;
  features += ",screenX="+l+",screenY="+t;
  features += ",scrollbars=0,resizable=0,location=0";
  features += ",menubar=0,toolbar=0,status=0";

  window.open(url, name, features);
}
function MostraTabellaNascosta(TableID,PosizioneY,PosizioneX,e) {
//rende visibile una tabella nascosta alla posizione del mouse

	var mousex;
	var mousey;
	var left;
	var top;
	var PageWidth;
	var PageHeight;

	if (document.all) {  
		//internet explorer
		//posizione del mouse rispetto alla pagina, compensando lo scrolling
		mousex=(document.body.scrollLeft?document.body.scrollLeft:document.body.offsetLeft)+window.event.clientX;
		mousey=(document.body.scrollTop?document.body.scrollTop:document.body.offsetTop)+window.event.clientY;
	}else{
		//netscape
		//posizione del mouse rispetto alla pagina
		mousex=e.pageX;
		mousey=e.pageY;
	}
	//centra la tabella in base a posizione del mouse
	left = (mousex+PosizioneX);
	//top = (mousey-PosizioneY+10);
	top = (mousey+PosizioneY);
	
	if(left<0){ left=0; }
	if(top<0){ top=0; }
	//rende visibile la finestra interessata
	document.getElementById(TableID).style.position="absolute";
	document.getElementById(TableID).style.top=top+"px";
	document.getElementById(TableID).style.left=left+"px"; 
	document.getElementById(TableID).style.visibility="Visible";
	document.getElementById(TableID).style.zindex=99;
}

function NascondiTabellaNascosta(TableID) {
//rende invisibile una finestra
	document.getElementById(TableID).style.position="absolute";
	document.getElementById(TableID).style.top="-800px";
	document.getElementById(TableID).style.left="-800px";
	document.getElementById(TableID).style.visibility="Hidden";
}

function MostraTabellaNascostaCentro(TableID,TableWidth,TableHeight) {
//rende visibile una tabella nascosta a centro schermo

	var left;
	var top;
	var PageWidth;
	var PageHeight;
	
	PageWidth=document.body.offsetWidth;
	PageHeight=document.body.offsetHeight;
	
	if (document.all) {  
		//internet explorer
	}else{
		//netscape
		PageHeight=PageHeight/2;
	}
	
	top=(PageHeight-TableHeight)/2;
	left=(PageWidth-TableWidth)/2;
	//rende visibile la finestra interessata
	document.getElementById(TableID).style.position="absolute";
	document.getElementById(TableID).style.top=top+"px";
	document.getElementById(TableID).style.left=left+"px"; 
	document.getElementById(TableID).style.visibility="Visible";
}

//costruisce e mostra indirizzo email antispam
function mail_no_spam(user,domain,ext,text){
	var destinatario;
	if(text!=""){
		destinatario=text;
	}else{
		destinatario = user + "@" + domain + "." + ext;
	}
	var indirizzo = "mailto:" + user + "@" + domain + "." + ext
	document.write(destinatario.link(indirizzo));
}