jQuery.fn.log = function (msg) {
  console.log("%s: %o", msg, this);
  return this;
};


$(document).ready(function() {
	
	//form inputs
	$('input[@title]').example(function() {
	    return $(this).attr('title');
	});
	
	//recipe slider
	$(".slider").jCarouselLite({
	    btnNext: "button.next",
	    btnPrev: "button.previous",
		easing: "easeOutSine",
		circular: false,
		visible: 2.15,
		speed: 800,
		beforeStart: function(a) {
			$('span.sliderShadow').fadeOut('fast');
		},
		afterEnd: function(a) {
			$('span.sliderShadow').fadeIn('fast');
		}
		
	});

	//pearcast hover
	$("div#pearCast a").hover(
		function () {
			$("div#pearCast").addClass("hover");
		}, 
		function () {
			$("div#pearCast").removeClass("hover");
		}
	);

	$("div#sidePearcast div.post a").hover(
		function () {
			$("div#sidePearcast div.post").addClass("hover");
		}, 
		function () {
			$("div#sidePearcast div.post").removeClass("hover");
		}
	);

	//fred dryer is the column equalizer
	$('#homeBuckets, #contentWrapper').equalHeights();

	$('ul.postsPearcast li:last').addClass('last');

	//fix stupid ie bug
	if ($.browser.msie) {
		$('hr').each(function(index) {
			var $hrClasses = $(this).attr('class');
			$(this).wrap('<div class="hr '+ $hrClasses +'"></div>')
		});
		$('div.featured').next('p').css("clear","both");
		$('input#newsletter_submit').attr("value","");
		
	}
	
/*	//ie7 only
	$.each($.browser, function(i, val) {
	  if(i=="msie" && jQuery.browser.version.substr()=="7.0")
	});
*/	
	//fix ie6 nonsense
	
	var version = jQuery.browser.version;
	if (version instanceof Object)
	    version=version.number();
	if ( jQuery.browser.msie && version < 7 ) {
		$('img[@src$=.png],#homeContent h2,.sliderShadow,ul.topNav a,a.peaRSS,span#stamp,#subhead h1,.doodles,.doodle,div.featuredData h2').ifixpng();
		
	}
	
	
	
});