var groupId = Math.floor(Math.random()*1000000000);var error_message = "Une erreur est survenue !!\n\nRaffraichissez votre navigateur...";var block1_content = '';////////////////////////////////////////////////////////////////////////////////////////////////////////////////////function findObj(theObj, theDoc){  var p, i, foundObj;    if(!theDoc) theDoc = document;  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)  {    theDoc = parent.frames[theObj.substring(p+1)].document;    theObj = theObj.substring(0,p);  }  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];  for (i=0; !foundObj && i < theDoc.forms.length; i++)     foundObj = theDoc.forms[i][theObj];  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)     foundObj = findObj(theObj,theDoc.layers[i].document);  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);  return foundObj;}////////////////////////////////////////////////////////////////////////////////////////////////////////////////////function myCallBackOnFinishUp(obj){ 	document.getElementById('block1').innerHTML = block1_content; 	//Cookie.set('ma_une_perso_active',1);	//initBlock();	//new Effect.BlindDown(obj.element.id,{duration:3,afterFinish: myCallBackOnFinishDown}); 			}////////////////////////////////////////////////////////////////////////////////////////////////////////////////////function myCallBackOnFinishDown(obj){	//alert(block1_content);	}////////////////////////////////////////////////////////////////////////////////////////////////////////////////////function active_votre_une(){			var opt = {		method: 'get',		onSuccess: function(t) {			block1_content = t.responseText;			//new Effect.BlindUp('block_votre_une',{duration:3,afterFinish: myCallBackOnFinishUp});			document.getElementById('block_votre_une').innerHTML = block1_content;		 	Cookie.set('ma_une_perso_active',1);			initBlock();					},		// Handle 404		on404: function(t) {			alert(error_message);		},		// Handle other errors		onFailure: function(t) {			alert(error_message);		}	}	new Ajax.Request('/static/your_block.php', opt);	}////////////////////////////////////////////////////////////////////////////////////////////////////////////////////function desactive_votre_une(){		var opt = {		method: 'get',		// Handle successful response		onSuccess: function(t) {			block1_content = t.responseText;			//new Effect.BlindUp('block_votre_une',{duration:3,afterFinish: myCallBackOnFinishUp});				Sortable.destroy('thelist');				Cookie.set('ma_une_perso_active',0);			document.getElementById('block_votre_une').innerHTML = block1_content;							},		// Handle 404		on404: function(t) {			alert(error_message);		},		// Handle other errors		onFailure: function(t) {			alert(error_message);		}	}		new Ajax.Request('', opt);	}var configAllOpened = false;////////////////////////////////////////////////////////////////////////////////function openConfigAll(){	var opt = {		method: 'get',		// Handle successful response		onSuccess: function(t) {			document.getElementById('config_all').innerHTML = t.responseText;			if(!forConfig)				new Effect.BlindDown('config_all');							configAllOpened = true;			forConfig = 0;						document.getElementById("block_list").innerHTML = "";			for(var i=0;i<tabBlocks.length;i++)			{				document.getElementById("block_list").innerHTML += "<li id='config_your_block_"+i+"' style='zoom:1;'><div style='float:left;zoom:1;'>"+tabBlocks[i]['title']+" ("+tabBlocks[i]['limit']+" article)</div> <div style='float:right;'><a href='javascript://' onclick='delBlock("+i+");' align='right'>X</a></div><span style='clear:both;'></span><div class='clear'></div></li>";			}						Sortable.create('block_list',{onUpdate:getNewConfig});		},		// Handle 404		on404: function(t) {			alert(error_message);		},		// Handle other errors		onFailure: function(t) {			alert(error_message);		}	}		if(!configAllOpened)		new Ajax.Request('/static/your_block_config.php', opt);		else		close_config_all();		}////////////////////////////////////////////////////////////////////////////////function delBlock(id){	var tmpData = new Array();	for(var i=0;i<tabBlocks.length;i++)	{		if(id != i)		{			if(tabBlocks[i] != 'undefined' && tabBlocks[i].id != 'undefined')			{				tmpData.push(tabBlocks[i]);			}		}	}	tabBlocks = tmpData;		var str_serialize = serialize_tabBlocks(tabBlocks);	Cookie.set('ma_une_perso',str_serialize);	Cookie.set('ma_une_perso_active',1);		setTimeout('reloadConfigAll()',100);}////////////////////////////////////////////////////////////////////////////////function reloadConfigAll(){	if(document.getElementById("block_list"))	{		document.getElementById("block_list").innerHTML = "";		for(var i=0;i<tabBlocks.length;i++)		{			document.getElementById("block_list").innerHTML += "<li id='config_your_block_"+i+"' style='zoom:1;'><div style='float:left;zoom:1;'>"+tabBlocks[i]['title']+" ("+tabBlocks[i]['limit']+" article)</div> <div style='float:right;'><a href='javascript://' onclick='delBlock("+i+");' align='right'>X</a></div><span style='clear:both;'></span><div class='clear'></div></li>";				}				Sortable.create('block_list',{onUpdate:getNewConfig});	}	if(!reloadNotAllblock)		initBlock();	reloadNotAllblock = 0;}////////////////////////////////////////////////////////////////////////////////function close_config_all(){	configAllOpened = false;	new Effect.BlindUp('config_all');}////////////////////////////////////////////////////////////////////////////////function serialize_tabBlocks(data){var str_serialize = '';	for(var i=0;i<data.length;i++)	{		if(i>0)			str_serialize+='|NEWLINE|';		str_serialize+=escape(data[i]['id'])+'|SEPARATOR|';		str_serialize+=escape(data[i]['title'])+'|SEPARATOR|';		str_serialize+=escape(data[i]['collection'])+'|SEPARATOR|';		str_serialize+=escape(data[i]['limit']);	}	return str_serialize;}//////////////////////////////////////function unserialize_tabBlocks(str){	var str = new String(str);	var data = new Array();	var data_0 = str.split('|NEWLINE|');	for(var i=0;i<data_0.length;i++)	{		var data_1 = data_0[i].split('|SEPARATOR|');		data[i] = new Array();		data[i]['id'] = unescape(data_1[0]);		data[i]['title'] = unescape(data_1[1]);		data[i]['collection'] = unescape(data_1[2]);		data[i]['limit'] = unescape(data_1[3]);	}	return data;}//////////////////////////////////////function submit_config_all(){	var str_serialize = serialize_tabBlocks(tabBlocks);	Cookie.set('ma_une_perso',str_serialize);	Cookie.set('ma_une_perso_active',1);	new Effect.BlindUp('config_all');	}////////////////////////////////////////////////////////////////////////////////function openConfig(id){	var opt = {		method: 'get',		// Handle successful response		onSuccess: function(t) {			document.getElementById('config_'+id).innerHTML = t.responseText;                   new Effect.BlindDown('config_'+id);		},		// Handle 404		on404: function(t) {			alert(error_message);		},		// Handle other errors		onFailure: function(t) {			alert(error_message);		}	}		new Ajax.Request('/static/your_block_config_2.php?id='+id+'&id_collection='+tabBlocks[(id-1)]['collection']+'&nb='+tabBlocks[(id-1)]['limit'], opt);	}////////////////////////////////////////////////////////////////////////////////function close_config(id){	new Effect.BlindUp('config_'+id);	/*document.getElementById('config_'+id).innerHTML = "";	*/}////////////////////////////////////////////////////////////////////////////////function submit_config(id){	var nb = document.getElementById('nb_article_'+id).value;	var id_collection = document.getElementById('id_collection_'+id).value;	var title = document.getElementById('id_collection_'+id).options[document.getElementById('id_collection_'+id).selectedIndex].firstChild.nodeValue;	tabBlocks[(id-1)]['title'] = title;	tabBlocks[(id-1)]['collection'] = id_collection;	tabBlocks[(id-1)]['limit'] = nb;	var str_serialize = serialize_tabBlocks(tabBlocks);	Cookie.set('ma_une_perso',str_serialize);	Cookie.set('ma_une_perso_active',1);	if(document.getElementById('config_all').style.display != 'none')	{		close_config_all();	}	initBlock();}////////////////////////////////////////////////////////////////////////////////function OpenFilInfo(url){window.open(url,'popupFI','toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=1, copyhistory=0, menuBar=0, width=767, height=570');}//////////////////////////////////////function hover(obj){	UL = obj.getElementsByTagName('ul');	SELECT    = document.getElementsByTagName('select');	if(UL.length > 0)	{		sousMenu = UL[0].style;	 		if(sousMenu.display == 'none' || sousMenu.display == '')		{			sousMenu.display = 'block';			if(document.all)			{				for(var i=0;i<SELECT.length;i++)				{					SELECT[i].style.display = 'none';				}			}		}		else		{			sousMenu.display = 'none';			if(document.all)			{				for(var i=0;i<SELECT.length;i++)				{					SELECT[i].style.display = 'block';				}			}		}	}}//////////////////////////////////////function init(){	if(document.getElementById('block_votre_une'))		setTimeout('init2()',100);}//window.onload=init;//////////////////////////////////////function init_menu(){	var objs = document.getElementsByClassName('btWithSubMenu');	objs.each(function(ob){		ob.onmouseover=function(){hover(this);};		ob.onmouseout=function(){hover(this);};	});}//////////////////////////////////////function init2(){	var myCookie = Cookie.get('ma_une_perso_active');	if(myCookie)	{		var myCookie = Cookie.get('ma_une_perso');		if(myCookie != undefined && myCookie  != "")			tabBlocks = unserialize_tabBlocks(myCookie);	}	if(tabBlocks.length == 0)	{		tabBlocks[0] = new Array();		tabBlocks[0]['id'] = 1;		tabBlocks[0]['title'] = 'Premier League';		tabBlocks[0]['collection'] = 2560;		tabBlocks[0]['limit'] = 1;				tabBlocks[1] = new Array();		tabBlocks[1]['id'] = 2;		tabBlocks[1]['title'] = 'Transferts';		tabBlocks[1]['collection'] = 2567;		tabBlocks[1]['limit'] = 1;			}	active_votre_une();}//////////////////////////////////////var tabBlocks = new Array();function initBlock(){		document.getElementById("thelist").innerHTML = "";	Position.includeScrollOffsets = true;    for(var i=0;i<tabBlocks.length;i++)	{				var li_Obj = Builder.node("li",{id:'your_block_'+(i+1),'class':'liBlockCss'});		document.getElementById("thelist").appendChild(li_Obj);				loadBlock((i+1),tabBlocks[i]['collection'],tabBlocks[i]['limit'],tabBlocks[i]['title']);	}}//////////////////////////////////////function loadBlock(id,collection,limit,title){document.getElementById('your_block_'+id).innerHTML = "<div style='text-align:center;'><img src='http://media.sporever.fr/mercato365/mediastore/images/design/loading.gif'> Chargement...</div>";	var opt = {		method: 'get',		// Handle successful response		onSuccess: function(t) {			document.getElementById('your_block_'+id).innerHTML = t.responseText;			Sortable.create('thelist',{onUpdate:getBlockConfig});					},		// Handle 404		on404: function(t) {			alert(error_message);		},		// Handle other errors		onFailure: function(t) {			alert(error_message);		}	}		new Ajax.Request('/shared/your_block_news_content.shtml?num='+id+'&collection='+collection+'&limit='+limit+'&title='+escape(title), opt);}//////////////////////////////////////// Config des blockvar forConfig = 0;var reloadNotAllblock = 0;//////////////////////////////////////var getNewConfig = function(obj){	var noueudAtraiter = obj.childNodes;	var tmpData = new Array();	for(var i=0;i<noueudAtraiter.length;i++)	{		if(noueudAtraiter[i] != 'undefined' && noueudAtraiter[i].id != 'undefined')		{			var str = new String(noueudAtraiter[i].id); 			var id = str.substr(18,3);			tmpData.push(tabBlocks[id]);		}	}	tabBlocks = tmpData;	var str_serialize = serialize_tabBlocks(tabBlocks);	Cookie.set('ma_une_perso',str_serialize);		forConfig = 1;	setTimeout('reloadConfigAll()',100);};//////////////////////////////////////var getBlockConfig = function(obj){	var noueudAtraiter = obj.childNodes;	var tmpData = new Array();	for(var i=0;i<noueudAtraiter.length;i++)	{		if(noueudAtraiter[i] != 'undefined' && noueudAtraiter[i].id != 'undefined')		{			var str = new String(noueudAtraiter[i].id); 					var id = str.substr(11,3);			tmpData.push(tabBlocks[(id-1)]);		}	}	tabBlocks = tmpData;	reloadNotAllblock = 1;	var str_serialize = serialize_tabBlocks(tabBlocks);	Cookie.set('ma_une_perso',str_serialize);	setTimeout('reloadConfigAll()',100);};//////////////////////////////////////var add_block = function(){	var nb = document.getElementById('nb_article_config').value;	var id_collection = document.getElementById('id_collection_config').value;	var title = document.getElementById('id_collection_config').options[document.getElementById('id_collection_config').selectedIndex].firstChild.nodeValue;		var id = tabBlocks.length;	var tmpData = new Array();	tmpData['id']=id;	tmpData['title'] = title;	tmpData['collection'] = id_collection;	tmpData['limit'] = nb;			tabBlocks.push(tmpData);	var str_serialize = serialize_tabBlocks(tabBlocks);	Cookie.set('ma_une_perso',str_serialize);	Cookie.set('ma_une_perso_active',1);		setTimeout('reloadConfigAll()',100);};//////////////////////////////////////var Cookie = {  set: function(name, value, daysToExpire) {    var expire = '';    daysToExpire = 9999;    if (daysToExpire != undefined) {      var d = new Date();      d.setTime(d.getTime() + (86400000 * parseFloat(daysToExpire)));      expire = '; expires=' + d.toGMTString();    }    return (document.cookie = escape(name) + '=' + escape(value || '') + expire);  },  get: function(name) {    var cookie = document.cookie.match(new RegExp('(^|;)\\s*' + escape(name) + '=([^;\\s]*)'));    return (cookie ? unescape(cookie[2]) : null);  },  erase: function(name) {    var cookie = Cookie.get(name) || true;    Cookie.set(name, '', -1);    return cookie;  },  accept: function() {    if (typeof navigator.cookieEnabled == 'boolean') {      return navigator.cookieEnabled;    }    Cookie.set('_test', '1');    return (Cookie.erase('_test') === '1');  }};function OpenAgentDeJoueurs(){window.open("/interactif/agent_de_joueurs.shtml",'popupMax','toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=0, copyhistory=0, menuBar=0, width=830, height=605');}		function GetCookie (name) {         if ( document.cookie) { // Le cookie est-il valide ?                  index = document.cookie.indexOf( name);                  if ( index != -1) {                           nDeb = (document.cookie.indexOf( "=", index) + 1);                           nFin = document.cookie.indexOf( ";", index);                           if (nFin == -1) {nFin = document.cookie.length;}                           return unescape(document.cookie.substring(nDeb, nFin));                  }         }         return null;}var initTweenJNews = function(){ posXstart = 0; posXend = 0; timerNews = 0;  var timerInterval = 10000;  var width = jQuery('#maskUne').css('width'); max = width.length - 2; width = width.substring(0, max);  //foreach #articleVignette a > mouseover var tab = document.getElementById('articleVignetteUne').getElementsByTagName('a'); for(var i = 0; i < tab.length; i++){	tab[i].index = i;	tab[i].onmouseover = function(){		var index = this.index;		posXend = (width*(index)*-1);		//Animation + décélération		jQuery('#articleUne').animate({left: posXend - 20}, {queue: false, duration: 150}).animate({left: posXend }, {queue: false, duration: 250});		posXstart = posXend;		//Réinitiasation de nextNews		clearInterval(timerNews);		timerNews = setInterval('nextNews()', timerInterval);	}	} timerNews = setInterval("nextNews()", timerInterval);}; function nextNews(){	 var size = jQuery('#articleUne').css('width');	 var width = jQuery('#maskUne').css('width');	 max = size.length - 2;	 size = size.substring(0, max);	 	 max = width.length - 2;	 width = width.substring(0, max);	 	 	 posXend -= width;	 if(posXend <= size*-1)	 posXend = 0;		 jQuery('#articleUne').animate({left: posXend -20}, {queue: false, duration: 150}).animate({left: posXend}, {queue: false, duration: 250});	 posXstart = posXend; }; var thisPage = 1;function nextVideos(){		var heightMask = jQuery('#scrollVignette').css('height');	heightMask =  parseInt(heightMask.substring(0, heightMask.length - 2));	var heightContent = document.getElementById('scrollVignetteContent').offsetHeight;	var nbPage =  Math.round(heightContent/heightMask);	if(heightContent%heightMask > 5)		nbPage++;	if(thisPage < nbPage)		thisPage++;	else		thisPage = 1;		posXendVideo = (Math.round(thisPage*heightMask) - heightMask)*-1;	jQuery('#scrollVignetteContent').animate({top: posXendVideo -20}, {queue: false, duration: 500}).animate({top: posXendVideo}, {queue: false, duration: 850}); }; function previousVideos(){		var heightMask = jQuery('#scrollVignette').css('height');	heightMask =  parseInt(heightMask.substring(0, heightMask.length - 2));	var heightContent = document.getElementById('scrollVignetteContent').offsetHeight;		var nbPage =  Math.round(heightContent/heightMask);	if(heightContent%heightMask > 5)		nbPage++;	if(thisPage > 1)		thisPage--;	else		thisPage = nbPage;		posXendVideo = (Math.round(thisPage*heightMask) - heightMask)*-1;	jQuery('#scrollVignetteContent').animate({top: posXendVideo-20}, {queue: false, duration: 500}).animate({top: posXendVideo}, {queue: false, duration: 850}); }; var brouilleURL = {		_base16: "0A12B34C56D78E9F",	encode: function (str)	{		var retour="";		for(var i=0;i<str.length;i++)		{			var cc=str.charCodeAt(i);			var ch=cc>>4;			var cl=cc-(ch*16);			retour+=this._base16[ch]+this._base16[cl];		}		return "concierge"+retour;	},	decode: function (str)	{		var retour="";		for(var i=0;i<str.length;i+=2)		{			var ch=this._base16.indexOf(str.charAt(i));			var cl=this._base16.indexOf(str.charAt(i+1));			retour+=String.fromCharCode((ch*16)+cl);		}		return retour;	},		init: function ()	{		var tagsA=document.getElementsByTagName("span");		for(var i=0;i<tagsA.length;i++)		{			if (tagsA[i].className.substring(0,3)=="365" && tagsA[i].className.length > 3)			{				var tmp    = this.decode(tagsA[i].className.substring(3)).split('|:|');				var url    = tmp[0];				var nlink  = document.createElement("a");				nlink.href = url;				if(tmp[1]) nlink.target = tmp[1];				if(tmp[2]) nlink.className = tmp[2];					nlink.innerHTML = tagsA[i].innerHTML;					tagsA[i].innerHTML = "";				tagsA[i].appendChild(nlink);			}		}	}	}