function setjCarouselLite() {
	var numberItem = $(".focusLancio ul li").length;
	if(numberItem > 1) {
		$("#LancioPrincipale .focusLancio").jCarouselLite({
			auto:	10000,
			btnNext: "#LancioPrincipale .next",
			btnPrev: "#LancioPrincipale .prev",		
			speed: 1500,
			visible: 1,
			easing: "easeOutBack"
		});
	} else {
		$("#LancioPrincipale .next img").attr("src","/dl/RaiSport/images/btn_lancioprincipale_dx_off.png");
		$("#LancioPrincipale .prev img").attr("src","/dl/RaiSport/images/btn_lancioprincipale_sx_off.png");
		$("#LancioPrincipale .focusLancio").css("visibility","visible");
	}
	
}

function loadVideo(url) {
	$('#Video').html("");
	$('#Video').media({ 
			type: 'flv',
			width:     384, 
			height:    352, 
			autoplay:  true, 
			src:       url			
	}); 	
}
function apripopup(url,w,h,res,scroll) {
	win = window.open(url,'v','width='+w+',height='+h+',top=40,left=40,toolbar=0,directories=0,menubar=0,status=0,resizable='+res+',location=0,scrollbars='+scroll+',copyhistory=0');
	win.focus();
}

function popupRadio(theURL) {
		var w = 450;
		var h = 340;
		var x = (screen.width-w)/2;
		var y = (screen.height-h)/2;
		var style = "width="+w+", height="+h+", status=no, menubar=no, toolbar=no, scrollbar=no, top="+y+", left="+x;
		window.open('http://www.11secchi.rai.it/popupaudio.html?t='+encodeURIComponent('Catersport')+'&p='+encodeURIComponent('11 Secchi')+'&u='+encodeURIComponent(theURL), 'RadioRaiPlayer', style);
}
function changeTitle(title) {
	title = title.replace(/&#39;/g, "'");
	document.title = "CaterSport - " +title;
}


/***********************   COOKIES  --- INIZIO ********************************************************************************/
var HOST = '';
function getCookie (name) {
    var prefix = name + '=';
    var c = document.cookie;
    var nullstring = '';
    var cookieStartIndex = c.indexOf(prefix);
    if (cookieStartIndex == -1)
        return nullstring;
    var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
    if (cookieEndIndex == -1)
        cookieEndIndex = c.length;
    return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}
function setCookie (name, value, expires, path, domain, secure) {
	var today = new Date();
	today.setTime( today.getTime() );
	if ( expires ) {
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	document.cookie = name+"="+( value ) +
		( ( expires ) ? ";expires="+expires_date.toGMTString() : "" ) + //expires.toGMTString()
		( ( path ) ? ";path=" + path : "" ) +
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
}
function deleteCookie( name, path, domain ) {
if ( getCookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
/***********************  COOKIES  --- FINE ***********************************************************************************/
