Cufon.replace('.clip-box h4', { hover: 'True', textShadow:'0px 1px  #fff',color:'#383838'});
Cufon.replace('.rapido-title h3, .podcast-title h3', { hover: 'True', textShadow:'0px -1px  #000',color:'#fff'});
Cufon.replace('a.bt h3', { hover: 'True', textShadow:'0px 1px  #fff'});

$(document).ready(function(){
 
//ANYTHING SLIDER 
 $('#slider1')
  .anythingSlider({
   width          : 960,
   height         : 264,
   toggleControls : false,
   startStopped   : false,
   theme          : 'metallic',
   startPanel          : 1,
   enableKeyboard      : true,
   delay               : 8000,
   animationTime       : 1000,
   easing              : "easeInOutQuint",
   pauseOnHover        : true,
   resumeOnVideoEnd    : true,
   navigationFormatter : function(i, panel){ // add thumbnails as navigation links
   	return '<img src="' + anythingSliderArr[i - 1] + '" width=69 height=auto >';
   }
  })
  

// GESTION DU MENU
$('ul.topnav').superfish({
	animation:   {opacity:'show',height:'show'},
	delay:         600,
	});  

$(function(){
    //Get our elements for faster access and set overlay width
    var div = $('div.wrapper'),
    	  ul = $('ul.sub-menu'),
		  div1 = $('div.wrapper1'),
    	  ul1 = $('ul.sub-menu1'),
		  ulPadding = 15,
		  divmenu = div.parent(".menu-item");
		  div1menu = div1.parent(".menu-item");
		  
			  
    //Get menu width
    var divWidth = div.width();
	 var div1Width = div1.width();
	
    //Remove scrollbars
    div.css({overflow: 'hidden'});
	 div1.css({overflow: 'hidden'});
		
	//Find last image container
    var lastLi = ul.find('li:last-child');
	 var lastLi1 = ul1.find('li:last-child');

	divmenu.mousemove(function(e){
	 		var ulWidth = lastLi[0].offsetLeft + lastLi.outerWidth() + ulPadding;
			var baseOffset = (e.pageX - div.offset().left) * (ulWidth-divWidth) / divWidth;
			div.scrollLeft(baseOffset);
			});

	div1menu.mousemove(function(e){
	 		var ul1Width = lastLi1[0].offsetLeft + lastLi1.outerWidth() + ulPadding;
			var baseOffset = (e.pageX - div1.offset().left) * (ul1Width-div1Width) / div1Width;
			div1.scrollLeft(baseOffset);
			});
	 
    //When user move mouse over menu
    div.mousemove(function(e){
      //As images are loaded ul width increases,
      //so we recalculate it each time
      var ulWidth = lastLi[0].offsetLeft + lastLi.outerWidth() + ulPadding;
		
      var left = (e.pageX - div.offset().left) * (ulWidth-divWidth) / divWidth;
      div.scrollLeft(left);
    });
    
       //When user move mouse over menu
    div1.mousemove(function(e){
      //As images are loaded ul width increases,
      //so we recalculate it each time
      var ul1Width = lastLi1[0].offsetLeft + lastLi1.outerWidth() + ulPadding;
		      
      var left = (e.pageX - div1.offset().left) * (ul1Width-div1Width) / div1Width;
      div1.scrollLeft(left);
    });
});




// BOUTON RETOUR HAUT
$('a[href^=#]').click(function(){
			cible=$(this).attr('href');
			if($(cible).length>=1){
				hauteur=$(cible).offset().top;	
			}
			else{
				hauteur=$("a[name="+cible.substr(1,cible.length-1)+"]").offset().top;
			}
			$('html,body').animate({scrollTop:hauteur},1000);
			return false;
		});
		
});

//GESTION DES BOUTONS DU PLAYER MP3

function start_mp3_file(mp3_title,mp3_url)
{
jQuery("#jquery_jplayer").jPlayer('setFile', mp3_url);
jQuery("#player-track-title").empty();
jQuery("#player-artist").empty();
jQuery("#player-track-title").append(mp3_title);
jQuery("#player-artist").append('toto');
jQuery("#jquery_jplayer").jPlayer('play');
}

function pause_mp3_file(mp3_file)
{
jQuery("#jquery_jplayer").jPlayer('pause');
}

//OUVERTURE DU PLAYER MP3 DANS UNE NOUVELLE FENETRE
function popup_player(player_page_url) {
window.open(player_page_url,'SourdOreille_Popup_player','toolbar=no,menubar=no,resizable=no,location=no,directories=no,status=no,scrollbars=no,width=600,height=350'); 
}  


//Verification si le media utilisé pour accéder au site est un mobile
function mobileVerification() {
            if ((navigator.userAgent.indexOf("iPhone") > 0) || (navigator.userAgent.indexOf("iPod") > 0) || (navigator.userAgent.indexOf("iPad") > 0)) {
                var result = confirm("Une application iPhone existe! Souhaitez-vous la télécharger ?");
                if (result) {
                    window.location = "http://itunes.apple.com/fr/app/sourdoreille-humeurs-musicales/id430285523?mt=8";
                }
            }
/*else if (navigator.userAgent.indexOf("Android") > 0) {
                var result = confirm("Une application Android existe! Souhaitez-vous la télécharger ?");
                if (result) {
                    window.location = "[LIEN_ANDROID_A_PLACER_ICI]";
                }
            }*/
        }





