//inizio funzione per l'apertura dei link del menù
function open_link(LINK){
	if(LINK == "FORUM") {
	window.open("phpBB2/index.php","_blank","width=700,height=500,top=50,left=150,resizable=yes,status=no,scrollbars=yes,location=no,toolbar=yes");
	}
	else
	if(LINK != "FORUM") {
	window.location=LINK;
	}
}
//fine funzione per l'apertura dei link del menù

//inizio funzioni per la gestione del menù secondario
function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("cont").getElementsByTagName("DIV");
		if(el.style.display == "none"){
			for (var i=0; i<ar.length; i++){
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}
function ChangeClass(menu, newClass) {
	if (document.getElementById) {
		document.getElementById(menu).className = newClass;
	}
}
//fine funzioni per la gestione del menù secondario

//inizio della funzione per la visualizzazione dei banner
var slideShowSpeed = 5000;
var crossFadeDuration = 10;

var t
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++){
   preLoad[i] = new Image();
   preLoad[i].src = Pic[i];
}
function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)";
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
      document.images.SlideShow.filters.blendTrans.Apply();
   }
   document.images.SlideShow.src = preLoad[j].src;
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play();
   }
   j = j + 1;
   if (j > (p-1)) j=0;
   t = setTimeout('runSlideShow()', slideShowSpeed);
}
//fine della funzione per la visualizzazione dei banner

//inizio delle funzioni per la visualizzazione degli ultimi topic inseriti nel forum
function lastForum(TOPIC){
if(TOPIC > LimitTopic) {TOPIC = "0";}
	var nT = '<strong><img src=\"pics/forumisti.gif\" width=\"18\" height=\"16\" border=\"0\" alt=\"\" align=\"left\">&nbsp;Ultime dal forum:</strong> <a href="'+linka[TOPIC]+'" onFocus="this.blur();">'+text[TOPIC]+'</a>';
	document.getElementById('divTopic').innerHTML = nT;
	nextindex = (parseFloat(TOPIC) + 1);
	setTimeout("lastForum(nextindex)",(SecondsDisplayTopic * 1000))
}

function open_thread_forum(link) {
   page_forum = window.open(link,"_blank",'width=700,height=500,top=50,left=150,resizable=yes,status=no,scrollbars=yes,location=no,toolbar=yes');
}
//fine delle funzioni per la visualizzazione degli ultimi topic inseriti nel forum

//inizio delle funzioni per la visualizzazione delle ultime news inserite
function lastNews(NEWSLAST){
if(NEWSLAST > LimitLastNews) {NEWSLAST = "0";}
	var nLN = '<table border="0" width="144" cellSpacing="0" cellPadding="0" summary=""><tbody><tr><td height=\"140\" class=\"divTop divLeft\"><div class=\"divCenter\"><span class="testo1"><strong>'+data_notizie[NEWSLAST]+'</strong></span></div><span class="testo1">'+titoli_notizie[NEWSLAST]+'</span><br><a href="'+link_notizie[NEWSLAST]+'" target="'+target_notizie[NEWSLAST]+'" onFocus="this.blur();" class="link4 cur" title="Clicca per leggere la notizia...">'+testo_breve_notizie[NEWSLAST]+' ...</a></td></tr></tbody></table>';
	document.getElementById('divBoxNews').innerHTML = nLN;
	nextindexNewsLast = (parseFloat(NEWSLAST) + 1);
	setTimeout("lastNews(nextindexNewsLast)",(SecondsDisplayLastNews * 1000))
}


document.onselectstart = new Function("return false");
