		$(document).ready(function(){
			$("#fp_btns li").click(function(){
				var thisIndex = $(this).index();
				$("#fp_images li.active").fadeOut("fast",function(){
					$(this).removeClass("active");
					$("#fp_btns li.active").removeClass("active");
					var nextIndex = thisIndex + 1;
					$("#fp_images li:nth-child(" + nextIndex + ")").fadeIn("fast",function(){
						$(this).addClass("active");
						$("#fp_btns li:nth-child(" + nextIndex + ")").addClass("active");
					});
				});
				
			});
		});
		
		
		function rotateMain(){
			var theWidth = 950;
			var theCount = 6;

				var currentLi = $("#homeBanner li.active").index();
				if(currentLi < theCount -1){
					var nextLi = currentLi + 1;
				}else{
					var nextLi = 0;
				}
				var thePage = nextLi + 1;

			goToPageHome(thePage);	
		
		}
		
		function goToPageHome(thePage){
			var nextPos = (thePage-1) * -950;
			$("#homeBanner").animate({
				marginLeft:nextPos
			},"slow",function(){
			//alert(thePage);
				$("#homeBanner li.active").removeClass("active");
				$("#homeBanner li:nth-child(" + thePage + ")").addClass("active");
				$("#homeMarkers li.active").removeClass("active").addClass("gry");
				$("#homeMarkers li:nth-child(" + thePage + ")").addClass("active").removeClass("gry");
			});
		}
