// JavaScript Document
		 var timer =0
		  function timeCount(){
			  if(timer==0)
			  {
				  suivant_Cheval('etalon',0);
				  suivant_Cheval('bl_horse',0);
				  setTimeout("timeCount()",5000);
			  }
			  
		  }
		function precedent_Cheval(_class){
				var tab_etalon=new Array();
				$('span.'+_class).each(
									  function(){
										  tab_etalon.push($(this));
									  }
									);
				var position=0;
				for (var j=0;j<=tab_etalon.length-1;j++){
					if(tab_etalon[j][0].style.display!='none'){
						position=j;
						break;
					}
				}
				
				if(tab_etalon.length!=0){
					if(position==0){
						tab_etalon[position].hide();
						tab_etalon[tab_etalon.length-1].show();
					}
					else
					{
						tab_etalon[position].hide();
						tab_etalon[position-1].show();
						
					}
				}
													
			}
			function suivant_Cheval(_class,time){
				timer=time;
				var tab_etalon=new Array();
				$('span.'+_class).each(
									  function(){
										  tab_etalon.push($(this));
									  }
									);
				var position=0;
				for (var j=0;j<=tab_etalon.length-1;j++){
					if(tab_etalon[j][0].style.display!='none'){
						position=j;
						break;
					}
				}
				
				if(tab_etalon.length!=0){
					if(position==tab_etalon.length-1){
						tab_etalon[position].hide();
						tab_etalon[0].show();
					}
					else
					{
						tab_etalon[position].hide();
						tab_etalon[position+1].show();
						
					}	
				}
			}
			

   $(document).ready(function(){
      
	   $('#diapo').crossSlide({
     			  sleep: 5,
				  fade: 1
				  }, [
				  { src: 'theme/106/img/diapo_photo1.jpg' }
				  ,{ src: 'theme/106/img/diapo_photo2.jpg' }
				  ]) ;
	   
	  			url = document.location.href;
				url = url.replace('http://www.harasdescours.fr/','');
				url = url.replace('fr/','');
				 if(url.indexOf("?")!=-1) {
				  url = url.substr(0,url.indexOf("?"));
				  }
			  	 $("a").each(function(i){
				  if($(this).attr('href')==url) {
				  $(this).addClass('selected');
				  }
			  	});
				 timeCount();
				
	   
      });
		 
