$(document).ready(function() {

/////////////////////////////////////////////////////////////////////////////////////////////////////////
//FONT REPLACEMENTS
/////////////////////////////////////////////////////////////////////////////////////////////////////////

	Cufon.replace('#header', {hover: true});
	Cufon.replace('#footer', {hover: true});
	Cufon.replace('#mainNav a', {hover: true});
	Cufon.replace('#featureNav span');
	Cufon.replace('#productNav span');
	Cufon.replace('.home h2');
	Cufon.replace('#callouts h2');
	Cufon.replace('h1');
	Cufon.replace('.link', {hover: true});
	Cufon.replace('.productName', {hover: true});
	Cufon.replace('form.eshop legend');
	Cufon.replace('thead');
	Cufon.replace('#subtotal');


/////////////////////////////////////////////////////////////////////////////////////////////////////////
//REMOVE WORDPRESS UNNECESSARY IMAGE PADDING
/////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	$('#content p:has(img)').css('padding' , '0');	

/////////////////////////////////////////////////////////////////////////////////////////////////////////
//BUTTONS
/////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	$('.bttnImage').each(function() {
            $(this).hover(function() {
                $(this).stop().animate({ opacity: .6 }, 100);
            },
           function() {
               $(this).stop().animate({ opacity: 1 },100);
           });
        });
	
	$('.buttonimg').each(function() {
            $(this).hover(function() {
                $(this).stop().animate({ opacity: .6 }, 100);
            },
           function() {
               $(this).stop().animate({ opacity: 1 },100);
           });
        });
	
	
/////////////////////////////////////////////////////////////////////////////////////////////////////////
//VARIOUS CYCLERS
/////////////////////////////////////////////////////////////////////////////////////////////////////////

//homepage features
	$('#features').cycle({ 
		fx:     'scrollHorz', 
		speed:  500, 
		next:   '#nextFeature', 
		prev:   '#prevFeature', 
		timeout: 8000, 
		cleartypeNoBg: true, 
		after:   onAfter,
		// callback fn to remove auto pager anchors
		pagerAnchorBuilder: function(idx, slide) { return ''; } 
		
	});
	
	function onAfter() { 
		
		var currAlt = $(this).children('.hideThis').text();
		$('#description').text(currAlt); 
		
	}
	
	//homepage products
	$('#products').cycle({ 
		fx:     'fade', 
		speed:  600, 
		next:   '#nextProduct', 
		prev:   '#prevProduct',
		timeout: 0,
		cleartypeNoBg: true, 
		// callback fn to remove auto pager anchors
		pagerAnchorBuilder: function(idx, slide) { return ''; }
		
	});
	

	$('#featureNav a').hover(function() {
		   
		 $(this).fadeTo('fast', .5);
		 		
		 }, function() {
		  
		 $(this).fadeTo('fast', 1);
		 
	});
	
	$('#productNav a').hover(function() {
		   
		 $(this).fadeTo('fast', .5);
		 		
		 }, function() {
		  
		 $(this).fadeTo('fast', 1);
		 
	});


	

/////////////////////////////////////////////////////////////////////////////////////////////////////////
//MAIN NAVIGATION
/////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	//$("#mainNav li").hover(function() { //Hover over event on list item
//		$(this).css({ 'background' : 'url(../images/bkg_mainNavBttn.png) top left repeat-x; '}); //Add background color and image on hovered list item
//		$(this).find("span").show(); //Show the subnav
//	} , function() { //on hover out...
//		$(this).css({ 'background' : 'none'}); //Ditch the background
//		$(this).find("span").hide(); //Hide the subnav
//	});



});

