
jQuery(function() {
    $("ul.tabs").tabs(".panes > li");
	
	$(".home #featured .navi").tabs("#featured .posts > .post", {
		effect : "fade",
		rotate : true,
	}).slideshow({
		autoplay : true,
		interval : 4000,
		clickable : false
	});
	
	var $smShare = $('.social-media-share');
	var top = $smShare.offset().top - parseFloat($smShare.css('marginTop').replace(/auto/, 0));
	$(window).scroll(function (event) {
		var y = $(this).scrollTop();
	  
		if (y >= top) {
			$smShare.addClass('scrolling');
		} else {
			$smShare.removeClass('scrolling');
		}
	});	
});

ieHover = function() {
	var sfEls = document.getElementById("sub_menu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" iehover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", ieHover);