var timeout = 15000;
var banner_topbanner = new Array();
var banner_sotto_menu = new Array();
var banner_sopra_notizie_lette_commentate = new Array();
var banner_sotto_notizie_lette_commentate = new Array();
var banner_sotto_gr = new Array();
var banner_sotto_sondaggio = new Array();
var banner_sotto_meteo = new Array();
var banner_cosa_c_era_in_homepage = new Array();
var banner_sotto_spettacoli = new Array();
var banner_sotto_incontri = new Array();
var banner_sotto_feste_sagre = new Array();
var banner_sotto_concerti = new Array();
var banner_manchette_sx = new Array();
var banner_manchette_dx = new Array();
var banner_sport_video_foto = new Array();
var banner_sport_tabellino = new Array();
var banner_sport_bottom = new Array();
var banner_sport_commenti = new Array();

var TOPBANNER_tempoliberoxxxxxxxxxxx = new Array();
var manchette_sx_tempoliberoxxxxxxxx = new Array();
var manchette_dx_tempoliberoxxxxxxxx = new Array();
var sub_header_tempoliberoxxxxxxxxxx = new Array();
var sotto_prima_notizia_tempoliberox = new Array();
var sotto_cinema_tempoliberoxxxxxxxx = new Array();
var sotto_blocco_tempoliberoxxxxxxxx = new Array();

var TOPBANNER_alessandriaxxxxxxxxxxx = new Array();
var manchette_sx_alessandriaxxxxxxxx = new Array();
var manchette_dx_alessandriaxxxxxxxx = new Array();
var sub_header_alessandriaxxxxxxxxxx = new Array();
var sotto_prima_notizia_alessandriax = new Array();
var sotto_archivio_video_alessandria = new Array();
var sotto_latest_match_alessandriaxx = new Array();
var sotto_next_match_alessandriaxxxx = new Array();
var sotto_ris_class_alessandriaxxxxx = new Array();
var sotto_coolest_sport_alessandriax = new Array();

var TOPBANNER_casalexxxxxxxxxxxxxxxx = new Array();
var manchette_sx_casalexxxxxxxxxxxxx = new Array();
var manchette_dx_casalexxxxxxxxxxxxx = new Array();
var sub_header_casalexxxxxxxxxxxxxxx = new Array();
var sotto_prima_notizia_casalexxxxxx = new Array();
var sotto_archivio_video_casalexxxxx = new Array();
var sotto_latest_match_casalexxxxxxx = new Array();
var sotto_next_match_casalexxxxxxxxx = new Array();
var sotto_ris_class_casalexxxxxxxxxx = new Array();
var sotto_coolest_sport_casalexxxxxx = new Array();

var TOPBANNER_valenzanaxxxxxxxxxxxxx = new Array();
var manchette_sx_valenzanaxxxxxxxxxx = new Array();
var manchette_dx_valenzanaxxxxxxxxxx = new Array();
var sub_header_valenzanaxxxxxxxxxxxx = new Array();
var sotto_prima_notizia_valenzanaxxx = new Array();
var sotto_archivio_video_valenzanaxx = new Array();
var sotto_latest_match_valenzanaxxxx = new Array();
var sotto_next_match_valenzanaxxxxxx = new Array();
var sotto_ris_class_valenzanaxxxxxxx = new Array();
var sotto_coolest_sport_valenzanaxxx = new Array();

var TOPBANNER_juniorxxxxxxxxxxxxxxxx = new Array();
var manchette_sx_juniorxxxxxxxxxxxxx = new Array();
var manchette_dx_juniorxxxxxxxxxxxxx = new Array();
var sub_header_juniorxxxxxxxxxxxxxxx = new Array();
var sotto_prima_notizia_juniorxxxxxx = new Array();
var sotto_archivio_video_juniorxxxxx = new Array();
var sotto_latest_match_juniorxxxxxxx = new Array();
var sotto_next_match_juniorxxxxxxxxx = new Array();
var sotto_ris_class_juniorxxxxxxxxxx = new Array();
var sotto_coolest_sport_juniorxxxxxx = new Array();


var index_banner_topbanner = 0;
var index_banner_sotto_menu = 0;
var index_banner_sopra_notizie_lette_commentate = 0;
var index_banner_sotto_notizie_lette_commentate = 0;
var index_banner_sotto_gr = 0;
var index_banner_sotto_sondaggio = 0;
var index_banner_sotto_meteo = 0;
var index_banner_cosa_c_era_in_homepage = 0;
var index_banner_sotto_spettacoli = 0;
var index_banner_sotto_incontri = 0;
var index_banner_sotto_feste_sagre = 0;
var index_banner_sotto_concerti = 0;
var index_banner_manchette_sx = 0;
var index_banner_manchette_dx = 0;
var index_banner_sport_video_foto = 0;
var index_banner_sport_tabellino = 0;
var index_banner_sport_bottom = 0;
var index_banner_sport_commenti = 0;

var index_TOPBANNER_tempoliberoxxxxxxxxxxx = 0;
var index_manchette_sx_tempoliberoxxxxxxxx = 0;
var index_manchette_dx_tempoliberoxxxxxxxx = 0;
var index_sub_header_tempoliberoxxxxxxxxxx = 0;
var index_sotto_prima_notizia_tempoliberox = 0;
var index_sotto_cinema_tempoliberoxxxxxxxx = 0;
var index_sotto_blocco_tempoliberoxxxxxxxx = 0;


var index_TOPBANNER_alessandriaxxxxxxxxxxx = 0;
var index_manchette_sx_alessandriaxxxxxxxx = 0;
var index_manchette_dx_alessandriaxxxxxxxx = 0;
var index_sub_header_alessandriaxxxxxxxxxx = 0;
var index_sotto_prima_notizia_alessandriax = 0;
var index_sotto_archivio_video_alessandria = 0;
var index_sotto_latest_match_alessandriaxx = 0;
var index_sotto_next_match_alessandriaxxxx = 0;
var index_sotto_ris_class_alessandriaxxxxx = 0;
var index_sotto_coolest_sport_alessandriax = 0;

var index_TOPBANNER_casalexxxxxxxxxxxxxxxx = 0;
var index_manchette_sx_casalexxxxxxxxxxxxx = 0;
var index_manchette_dx_casalexxxxxxxxxxxxx = 0;
var index_sub_header_casalexxxxxxxxxxxxxxx = 0;
var index_sotto_prima_notizia_casalexxxxxx = 0;
var index_sotto_archivio_video_casalexxxxx = 0;
var index_sotto_latest_match_casalexxxxxxx = 0;
var index_sotto_next_match_casalexxxxxxxxx = 0;
var index_sotto_ris_class_casalexxxxxxxxxx = 0;
var index_sotto_coolest_sport_casalexxxxxx = 0;

var index_TOPBANNER_valenzanaxxxxxxxxxxxxx = 0;
var index_manchette_sx_valenzanaxxxxxxxxxx = 0;
var index_manchette_dx_valenzanaxxxxxxxxxx = 0;
var index_sub_header_valenzanaxxxxxxxxxxxx = 0;
var index_sotto_prima_notizia_valenzanaxxx = 0;
var index_sotto_archivio_video_valenzanaxx = 0;
var index_sotto_latest_match_valenzanaxxxx = 0;
var index_sotto_next_match_valenzanaxxxxxx = 0;
var index_sotto_ris_class_valenzanaxxxxxxx = 0;
var index_sotto_coolest_sport_valenzanaxxx = 0;

var index_TOPBANNER_juniorxxxxxxxxxxxxxxxx = 0;
var index_manchette_sx_juniorxxxxxxxxxxxxx = 0;
var index_manchette_dx_juniorxxxxxxxxxxxxx = 0;
var index_sub_header_juniorxxxxxxxxxxxxxxx = 0;
var index_sotto_prima_notizia_juniorxxxxxx = 0;
var index_sotto_archivio_video_juniorxxxxx = 0;
var index_sotto_latest_match_juniorxxxxxxx = 0;
var index_sotto_next_match_juniorxxxxxxxxx = 0;
var index_sotto_ris_class_juniorxxxxxxxxxx = 0;
var index_sotto_coolest_sport_juniorxxxxxx = 0;

var length_banner_topbanner = 0;
var length_banner_sotto_menu = 0;
var length_banner_sopra_notizie_lette_commentate = 0;
var length_banner_sotto_notizie_lette_commentate = 0;
var length_banner_sotto_gr = 0;
var length_banner_sotto_sondaggio = 0;
var length_banner_sotto_meteo = 0;
var length_banner_cosa_c_era_in_homepage = 0;
var length_banner_sotto_spettacoli = 0;
var length_banner_sotto_incontri = 0;
var length_banner_sotto_feste_sagre = 0;
var length_banner_sotto_concerti = 0;
var length_banner_manchette_sx = 0;
var length_banner_manchette_dx = 0;
var length_banner_sport_video_foto = 0;
var length_banner_sport_tabellino = 0;
var length_banner_sport_bottom = 0;
var length_banner_sport_commenti = 0;

var length_TOPBANNER_tempoliberoxxxxxxxxxxx = 0;
var length_manchette_sx_tempoliberoxxxxxxxx = 0;
var length_manchette_dx_tempoliberoxxxxxxxx = 0;
var length_sub_header_tempoliberoxxxxxxxxxx = 0;
var length_sotto_prima_notizia_tempoliberox = 0;
var length_sotto_cinema_tempoliberoxxxxxxxx = 0;
var length_sotto_blocco_tempoliberoxxxxxxxx = 0;

var length_TOPBANNER_alessandriaxxxxxxxxxxx = 0;
var length_manchette_sx_alessandriaxxxxxxxx = 0;
var length_manchette_dx_alessandriaxxxxxxxx = 0;
var length_sub_header_alessandriaxxxxxxxxxx = 0;
var length_sotto_prima_notizia_alessandriax = 0;
var length_sotto_archivio_video_alessandria = 0;
var length_sotto_latest_match_alessandriaxx = 0;
var length_sotto_next_match_alessandriaxxxx = 0;
var length_sotto_ris_class_alessandriaxxxxx = 0;
var length_sotto_coolest_sport_alessandriax = 0;

var length_TOPBANNER_casalexxxxxxxxxxxxxxxx = 0;
var length_manchette_sx_casalexxxxxxxxxxxxx = 0;
var length_manchette_dx_casalexxxxxxxxxxxxx = 0;
var length_sub_header_casalexxxxxxxxxxxxxxx = 0;
var length_sotto_prima_notizia_casalexxxxxx = 0;
var length_sotto_archivio_video_casalexxxxx = 0;
var length_sotto_latest_match_casalexxxxxxx = 0;
var length_sotto_next_match_casalexxxxxxxxx = 0;
var length_sotto_ris_class_casalexxxxxxxxxx = 0;
var length_sotto_coolest_sport_casalexxxxxx = 0;

var length_TOPBANNER_valenzanaxxxxxxxxxxxxx = 0;
var length_manchette_sx_valenzanaxxxxxxxxxx = 0;
var length_manchette_dx_valenzanaxxxxxxxxxx = 0;
var length_sub_header_valenzanaxxxxxxxxxxxx = 0;
var length_sotto_prima_notizia_valenzanaxxx = 0;
var length_sotto_archivio_video_valenzanaxx = 0;
var length_sotto_latest_match_valenzanaxxxx = 0;
var length_sotto_next_match_valenzanaxxxxxx = 0;
var length_sotto_ris_class_valenzanaxxxxxxx = 0;
var length_sotto_coolest_sport_valenzanaxxx = 0;

var length_TOPBANNER_juniorxxxxxxxxxxxxxxxx = 0;
var length_manchette_sx_juniorxxxxxxxxxxxxx = 0;
var length_manchette_dx_juniorxxxxxxxxxxxxx = 0;
var length_sub_header_juniorxxxxxxxxxxxxxxx = 0;
var length_sotto_prima_notizia_juniorxxxxxx = 0;
var length_sotto_archivio_video_juniorxxxxx = 0;
var length_sotto_latest_match_juniorxxxxxxx = 0;
var length_sotto_next_match_juniorxxxxxxxxx = 0;
var length_sotto_ris_class_juniorxxxxxxxxxx = 0;
var length_sotto_coolest_sport_juniorxxxxxx = 0;

var $target_banner_topbanner = "";
var $target_banner_sotto_menu = "";
var $target_banner_sopra_notizie_lette_commentate = "";
var $target_banner_sotto_notizie_lette_commentate = "";
var $target_banner_sotto_gr = "";
var $target_banner_sotto_sondaggio = "";
var $target_banner_sotto_meteo = "";
var $target_banner_cosa_c_era_in_homepage = "";
var $target_banner_sotto_spettacoli = "";
var $target_banner_sotto_incontri = "";
var $target_banner_sotto_feste_sagre = "";
var $target_banner_sotto_concerti = "";
var $target_banner_manchette_sx = "";
var $target_banner_manchette_dx = "";
var $target_banner_sport_video_foto = "";
var $target_banner_sport_tabellino = "";
var $target_banner_sport_bottom = "";
var $target_banner_sport_commenti = "";

var $target_TOPBANNER_tempoliberoxxxxxxxxxxx = "";
var $target_manchette_sx_tempoliberoxxxxxxxx = "";
var $target_manchette_dx_tempoliberoxxxxxxxx = "";
var $target_sub_header_tempoliberoxxxxxxxxxx = "";
var $target_sotto_prima_notizia_tempoliberox = "";
var $target_sotto_cinema_tempoliberoxxxxxxxx = "";
var $target_sotto_blocco_tempoliberoxxxxxxxx = "";

var $target_TOPBANNER_alessandriaxxxxxxxxxxx = "";
var $target_manchette_sx_alessandriaxxxxxxxx = "";
var $target_manchette_dx_alessandriaxxxxxxxx = "";
var $target_sub_header_alessandriaxxxxxxxxxx = "";
var $target_sotto_prima_notizia_alessandriax = "";
var $target_sotto_archivio_video_alessandria = "";
var $target_sotto_latest_match_alessandriaxx = "";
var $target_sotto_next_match_alessandriaxxxx = "";
var $target_sotto_ris_class_alessandriaxxxxx = "";
var $target_sotto_coolest_sport_alessandriax = "";

var $target_TOPBANNER_casalexxxxxxxxxxxxxxxx = "";
var $target_manchette_sx_casalexxxxxxxxxxxxx = "";
var $target_manchette_dx_casalexxxxxxxxxxxxx = "";
var $target_sub_header_casalexxxxxxxxxxxxxxx = "";
var $target_sotto_prima_notizia_casalexxxxxx = "";
var $target_sotto_archivio_video_casalexxxxx = "";
var $target_sotto_latest_match_casalexxxxxxx = "";
var $target_sotto_next_match_casalexxxxxxxxx = "";
var $target_sotto_ris_class_casalexxxxxxxxxx = "";
var $target_sotto_coolest_sport_casalexxxxxx = "";

var $target_TOPBANNER_valenzanaxxxxxxxxxxxxx = "";
var $target_manchette_sx_valenzanaxxxxxxxxxx = "";
var $target_manchette_dx_valenzanaxxxxxxxxxx = "";
var $target_sub_header_valenzanaxxxxxxxxxxxx = "";
var $target_sotto_prima_notizia_valenzanaxxx = "";
var $target_sotto_archivio_video_valenzanaxx = "";
var $target_sotto_latest_match_valenzanaxxxx = "";
var $target_sotto_next_match_valenzanaxxxxxx = "";
var $target_sotto_ris_class_valenzanaxxxxxxx = "";
var $target_sotto_coolest_sport_valenzanaxxx = "";

var $target_TOPBANNER_juniorxxxxxxxxxxxxxxxx = "";
var $target_manchette_sx_juniorxxxxxxxxxxxxx = "";
var $target_manchette_dx_juniorxxxxxxxxxxxxx = "";
var $target_sub_header_juniorxxxxxxxxxxxxxxx = "";
var $target_sotto_prima_notizia_juniorxxxxxx = "";
var $target_sotto_archivio_video_juniorxxxxx = "";
var $target_sotto_latest_match_juniorxxxxxxx = "";
var $target_sotto_next_match_juniorxxxxxxxxx = "";
var $target_sotto_ris_class_juniorxxxxxxxxxx = "";
var $target_sotto_coolest_sport_juniorxxxxxx = "";

$(document).ready(function() {

    if ($("#email_commento").val()){
        checkMailNewsletter($("#email_commento"));
    }

    if ($("#form_commenti").is(":visible")){
        $.post("/site/utils/token.php","",function(data){
            $("#form_commenti").append("<input type=\"hidden\" name=\"ts\" value=\""+data+"\" />");
        });
    }
	
	$(".team-table tr:even").addClass('even');
    $(".partiteTable tr:even").addClass('even');
    $(".partiteTable tr:odd").addClass('odd');

    $target_banner_topbanner = $(".id_banner_categoria[value='TOPBANNERxxxxxxxxxxxxxxxxxxxxxxx']").parent().find("div");
    $target_banner_sotto_menu = $(".id_banner_categoria.sotto_menu").parent().find("div");
    $target_banner_sopra_notizie_lette_commentate = $(".id_banner_categoria[value='5fe6ce280af32ba2816b0f0d4cff5e63']").parent().find("div");
    $target_banner_sotto_notizie_lette_commentate = $(".id_banner_categoria[value='5fe6ce280af32ba2816b0f0d4cff5e65']").parent().find("div");
    $target_banner_sotto_gr = $(".id_banner_categoria[value='WEB_TVxxxxxxxxxxxxxxxxxxxxxxxxxx']").parent().find("div");
    $target_banner_sotto_sondaggio = $(".id_banner_categoria[value='d6f21258c28da5af1123d73e47aecc1e']").parent().find("div");
    $target_banner_sotto_meteo = $(".id_banner_categoria[value='sotto_meteo_xxxxxxxxxxxxxxxxxxxx']").parent().find("div");
    $target_banner_cosa_c_era_in_homepage = $(".id_banner_categoria[value='cosa_c_era_in_homepage_xxxxxxxxx']").parent().find("div");
    $target_banner_sotto_spettacoli = $(".id_banner_categoria[value='sotto_spettacoli_xxxxxxxxxxxxxxx']").parent().find("div");
    $target_banner_sotto_incontri = $(".id_banner_categoria[value='sotto_incontri_xxxxxxxxxxxxxxxxx']").parent().find("div");
    $target_banner_sotto_feste_sagre = $(".id_banner_categoria[value='sotto_feste_sagre_xxxxxxxxxxxxxx']").parent().find("div");
    $target_banner_sotto_concerti = $(".id_banner_categoria[value='sotto_concerti_xxxxxxxxxxxxxxxxx']").parent().find("div");
    $target_banner_manchette_sx = $(".id_banner_categoria[value='manchette_sx_xxxxxxxxxxxxxxxxxxx']").parent().find("div");
    $target_banner_manchette_dx = $(".id_banner_categoria[value='manchette_dx_xxxxxxxxxxxxxxxxxxx']").parent().find("div");
    $target_banner_sport_video_foto = $(".id_banner_categoria.sport_video_foto").parent().find("div");
    $target_banner_sport_tabellino = $(".id_banner_categoria.sport_tabellino").parent().find("div");
    $target_banner_sport_bottom = $(".id_banner_categoria.sport_bottom").parent().find("div");
    $target_banner_sport_commenti = $(".id_banner_categoria.sport_commenti").parent().find("div");

    $target_TOPBANNER_tempoliberoxxxxxxxxxxx = $(".id_banner_categoria[value='TOPBANNER_tempoliberoxxxxxxxxxxx']").parent().find("div");
    $target_manchette_sx_tempoliberoxxxxxxxx = $(".id_banner_categoria[value='manchette_sx_tempoliberoxxxxxxxx']").parent().find("div");
    $target_manchette_dx_tempoliberoxxxxxxxx = $(".id_banner_categoria[value='manchette_dx_tempoliberoxxxxxxxx']").parent().find("div");
    $target_sub_header_tempoliberoxxxxxxxxxx = $(".id_banner_categoria[value='sub_header_tempoliberoxxxxxxxxxx']").parent().find("div");
    $target_sotto_prima_notizia_tempoliberox = $(".id_banner_categoria[value='sotto_prima_notizia_tempoliberox']").parent().find("div");
    $target_sotto_cinema_tempoliberoxxxxxxxx = $(".id_banner_categoria[value='sotto_cinema_tempoliberoxxxxxxxx']").parent().find("div");
    $target_sotto_blocco_tempoliberoxxxxxxxx = $(".id_banner_categoria[value='sotto_blocco_tempoliberoxxxxxxxx']").parent().find("div");

    $target_TOPBANNER_alessandriaxxxxxxxxxxx = $(".id_banner_categoria[value='TOPBANNER_alessandriaxxxxxxxxxxx']").parent().find("div");
    $target_manchette_sx_alessandriaxxxxxxxx = $(".id_banner_categoria[value='manchette_sx_alessandriaxxxxxxxx']").parent().find("div");
    $target_manchette_dx_alessandriaxxxxxxxx = $(".id_banner_categoria[value='manchette_dx_alessandriaxxxxxxxx']").parent().find("div");
    $target_sub_header_alessandriaxxxxxxxxxx = $(".id_banner_categoria[value='sub_header_alessandriaxxxxxxxxxx']").parent().find("div");
    $target_sotto_prima_notizia_alessandriax = $(".id_banner_categoria[value='sotto_prima_notizia_alessandriax']").parent().find("div");
    $target_sotto_archivio_video_alessandria = $(".id_banner_categoria[value='sotto_archivio_video_alessandria']").parent().find("div");
    $target_sotto_latest_match_alessandriaxx = $(".id_banner_categoria[value='sotto_latest_match_alessandriaxx']").parent().find("div");
    $target_sotto_next_match_alessandriaxxxx = $(".id_banner_categoria[value='sotto_next_match_alessandriaxxxx']").parent().find("div");
    $target_sotto_ris_class_alessandriaxxxxx = $(".id_banner_categoria[value='sotto_ris_class_alessandriaxxxxx']").parent().find("div");
    $target_sotto_coolest_sport_alessandriax = $(".id_banner_categoria[value='sotto_coolest_sport_alessandriax']").parent().find("div");

    $target_TOPBANNER_casalexxxxxxxxxxxxxxxx = $(".id_banner_categoria[value='TOPBANNER_casalexxxxxxxxxxxxxxxx']").parent().find("div");
    $target_manchette_sx_casalexxxxxxxxxxxxx = $(".id_banner_categoria[value='manchette_sx_casalexxxxxxxxxxxxx']").parent().find("div");
    $target_manchette_dx_casalexxxxxxxxxxxxx = $(".id_banner_categoria[value='manchette_dx_casalexxxxxxxxxxxxx']").parent().find("div");
    $target_sub_header_casalexxxxxxxxxxxxxxx = $(".id_banner_categoria[value='sub_header_casalexxxxxxxxxxxxxxx']").parent().find("div");
    $target_sotto_prima_notizia_casalexxxxxx = $(".id_banner_categoria[value='sotto_prima_notizia_casalexxxxxx']").parent().find("div");
    $target_sotto_archivio_video_casalexxxxx = $(".id_banner_categoria[value='sotto_archivio_video_casalexxxxx']").parent().find("div");
    $target_sotto_latest_match_casalexxxxxxx = $(".id_banner_categoria[value='sotto_latest_match_casalexxxxxxx']").parent().find("div");
    $target_sotto_next_match_casalexxxxxxxxx = $(".id_banner_categoria[value='sotto_next_match_casalexxxxxxxxx']").parent().find("div");
    $target_sotto_ris_class_casalexxxxxxxxxx = $(".id_banner_categoria[value='sotto_ris_class_casalexxxxxxxxxx']").parent().find("div");
    $target_sotto_coolest_sport_casalexxxxxx = $(".id_banner_categoria[value='sotto_coolest_sport_casalexxxxxx']").parent().find("div");

    $target_TOPBANNER_valenzanaxxxxxxxxxxxxx = $(".id_banner_categoria[value='TOPBANNER_valenzanaxxxxxxxxxxxxx']").parent().find("div");
    $target_manchette_sx_valenzanaxxxxxxxxxx = $(".id_banner_categoria[value='manchette_sx_valenzanaxxxxxxxxxx']").parent().find("div");
    $target_manchette_dx_valenzanaxxxxxxxxxx = $(".id_banner_categoria[value='manchette_dx_valenzanaxxxxxxxxxx']").parent().find("div");
    $target_sub_header_valenzanaxxxxxxxxxxxx = $(".id_banner_categoria[value='sub_header_valenzanaxxxxxxxxxxxx']").parent().find("div");
    $target_sotto_prima_notizia_valenzanaxxx = $(".id_banner_categoria[value='sotto_prima_notizia_valenzanaxxx']").parent().find("div");
    $target_sotto_archivio_video_valenzanaxx = $(".id_banner_categoria[value='sotto_archivio_video_valenzanaxx']").parent().find("div");
    $target_sotto_latest_match_valenzanaxxxx = $(".id_banner_categoria[value='sotto_latest_match_valenzanaxxxx']").parent().find("div");
    $target_sotto_next_match_valenzanaxxxxxx = $(".id_banner_categoria[value='sotto_next_match_valenzanaxxxxxx']").parent().find("div");
    $target_sotto_ris_class_valenzanaxxxxxxx = $(".id_banner_categoria[value='sotto_ris_class_valenzanaxxxxxxx']").parent().find("div");
    $target_sotto_coolest_sport_valenzanaxxx = $(".id_banner_categoria[value='sotto_coolest_sport_valenzanaxxx']").parent().find("div");

    $target_TOPBANNER_juniorxxxxxxxxxxxxxxxx = $(".id_banner_categoria[value='TOPBANNER_juniorxxxxxxxxxxxxxxxx']").parent().find("div");
    $target_manchette_sx_juniorxxxxxxxxxxxxx = $(".id_banner_categoria[value='manchette_sx_juniorxxxxxxxxxxxxx']").parent().find("div");
    $target_manchette_dx_juniorxxxxxxxxxxxxx = $(".id_banner_categoria[value='manchette_dx_juniorxxxxxxxxxxxxx']").parent().find("div");
    $target_sub_header_juniorxxxxxxxxxxxxxxx = $(".id_banner_categoria[value='sub_header_juniorxxxxxxxxxxxxxxx']").parent().find("div");
    $target_sotto_prima_notizia_juniorxxxxxx = $(".id_banner_categoria[value='sotto_prima_notizia_juniorxxxxxx']").parent().find("div");
    $target_sotto_archivio_video_juniorxxxxx = $(".id_banner_categoria[value='sotto_archivio_video_juniorxxxxx']").parent().find("div");
    $target_sotto_latest_match_juniorxxxxxxx = $(".id_banner_categoria[value='sotto_latest_match_juniorxxxxxxx']").parent().find("div");
    $target_sotto_next_match_juniorxxxxxxxxx = $(".id_banner_categoria[value='sotto_next_match_juniorxxxxxxxxx']").parent().find("div");
    $target_sotto_ris_class_juniorxxxxxxxxxx = $(".id_banner_categoria[value='sotto_ris_class_juniorxxxxxxxxxx']").parent().find("div");
    $target_sotto_coolest_sport_juniorxxxxxx = $(".id_banner_categoria[value='sotto_coolest_sport_juniorxxxxxx']").parent().find("div");

    		
	$(function() {
		$("a[rel='_blank']").attr("target","_blank");				
	});
	
  	//$('a[rel*=facebox]').facebox();
	//$('a.modal').facebox();
	
	$.urlParam = function(name){
		var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
		if(results) {
			return results[1] || 0;
		}
	};
	
	jQuery.fn.delay = function(time,func){
		this.each(function(){
			setTimeout(func,time);
		});	
	   return this;
	}; 
	
	// INIZIO FUNZIONE MENU BOXES
	$(function() {
		function addBox(){
  			$(this).find('div.menu-box').show();
			$(this).children('a').addClass('_hover');
		}
		function removeBox(){
  			$(this).find('div.menu-box').hide();
			$(this).children('a').removeClass('_hover');
		}
		var menuBox = {    
     		interval: 0,
     		sensitivity: 7,
			over: addBox,
			timeout: 0,
     		out: removeBox
     	};
		$('#nav').children('li').each(function(){
			$(this).hoverIntent(menuBox);
			$(this).children('a').click(function(){
				return false
			});
		});
	});
	// FINE FUNZIONE FUNZIONE MENU BOXES
	
	// INIZIO FUNZIONE ROUNDED LINK BOXES
	$(function() {
		$('.rounded-text-link').each(function(){
			var _htmlStr = $(this).html();
			$(this).html('<span class="left-corners"></span><span class="text-link">'+_htmlStr+'</span><span class="right-corners"></span>');
		});
	});
	// FINE FUNZIONE ROUNDED LINK BOXES
	
	// INIZIO FUNZIONE POPUP
	$(function() {
		var popupRE = /external\[(\d+),(\d+)\]/gi;
		var links = $('a[rel^="external"]');
		var rel, width, height;
 
		links.click(function() {
  			rel = $(this).attr('rel');
  			if(rel == "external") {
    			window.open($(this).attr('href'));
    			return false;
  			} else if(rel.match(popupRE)) {
    			width = RegExp.$1;
    			height = RegExp.$2;
    			window.open($(this).attr('href'), '', 'width=' + width + ',height=' + height + ', scrollbars=no', 'resizable=no', 'status=no', 'menubar=no', 'toolbar=no');
    			return false;
  			}
		});		
	});
	// FINE FUNZIONE POPUP
		
	// INIZIO FUNZIONE SEARCH BOX
	$(function() {
		$('#search-site').bind("click", function(){
			$('.search-site-options').fadeIn();
		});
		$('#search-site').bind("dblclick", function(){
      		$('.search-site-options').fadeOut();
    	});
		/*$('html').bind("click", function(){
      		$('.search-site-options').fadeOut();
			return false
    	});*/
		$('.option-radiogold').bind("click", function(){
      		$('.search-site-options').fadeOut();
			return false
    	});
		$('.option-google').bind("click", function(){
      		$('.search-site-options').fadeOut();
			return false
    	});
	});
	// FINE FUNZIONE SEARCH BOX
	
	// INIZIO FUNZIONE FOOTER CONTENTS
	$(function() {
		$('#footer-toggler').show();
		$('#footer-contents').hide();
		
		$('#footer-toggler').find('a').click(function(){
			$(this).parent().parent().toggleClass('show-contents');
			$('#footer-contents').slideToggle();
			var highestCol = Math.max($('#footer-summary-1 ul').height(),$('#footer-summary-2 ul').height(),$('#footer-summary-3 ul').height(),$('#footer-summary-4 ul').height());
			$('.summary ul').height(highestCol);
		return false
		});
	});
	// FINE FUNZIONE FOOTER CONTENTS
	
	// INIZIO FUNZIONE FOOTER COLUMNS EQUAL HEIGHT
	/*$(function() {
		var highestCol = Math.max($('#footer-summary-1 ul').height(),$('#footer-summary-2 ul').height(),$('#footer-summary-3 ul').height(),$('#footer-summary-4 ul').height());
		$('.summary ul').height(highestCol);
	});*/
	// FINE FUNZIONE FOOTER COLUMNS EQUAL HEIGHT
	
	// INIZIO FUNZIONE DL PALINSESTO
	$(function() {
		if($('dl.palinsesto-list').length) {
			$(this).find('span.description').hide();
			$('dl.palinsesto-list dd').find('a').click(function(){
				$(this).parent().find('span.description').toggle();
				var ddHeight = $(this).parent().height();
				$(this).parent().prev().css('height',ddHeight);
			return false
			});
			$('.palinsesto-nav').find('a').click(function(){
				$('.palinsesto-nav li a').removeClass('current');
				$(this).addClass('current');
			});
		}
	});
	// FINE FUNZIONE DL PALINSESTO
	
	// INIZIO FUNZIONE FONT SCALER

	$(function() {
		if(!$('.no-font-scaler').length) {
			$('#news').css('position','relative');
			$('#news').not('.dont-scale').append('<div id="font-scaler"> <a href="#" class="small" title="dimensione font standard">small</a> <a href="#" class="medium" title="dimensione font media">medium</a> <a href="#" class="large" title="dimensione font massima">big</a> </div>');
			$(function() {
				cookieResize('#font-scaler a', 'small');
			});
		}
	});
	// FINE FUNZIONE FONT SCALER
	
	// INIZIO FUNZIONE HIDE/SHOW COMMENTI
	/*$(function() {
		if($('.news-comments').length) {
			$('.news-comments').hide();
			$('#comments-list-toggler').click(function(){
				$('.news-comments').show();
			});
			$('#comment-post-toggler').click(function(){
				$('.news-comments').show();
			});
		}
	});*/
	// FINE FUNZIONE HIDE/SHOW COMMENTI
	
	// INIZIO FUNZIONE APPEND ICONA LINK MULTIMEDIA
	$('.get-more').getMore();
	// FINE FUNZIONE APPEND ICONA LINK MULTIMEDIA
	
	// INIZIO FUNZIONE HIDE/SHOW FORMS NEWSLETTER
	$(function() {
		if($('#subscribe').length) {
			$('#unsubscribe').hide();
			$('#intro-unsubscribe').hide();
			$('#unsuscribe-toggler').click(function(){
				if(!$('#unsubscribe').is(':visible')) {
					$('#intro-subscribe').fadeOut();
					$('#subscribe').fadeOut();
					$('#unsubscribe').fadeIn();
					$('#intro-unsubscribe').fadeIn();
				}
				return false
			});
		}
	});
	// FINE FUNZIONE HIDE/SHOW FORMS NEWSLETTER
    
    $('.get-prev-item,.get-next-item').click(function(){
        //$('#pic-holder-box-content').fadeOut();
		$('#pic-holder-box-content').slideUp();
		$('.pic-holder').addClass('loading');
        var start = $(this).attr('rel');
        $(this).delay(1000,function(){
            nextPhoto(start);
        });
        //$('#pic-holder-box').fadeIn(1000);
    });
	
    
    /*$.get("/site/include/ticker_musica.php", {}, function(data){
        $("#sezione-musica").append(data).find("ul").newsTicker();
    });*/
	
    loadBanner();
    //setTimeout("autoBanner()",timeout);
	
});


// INIZIO FUNZIONE INIZIALIZZO MODALE
$(function(){
		$.superbox.settings = {
			overlayOpacity: .8, // Background opaqueness
			loadTxt: "Loading...", // Loading text
			closeTxt: "Chiudi",
			nextTxt: "Successiva",
			prevTxt: "Precedente"
		};
		$.superbox();
});
// FINE FUNZIONE INIZIALIZZO MODALE


// INIZIO FUNZIONE AGGIUNGI COMMENTO POST
function addComment(obj) {
    $(obj).attr("disabled","disabled");
	//$('#form_commenti .textinput, #form_commenti .textarea').each(function(){
	$('.mandatory').each(function(){
       if($(this).is(':checkbox')){
		   if(!$(this).attr('checked'))
		   {
				$(this).parent().find('label').addClass('missing-field');
		   }
		   else
		   {
				$(this).parent().find('label').removeClass('missing-field');
		   }		  
	   } else {	   
		   if(!$(this).val())
		   {
				$(this).addClass('missing-field');
		   }
		   else
		   {
				$(this).removeClass('missing-field');
		   }		  
	   }
    });
    if ($('.missing-field').length == 0){
		$('<span class="tiny-loader"></span>').insertAfter('#form_commenti .submit');		
        var postStr = $("#form_commenti").formSerialize()+"&testo_codificato="+$.URLEncode($("#messaggio").val());  
        var tipo_commento = $("#form_commenti input[name='tipo_commento']").val();
        $.post('/site/include/add_comment.php',postStr,function(data){
            $('#comment-post').slideUp(1000, function() {
    			$('#comments-list').addClass('just-posted');
  			});
            switch(tipo_commento){
                case "live":
                    if(!$('#comments-list').length){
        				$('.tempo-reale-comment-list').append('<ul id="comments-list"></ul>');
        			}
        			$('#comments-list').html(data);
                    $('#comments-list-toggler').html($('#new-comments-list-toggler').text());		
        			$('#comments-list li:first').slideDown(1500);
                    $("#form_commenti .tiny-loader").remove();
                    $("#form_commenti textarea").removeAttr("value");
                    break;
                default:
                    var target = $('#start2watch'); 
                    $(document).stop().scrollTo( target , 800 );
                    if(!$('#comments-list').length){
        				$('.news-comments').append('<ul id="comments-list"></ul>');
        			}
        			$('#comments-list').html(data);
                    $('#comments-list-toggler').html($('#new-comments-list-toggler').text());		
        			$('#comments-list li:first').slideDown(1500);
                    break;
            }
            $(obj).removeAttr("disabled");			
        });
    }else{
        $(obj).removeAttr("disabled");
    }    
    return false;
}
// FINE FUNZIONE AGGIUNGI COMMENTO POST

function nextPhoto(start) 
{
    var postStr = 'start='+start;
    $.post('/site/include/next_photo.php',postStr,function(data){
        $('#pic-holder-box-content').delay(1000, function(){
            $("#pic-holder-box-content").html(data);
            document.getElementById("img-ajax").onload = function (){
                $('.pic-holder').removeClass('loading');
				//$("#pic-holder-box-content").fadeIn();
				$("#pic-holder-box-content").slideDown();
                $('#pic-holder-box-content').delay(1000, function(){
                    $("#pic-holder-box-content").find('.get-more').getMore();
                });                  
            };            
            $('.get-prev-item,.get-next-item').click(function(){
                //$('#pic-holder-box-content').fadeOut();
				//var presentHeight = $('#pic-holder-box-content').height();
				//var nextHeight = presentHeight+100+"px";
				//alert(nextHeight);
				$('#pic-holder-box-content').slideUp();
				//$('.pic-holder').css('height',nextHeight).addClass('loading');
				$('.pic-holder').addClass('loading');
                var start = $(this).attr('rel');
                nextPhoto(start);
            });            
            $(document).ready(function(){        		        		
                $.superbox.settings = {
        			overlayOpacity: .8, // Background opaqueness
        			loadTxt: "Loading...", // Loading text
        			closeTxt: "Chiudi",
        			nextTxt: "Successiva",
        			prevTxt: "Precedente",
                    classSelector: ".superbox"
        		};                
                $.superbox();
            });
        });        
    });
}

// CHECK CAMPI NEWSLETTER
function checkSubscribe() 
{
    var err = 0;
    
    if(!$('#nome').val())
    {
        $('#nome').addClass('missing-field');
        err++;
    }
    else
        $('#nome').removeClass('missing-field');
    
    if(!$('#cnome').val())
    {
        $('#cnome').addClass('missing-field');
        err++;
    }
    else
        $('#cnome').removeClass('missing-field');
        
    if(!$('#mail').val())
    {
        $('#mail').addClass('missing-field');
        err++;
    }
    else
        $('#mail').removeClass('missing-field');
        
    if(!$('#securcode').val())
    {
        $('#securcode').addClass('missing-field');
        err++;
    }
    else
        $('#securcode').removeClass('missing-field'); 
           
    if(!$('#consenso').attr('checked'))
    {
        $('#consenso').parent().find('span').addClass('missing-field');
        err++;
    }
    else
        $('#consenso').parent().find('span').removeClass('missing-field'); 
    /* controllare anche il checkbox */
    if (err == 0)
        return true;
    else
        return false;
}

function reloadVideoTab(id_link) {
    var postStr = 'id_link='+id_link;
    $.post('/site/include/get_tab_video.php',postStr,function(data){
        $('#tab-video').html(data);
		$('.get-more').append('<span></span>');
    });
}

function reloadVideoMusicaliTab(page_video_musicali) {
    var postStr = 'page_video_musicali='+page_video_musicali;
    $.post('/site/include/sidebar_video_musicali.php',postStr,function(data){
        $('#video-musicali-box').html(data);
    });
}

function loadBanner(){
    var poststr = "id_banner_categoria=";
    $(".autobanner").each(function(i){
        if (i == 0){
            poststr += $(this).find(".id_banner_categoria").val();
        }else{
            poststr += "^"+$(this).find(".id_banner_categoria").val();
        }
    });
    $.post("/site/include/getBannerAuto.php", poststr, function(data){
        $("#banner_container").html(data);
        $(".id_banner_categoria_ok").each(function(){
            var id_banner_categoria = $(this).val();
            switch(id_banner_categoria){
                case "TOPBANNERxxxxxxxxxxxxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_topbanner.push($(this).html());    
                    });                                        
                    break;
                case "14e0789505a8880963e23e40c91c3bd6":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sotto_menu.push($(this).html());    
                    });                                        
                    break;
                case "sport_wide_top_alessandria_xxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sotto_menu.push($(this).html());    
                    });                                        
                    break;
                case "sport_wide_top_casale_xxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sotto_menu.push($(this).html());    
                    });                                        
                    break;
                case "sport_wide_top_valenzana_xxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sotto_menu.push($(this).html());    
                    });                                        
                    break;
                case "5fe6ce280af32ba2816b0f0d4cff5e63":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sopra_notizie_lette_commentate.push($(this).html());    
                    });                                                                                
                    break;
                case "5fe6ce280af32ba2816b0f0d4cff5e65":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sotto_notizie_lette_commentate.push($(this).html());    
                    });                                                                                
                    break;
                case "WEB_TVxxxxxxxxxxxxxxxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sotto_gr.push($(this).html());    
                    });                                                                                
                    break;
                case "d6f21258c28da5af1123d73e47aecc1e":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sotto_sondaggio.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_meteo_xxxxxxxxxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sotto_meteo.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_spettacoli_xxxxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sotto_spettacoli.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_incontri_xxxxxxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sotto_incontri.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_feste_sagre_xxxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sotto_feste_sagre.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_concerti_xxxxxxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sotto_concerti.push($(this).html());    
                    });                                                                                
                    break;
                case "manchette_sx_xxxxxxxxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_manchette_sx.push($(this).html());    
                    });                                                                                
                    break;
                case "manchette_dx_xxxxxxxxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_manchette_dx.push($(this).html());    
                    });                                                                                
                    break;
                case "cosa_c_era_in_homepage_xxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_cosa_c_era_in_homepage.push($(this).html());    
                    });                                                                                
                    break;
                case "sport_video_alessandria_xxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sport_video_foto.push($(this).html());    
                    });                                                                                
                    break;
                case "sport_video_casale_xxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sport_video_foto.push($(this).html());    
                    });                                                                                
                    break;
                case "sport_video_valenzana_xxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sport_video_foto.push($(this).html());    
                    });                                                                                
                    break;
                case "sport_tabellino_alessandria_xxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sport_tabellino.push($(this).html());    
                    });                                                                                
                    break;
                case "sport_tabellino_casale_xxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sport_tabellino.push($(this).html());    
                    });                                                                                
                    break;
                case "sport_tabellino_valenzana_xxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sport_tabellino.push($(this).html());    
                    });                                                                                
                    break;
                case "sport_wide_bottom_alessandria_xx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sport_bottom.push($(this).html());    
                    });                                                                                
                    break;
                case "sport_wide_bottom_casale_xxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sport_bottom.push($(this).html());    
                    });                                                                                
                    break;
                case "sport_wide_bottom_valenzana_xxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sport_bottom.push($(this).html());    
                    });                                                                                
                    break;                    
                case "sport_commenti_alessandria_xxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sport_commenti.push($(this).html());    
                    });                                                                                
                    break;                    
                case "sport_commenti_casale_xxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sport_commenti.push($(this).html());    
                    });                                                                                
                    break;                    
                case "sport_commenti_valenzana_xxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        banner_sport_commenti.push($(this).html());    
                    });                                                                                
                    break; 
                
                case "TOPBANNER_alessandriaxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        TOPBANNER_alessandriaxxxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "manchette_sx_alessandriaxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        manchette_sx_alessandriaxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "manchette_dx_alessandriaxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        manchette_dx_alessandriaxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;    
                case "sub_header_alessandriaxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sub_header_alessandriaxxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_prima_notizia_alessandriax":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_prima_notizia_alessandriax.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_archivio_video_alessandria":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_archivio_video_alessandria.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_latest_match_alessandriaxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_latest_match_alessandriaxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_next_match_alessandriaxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_next_match_alessandriaxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_ris_class_alessandriaxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_ris_class_alessandriaxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_coolest_sport_alessandriax":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_coolest_sport_alessandriax.push($(this).html());    
                    });                                                                                
                    break;

                case "TOPBANNER_casalexxxxxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        TOPBANNER_casalexxxxxxxxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "manchette_sx_casalexxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        manchette_sx_casalexxxxxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "manchette_dx_casalexxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        manchette_dx_casalexxxxxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;    
                case "sub_header_casalexxxxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sub_header_casalexxxxxxxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_prima_notizia_casalexxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_prima_notizia_casalexxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_archivio_video_casalexxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_archivio_video_casalexxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_latest_match_casalexxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_latest_match_casalexxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_next_match_casalexxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_next_match_casalexxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_ris_class_casalexxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_ris_class_casalexxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_coolest_sport_casalexxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_coolest_sport_casalexxxxxx.push($(this).html());    
                    });                                                                                
                    break;

                case "TOPBANNER_valenzanaxxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        TOPBANNER_valenzanaxxxxxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "manchette_sx_valenzanaxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        manchette_sx_valenzanaxxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "manchette_dx_valenzanaxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        manchette_dx_valenzanaxxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;    
                case "sub_header_valenzanaxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sub_header_valenzanaxxxxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_prima_notizia_valenzanaxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_prima_notizia_valenzanaxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_archivio_video_valenzanaxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_archivio_video_valenzanaxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_latest_match_valenzanaxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_latest_match_valenzanaxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_next_match_valenzanaxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_next_match_valenzanaxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_ris_class_valenzanaxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_ris_class_valenzanaxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_coolest_sport_valenzanaxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_coolest_sport_valenzanaxxx.push($(this).html());    
                    });                                                                                
                    break;

                case "TOPBANNER_juniorxxxxxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        TOPBANNER_juniorxxxxxxxxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "manchette_sx_juniorxxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        manchette_sx_juniorxxxxxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "manchette_dx_juniorxxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        manchette_dx_juniorxxxxxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;    
                case "sub_header_juniorxxxxxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sub_header_juniorxxxxxxxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_prima_notizia_juniorxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_prima_notizia_juniorxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_archivio_video_juniorxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_archivio_video_juniorxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_latest_match_juniorxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_latest_match_juniorxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_next_match_juniorxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_next_match_juniorxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_ris_class_juniorxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_ris_class_juniorxxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_coolest_sport_juniorxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_coolest_sport_juniorxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "TOPBANNER_tempoliberoxxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        TOPBANNER_tempoliberoxxxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "manchette_sx_tempoliberoxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        manchette_sx_tempoliberoxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "manchette_dx_tempoliberoxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        manchette_dx_tempoliberoxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sub_header_tempoliberoxxxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sub_header_tempoliberoxxxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_prima_notizia_tempoliberox":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_prima_notizia_tempoliberox.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_cinema_tempoliberoxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_cinema_tempoliberoxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;
                case "sotto_blocco_tempoliberoxxxxxxxx":
                    $(this).parent().find(".banner_ok").each(function(){
                        if($(this).html())
                        sotto_blocco_tempoliberoxxxxxxxx.push($(this).html());    
                    });                                                                                
                    break;                                                                                                                                                                                                                                          
             }
        });
        length_banner_topbanner = banner_topbanner.length;
        length_banner_sotto_menu = banner_sotto_menu.length;
        length_banner_sopra_notizie_lette_commentate = banner_sopra_notizie_lette_commentate.length;
        length_banner_sotto_notizie_lette_commentate = banner_sotto_notizie_lette_commentate.length;
        length_banner_sotto_gr = banner_sotto_gr.length;
        length_banner_sotto_sondaggio = banner_sotto_sondaggio.length;
        length_banner_sotto_meteo = banner_sotto_meteo.length;
        length_banner_cosa_c_era_in_homepage = banner_cosa_c_era_in_homepage.length;
        length_banner_sotto_spettacoli = banner_sotto_spettacoli.length;
        length_banner_sotto_incontri = banner_sotto_incontri.length;
        length_banner_sotto_feste_sagre = banner_sotto_feste_sagre.length;
        length_banner_sotto_concerti = banner_sotto_concerti.length;
        length_banner_manchette_sx = banner_manchette_sx.length;
        length_banner_manchette_dx = banner_manchette_dx.length;
        length_banner_sport_video_foto = banner_sport_video_foto.length;
        length_banner_sport_tabellino = banner_sport_tabellino.length;
        length_banner_sport_bottom = banner_sport_bottom.length;
        length_banner_sport_commenti = banner_sport_commenti.length;

        length_TOPBANNER_tempoliberoxxxxxxxxxxx = TOPBANNER_tempoliberoxxxxxxxxxxx.length;
        length_manchette_sx_tempoliberoxxxxxxxx = manchette_sx_tempoliberoxxxxxxxx.length;
        length_manchette_dx_tempoliberoxxxxxxxx = manchette_dx_tempoliberoxxxxxxxx.length;
        length_sub_header_tempoliberoxxxxxxxxxx = sub_header_tempoliberoxxxxxxxxxx.length;
        length_sotto_prima_notizia_tempoliberox = sotto_prima_notizia_tempoliberox.length;
        length_sotto_cinema_tempoliberoxxxxxxxx = sotto_cinema_tempoliberoxxxxxxxx.length;
        length_sotto_blocco_tempoliberoxxxxxxxx = sotto_blocco_tempoliberoxxxxxxxx.length;
        
        length_TOPBANNER_alessandriaxxxxxxxxxxx = TOPBANNER_alessandriaxxxxxxxxxxx.length;
        length_manchette_sx_alessandriaxxxxxxxx = manchette_sx_alessandriaxxxxxxxx.length;
        length_manchette_dx_alessandriaxxxxxxxx = manchette_dx_alessandriaxxxxxxxx.length;
        length_sub_header_alessandriaxxxxxxxxxx = sub_header_alessandriaxxxxxxxxxx.length;
        length_sotto_prima_notizia_alessandriax = sotto_prima_notizia_alessandriax.length;
        length_sotto_archivio_video_alessandria = sotto_archivio_video_alessandria.length;
        length_sotto_latest_match_alessandriaxx = sotto_latest_match_alessandriaxx.length;
        length_sotto_next_match_alessandriaxxxx = sotto_next_match_alessandriaxxxx.length;
        length_sotto_ris_class_alessandriaxxxxx = sotto_ris_class_alessandriaxxxxx.length;
        length_sotto_coolest_sport_alessandriax = sotto_coolest_sport_alessandriax.length;

        length_TOPBANNER_casalexxxxxxxxxxxxxxxx = TOPBANNER_casalexxxxxxxxxxxxxxxx.length;
        length_manchette_sx_casalexxxxxxxxxxxxx = manchette_sx_casalexxxxxxxxxxxxx.length;
        length_manchette_dx_casalexxxxxxxxxxxxx = manchette_dx_casalexxxxxxxxxxxxx.length;
        length_sub_header_casalexxxxxxxxxxxxxxx = sub_header_casalexxxxxxxxxxxxxxx.length;
        length_sotto_prima_notizia_casalexxxxxx = sotto_prima_notizia_casalexxxxxx.length;
        length_sotto_archivio_video_casalexxxxx = sotto_archivio_video_casalexxxxx.length;
        length_sotto_latest_match_casalexxxxxxx = sotto_latest_match_casalexxxxxxx.length;
        length_sotto_next_match_casalexxxxxxxxx = sotto_next_match_casalexxxxxxxxx.length;
        length_sotto_ris_class_casalexxxxxxxxxx = sotto_ris_class_casalexxxxxxxxxx.length;
        length_sotto_coolest_sport_casalexxxxxx = sotto_coolest_sport_casalexxxxxx.length;

        length_TOPBANNER_valenzanaxxxxxxxxxxxxx = TOPBANNER_valenzanaxxxxxxxxxxxxx.length;
        length_manchette_sx_valenzanaxxxxxxxxxx = manchette_sx_valenzanaxxxxxxxxxx.length;
        length_manchette_dx_valenzanaxxxxxxxxxx = manchette_dx_valenzanaxxxxxxxxxx.length;
        length_sub_header_valenzanaxxxxxxxxxxxx = sub_header_valenzanaxxxxxxxxxxxx.length;
        length_sotto_prima_notizia_valenzanaxxx = sotto_prima_notizia_valenzanaxxx.length;
        length_sotto_archivio_video_valenzanaxx = sotto_archivio_video_valenzanaxx.length;
        length_sotto_latest_match_valenzanaxxxx = sotto_latest_match_valenzanaxxxx.length;
        length_sotto_next_match_valenzanaxxxxxx = sotto_next_match_valenzanaxxxxxx.length;
        length_sotto_ris_class_valenzanaxxxxxxx = sotto_ris_class_valenzanaxxxxxxx.length;
        length_sotto_coolest_sport_valenzanaxxx = sotto_coolest_sport_valenzanaxxx.length;

        length_TOPBANNER_juniorxxxxxxxxxxxxxxxx = TOPBANNER_juniorxxxxxxxxxxxxxxxx.length;
        length_manchette_sx_juniorxxxxxxxxxxxxx = manchette_sx_juniorxxxxxxxxxxxxx.length;
        length_manchette_dx_juniorxxxxxxxxxxxxx = manchette_dx_juniorxxxxxxxxxxxxx.length;
        length_sub_header_juniorxxxxxxxxxxxxxxx = sub_header_juniorxxxxxxxxxxxxxxx.length;
        length_sotto_prima_notizia_juniorxxxxxx = sotto_prima_notizia_juniorxxxxxx.length;
        length_sotto_archivio_video_juniorxxxxx = sotto_archivio_video_juniorxxxxx.length;
        length_sotto_latest_match_juniorxxxxxxx = sotto_latest_match_juniorxxxxxxx.length;
        length_sotto_next_match_juniorxxxxxxxxx = sotto_next_match_juniorxxxxxxxxx.length;
        length_sotto_ris_class_juniorxxxxxxxxxx = sotto_ris_class_juniorxxxxxxxxxx.length;
        length_sotto_coolest_sport_juniorxxxxxx = sotto_coolest_sport_juniorxxxxxx.length;
         
        $("#banner_container").html("");
        setTimeout("autoBanner()",timeout);        
    });    
}

/*
function autoBanner(){
    
    var poststr = "id_banner_categoria=";
    
    $(".autobanner").each(function(i){
        if (i == 0){
            poststr += $(this).find(".id_banner_categoria").val();
        }else{
            poststr += "^"+$(this).find(".id_banner_categoria").val();
        }
    });
    
    $.post("/site/include/getBannerAuto.php", poststr, function(data){
       $("#banner_container").html(data);
       
       $(".id_banner_categoria_ok").each(function(){
            var id_banner_categoria = $(this).val();
            var $target_div = $(".id_banner_categoria[value='"+id_banner_categoria+"']").parent().find("div");
            $target_div.html($(this).parent().find(".banner_ok"));
       });        
       $("#banner_container").html("");
       setTimeout("autoBanner()",timeout);
    });            
}
*/

function autoBanner(){
    //alert(banner_sport_commenti.toSource());
    var filter = /swf$/;
    if (length_banner_topbanner > 1){
        if (filter.test(banner_topbanner[index_banner_topbanner])){
    		$target_banner_topbanner.html("");
            var swfBanner = new SWFObject(banner_topbanner[index_banner_topbanner],"banner_TOPBANNERxxxxxxxxxxxxxxxxxxxxxxx",937,110,'8');
            swfBanner.addParam('wmode', 'opaque');
            swfBanner.write("TOPBANNERxxxxxxxxxxxxxxxxxxxxxxx");                        
        }else{
            $target_banner_topbanner.html(banner_topbanner[index_banner_topbanner]);    
        }        
        index_banner_topbanner++;
        if (index_banner_topbanner == length_banner_topbanner) index_banner_topbanner = 0;
    }
    if (length_banner_sotto_menu > 1){
        $target_banner_sotto_menu.html(banner_sotto_menu[index_banner_sotto_menu]);
        index_banner_sotto_menu++;
        if (index_banner_sotto_menu == length_banner_sotto_menu) index_banner_sotto_menu = 0;
    }
    if (length_banner_sopra_notizie_lette_commentate > 1){
        $target_banner_sopra_notizie_lette_commentate.html(banner_sopra_notizie_lette_commentate[index_banner_sopra_notizie_lette_commentate]);
        index_banner_sopra_notizie_lette_commentate++;
        if (index_banner_sopra_notizie_lette_commentate == length_banner_sopra_notizie_lette_commentate) index_banner_sopra_notizie_lette_commentate = 0;        
    }
    if (length_banner_sotto_notizie_lette_commentate > 1){
        $target_banner_sotto_notizie_lette_commentate.html(banner_sotto_notizie_lette_commentate[index_banner_sotto_notizie_lette_commentate]);
        index_banner_sotto_notizie_lette_commentate++;
        if (index_banner_sotto_notizie_lette_commentate == length_banner_sotto_notizie_lette_commentate) index_banner_sotto_notizie_lette_commentate = 0;        
    }    
    if (length_banner_sotto_gr > 1){
        $target_banner_sotto_gr.html(banner_sotto_gr[index_banner_sotto_gr]);
        index_banner_sotto_gr++;
        if (index_banner_sotto_gr == length_banner_sotto_gr) index_banner_sotto_gr = 0;        
    }
    if (length_banner_sotto_sondaggio > 1){
        $target_banner_sotto_sondaggio.html(banner_sotto_sondaggio[index_banner_sotto_sondaggio]);
        index_banner_sotto_sondaggio++;
        if (index_banner_sotto_sondaggio == length_banner_sotto_sondaggio) index_banner_sotto_sondaggio = 0;        
    }
    if (length_banner_sotto_meteo > 1){
        var filter_2 = /swf$/;
        if (filter_2.test(banner_sotto_meteo[index_banner_sotto_meteo])){
    		$target_banner_sotto_meteo.html("");
            swfBanner = new SWFObject(banner_sotto_meteo[index_banner_sotto_meteo],"banner_sotto_meteo_xxxxxxxxxxxxxxxxxxxx",390,60,'8');
            swfBanner.addParam('wmode', 'opaque');
            swfBanner.write("sotto_meteo_xxxxxxxxxxxxxxxxxxxx");                        
        }else{
            $target_banner_sotto_meteo.html(banner_sotto_meteo[index_banner_sotto_meteo]);    
        }        
        index_banner_sotto_meteo++;
        if (index_banner_sotto_meteo == length_banner_sotto_meteo) index_banner_sotto_meteo = 0;        
    }    

    if (length_banner_cosa_c_era_in_homepage > 1){
        $target_banner_cosa_c_era_in_homepage.html(banner_cosa_c_era_in_homepage[index_banner_cosa_c_era_in_homepage]);
        index_banner_cosa_c_era_in_homepage++;
        if (index_banner_cosa_c_era_in_homepage == length_banner_cosa_c_era_in_homepage) index_banner_cosa_c_era_in_homepage = 0;        
    }

    if (length_banner_sotto_spettacoli > 1){
        $target_banner_sotto_spettacoli.html(banner_sotto_spettacoli[index_banner_sotto_spettacoli]);
        index_banner_sotto_spettacoli++;
        if (index_banner_sotto_spettacoli == length_banner_sotto_spettacoli) index_banner_sotto_spettacoli = 0;        
    }

    if (length_banner_sotto_incontri > 1){
        $target_banner_sotto_incontri.html(banner_sotto_incontri[index_banner_sotto_incontri]);
        index_banner_sotto_incontri++;
        if (index_banner_sotto_incontri == length_banner_sotto_incontri) index_banner_sotto_incontri = 0;        
    }

    if (length_banner_sotto_feste_sagre > 1){
        $target_banner_sotto_feste_sagre.html(banner_sotto_feste_sagre[index_banner_sotto_feste_sagre]);
        index_banner_sotto_feste_sagre++;
        if (index_banner_sotto_feste_sagre == length_banner_sotto_feste_sagre) index_banner_sotto_feste_sagre = 0;        
    }

    if (length_banner_sotto_concerti > 1){
        $target_banner_sotto_concerti.html(banner_sotto_concerti[index_banner_sotto_concerti]);
        index_banner_sotto_concerti++;
        if (index_banner_sotto_concerti == length_banner_sotto_concerti) index_banner_sotto_concerti = 0;        
    }

    if (length_banner_manchette_sx > 1){
        $target_banner_manchette_sx.html(banner_manchette_sx[index_banner_manchette_sx]);
        index_banner_manchette_sx++;
        if (index_banner_manchette_sx == length_banner_manchette_sx) index_banner_manchette_sx = 0;        
    }

    if (length_banner_manchette_dx > 1){
        $target_banner_manchette_dx.html(banner_manchette_dx[index_banner_manchette_dx]);
        index_banner_manchette_dx++;
        if (index_banner_manchette_dx == length_banner_manchette_dx) index_banner_manchette_dx = 0;        
    }

    //alert(length_banner_sport_video_foto);
    if (length_banner_sport_video_foto > 1){
        //alert(banner_sport_video_foto[index_banner_sport_video_foto]);
        $target_banner_sport_video_foto.html(banner_sport_video_foto[index_banner_sport_video_foto]);
        index_banner_sport_video_foto++;
        if (index_banner_sport_video_foto == length_banner_sport_video_foto) index_banner_sport_video_foto = 0;        
    }

    if (length_banner_sport_tabellino > 1){
        $target_banner_sport_tabellino.html(banner_sport_tabellino[index_banner_sport_tabellino]);
        index_banner_sport_tabellino++;
        if (index_banner_sport_tabellino == length_banner_sport_tabellino) index_banner_sport_tabellino = 0;        
    }

    if (length_banner_sport_bottom > 1){
        $target_banner_sport_bottom.html(banner_sport_bottom[index_banner_sport_bottom]);
        index_banner_sport_bottom++;
        if (index_banner_sport_bottom == length_banner_sport_bottom) index_banner_sport_bottom = 0;        
    }

    if (length_banner_sport_commenti > 1){
        $target_banner_sport_commenti.html(banner_sport_commenti[index_banner_sport_commenti]);
        index_banner_sport_commenti++;
        if (index_banner_sport_commenti == length_banner_sport_commenti) index_banner_sport_commenti = 0;        
    }

    if (length_TOPBANNER_alessandriaxxxxxxxxxxx > 1){
        $target_TOPBANNER_alessandriaxxxxxxxxxxx.html(TOPBANNER_alessandriaxxxxxxxxxxx[index_TOPBANNER_alessandriaxxxxxxxxxxx]);
        index_TOPBANNER_alessandriaxxxxxxxxxxx++;
        if (index_TOPBANNER_alessandriaxxxxxxxxxxx == length_TOPBANNER_alessandriaxxxxxxxxxxx) index_TOPBANNER_alessandriaxxxxxxxxxxx = 0;        
    }
    if (length_manchette_sx_alessandriaxxxxxxxx > 1){
        $target_manchette_sx_alessandriaxxxxxxxx.html(manchette_sx_alessandriaxxxxxxxx[index_manchette_sx_alessandriaxxxxxxxx]);
        index_manchette_sx_alessandriaxxxxxxxx++;
        if (index_manchette_sx_alessandriaxxxxxxxx == length_manchette_sx_alessandriaxxxxxxxx) index_manchette_sx_alessandriaxxxxxxxx = 0;        
    }
    if (length_manchette_dx_alessandriaxxxxxxxx > 1){
        $target_manchette_dx_alessandriaxxxxxxxx.html(manchette_dx_alessandriaxxxxxxxx[index_manchette_dx_alessandriaxxxxxxxx]);
        index_manchette_dx_alessandriaxxxxxxxx++;
        if (index_manchette_dx_alessandriaxxxxxxxx == length_manchette_dx_alessandriaxxxxxxxx) index_manchette_dx_alessandriaxxxxxxxx = 0;        
    }
    if (length_sub_header_alessandriaxxxxxxxxxx > 1){
        $target_sub_header_alessandriaxxxxxxxxxx.html(sub_header_alessandriaxxxxxxxxxx[index_sub_header_alessandriaxxxxxxxxxx]);
        index_sub_header_alessandriaxxxxxxxxxx++;
        if (index_sub_header_alessandriaxxxxxxxxxx == length_sub_header_alessandriaxxxxxxxxxx) index_sub_header_alessandriaxxxxxxxxxx = 0;        
    }
    if (length_sotto_prima_notizia_alessandriax > 1){
        $target_sotto_prima_notizia_alessandriax.html(sotto_prima_notizia_alessandriax[index_sotto_prima_notizia_alessandriax]);
        index_sotto_prima_notizia_alessandriax++;
        if (index_sotto_prima_notizia_alessandriax == length_sotto_prima_notizia_alessandriax) index_sotto_prima_notizia_alessandriax = 0;        
    }
    if (length_sotto_archivio_video_alessandria > 1){
        $target_sotto_archivio_video_alessandria.html(sotto_archivio_video_alessandria[index_sotto_archivio_video_alessandria]);
        index_sotto_archivio_video_alessandria++;
        if (index_sotto_archivio_video_alessandria == length_sotto_archivio_video_alessandria) index_sotto_archivio_video_alessandria = 0;        
    }
     if (length_sotto_latest_match_alessandriaxx > 1){
        $target_sotto_latest_match_alessandriaxx.html(sotto_latest_match_alessandriaxx[index_sotto_latest_match_alessandriaxx]);
        index_sotto_latest_match_alessandriaxx++;
        if (index_sotto_latest_match_alessandriaxx == length_sotto_latest_match_alessandriaxx) index_sotto_latest_match_alessandriaxx = 0;        
    }
     if (length_sotto_next_match_alessandriaxxxx > 1){
        $target_sotto_next_match_alessandriaxxxx.html(sotto_next_match_alessandriaxxxx[index_sotto_next_match_alessandriaxxxx]);
        index_sotto_next_match_alessandriaxxxx++;
        if (index_sotto_next_match_alessandriaxxxx == length_sotto_next_match_alessandriaxxxx) index_sotto_next_match_alessandriaxxxx = 0;        
    }
     if (length_sotto_ris_class_alessandriaxxxxx > 1){
        $target_sotto_ris_class_alessandriaxxxxx.html(sotto_ris_class_alessandriaxxxxx[index_sotto_ris_class_alessandriaxxxxx]);
        index_sotto_ris_class_alessandriaxxxxx++;
        if (index_sotto_ris_class_alessandriaxxxxx == length_sotto_ris_class_alessandriaxxxxx) index_sotto_ris_class_alessandriaxxxxx = 0;        
    }
     if (length_sotto_coolest_sport_alessandriax > 1){
        $target_sotto_coolest_sport_alessandriax.html(sotto_coolest_sport_alessandriax[index_sotto_coolest_sport_alessandriax]);
        index_sotto_coolest_sport_alessandriax++;
        if (index_sotto_coolest_sport_alessandriax == length_sotto_coolest_sport_alessandriax) index_sotto_coolest_sport_alessandriax = 0;        
    }                            

    if (length_TOPBANNER_casalexxxxxxxxxxxxxxxx > 1){
        $target_TOPBANNER_casalexxxxxxxxxxxxxxxx.html(TOPBANNER_casalexxxxxxxxxxxxxxxx[index_TOPBANNER_casalexxxxxxxxxxxxxxxx]);
        index_TOPBANNER_casalexxxxxxxxxxxxxxxx++;
        if (index_TOPBANNER_casalexxxxxxxxxxxxxxxx == length_TOPBANNER_casalexxxxxxxxxxxxxxxx) index_TOPBANNER_casalexxxxxxxxxxxxxxxx = 0;        
    }
    if (length_manchette_sx_casalexxxxxxxxxxxxx > 1){
        $target_manchette_sx_casalexxxxxxxxxxxxx.html(manchette_sx_casalexxxxxxxxxxxxx[index_manchette_sx_casalexxxxxxxxxxxxx]);
        index_manchette_sx_casalexxxxxxxxxxxxx++;
        if (index_manchette_sx_casalexxxxxxxxxxxxx == length_manchette_sx_casalexxxxxxxxxxxxx) index_manchette_sx_casalexxxxxxxxxxxxx = 0;        
    }
    if (length_manchette_dx_casalexxxxxxxxxxxxx > 1){
        $target_manchette_dx_casalexxxxxxxxxxxxx.html(manchette_dx_casalexxxxxxxxxxxxx[index_manchette_dx_casalexxxxxxxxxxxxx]);
        index_manchette_dx_casalexxxxxxxxxxxxx++;
        if (index_manchette_dx_casalexxxxxxxxxxxxx == length_manchette_dx_casalexxxxxxxxxxxxx) index_manchette_dx_casalexxxxxxxxxxxxx = 0;        
    }
    if (length_sub_header_casalexxxxxxxxxxxxxxx > 1){
        $target_sub_header_casalexxxxxxxxxxxxxxx.html(sub_header_casalexxxxxxxxxxxxxxx[index_sub_header_casalexxxxxxxxxxxxxxx]);
        index_sub_header_casalexxxxxxxxxxxxxxx++;
        if (index_sub_header_casalexxxxxxxxxxxxxxx == length_sub_header_casalexxxxxxxxxxxxxxx) index_sub_header_casalexxxxxxxxxxxxxxx = 0;        
    }
    if (length_sotto_prima_notizia_casalexxxxxx > 1){
        $target_sotto_prima_notizia_casalexxxxxx.html(sotto_prima_notizia_casalexxxxxx[index_sotto_prima_notizia_casalexxxxxx]);
        index_sotto_prima_notizia_casalexxxxxx++;
        if (index_sotto_prima_notizia_casalexxxxxx == length_sotto_prima_notizia_casalexxxxxx) index_sotto_prima_notizia_casalexxxxxx = 0;        
    }
    if (length_sotto_archivio_video_casalexxxxx > 1){
        $target_sotto_archivio_video_casalexxxxx.html(sotto_archivio_video_casalexxxxx[index_sotto_archivio_video_casalexxxxx]);
        index_sotto_archivio_video_casalexxxxx++;
        if (index_sotto_archivio_video_casalexxxxx == length_sotto_archivio_video_casalexxxxx) index_sotto_archivio_video_casalexxxxx = 0;        
    }
     if (length_sotto_latest_match_casalexxxxxxx > 1){
        $target_sotto_latest_match_casalexxxxxxx.html(sotto_latest_match_casalexxxxxxx[index_sotto_latest_match_casalexxxxxxx]);
        index_sotto_latest_match_casalexxxxxxx++;
        if (index_sotto_latest_match_casalexxxxxxx == length_sotto_latest_match_casalexxxxxxx) index_sotto_latest_match_casalexxxxxxx = 0;        
    }
     if (length_sotto_next_match_casalexxxxxxxxx > 1){
        $target_sotto_next_match_casalexxxxxxxxx.html(sotto_next_match_casalexxxxxxxxx[index_sotto_next_match_casalexxxxxxxxx]);
        index_sotto_next_match_casalexxxxxxxxx++;
        if (index_sotto_next_match_casalexxxxxxxxx == length_sotto_next_match_casalexxxxxxxxx) index_sotto_next_match_casalexxxxxxxxx = 0;        
    }
     if (length_sotto_ris_class_casalexxxxxxxxxx > 1){
        $target_sotto_ris_class_casalexxxxxxxxxx.html(sotto_ris_class_casalexxxxxxxxxx[index_sotto_ris_class_casalexxxxxxxxxx]);
        index_sotto_ris_class_casalexxxxxxxxxx++;
        if (index_sotto_ris_class_casalexxxxxxxxxx == length_sotto_ris_class_casalexxxxxxxxxx) index_sotto_ris_class_casalexxxxxxxxxx = 0;        
    }
     if (length_sotto_coolest_sport_casalexxxxxx > 1){
        $target_sotto_coolest_sport_casalexxxxxx.html(sotto_coolest_sport_casalexxxxxx[index_sotto_coolest_sport_casalexxxxxx]);
        index_sotto_coolest_sport_casalexxxxxx++;
        if (index_sotto_coolest_sport_casalexxxxxx == length_sotto_coolest_sport_casalexxxxxx) index_sotto_coolest_sport_casalexxxxxx = 0;        
    }                            

    if (length_TOPBANNER_valenzanaxxxxxxxxxxxxx > 1){
        $target_TOPBANNER_valenzanaxxxxxxxxxxxxx.html(TOPBANNER_valenzanaxxxxxxxxxxxxx[index_TOPBANNER_valenzanaxxxxxxxxxxxxx]);
        index_TOPBANNER_valenzanaxxxxxxxxxxxxx++;
        if (index_TOPBANNER_valenzanaxxxxxxxxxxxxx == length_TOPBANNER_valenzanaxxxxxxxxxxxxx) index_TOPBANNER_valenzanaxxxxxxxxxxxxx = 0;        
    }
    if (length_manchette_sx_valenzanaxxxxxxxxxx > 1){
        $target_manchette_sx_valenzanaxxxxxxxxxx.html(manchette_sx_valenzanaxxxxxxxxxx[index_manchette_sx_valenzanaxxxxxxxxxx]);
        index_manchette_sx_valenzanaxxxxxxxxxx++;
        if (index_manchette_sx_valenzanaxxxxxxxxxx == length_manchette_sx_valenzanaxxxxxxxxxx) index_manchette_sx_valenzanaxxxxxxxxxx = 0;        
    }
    if (length_manchette_dx_valenzanaxxxxxxxxxx > 1){
        $target_manchette_dx_valenzanaxxxxxxxxxx.html(manchette_dx_valenzanaxxxxxxxxxx[index_manchette_dx_valenzanaxxxxxxxxxx]);
        index_manchette_dx_valenzanaxxxxxxxxxx++;
        if (index_manchette_dx_valenzanaxxxxxxxxxx == length_manchette_dx_valenzanaxxxxxxxxxx) index_manchette_dx_valenzanaxxxxxxxxxx = 0;        
    }
    if (length_sub_header_valenzanaxxxxxxxxxxxx > 1){
        $target_sub_header_valenzanaxxxxxxxxxxxx.html(sub_header_valenzanaxxxxxxxxxxxx[index_sub_header_valenzanaxxxxxxxxxxxx]);
        index_sub_header_valenzanaxxxxxxxxxxxx++;
        if (index_sub_header_valenzanaxxxxxxxxxxxx == length_sub_header_valenzanaxxxxxxxxxxxx) index_sub_header_valenzanaxxxxxxxxxxxx = 0;        
    }
    if (length_sotto_prima_notizia_valenzanaxxx > 1){
        $target_sotto_prima_notizia_valenzanaxxx.html(sotto_prima_notizia_valenzanaxxx[index_sotto_prima_notizia_valenzanaxxx]);
        index_sotto_prima_notizia_valenzanaxxx++;
        if (index_sotto_prima_notizia_valenzanaxxx == length_sotto_prima_notizia_valenzanaxxx) index_sotto_prima_notizia_valenzanaxxx = 0;        
    }
    if (length_sotto_archivio_video_valenzanaxx > 1){
        $target_sotto_archivio_video_valenzanaxx.html(sotto_archivio_video_valenzanaxx[index_sotto_archivio_video_valenzanaxx]);
        index_sotto_archivio_video_valenzanaxx++;
        if (index_sotto_archivio_video_valenzanaxx == length_sotto_archivio_video_valenzanaxx) index_sotto_archivio_video_valenzanaxx = 0;        
    }
     if (length_sotto_latest_match_valenzanaxxxx > 1){
        $target_sotto_latest_match_valenzanaxxxx.html(sotto_latest_match_valenzanaxxxx[index_sotto_latest_match_valenzanaxxxx]);
        index_sotto_latest_match_valenzanaxxxx++;
        if (index_sotto_latest_match_valenzanaxxxx == length_sotto_latest_match_valenzanaxxxx) index_sotto_latest_match_valenzanaxxxx = 0;        
    }
     if (length_sotto_next_match_valenzanaxxxxxx > 1){
        $target_sotto_next_match_valenzanaxxxxxx.html(sotto_next_match_valenzanaxxxxxx[index_sotto_next_match_valenzanaxxxxxx]);
        index_sotto_next_match_valenzanaxxxxxx++;
        if (index_sotto_next_match_valenzanaxxxxxx == length_sotto_next_match_valenzanaxxxxxx) index_sotto_next_match_valenzanaxxxxxx = 0;        
    }
     if (length_sotto_ris_class_valenzanaxxxxxxx > 1){
        $target_sotto_ris_class_valenzanaxxxxxxx.html(sotto_ris_class_valenzanaxxxxxxx[index_sotto_ris_class_valenzanaxxxxxxx]);
        index_sotto_ris_class_valenzanaxxxxxxx++;
        if (index_sotto_ris_class_valenzanaxxxxxxx == length_sotto_ris_class_valenzanaxxxxxxx) index_sotto_ris_class_valenzanaxxxxxxx = 0;        
    }
     if (length_sotto_coolest_sport_valenzanaxxx > 1){
        $target_sotto_coolest_sport_valenzanaxxx.html(sotto_coolest_sport_valenzanaxxx[index_sotto_coolest_sport_valenzanaxxx]);
        index_sotto_coolest_sport_valenzanaxxx++;
        if (index_sotto_coolest_sport_valenzanaxxx == length_sotto_coolest_sport_valenzanaxxx) index_sotto_coolest_sport_valenzanaxxx = 0;        
    }                            

    if (length_TOPBANNER_juniorxxxxxxxxxxxxxxxx > 1){
        $target_TOPBANNER_juniorxxxxxxxxxxxxxxxx.html(TOPBANNER_juniorxxxxxxxxxxxxxxxx[index_TOPBANNER_juniorxxxxxxxxxxxxxxxx]);
        index_TOPBANNER_juniorxxxxxxxxxxxxxxxx++;
        if (index_TOPBANNER_juniorxxxxxxxxxxxxxxxx == length_TOPBANNER_juniorxxxxxxxxxxxxxxxx) index_TOPBANNER_juniorxxxxxxxxxxxxxxxx = 0;        
    }
    if (length_manchette_sx_juniorxxxxxxxxxxxxx > 1){
        $target_manchette_sx_juniorxxxxxxxxxxxxx.html(manchette_sx_juniorxxxxxxxxxxxxx[index_manchette_sx_juniorxxxxxxxxxxxxx]);
        index_manchette_sx_juniorxxxxxxxxxxxxx++;
        if (index_manchette_sx_juniorxxxxxxxxxxxxx == length_manchette_sx_juniorxxxxxxxxxxxxx) index_manchette_sx_juniorxxxxxxxxxxxxx = 0;        
    }
    if (length_manchette_dx_juniorxxxxxxxxxxxxx > 1){
        $target_manchette_dx_juniorxxxxxxxxxxxxx.html(manchette_dx_juniorxxxxxxxxxxxxx[index_manchette_dx_juniorxxxxxxxxxxxxx]);
        index_manchette_dx_juniorxxxxxxxxxxxxx++;
        if (index_manchette_dx_juniorxxxxxxxxxxxxx == length_manchette_dx_juniorxxxxxxxxxxxxx) index_manchette_dx_juniorxxxxxxxxxxxxx = 0;        
    }
    if (length_sub_header_juniorxxxxxxxxxxxxxxx > 1){
        $target_sub_header_juniorxxxxxxxxxxxxxxx.html(sub_header_juniorxxxxxxxxxxxxxxx[index_sub_header_juniorxxxxxxxxxxxxxxx]);
        index_sub_header_juniorxxxxxxxxxxxxxxx++;
        if (index_sub_header_juniorxxxxxxxxxxxxxxx == length_sub_header_juniorxxxxxxxxxxxxxxx) index_sub_header_juniorxxxxxxxxxxxxxxx = 0;        
    }
    if (length_sotto_prima_notizia_juniorxxxxxx > 1){
        $target_sotto_prima_notizia_juniorxxxxxx.html(sotto_prima_notizia_juniorxxxxxx[index_sotto_prima_notizia_juniorxxxxxx]);
        index_sotto_prima_notizia_juniorxxxxxx++;
        if (index_sotto_prima_notizia_juniorxxxxxx == length_sotto_prima_notizia_juniorxxxxxx) index_sotto_prima_notizia_juniorxxxxxx = 0;        
    }
    if (length_sotto_archivio_video_juniorxxxxx > 1){
        $target_sotto_archivio_video_juniorxxxxx.html(sotto_archivio_video_juniorxxxxx[index_sotto_archivio_video_juniorxxxxx]);
        index_sotto_archivio_video_juniorxxxxx++;
        if (index_sotto_archivio_video_juniorxxxxx == length_sotto_archivio_video_juniorxxxxx) index_sotto_archivio_video_juniorxxxxx = 0;        
    }
     if (length_sotto_latest_match_juniorxxxxxxx > 1){
        $target_sotto_latest_match_juniorxxxxxxx.html(sotto_latest_match_juniorxxxxxxx[index_sotto_latest_match_juniorxxxxxxx]);
        index_sotto_latest_match_juniorxxxxxxx++;
        if (index_sotto_latest_match_juniorxxxxxxx == length_sotto_latest_match_juniorxxxxxxx) index_sotto_latest_match_juniorxxxxxxx = 0;        
    }
     if (length_sotto_next_match_juniorxxxxxxxxx > 1){
        $target_sotto_next_match_juniorxxxxxxxxx.html(sotto_next_match_juniorxxxxxxxxx[index_sotto_next_match_juniorxxxxxxxxx]);
        index_sotto_next_match_juniorxxxxxxxxx++;
        if (index_sotto_next_match_juniorxxxxxxxxx == length_sotto_next_match_juniorxxxxxxxxx) index_sotto_next_match_juniorxxxxxxxxx = 0;        
    }
     if (length_sotto_ris_class_juniorxxxxxxxxxx > 1){
        $target_sotto_ris_class_juniorxxxxxxxxxx.html(sotto_ris_class_juniorxxxxxxxxxx[index_sotto_ris_class_juniorxxxxxxxxxx]);
        index_sotto_ris_class_juniorxxxxxxxxxx++;
        if (index_sotto_ris_class_juniorxxxxxxxxxx == length_sotto_ris_class_juniorxxxxxxxxxx) index_sotto_ris_class_juniorxxxxxxxxxx = 0;        
    }
     if (length_sotto_coolest_sport_juniorxxxxxx > 1){
        $target_sotto_coolest_sport_juniorxxxxxx.html(sotto_coolest_sport_juniorxxxxxx[index_sotto_coolest_sport_juniorxxxxxx]);
        index_sotto_coolest_sport_juniorxxxxxx++;
        if (index_sotto_coolest_sport_juniorxxxxxx == length_sotto_coolest_sport_juniorxxxxxx) index_sotto_coolest_sport_juniorxxxxxx = 0;        
    }                            
    /*
    $ret = array("TOPBANNER_tempoliberoxxxxxxxxxxx",
                 "manchette_sx_tempoliberoxxxxxxxx",
                 "manchette_dx_tempoliberoxxxxxxxx",
                 "sub_header_tempoliberoxxxxxxxxxx",
                 "sotto_prima_notizia_tempoliberox",
                 "sotto_cinema_tempoliberoxxxxxxxx",
                 "sotto_blocco_tempoliberoxxxxxxxx");
    */

    if (length_TOPBANNER_tempoliberoxxxxxxxxxxx > 1){
        $target_TOPBANNER_tempoliberoxxxxxxxxxxx.html(TOPBANNER_tempoliberoxxxxxxxxxxx[index_TOPBANNER_tempoliberoxxxxxxxxxxx]);
        index_TOPBANNER_tempoliberoxxxxxxxxxxx++;
        if (index_TOPBANNER_tempoliberoxxxxxxxxxxx == length_TOPBANNER_tempoliberoxxxxxxxxxxx) index_TOPBANNER_tempoliberoxxxxxxxxxxx = 0;        
    }
    if (length_manchette_sx_tempoliberoxxxxxxxx > 1){
        $target_manchette_sx_tempoliberoxxxxxxxx.html(manchette_sx_tempoliberoxxxxxxxx[index_manchette_sx_tempoliberoxxxxxxxx]);
        index_manchette_sx_tempoliberoxxxxxxxx++;
        if (index_manchette_sx_tempoliberoxxxxxxxx == length_manchette_sx_tempoliberoxxxxxxxx) index_manchette_sx_tempoliberoxxxxxxxx = 0;        
    }
    if (length_manchette_dx_tempoliberoxxxxxxxx > 1){
        $target_manchette_dx_tempoliberoxxxxxxxx.html(manchette_dx_tempoliberoxxxxxxxx[index_manchette_dx_tempoliberoxxxxxxxx]);
        index_manchette_dx_tempoliberoxxxxxxxx++;
        if (index_manchette_dx_tempoliberoxxxxxxxx == length_manchette_dx_tempoliberoxxxxxxxx) index_manchette_dx_tempoliberoxxxxxxxx = 0;        
    }
    if (length_sub_header_tempoliberoxxxxxxxxxx > 1){
        $target_sub_header_tempoliberoxxxxxxxxxx.html(sub_header_tempoliberoxxxxxxxxxx[index_sub_header_tempoliberoxxxxxxxxxx]);
        index_sub_header_tempoliberoxxxxxxxxxx++;
        if (index_sub_header_tempoliberoxxxxxxxxxx == length_sub_header_tempoliberoxxxxxxxxxx) index_sub_header_tempoliberoxxxxxxxxxx = 0;        
    }
    if (length_sotto_prima_notizia_tempoliberox > 1){
        $target_sotto_prima_notizia_tempoliberox.html(sotto_prima_notizia_tempoliberox[index_sotto_prima_notizia_tempoliberox]);
        index_sotto_prima_notizia_tempoliberox++;
        if (index_sotto_prima_notizia_tempoliberox == length_sotto_prima_notizia_tempoliberox) index_sotto_prima_notizia_tempoliberox = 0;        
    }
    if (length_sotto_cinema_tempoliberoxxxxxxxx > 1){
        $target_sotto_cinema_tempoliberoxxxxxxxx.html(sotto_cinema_tempoliberoxxxxxxxx[index_sotto_cinema_tempoliberoxxxxxxxx]);
        index_sotto_cinema_tempoliberoxxxxxxxx++;
        if (index_sotto_cinema_tempoliberoxxxxxxxx == length_sotto_cinema_tempoliberoxxxxxxxx) index_sotto_cinema_tempoliberoxxxxxxxx = 0;        
    }
     if (length_sotto_blocco_tempoliberoxxxxxxxx > 1){
        $target_sotto_blocco_tempoliberoxxxxxxxx.html(sotto_blocco_tempoliberoxxxxxxxx[index_sotto_blocco_tempoliberoxxxxxxxx]);
        index_sotto_blocco_tempoliberoxxxxxxxx++;
        if (index_sotto_blocco_tempoliberoxxxxxxxx == length_sotto_blocco_tempoliberoxxxxxxxx) index_sotto_blocco_tempoliberoxxxxxxxx = 0;        
    }
              
    setTimeout("autoBanner()",timeout);                    
}


function checkMailNewsletter(obj){
    if (!$(obj).attr('value').match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})$/)) {
        alert("ATTENZIONE! Hai inserito un indirizzo e-mail non valido.");        
    }else{
        var poststr = "&email="+$(obj).val();
        $.post("/site/utils/checkMailNewsletter.php",poststr,function(data){
            var response = 1*$(data).find("response").text();
            if (response){
                $("#checkbox_newsletter input:checkbox").removeAttr("checked");
                $("#checkbox_newsletter").hide();
            }else{
                $("#checkbox_newsletter").show();
            }
        },"xml");
    }    
}


function loadEmbedVideo(obj){
    var id = $(obj).attr("rel");
    $.post("/site/utils/loadEmbedVideo.php", {id_video: id}, function(data){
       $("#live-now").html(data); 
    });
}

function loadEmbedVideoNotLive(obj){
    var poststr = "&id_video="+$(obj).attr("rel")+"&not_live=1";
    $.post("/site/utils/loadEmbedVideo.php", poststr, function(data){
       $("#live-now").html(data); 
    });
}

function getClassificaGenerale(id_form){
    var poststr = $("#"+id_form).serialize();
    $.post("/site/utils/getClassifiche.php", poststr, function(data){
       $("#classifica_generale").html(data);
       $(document).ready(function(){
            $(".highlight").parent().attr("class","table-row-highlight");
            $(".team-table tr:even").addClass('even');        
       }); 
    }); 
}

function getPrevPageVideo(obj){
    var page = 1*$("#page_video").val();
    var total_pages = 1*$("#total_pages_video").val();
    page--;
    var poststr = "&page="+page;
    if ($(obj).attr("rel") == "not_live"){
        poststr += "&not_live=1&id_video_categoria="+$("#id_video_categoria").val();
    }
    $.post("/site/utils/getArchivioVideo.php", poststr, function(data){
        $(".video-related").html(data);
        $("#page_video").val(page);
        if (page == 1){
            $(obj).hide();
        }else{
            $(obj).show();
        }
        if (page < total_pages){
            $("#next-page-video").show();
        }        
    });
}

function getNextPageVideo(obj){
    var page = 1*$("#page_video").val();
    var total_pages = 1*$("#total_pages_video").val();
    page++;    
    var poststr = "&page="+page;
    if ($(obj).attr("rel") == "not_live"){
        poststr += "&not_live=1&id_video_categoria="+$("#id_video_categoria").val();
    }
    
    $.post("/site/utils/getArchivioVideo.php", poststr, function(data){
        $(".video-related").html(data);
        $("#page_video").val(page);
        if (page == total_pages){
            $(obj).hide();
        }else{
            $(obj).show();
        }
        if (page > 1){
            $("#prev-page-video").show();
        }
    });
}
