


$(document).ready(
    function() {
      setBorderColorTheme();
      setListenerFooter();              
    });

var bCallAjax = true;

function setListenerFooter() {
    var Gia_Aperto_popCompanyInfo = 0;
    var Gia_Aperto_popTermAndCondition = 0;  
    var sContentId = $('.content').attr('id');
    if (sContentId == 'contentHp')
        $('#footer').attr({ 'class': 'footer footerHp' });

    $('.lnkInternal').bind('click', function() {
        if (bCallAjax) {
            var sCurrentLinkLink = $(this).attr('href');
            var sCurrentLinkId = $(this).attr('id');
            $(this).attr({ 'href': 'javascript:;' });
            var sCurrentPopId = sCurrentLinkId.replace('lnkInternal_', '');
            if (sCurrentPopId != '') 
              {
 
                 Carica_Contenuto = 0;
                if ((sCurrentPopId == 'popCompanyInfo')&&(Gia_Aperto_popCompanyInfo == 0))
                  {
                    Gia_Aperto_popCompanyInfo = 1;
                    Carica_Contenuto = 1;
                  }
                if ((sCurrentPopId == 'popTermAndCondition')&&(Gia_Aperto_popTermAndCondition == 0))
                  {
                    Gia_Aperto_popTermAndCondition = 1;
                    Carica_Contenuto = 1;
                  }              
                if (Carica_Contenuto == 1)
                  {             
              
              
                sCurrentLinkLink = sCurrentLinkLink + "?getSectionContent=true";
                $('#' + sCurrentPopId + '_text').load(sCurrentLinkLink, function() {
                    $('#' + sCurrentPopId).css({ 'display': 'block' });
                });
                  }
                else
                  {
                    $('#' + sCurrentPopId).css({ 'display': 'block' });
                  }                      
              
              
              }
        }
    });
}

function closeLnkInternal(_object) {
    $('#' + _object).css({ 'display': 'none' });
}

function setListenerFooterOld() {
    $('.lnkInternal').bind('click', function() {
        if (bCallAjax) {
            var sCurrentLinkLink = '' + $(this).attr('href');
            var sCurrentLinkId = $(this).attr('id');
            $(this).attr({ 'href': 'javascript:;' });
            var sCurrentPopId = sCurrentLinkId.replace('lnkInternal_', '');
            if (sCurrentLinkLink == '') {
                $('#' + sCurrentPopId).css({ 'visibility': 'visible' });
            } else {
                var sCurrentPopContentId = 'boxScroll_' + sCurrentPopId;
                if (sCurrentPopId != '') {
                    $('#' + sCurrentPopContentId).load(sCurrentLinkLink, function() {
                        $('#' + sCurrentPopId).css({ 'visibility': 'visible' });
                    });
                }
            }
        }
    });
}
