// funzione per l'interazione asincrona (versione semplificata)
// parametri:
// action l'url da richiamare
// id l'id dell'elemento che include il contenuto da aggiornare
// async false per richieste sincrone, altrimenti asincrone
function simpleAjaxCallGet(action, id, async)
{  
    logger.debug("simpleAjaxCall - inizio");
    logger.debug("simpleAjaxCall - action: " + action);
    logger.debug("simpleAjaxCall - id: " + id);
    logger.debug("simpleAjaxCall - async: " + async);
    
    try
    {
        // recupero l'oggetto XMLHttpRequest o equivalente
        var xmlHttp = getXmlHttpObject();
        if (xmlHttp == null)
        {
            return;
        }
        
        // gestisco l'esito della chiamata ajax asincrona
        xmlHttp.onreadystatechange = function()
        {
            if(xmlHttp.readyState == 4)
            {
                if (xmlHttp.status == 200)
                {
                    logger.trace("simpleAjaxCall - responseText: " + xmlHttp.responseText);
                    
                    var ajaxDiv = document.getElementById(id);
                    
                    if (ajaxDiv != null)
                    {
                        logger.trace("simpleAjaxCall - innerHTML: " + ajaxDiv.innerHTML);
                        
                        ajaxDiv.innerHTML = xmlHttp.responseText;
                        
                        onloadCross();
                    }
                }
                else
                {
                    logger.error("simpleAjaxCall - status: " + xmlHttp.status);
                }
            }
        }
        
        // eseguo la chiamata ajax
        xmlHttp.open("GET", action, ((async == false) ? false : true));
        xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        xmlHttp.send('');
        // gestisco l'esito della chiamata ajax sincrona
        if (async == false)
        {
            if(xmlHttp.readyState == 4)
            {
                if (xmlHttp.status == 200)
                {
                    logger.trace("simpleAjaxCall - responseText: " + xmlHttp.responseText);
                    
                    var ajaxDiv = document.getElementById(id);
                    
                    if (ajaxDiv != null)
                    {
                        logger.trace("simpleAjaxCall - innerHTML: " + ajaxDiv.innerHTML);
                        
                        ajaxDiv.innerHTML = xmlHttp.responseText;
                        
                        onloadCross();
                    }
                }
                else
                {
                    logger.error("simpleAjaxCall - status: " + xmlHttp.status);
                }
            }
        }
        delete xmlHttp;
    }
    catch(e)
    {
        logger.error("simpleAjaxCall - " + e, e);
    }
    
    logger.debug("simpleAjaxCall - fine");
}
function simpleAjaxCall(action, id, async)
{  
    logger.debug("simpleAjaxCall - inizio");
    logger.debug("simpleAjaxCall - action: " + action);
    logger.debug("simpleAjaxCall - id: " + id);
    logger.debug("simpleAjaxCall - async: " + async);
    
    try
    {
        // recupero l'oggetto XMLHttpRequest o equivalente
        var xmlHttp = getXmlHttpObject();
        if (xmlHttp == null)
        {
            return;
        }
        
        // gestisco l'esito della chiamata ajax asincrona
        xmlHttp.onreadystatechange = function()
        {
            if(xmlHttp.readyState == 4)
            {
                if (xmlHttp.status == 200)
                {
                    logger.trace("simpleAjaxCall - responseText: " + xmlHttp.responseText);
                    
                    var ajaxDiv = document.getElementById(id);
                    
                    if (ajaxDiv != null)
                    {
                        logger.trace("simpleAjaxCall - innerHTML: " + ajaxDiv.innerHTML);
                        
                        ajaxDiv.innerHTML = xmlHttp.responseText;
                        
                        onloadCross();
                    }
                }
                else
                {
                    logger.error("simpleAjaxCall - status: " + xmlHttp.status);
                }
            }
        }
        
        // eseguo la chiamata ajax
        xmlHttp.open("POST", action, ((async == false) ? false : true));
        xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        xmlHttp.send('');
        // gestisco l'esito della chiamata ajax sincrona
        if (async == false)
        {
            if(xmlHttp.readyState == 4)
            {
                if (xmlHttp.status == 200)
                {
                    logger.trace("simpleAjaxCall - responseText: " + xmlHttp.responseText);
                    
                    var ajaxDiv = document.getElementById(id);
                    
                    if (ajaxDiv != null)
                    {
                        logger.trace("simpleAjaxCall - innerHTML: " + ajaxDiv.innerHTML);
                        
                        ajaxDiv.innerHTML = xmlHttp.responseText;
                        
                        onloadCross();
                    }
                }
                else
                {
                    logger.error("simpleAjaxCall - status: " + xmlHttp.status);
                }
            }
        }
        delete xmlHttp;
    }
    catch(e)
    {
        logger.error("simpleAjaxCall - " + e, e);
    }
    
    logger.debug("simpleAjaxCall - fine");
}

// funzione per la gestione delle nuove "portlet" del palinsesto (implementate come jsp/servlet)
function managePortletLoading()
{
    try
    {
        getLogger(location.pathname, '/Palinsesto/pubblico/servlet/logging');
        
        // gestione portlet in pagina
        var async = false;
        var menuSportIppica = document.getElementById("menuSportIppicaPortal");
        var menuCps = document.getElementById("menuCpsPortal");
        var menuTris = document.getElementById("menuTrisPortal");
        var palinsestoSport = document.getElementById("palinsestoSportPortal");
        var palinsestoIppica = document.getElementById("palinsestoIppicaPortal");
        var liveLastMinuteTopQuote = document.getElementById("liveLastMinuteTopQuotePortal");
        var topQuoteHome = document.getElementById("topQuoteHomePortal");
        var ippicaProssimeCorse = document.getElementById("ippicaProssimeCorsePortal");
        var cps = document.getElementById("cpsPortal");
        var tris = document.getElementById("trisPortal");
        var quoteTris = document.getElementById("quoteTrisPortal");
        var ultimoConcorsoTotocalcio = document.getElementById("ultimoConcorsoTotocalcioPortal");
        var ultimoConcorsoTotogol = document.getElementById("ultimoConcorsoTotogolPortal");
        var jackpot = document.getElementById("jackpotPortal");
        var ippicaProssimeCorseMini = document.getElementById("ippicaProssimeCorseMiniPortal");
        var jackpotSE = document.getElementById("jackpotSEPortal");
        var jackpotSEFlash = document.getElementById("jackpotSEFlashPortal");
        var jackpotSEFlashSmall = document.getElementById("jackpotSEFlashSmallPortal");
        var combinazioneSE = document.getElementById("combinazioneSEPortal");
        var topQuoteSmall = document.getElementById("topQuoteSmallPortal");
        var lastMinuteSmall = document.getElementById("lastMinuteSmallPortal");
        var ippicaProssimeCorseSmall = document.getElementById("ippicaProssimeCorseSmallPortal");
        var liveSmall = document.getElementById("liveSmallPortal");
        
        logger.debug("managePortletLoading - menuSportIppicaPortal: " + menuSportIppica);
        logger.debug("managePortletLoading - menuCpsPortal: " + menuCps);
        logger.debug("managePortletLoading - menuTrisPortal: " + menuTris);
        logger.debug("managePortletLoading - palinsestoSportPortal: " + palinsestoSport);
        logger.debug("managePortletLoading - palinsestoIppicaPortal: " + palinsestoIppica);
        logger.debug("managePortletLoading - liveLastMinuteTopQuotePortal: " + liveLastMinuteTopQuote);
        logger.debug("managePortletLoading - topQuoteHomePortal: " + topQuoteHome);
        logger.debug("managePortletLoading - ippicaProssimeCorsePortal: " + ippicaProssimeCorse);
        logger.debug("managePortletLoading - cpsPortal: " + cps);
        logger.debug("managePortletLoading - trisPortal: " + tris);
        logger.debug("managePortletLoading - quoteTrisPortal: " + quoteTris);
        logger.debug("managePortletLoading - ultimoConcorsoTotocalcioPortal: " + ultimoConcorsoTotocalcio);
        logger.debug("managePortletLoading - ultimoConcorsoTotogolPortal: " + ultimoConcorsoTotogol);
        logger.debug("managePortletLoading - jackpotPortal: " + jackpot);
        logger.debug("managePortletLoading - ippicaProssimeCorseMiniPortal: " + ippicaProssimeCorseMini);
        logger.debug("managePortletLoading - jackpotSEPortal: " + jackpotSE);
        logger.debug("managePortletLoading - jackpotSEFlashPortal: " + jackpotSEFlash);
        logger.debug("managePortletLoading - jackpotSEFlashSmallPortal: " + jackpotSEFlashSmall);
        logger.debug("managePortletLoading - combinazioneSEPortal: " + combinazioneSE);
        logger.debug("managePortletLoading - topQuoteSmallPortal: " + topQuoteSmall);
        logger.debug("managePortletLoading - lastMinuteSmallPortal: " + lastMinuteSmall);
        logger.debug("managePortletLoading - ippicaProssimeCorseSmallPortal: " + ippicaProssimeCorseSmall);
        logger.debug("managePortletLoading - liveSmallPortal: " + liveSmall);
        
        if (menuSportIppica != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/menuDirettaView.jsp" + location.search, "menuSportIppicaPortal", async);
            async = true;
            if (palinsestoSport == null && palinsestoIppica == null)
            {
                resetEvidenceMenuSportIppica("sportdioggi2_");
                resetEvidenceMenuSportIppica("sport2_");
                resetEvidenceMenuSportIppica("ippica2_");
            }
        }
        if (menuCps != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/menuCpsDirettaView.jsp", "menuCpsPortal", async);
            async = true;
        }
        if (menuTris != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/menuTrisDirettaView.jsp", "menuTrisPortal", async);
            async = true;
        }
        if (palinsestoSport != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/sportDirettaView.jsp" + location.search, "palinsestoSportPortal", async);
            async = true;
        }
        if (palinsestoIppica != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/ippicaDirettaView.jsp" + location.search, "palinsestoIppicaPortal", async);
            async = true;
        }
        if (liveLastMinuteTopQuote != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/liveLastMinuteTopQuoteDirettaView.jsp", "liveLastMinuteTopQuotePortal", async);
            async = true;
        }
        if (topQuoteHome != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/topQuoteHomeDirettaView.jsp", "topQuoteHomePortal", async);
            async = true;
        }
        if (ippicaProssimeCorse != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/ippicaProssimeCorseDirettaView.jsp", "ippicaProssimeCorsePortal", async);
            async = true;
        }
        if (cps != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/schedinaDirettaView.jsp", "cpsPortal", async);
            async = true;
        }
        if (tris != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/trisDirettaView.jsp", "trisPortal", async);
            async = true;
        }
        if (quoteTris != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/quoteTrisDirettaView.jsp", "quoteTrisPortal", async);
            async = true;
        }
        if (ultimoConcorsoTotocalcio != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/ultimoConcorsoTotocalcioDirettaView.jsp", "ultimoConcorsoTotocalcioPortal", async);
            async = true;
        }
        if (ultimoConcorsoTotogol != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/ultimoConcorsoTotogolDirettaView.jsp", "ultimoConcorsoTotogolPortal", async);
            async = true;
        }
        if (jackpot != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/jackpotDirettaView.jsp", "jackpotPortal", async);
            async = true;
        }
        if (ippicaProssimeCorseMini != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/ippicaProssimeCorseMiniDirettaView.jsp", "ippicaProssimeCorseMiniPortal", async);
            async = true;
        }
        if (jackpotSE != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/jackpotSEDirettaView.jsp", "jackpotSEPortal", async);
            async = true;
        }
        if (jackpotSEFlash != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/jackpotSEFlash.jsp", "jackpotSEFlashPortal", async);
            async = true;
        }
        if (jackpotSEFlashSmall != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/jackpotSEFlashSmall.jsp", "jackpotSEFlashSmallPortal", async);
            async = true;
        }
        if (combinazioneSE != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/combinazioneSEDirettaView.jsp", "combinazioneSEPortal", async);
            async = true;
        }
        if (topQuoteSmall != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/topQuoteSmallDirettaView.jsp", "topQuoteSmallPortal", async);
            async = true;
        }
        if (lastMinuteSmall != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/lastMinuteSmallDirettaView.jsp", "lastMinuteSmallPortal", async);
            async = true;
        }
        if (ippicaProssimeCorseSmall != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/ippicaProssimeCorseSmallDirettaView.jsp", "ippicaProssimeCorseSmallPortal", async);
            async = true;
        }
        if (liveSmall != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/liveSmallDirettaView.jsp", "liveSmallPortal", async);
            async = true;
        }
    }
    catch(e)
    {
        alert(e);
    }
}

// funzione per la gestione delle nuove "portlet" del palinsesto (implementate come jsp/servlet)
// versione con sole chiamate asincrone
function managePortletLoadingImproved()
{
    try
    {
        getLogger(location.pathname, '/Palinsesto/pubblico/servlet/logging');
        
        // gestione portlet in pagina
        var menuSportIppica = document.getElementById("menuSportIppicaPortal");
        var menuCps = document.getElementById("menuCpsPortal");
        var menuTris = document.getElementById("menuTrisPortal");
        var palinsestoSport = document.getElementById("palinsestoSportPortal");
        var palinsestoIppica = document.getElementById("palinsestoIppicaPortal");
        var liveLastMinuteTopQuote = document.getElementById("liveLastMinuteTopQuotePortal");
        var topQuoteHome = document.getElementById("topQuoteHomePortal");
        var ippicaProssimeCorse = document.getElementById("ippicaProssimeCorsePortal");
        var cps = document.getElementById("cpsPortal");
        var tris = document.getElementById("trisPortal");
        var quoteTris = document.getElementById("quoteTrisPortal");
        var ultimoConcorsoTotocalcio = document.getElementById("ultimoConcorsoTotocalcioPortal");
        var ultimoConcorsoTotogol = document.getElementById("ultimoConcorsoTotogolPortal");
        var jackpot = document.getElementById("jackpotPortal");
        var ippicaProssimeCorseMini = document.getElementById("ippicaProssimeCorseMiniPortal");
        var jackpotSE = document.getElementById("jackpotSEPortal");
        var jackpotSEFlash = document.getElementById("jackpotSEFlashPortal");
        var jackpotSEFlashSmall = document.getElementById("jackpotSEFlashSmallPortal");
        var combinazioneSE = document.getElementById("combinazioneSEPortal");
        var topQuoteSmall = document.getElementById("topQuoteSmallPortal");
        var lastMinuteSmall = document.getElementById("lastMinuteSmallPortal");
        var ippicaProssimeCorseSmall = document.getElementById("ippicaProssimeCorseSmallPortal");
        var liveSmall = document.getElementById("liveSmallPortal");
        
        if (menuSportIppica != null)
        {
            ajaxCall("/Palinsesto/pubblico/menuDirettaView.jsp" + location.search, "menuSportIppicaPortal", 'managePortletLoadingAsync("menuSportIppicaPortal");');
        }
        else if (menuCps != null)
        {
            ajaxCall("/Palinsesto/pubblico/menuCpsDirettaView.jsp", "menuCpsPortal", 'managePortletLoadingAsync("menuCpsPortal");');
        }
        else if (menuTris != null)
        {
            ajaxCall("/Palinsesto/pubblico/menuTrisDirettaView.jsp", "menuTrisPortal", 'managePortletLoadingAsync("menuTrisPortal");');
        }
        else if (palinsestoSport != null)
        {
            ajaxCall("/Palinsesto/pubblico/sportDirettaView.jsp" + location.search, "palinsestoSportPortal", 'managePortletLoadingAsync("palinsestoSportPortal");');
        }
        else if (palinsestoIppica != null)
        {
            ajaxCall("/Palinsesto/pubblico/ippicaDirettaView.jsp" + location.search, "palinsestoIppicaPortal", 'managePortletLoadingAsync("palinsestoIppicaPortal");');
        }
        else if (liveLastMinuteTopQuote != null)
        {
            ajaxCall("/Palinsesto/pubblico/liveLastMinuteTopQuoteDirettaView.jsp", "liveLastMinuteTopQuotePortal", 'managePortletLoadingAsync("liveLastMinuteTopQuotePortal");');
        }
        else if (topQuoteHome != null)
        {
            ajaxCall("/Palinsesto/pubblico/topQuoteHomeDirettaView.jsp", "topQuoteHomePortal", 'managePortletLoadingAsync("topQuoteHomePortal");');
        }
        else if (ippicaProssimeCorse != null)
        {
            ajaxCall("/Palinsesto/pubblico/ippicaProssimeCorseDirettaView.jsp", "ippicaProssimeCorsePortal", 'managePortletLoadingAsync("ippicaProssimeCorsePortal");');
        }
        else if (cps != null)
        {
            ajaxCall("/Palinsesto/pubblico/schedinaDirettaView.jsp", "cpsPortal", 'managePortletLoadingAsync("cpsPortal");');
        }
        else if (tris != null)
        {
            ajaxCall("/Palinsesto/pubblico/trisDirettaView.jsp", "trisPortal", 'managePortletLoadingAsync("trisPortal");');
        }
        else if (quoteTris != null)
        {
            ajaxCall("/Palinsesto/pubblico/quoteTrisDirettaView.jsp", "quoteTrisPortal", 'managePortletLoadingAsync("quoteTrisPortal");');
        }
        else if (ultimoConcorsoTotocalcio != null)
        {
            ajaxCall("/Palinsesto/pubblico/ultimoConcorsoTotocalcioDirettaView.jsp", "ultimoConcorsoTotocalcioPortal", 'managePortletLoadingAsync("ultimoConcorsoTotocalcioPortal");');
        }
        else if (ultimoConcorsoTotogol != null)
        {
            ajaxCall("/Palinsesto/pubblico/ultimoConcorsoTotogolDirettaView.jsp", "ultimoConcorsoTotogolPortal", 'managePortletLoadingAsync("ultimoConcorsoTotogolPortal");');
        }
        else if (jackpot != null)
        {
            ajaxCall("/Palinsesto/pubblico/jackpotDirettaView.jsp", "jackpotPortal", 'managePortletLoadingAsync("jackpotPortal");');
        }
        else if (ippicaProssimeCorseMini != null)
        {
            ajaxCall("/Palinsesto/pubblico/ippicaProssimeCorseMiniDirettaView.jsp", "ippicaProssimeCorseMiniPortal", 'managePortletLoadingAsync("ippicaProssimeCorseMiniPortal");');
        }
        else if (jackpotSE != null)
        {
            ajaxCall("/Palinsesto/pubblico/jackpotSEDirettaView.jsp", "jackpotSEPortal", 'managePortletLoadingAsync("jackpotSEPortal");');
        }
        else if (jackpotSEFlash != null)
        {
            ajaxCall("/Palinsesto/pubblico/jackpotSEFlash.jsp", "jackpotSEFlashPortal", 'managePortletLoadingAsync("jackpotSEFlashPortal");');
        }
        else if (jackpotSEFlashSmall != null)
        {
            ajaxCall("/Palinsesto/pubblico/jackpotSEFlashSmall.jsp", "jackpotSEFlashSmallPortal", 'managePortletLoadingAsync("jackpotSEFlashSmallPortal");');
        }
        else if (combinazioneSE != null)
        {
            ajaxCall("/Palinsesto/pubblico/combinazioneSEDirettaView.jsp", "combinazioneSEPortal", 'managePortletLoadingAsync("combinazioneSEPortal");');
        }
        else if (topQuoteSmall != null)
        {
            ajaxCall("/Palinsesto/pubblico/topQuoteSmallDirettaView.jsp", "topQuoteSmallPortal", 'managePortletLoadingAsync("topQuoteSmallPortal");');
        }
        else if (lastMinuteSmall != null)
        {
            ajaxCall("/Palinsesto/pubblico/lastMinuteSmallDirettaView.jsp", "lastMinuteSmallPortal", 'managePortletLoadingAsync("lastMinuteSmallPortal");');
        }
        else if (ippicaProssimeCorseSmall != null)
        {
            ajaxCall("/Palinsesto/pubblico/ippicaProssimeCorseSmallDirettaView.jsp", "ippicaProssimeCorseSmallPortal", 'managePortletLoadingAsync("ippicaProssimeCorseSmallPortal");');
        }
        else if (liveSmall != null)
        {
            ajaxCall("/Palinsesto/pubblico/liveSmallDirettaView.jsp", "liveSmallPortal", 'managePortletLoadingAsync("liveSmallPortal");');
        }
    }
    catch(e)
    {
        alert(e);
    }
}

// funzione per la gestione delle nuove "portlet" del palinsesto (implementate come jsp/servlet)
// versione con sole chiamate asincrone
// parametri:
// id l'id dell'elemento che deve essere escluso dalla gestione
function managePortletLoadingAsync(id)
{
    try
    {
        // gestione portlet in pagina
        var async = true;
        var menuSportIppica = document.getElementById("menuSportIppicaPortal");
        var menuCps = document.getElementById("menuCpsPortal");
        var menuTris = document.getElementById("menuTrisPortal");
        var palinsestoSport = document.getElementById("palinsestoSportPortal");
        var palinsestoIppica = document.getElementById("palinsestoIppicaPortal");
        var liveLastMinuteTopQuote = document.getElementById("liveLastMinuteTopQuotePortal");
        var topQuoteHome = document.getElementById("topQuoteHomePortal");
        var ippicaProssimeCorse = document.getElementById("ippicaProssimeCorsePortal");
        var cps = document.getElementById("cpsPortal");
        var tris = document.getElementById("trisPortal");
        var quoteTris = document.getElementById("quoteTrisPortal");
        var ultimoConcorsoTotocalcio = document.getElementById("ultimoConcorsoTotocalcioPortal");
        var ultimoConcorsoTotogol = document.getElementById("ultimoConcorsoTotogolPortal");
        var jackpot = document.getElementById("jackpotPortal");
        var ippicaProssimeCorseMini = document.getElementById("ippicaProssimeCorseMiniPortal");
        var jackpotSE = document.getElementById("jackpotSEPortal");
        var jackpotSEFlash = document.getElementById("jackpotSEFlashPortal");
        var jackpotSEFlashSmall = document.getElementById("jackpotSEFlashSmallPortal");
        var combinazioneSE = document.getElementById("combinazioneSEPortal");
        var topQuoteSmall = document.getElementById("topQuoteSmallPortal");
        var lastMinuteSmall = document.getElementById("lastMinuteSmallPortal");
        var ippicaProssimeCorseSmall = document.getElementById("ippicaProssimeCorseSmallPortal");
        var liveSmall = document.getElementById("liveSmallPortal");
        
        // gestione portlet esclusa
        if (id != null)
        {
            if (id == "menuSportIppicaPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                menuSportIppica = null;
            }
            else if (id == "menuCpsPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                menuCps = null;
            }
            else if (id == "menuTrisPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                menuTris = null;
            }
            else if (id == "palinsestoSportPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                palinsestoSport = null;
            }
            else if (id == "palinsestoIppicaPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                palinsestoIppica = null;
            }
            else if (id == "liveLastMinuteTopQuotePortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                liveLastMinuteTopQuote = null;
            }
            else if (id == "topQuoteHomePortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                topQuoteHome = null;
            }
            else if (id == "ippicaProssimeCorsePortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                ippicaProssimeCorse = null;
            }
            else if (id == "cpsPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                cps = null;
            }
            else if (id == "trisPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                tris = null;
            }
            else if (id == "quoteTrisPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                quoteTris = null;
            }
            else if (id == "ultimoConcorsoTotocalcioPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                ultimoConcorsoTotocalcio = null;
            }
            else if (id == "ultimoConcorsoTotogolPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                ultimoConcorsoTotogol = null;
            }
            else if (id == "jackpotPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                jackpot = null;
            }
            else if (id == "ippicaProssimeCorseMiniPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                ippicaProssimeCorseMini = null;
            }
            else if (id == "jackpotSEPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                jackpotSE = null;
            }
            else if (id == "jackpotSEFlashPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                jackpotSEFlash = null;
            }
            else if (id == "jackpotSEFlashSmallPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                jackpotSEFlashSmall = null;
            }
            else if (id == "combinazioneSEPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                combinazioneSE = null;
            }
            else if (id == "topQuoteSmallPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                topQuoteSmall = null;
            }
            else if (id == "lastMinuteSmallPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                lastMinuteSmall = null;
            }
            else if (id == "ippicaProssimeCorseSmallPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                ippicaProssimeCorseSmall = null;
            }
            else if (id == "liveSmallPortal")
            {
                logger.debug("managePortletLoadingAsync - esclusione " + id);
                
                liveSmall = null;
            }
        }
        
        logger.debug("managePortletLoadingAsync - menuSportIppicaPortal: " + menuSportIppica);
        logger.debug("managePortletLoadingAsync - menuCpsPortal: " + menuCps);
        logger.debug("managePortletLoadingAsync - menuTrisPortal: " + menuTris);
        logger.debug("managePortletLoadingAsync - palinsestoSportPortal: " + palinsestoSport);
        logger.debug("managePortletLoadingAsync - palinsestoIppicaPortal: " + palinsestoIppica);
        logger.debug("managePortletLoadingAsync - liveLastMinuteTopQuotePortal: " + liveLastMinuteTopQuote);
        logger.debug("managePortletLoadingAsync - topQuoteHomePortal: " + topQuoteHome);
        logger.debug("managePortletLoadingAsync - ippicaProssimeCorsePortal: " + ippicaProssimeCorse);
        logger.debug("managePortletLoadingAsync - cpsPortal: " + cps);
        logger.debug("managePortletLoadingAsync - trisPortal: " + tris);
        logger.debug("managePortletLoadingAsync - quoteTrisPortal: " + quoteTris);
        logger.debug("managePortletLoadingAsync - ultimoConcorsoTotocalcioPortal: " + ultimoConcorsoTotocalcio);
        logger.debug("managePortletLoadingAsync - ultimoConcorsoTotogolPortal: " + ultimoConcorsoTotogol);
        logger.debug("managePortletLoadingAsync - jackpotPortal: " + jackpot);
        logger.debug("managePortletLoadingAsync - ippicaProssimeCorseMiniPortal: " + ippicaProssimeCorseMini);
        logger.debug("managePortletLoadingAsync - jackpotSEPortal: " + jackpotSE);
        logger.debug("managePortletLoadingAsync - jackpotSEFlashPortal: " + jackpotSEFlash);
        logger.debug("managePortletLoadingAsync - jackpotSEFlashSmallPortal: " + jackpotSEFlashSmall);
        logger.debug("managePortletLoadingAsync - combinazioneSEPortal: " + combinazioneSE);
        logger.debug("managePortletLoadingAsync - topQuoteSmallPortal: " + topQuoteSmall);
        logger.debug("managePortletLoadingAsync - lastMinuteSmallPortal: " + lastMinuteSmall);
        logger.debug("managePortletLoadingAsync - ippicaProssimeCorseSmallPortal: " + ippicaProssimeCorseSmall);
        logger.debug("managePortletLoadingAsync - liveSmallPortal: " + liveSmall);
        
        if (menuSportIppica != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/menuDirettaView.jsp" + location.search, "menuSportIppicaPortal", async);
            async = true;
            if (palinsestoSport == null && palinsestoIppica == null)
            {
                resetEvidenceMenuSportIppica("sportdioggi2_");
                resetEvidenceMenuSportIppica("sport2_");
                resetEvidenceMenuSportIppica("ippica2_");
            }
        }
        if (menuCps != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/menuCpsDirettaView.jsp", "menuCpsPortal", async);
            async = true;
        }
        if (menuTris != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/menuTrisDirettaView.jsp", "menuTrisPortal", async);
            async = true;
        }
        if (palinsestoSport != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/sportDirettaView.jsp" + location.search, "palinsestoSportPortal", async);
            async = true;
        }
        if (palinsestoIppica != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/ippicaDirettaView.jsp" + location.search, "palinsestoIppicaPortal", async);
            async = true;
        }
        if (liveLastMinuteTopQuote != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/liveLastMinuteTopQuoteDirettaView.jsp", "liveLastMinuteTopQuotePortal", async);
            async = true;
        }
        if (topQuoteHome != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/topQuoteHomeDirettaView.jsp", "topQuoteHomePortal", async);
            async = true;
        }
        if (ippicaProssimeCorse != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/ippicaProssimeCorseDirettaView.jsp", "ippicaProssimeCorsePortal", async);
            async = true;
        }
        if (cps != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/schedinaDirettaView.jsp", "cpsPortal", async);
            async = true;
        }
        if (tris != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/trisDirettaView.jsp", "trisPortal", async);
            async = true;
        }
        if (quoteTris != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/quoteTrisDirettaView.jsp", "quoteTrisPortal", async);
            async = true;
        }
        if (ultimoConcorsoTotocalcio != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/ultimoConcorsoTotocalcioDirettaView.jsp", "ultimoConcorsoTotocalcioPortal", async);
            async = true;
        }
        if (ultimoConcorsoTotogol != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/ultimoConcorsoTotogolDirettaView.jsp", "ultimoConcorsoTotogolPortal", async);
            async = true;
        }
        if (jackpot != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/jackpotDirettaView.jsp", "jackpotPortal", async);
            async = true;
        }
        if (ippicaProssimeCorseMini != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/ippicaProssimeCorseMiniDirettaView.jsp", "ippicaProssimeCorseMiniPortal", async);
            async = true;
        }
        if (jackpotSE != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/jackpotSEDirettaView.jsp", "jackpotSEPortal", async);
            async = true;
        }
        if (jackpotSEFlash != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/jackpotSEFlash.jsp", "jackpotSEFlashPortal", async);
            async = true;
        }
        if (jackpotSEFlashSmall != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/jackpotSEFlashSmall.jsp", "jackpotSEFlashSmallPortal", async);
            async = true;
        }
        if (combinazioneSE != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/combinazioneSEDirettaView.jsp", "combinazioneSEPortal", async);
            async = true;
        }
        if (topQuoteSmall != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/topQuoteSmallDirettaView.jsp", "topQuoteSmallPortal", async);
            async = true;
        }
        if (lastMinuteSmall != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/lastMinuteSmallDirettaView.jsp", "lastMinuteSmallPortal", async);
            async = true;
        }
        if (ippicaProssimeCorseSmall != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/ippicaProssimeCorseSmallDirettaView.jsp", "ippicaProssimeCorseSmallPortal", async);
            async = true;
        }
        if (liveSmall != null)
        {
            simpleAjaxCall("/Palinsesto/pubblico/liveSmallDirettaView.jsp", "liveSmallPortal", async);
            async = true;
        }
    }
    catch(e)
    {
        alert(e);
    }
}