/**
 * David Sullivan for District Attorney
 * Homepage Feature Rotator
 * Author: TJ Kelly
 * Info: Glexia Inc, www.glexia.com
 * Date: 05 Feb 2009
 */


$(document).ready(function(){

	// Codereck Image Rotate
	function image_rotate(){
		var new_image = 0;
		$("#feature_rotator_tabs li").each(function(count){
			if($(this).hasClass('feature_rotator_tab_active')){
				new_image = count + 1;
				$("#feature_rotator_tabs li.feature_rotator_tab_active").removeClass('feature_rotator_tab_active');
			}
		});
		if(new_image > 3){
			new_image = 0;
		}
		$('#feature_rotator_tabs a:eq(' + new_image + ')').trigger('click');
		$('#feature_rotator_tabs a:eq(' + new_image + ')').parent("li").addClass('feature_rotator_tab_active');
	}
	
	// Initiate innerfade for large images
	//$("#feature_rotator_content").innerfade(); // Uncomment this line to restore rotating images
	
	// set class of first tab
	//$("#feature_rotator_tabs li:eq(0)").addClass('feature_rotator_tab_active'); // Uncomment this line and the one below it to restore rotating highlighted tabs
	//$.create_beat('feature_rotator_tabs', 7500, image_rotate); // Uncomment this line and the one above it to restore rotating highlighted tabs
	
});