//on page load
$(document).ready(function() {
	
	//remove bottom margin on last elements
	$('.spec-editorial-box:last').addClass('last');
	$('.spec-qa-box:last').addClass('last');
	
	//remove some padding from the first column cat header
	$('.column-cat-header:first').css("padding-top","0");
	
	//a little rollover magic
	$('.column-module').mouseover(function() {
		$(this).css("background-position","top right");
		$(this).siblings('.column-module-footer').css("background-position","bottom right");
	});
	
	$('.column-module').mouseout(function() {
		$(this).css("background-position","top left");
		$(this).siblings('.column-module-footer').css("background-position","bottom left");
	});
	
	//content promo box
	//$("#rotator").tabs({ fx: { opacity: 'toggle' } }).tabs('rotate', 5000);
	//$("#rotator").hover(function() {  
	//	$("#rotator").tabs("rotate",0,true);  
	//}, function() {  
	//	$("#rotator").tabs("rotate",5000,true);  
	//});
	
	$('#rotator')
			.before('<div id="featured-nav">')
			.cycle({
			fx: 'fade',
			speed: 300,
			timeout: 8000,
			pause: 1,
			pager: '#featured-nav'
		});
	
	//scrollTo
	$('.actions-spec a.prevPage').click(function() {
		$('.column-category-box').scrollTo('-=500', 800 );	
	});

	$('.actions-spec a.nextPage').click(function() {
		$('.column-category-box').scrollTo('+=500', 800 );	
	});
	
	$('li#anatomy a').click(function() {
		var loc = $(this).attr('rel');
		$('.column-category-box').scrollTo( $('p#'+loc), 800 );	
	});
	
});
