var AsmClassement={
	
	current:'top14',
	
	loadForHome:function(){
		var request=new Request({
			url:PmsUrl.getBaseUrl()+'asm/classement/home?compet='+AsmClassement.current,
			onComplete:AsmClassement.onLoadForHomeComplete
		});
		
		request.send();
	},
	
	onLoadForHomeComplete:function(request){
		var result=JSON.decode(request);
		var destination=$('encartClassement');
		var output=new Array();
		
		for(var i=0; i<result.length; i++){
			if(result[i].focus=='true'){
				output.push('<li style="white-space:nowrap"><strong><span>'+result[i].classement+'.</span> '+result[i].team.infosTeam.nom[0]+' - '+result[i].infos.points+' pts</strong></li>');
			}
			else{
				output.push('<li style="white-space:nowrap"><span>'+result[i].classement+'.</span> '+result[i].team.infosTeam.nom[0]+' - '+result[i].infos.points+' pts</li>');
			}
		}
		
		destination.innerHTML=output.join('');
		
		if(AsmClassement.current=='hcup'){
			
			var imUrl='url(http://static.asm-rugby.com/public/gfx/layout/h_cup.gif)';
			var drapeauUrl='url(http://static.asm-rugby.com/public/gfx/pictos/hcup.gif)';
			
			document.getElementById('encartClassement').className="hcup";
			
			$('lienLogo').href = "http://www.ercrugby.com/fra/";
			$('classementTitre').innerHTML='<span style="color:#FFF">Journée de HCUP</span>';
			$('classementUpdate').innerHTML='Classement top 14';
		}
		else{
			var drapeauUrl='url(http://static.asm-rugby.com/public/gfx/pictos/top14.gif)';
			var imUrl='url(http://static.asm-rugby.com/public/gfx/layout/top_14.gif)';
			
			document.getElementById('encartClassement').className="top14";
			
			$('lienLogo').href = "http://www.lnr.fr/";
			$('classementTitre').innerHTML='Journée de TOP14';
			$('classementUpdate').innerHTML='Classement HCUP';
		}
		
		document.getElementById('top14').style.backgroundImage=imUrl;
		document.getElementById('classement_drapeau').style.backgroundImage=drapeauUrl;
		
		$('top14').setStyle('background-image', imUrl);
		$('classement_drapeau').setStyle('background-image', drapeauUrl);
		
		if(AsmClassement.current=='top14') AsmClassement.current='hcup';
		else AsmClassement.current='top14';
	}
	
}