var diapo = 1;

$('.page_item a img').live("mouseover",
      function () {
		 if($(this).is('.courante')==false)
		 {
         var nomimage = $(this).attr("src");
		 nomimage = nomimage.replace('.png','_hover.png');
		 $(this).attr({src:nomimage});     
		 }
	  }
);

$('.page_item a img').live("mouseout",
      function () {
		 if($(this).is('.courante')==false){
			 var nomimage = $(this).attr("src");
			 nomimage = nomimage.replace('_hover.png','.png');
			 $(this).attr({src:nomimage});     }
	  }
);



$(document).ready(function(){
						   
	 var pagecourante = window.location.href;					   
	 $("#header").everyTime(5000,function() {
		
		if(diapo<5){						  
		$('#smalldiapo'+diapo).fadeOut('slow');
		$('#smalldiapo'+(diapo+1)).fadeIn('slow');
		diapo++;
		}
		else {
		$('#smalldiapo'+diapo).fadeOut('slow');
		$('#smalldiapo1').fadeIn('slow');
		diapo=1;
		}
		
		
     });
     $('a.readMorepoplist').each(function ()
		{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/lnpop.png" />');
		} );
	 $('h2#nouveautes').each(function ()
		{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/h2_nouveaute.png" />');
		} );
	 $('h2#liens').each(function ()
		{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/h2_liens.png" />');
		} );
	 $('h2#partenaires').each(function ()
		{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/h2_partenaires.png" />');
		} );
	 
	  $('h3.letcomment').each(function ()
		{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/h3_letcomment.png" />');
		} );
	    $('h3.letcomment2').each(function ()
		{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/h3_letcomment2.png" />');
		} );
	 
	  $('a.readMoreHome').each(function ()
		{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/readmore.png" border="0" />');
		} );
	  
	  	  $('a.readMoreDiapo').each(function ()
		{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/readmorediapo.png" border="0" />');
		} );
	  
	  

	
	  
	    $('.widget_categories h2').each(function ()
		{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/categorieh2.png" border="0" />');
		} );
	 
	 
	   $('.widget_archive h2').each(function ()
		{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/archiveh2.png" border="0" class="imgspacer"/>');
		} );
	   
	   
	      $('.widget_popularity_lists h2').each(function ()
		{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/articlespopulaires.png" border="0" />');
		} );
	   
	     $("a[rel='category tag']").each(function ()
		{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/voirtous.png" border="0" align="absmiddle" />');
		} );
	 
	 
	 
	 
	 
	 
	  $('#sidebar li.cat-item a').each(function ()
		{
			 var imgtoload=$(this).html();
			 $(this).html('<img src="/wp-content/themes/ramonev2/images/cat/'+imgtoload+'.png" border="0"/>');
		} );
	 
	 $('h2.pagetitle').each(function ()
		{
			 var imgtoload=$(this).html();
			 $(this).html('<img src="/wp-content/themes/ramonev2/images/cat/archive'+imgtoload+'.png" border="0"/>');
		} );
	 
	 $('#popmiddle').each(function ()
		{
			 //var contenttoload=$('#popularity-lists-1').html();
			 //$(this).html(contenttoload);
		} );
	 
	 //ONGLET PORTFOLIOREALISATION
	 
	 $('#branding li.page-item-829 a').each(function ()
		{
			if ($('#branding li.page-item-829').is(".current_page_item")==false){
			$(this).html('<img src="/wp-content/themes/ramonev2/images/onglet/portfolio_off.png" border="0" align="absbottom"/>');
			}
			else{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/onglet/portfolio_on.png" border="0" align="absbottom" class="courante"/>');
			}
		} );
	 
	 //ONGLET ACTU
	 
	 $('#branding li.page-item-831 a').each(function ()
		{
			if ($('#branding li.page-item-831').is(".current_page_item")==false){
			$(this).html('<img src="/wp-content/themes/ramonev2/images/onglet/actu_off.png" border="0" align="absbottom"/>');
			}
			else{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/onglet/actu_on.png" border="0" align="absbottom" class="courante"/>');
			}
		} );
	 
	 
	 //ONGLET STUDIO
	 
	 $('#branding li.page-item-19 a').each(function ()
		{
			if ($('#branding li.page-item-19').is(".current_page_item")==false){
			$(this).html('<img src="/wp-content/themes/ramonev2/images/onglet/studio_off.png" border="0" align="absbottom"/>');
			}
			else{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/onglet/studio_on.png" border="0" align="absbottom" class="courante"/>');
			}
		} );
	 
	 //ONGLET CONTACT
	 	 $('#branding li.page-item-23 a').each(function ()
		{
			if ($('#branding li.page-item-23').is(".current_page_item")==false){
			$(this).html('<img src="/wp-content/themes/ramonev2/images/onglet/contact_off.png" border="0" align="absbottom"/>');
			}
			else{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/onglet/contact_on.png" border="0" align="absbottom"  class="courante"/>');
			}
		} );

	 //ONGLET PARTENAIRE
	 
	 	 	 $('#branding li.page-item-21 a').each(function ()
		{
			if ($('#branding li.page-item-21').is(".current_page_item")==false){
			$(this).html('<img src="/wp-content/themes/ramonev2/images/onglet/partenaire_off.png" border="0" align="absbottom" />');
			}
			else{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/onglet/partenaire_on.png" border="0" align="absbottom"  class="courante" />');
			}
		} );
			 
			  //ONGLET BLOG
	 
	 	 	 $('#branding li.page-item-1 a').each(function ()
		{
			if(pagecourante=="http://www.ram-one.com/studio/" || pagecourante=="http://www.ram-one.com/partenaires/" || pagecourante=="http://www.ram-one.com/contact/"){
			$(this).html('<img src="/wp-content/themes/ramonev2/images/onglet/portfolio_off.png" border="0" align="absbottom"/>');
			}
			else{
			$(this).html('<img src="/wp-content/themes/ramonev2/images/onglet/portfolio_on.png" border="0" align="absbottom"  class="courante" / >');
			}
		} );


         $('#btnSub').each(function ()
		{							
									$(this).replaceWith('<input type="image" src="/btnSub.gif" id="btnSub" value="Envoyer"/>');
		} );


});


