/*MENU TOP .COM*/
function menuTopCom (divAction, classAction, link)
{
    document.getElementById('menu01').className='menuTop';
    document.getElementById('menu02').className='menuTop';
    document.getElementById('menu03').className='menuTop';
    document.getElementById('menu04').className='menuTop';
    document.getElementById('menu05').className='menuTop';
    document.getElementById('menu06').className='menuTop';
    document.getElementById('menu07').className='menuTop';
    document.getElementById('menu08').className='menuTop';
    document.getElementById('menu09').className='menuTop';
    document.getElementById('menu10').className='menuTop';
    document.getElementById('menu11').className='menuTop';
    document.getElementById('menuBasket').style.display='none';
    document.getElementById('menuRosetano').style.display='none';
    document.getElementById('menuLinks').style.display='none';

    if (divAction != "")
        document.getElementById(divAction).style.display='block';

    if (classAction != "")
        document.getElementById(classAction).className='menuTop_roll';

    if (link == "./forum2/")
    {
        var newWindow = window.open(link, '_blank');
        newWindow.focus();
    }
    else if (link != "")
        document.location.href=link;
}
/*FINE MENU TOP .COM*/


//DISABILITA LA DATA SU CERCA AVANZATA
function disableDataCerca ()
{
	document.formCercaAva.giornodalAva.disabled=true;
	document.formCercaAva.mesedalAva.disabled=true;
	document.formCercaAva.annodalAva.disabled=true;

	document.formCercaAva.giornoalAva.disabled=true;
	document.formCercaAva.mesealAva.disabled=true;
	document.formCercaAva.annoalAva.disabled=true;
}

//ABILITA LA DATA SU CERCA AVANZATA
function ableDataCerca ()
{
	document.formCercaAva.giornodalAva.disabled=false;
	document.formCercaAva.mesedalAva.disabled=false;
	document.formCercaAva.annodalAva.disabled=false;

	document.formCercaAva.giornoalAva.disabled=false;
	document.formCercaAva.mesealAva.disabled=false;
	document.formCercaAva.annoalAva.disabled=false;
}

//BOX NEWS + VISTE
function boxNewsVisite ()
{
	if (document.getElementById('contenitore').style.overflow=="hidden")
	{
	document.getElementById('contenitore').style.overflow="";
	document.getElementById('contenitore').style.height="";
	document.getElementById('imageDIV').src="img/openDIV.gif";
	}
	else
	{
	document.getElementById('contenitore').style.overflow="hidden";
	document.getElementById('contenitore').style.height="190px";
	document.getElementById('imageDIV').src="img/closeDIV.gif";
	}
}

//AJAX PER NOTIZIE + VISTE
function CaricaVideoSettimana()
{
     RefreshFinestra('contenitore', 'sceltaFunzioni.php?action=Videosettimana');
}

function CaricaVideoMese()
{
     RefreshFinestra('contenitore', 'sceltaFunzioni.php?action=Videomese');
}

function CaricaVideoSempre()
{
     RefreshFinestra('contenitore', 'sceltaFunzioni.php?action=Videosempre');
}

function CaricaSettimana()
{
     RefreshFinestra('contenitore', 'sceltaFunzioni.php?action=settimana');
}

function CaricaMese()
{
     RefreshFinestra('contenitore', 'sceltaFunzioni.php?action=mese');
}

function CaricaSempre()
{
     RefreshFinestra('contenitore', 'sceltaFunzioni.php?action=sempre');
}

function RefreshFinestra(finestra, url)
{
    var f=document.getElementById(finestra);
    //f.innerHTML='Sei ancora in attesa?';
    var oXmlHttp = zXmlHttp.createRequest();
    oXmlHttp.open('get', url, true);
    oXmlHttp.onreadystatechange = function ()
    {
        if (oXmlHttp.readyState==4)
        {
            if (oXmlHttp.status==200)
            {
                f.innerHTML=oXmlHttp.responseText;
                return;
            }
            if (oXmlHttp.status==404)
            {
                alert('La pagina '+ url + ' non esiste!');
            }
            else alert('Errore, status: '+oXmlHttp.status);
        }
    }
    oXmlHttp.send(null);
}



//POPUP
function new_window_gen(url)
{
link = window.open(url,"Chat","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=700,height=600,left=0,top=0");
}

function new_window_webcam(url)
{
link = window.open(url,"Chat","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=630,height=450,left=0,top=0");
}

function new_window1(url)
{
link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=340,height=260,left=0,top=0");
}

function new_window01(url)
{
link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=650,height=290,left=0,top=0");
}

function new_window2(url)
{
link = window.open(url,"Wap","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=430,height=425,left=0,top=0");
}

function new_window4(URL)
{
link = window.open(url,"offerta","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=567,height=500,left=0,top=0");
}

//POPUP X RIDIMENSIONAMENTO
function openWin(content,w,h,isscroll,isresize)
{
   finestra=window.open(content,'zoom','scrollbars=' + isscroll + ',resizable=' + isresize + ',width=' + w + ',height=' + h + ',status=no,location=no,toolbar=no');
   finestra.focus();
}

