$(document).ready(function() {
//cufon
Cufon.replace('#nav > ul > li > a', {
				textShadow: '#ffcb83 1px 1px'
			});
Cufon.replace('#slogan', {
				textShadow: '#fff 1px 1px'
			});
Cufon.replace('#phones', {
				textShadow: '#fff 1px 1px'
			});
Cufon.replace('.f_title');
Cufon.replace('.widgettitle');
Cufon.replace('#works_title');
Cufon.replace('.post h1');
Cufon.replace('.indexloop h1');
Cufon.replace('.indexloop h2');
Cufon.replace('.cufon');
//jQ
 $('#slider').nivoSlider();
		$(".jQslide").jCarouselLite({
    btnNext: ".next",
    btnPrev: ".prev",
	visible: 7
		});
		
	//$('.attachment-thumbnail').wrap('<div class="fixRound" />');
	$('.attachment-thumbnail').after('<span class="portfolio-mask"></span>');
 
	
		
	$('img.category_icon').each(function(){
    var t=$(this);
    var src1= t.attr('src'); // initial src
    var newSrc = src1.substring(0, src1.lastIndexOf('.'));; // let's get file name without extension
    t.hover(function(){
        $(this).attr('src', newSrc+ '-over.' + /[^.]+$/.exec(src1)); //last part is for extension   
    }, function(){
        $(this).attr('src', newSrc + '.' + /[^.]+$/.exec(src1)); //removing '-over' from the name
    });
	});
	
	//$(".category_icon").fadeTo('fast', 0.6);
	//$(".category_icon").mouseenter(function(){
	//$(this).fadeTo('fast', 1);
	//});
	//$(".category_icon").mouseleave(function(){
	//$(this).fadeTo('fast', 0.6);
	//});
	
	//$(".portfolio-post").fadeTo('fast', 0.6);
	//$(".portfolio-post").mouseenter(function(){
	//$(this).fadeTo('fast', 1);
	//});
	//$(".portfolio-post").mouseleave(function(){
	//$(this).fadeTo('fast', 0.6);
	//});
	
	
	$("#nav > ul > li:last").addClass("last");
	$("#footerNav > ul > li:last").addClass("last");
	
//colors
      // click event for anchor tags with class of toggleLink 
      $('.colorChanger').click(function(e){ 
           // prevent page jump 
            e.preventDefault(); 
            // get href 
           var getlink = $(this).attr("title");
		$('div#colors').css("background-image", "url(/wp-content/themes/axiomauto/images/exterior_"+getlink+".png)");
      }); 
	  
	   // click event for anchor tags with class of toggleLink 
      $('.seatColorChanger').click(function(e){ 
           // prevent page jump 
            e.preventDefault(); 
            // get href 
           var getlink = $(this).attr("title");
		$('div#seats').css("background-image", "url(images/seats_"+getlink+".png)");
      }); 
});
