function linguettaRollOn(nl)
{
	prendiElementoDaId("ling_"+nl+"_1").src='/graphics/linguetta_rollon_left.png';
	prendiElementoDaId("ling_"+nl+"_2").className = 'linguettarollon left';
	prendiElementoDaId("link_"+nl+"_2").className = 'txtlinguettarollon';
	prendiElementoDaId("ling_"+nl+"_3").src='/graphics/linguetta_rollon_right.png';
}

function linguettaRollOff(nl)
{
	prendiElementoDaId("ling_"+nl+"_1").src='/graphics/linguetta_off_left.png';
	prendiElementoDaId("ling_"+nl+"_2").className = 'linguettaoff left';
	prendiElementoDaId("link_"+nl+"_2").className = 'txtlinguettaoff';
	prendiElementoDaId("ling_"+nl+"_3").src='/graphics/linguetta_off_right.png';
}

function apriTendina(t)
{

	prendiElementoDaId("tendina"+t).className = 'assoluto visibile'
}

function chiudiTendina(t)
{
	prendiElementoDaId('tendina'+t).className = 'assoluto nascosto'
}

function votaStelle(v,filmid)
{
	for(k=1;k<=v;k++)
	{
		prendiElementoDaId("star"+k).src = '/graphics/stellina.on.png';
	}
	 c = eseguiInRemoto('/votaACT.php?m='+filmid+'&v='+v+'&nocache='+new Date().getTime());
	 if(c=='0')
	 {
	 	alert('Problemi durante il salvataggio del voto; riprovare pił tardi');
	 }
	 if(c=='-1')
	 {
	 	alert('Servizio dedicato agli utenti registrati');
	 }	 
}

function votaInteressi(v,filmid)
{
	 c = eseguiInRemoto('/votaINTERESSIACT.php?m='+filmid+'&v='+v+'&nocache='+new Date().getTime());
	 if(c=='0')
	 {
	 	alert('Problemi durante il salvataggio del voto; riprovare pił tardi');
	 }
	 if(c=='-1')
	 {
	 	alert('Servizio dedicato agli utenti registrati');
	 }	 
}

function offStelle()
{
	for(k=1;k<=5;k++)
	{
		var f = prendiElementoDaId("star"+k).src;
		if(f.indexOf('/graphics/stellina.on.png') == -1)
		{
			prendiElementoDaId("star"+k).src = '/graphics/stellina.off.png';
		}
	}
}
function onStelle(v)
{
	for(k=1;k<=v;k++)
	{
		var f = prendiElementoDaId("star"+k).src;
		if(f.indexOf('/graphics/stellina.on.png') == -1)
		{	
			prendiElementoDaId("star"+k).src = '/graphics/stellina.rollon.png';
		}
	}
}

function salvaCommentoScheda(cid,editval)
{
    el = document.frmCommento;
    valoreCommento = el.commentotxt.value;
    stringPar = "cmTXT="+valoreCommento+"&cid="+cid+"&editval="+editval;
    el.commentotxt.disabled=true;
    fmk$PostCall("/commentiACT.php",stringPar,true,"responsoCommento");
    
    setTimeout("fmk$clean('responsoCommento');el.commentotxt.value=''",2000);
    if(editval!=0)
    {
        setTimeout("fmk$nascondi('commento"+editval+"');fmk$clean('commento"+editval+"');",400);
    }
}

function delCommento(cccid)
{
    if(confirm('Sei sicuro di voler eliminare questo commento?'))
    {
        c = eseguiInRemoto('/commentiACT.php?ope=del&cccid='+cccid+'&nocache='+new Date().getTime());
        if(c=="1")
        {
            
            setTimeout("fmk$nascondi('commento"+cccid+"');fmk$clean('commento"+cccid+"');",400);
        }
    }
}

function writeTitolo(t)
{
    document.getElementById("ConsoleDida").innerHTML = t;
}

function MediaZoom(f)
{
    //document.getElementById('imgHL').src='/risorse/ambiente/images/'+f;
    document.getElementById('imgHL').src = f;
}


function findValue(li) {

    if (li == null)
        return alert("No match!");
    if (!!li.extra) {
        var sValue = li.extra[0];
    } else {
        var sValue = li.selectValue;
    }

    alert(sValue);

}

function selectItem(li) {
    findValue(li);
}

function formatItem(row) {
    //return row[0] + " (id: " + row[1] + ")";
    return row[0];

}

function lookupAjax() {
    var oSuggest = $(".filmSRC")[0].autocompleter;

    oSuggest.findValue();

    return false;
}

function lookupLocal() {
    var oSuggest = $(".filmSRC")[0].autocompleter;

    oSuggest.findValue();

    return false;
}

function lookupAjaxC() {
    var oSuggest = $(".filmSRC")[0].autocompleter;

    oSuggest.findValue();

    return false;
}


function bookmarksite(){
    if (document.all)
    window.external.AddFavorite(location.href, document.title);
    else if (window.sidebar)
    window.sidebar.addPanel(document.title, location.href, "")
}

function checkVoto() {

    nRisposte = (document.frmSondaggio.valore.length) - 1;
    for (k = 0; k <= nRisposte; k++) {
        if (document.frmSondaggio.valore[k].checked) {
            var v = document.frmSondaggio.valore[k].value;
            caricaTestoLight('sondaggio_MIDD', '/sondaggioACT.php?ida=' + v);
        }
    }
}