/*
	===========================================================
	Cimarron Animal Hospital - Interface - Sequence.js
	Author: Mark C. Garity, Anchorwave.com
	===========================================================
	Description: Homepage specials.
	===========================================================
*/

jQuery(function( $ ){

	// Sliding specials of awesomeness (Homepage only)
	var $HLTarget = $('.rotate-container');
	var slideRotate = 1;
	$.scrollTo.defaults.axis = 'x'; 
	$HLTarget.stop().scrollTo( '0px', 0 );
	
	function HlSlide (item) {
		if (item==1){
			$HLTarget.stop().scrollTo( '0px', 1000 );
			slideRotate = 1;
		}else if (item==2){
			$HLTarget.stop().scrollTo( '365px', 1000 );
			slideRotate = 2;
		}else if (item==3){
			$HLTarget.stop().scrollTo( '730px', 1000 );
			slideRotate = 3;
		}
	}
	
	$(document).ready(function(){
		setInterval( function() {
			if (slideRotate==1){
				HlSlide(2);
			}else if (slideRotate==2){
				HlSlide(3);
			}else if (slideRotate==3){
				HlSlide(1);
			}
		}, 7000);
	});
	
});