var active_slide = 0;
var last_slide = 0;
var stopped = "false";

$(function(){
		   
	$(".ui-button").button();
		   
	if(location.href.indexOf("home") != -1){
		   
		slideshow();
		
		$("#nav li a").click(function() {					  
			active_slide = $(this).attr("id");
			stopped = "true";
		});
		
	}

});

function slideshow(){
	$('#slideshow').cycle({
		fx:     'scrollLeft',
		speed:  750,
		timeout: 3000,
		pager:  '#nav',
		cleartype:  true,
		cleartypeNoBg:  true,
		pagerAnchorBuilder: function(idx, slide) {
			last_slide = idx;
			// return sel string for existing anchor
			return '#nav li:eq(' + (idx) + ') a';
		}
	});
};
