function ReturnDomaine()
{
	var domaine=document.domain;
	return domaine+'/m';
}

function ReturnMainsite()
{
	var domaine=document.domain;
	if (domaine=='localhost'|| domaine=='192.168.10.54')
	{
		mainsite='http://www.sportweek.fr/';
	}
	else if (domaine=='forum.sportweekfoot.fr') 
	{
		mainsite='http://www.sportweekfoot.fr/';
	}
	else
	{
		mainsite='http://'+domaine+'/';
	}
	return mainsite;
}



function Show(ID)
{
	if ($("#"+ID).css("display")=='none')
	{
		$("#"+ID).css("display","");
	}
	else
	{
		$("#"+ID).css("display","none");
	}
}

function popUp2(url,nom,largeur,hauteur,scrolling)
{
  window.open(url,nom,'width=' + largeur + ',height=' + hauteur + ',left='+(Math.round((screen.width-largeur)/2))+',top='+(Math.round((screen.height-hauteur)/2))+',scrollbars='+scrolling);	
}

function AffichageBlocBEtclic(competition,ID_bloc)
{
	var domaine=ReturnDomaine();
	
	$.get("http://"+domaine+"/football.php",
		   			{ q: "bloc_betclic_cotes", competition: competition},
		   			function(data)
		   			{
		   				$('#'+ID_bloc).html(data);
		   			}
		 	);

	 return true;
		
}


function strtoupper( str ) {
    return str.toUpperCase();
}


function Getbloc(a)
{
	var domaine=ReturnDomaine();
	//alert (domaine);
	$.ajax({
		type: "GET",
		url: "http://"+domaine+"/football.php",
		data:{q: "bloc_pages"},
		dataType : "html",
		timeout:"60000",
		success: function(data){
		   				$('#bloc_livescore').html(data);
		   				 Display(ID,ID2);
		   				if(a==1)
		   				{
		   					MAJ_bloc();
		   				}
		   				}
	});

	 return true;
}

function MAJ_bloc()
{
	Getbloc(0);
	// Display('LIGUE_1','resultat');
	var domaine=ReturnDomaine();
	$.get("http://"+domaine+"/football.php",
		   			{ q: "bloc_statut"},
		   			function(data)
		   			{
		   			 				
		   				if (data=='1')
		   				{
		   					
		   					var fonc="MAJ_bloc();";
							var a=setTimeout(fonc,300000);
		   				}
		   				
		   			}
		 	);

	return true;
}


function getforum(fid) {

    $.getFeed({
        url: '/m/proxy.php?url=http://forum.sportweekfoot.fr/syndication.php?fid='+fid,
        success: function(feed) {
        
            $('#forum').html('<h2 class="spBlocTitre1">'
            + '<a href="'
            + feed.link
            + '">'
            + 'Le forum'
            + '</a>'
            + '</h2>');
            
            var html = '';
            for(var i = 0; i < feed.items.length && i < 5; i++) {
            
                var item = feed.items[i];
                
                html +='<div class="spInfosLigne" style="height:70px;overflow:hidden;position:relative;">';
                html +='<a class="spBloc1Link1" href="' + item.link + '">'+ item.title +' <br /> ' + item.description + '</a>'
                html +='<br/></div>';
                 }
        
            $('#forum').append(html);
        }    
    });
}


