
function formatText(index, panel){
	return index + "";
}
		
$(function () {
	$('#anythingSlider1').anythingSlider({
		easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
		autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
		delay: 5000,                    // How long between slide transitions in AutoPlay mode
		startStopped: false,            // If autoPlay is on, this can force it to start stopped
		animationTime: 1000,             // How long the slide transition takes
		hashTags: true,                 // Should links change the hashtag in the URL?
		buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
		startText: "Go",             // Start text
		stopText: "Stop",               // Stop text
		navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
	});

	$('#anythingSlider2').anythingSlider({
		easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
		autoPlay: false,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
		delay: 5000,                    // How long between slide transitions in AutoPlay mode
		startStopped: false,            // If autoPlay is on, this can force it to start stopped
		animationTime: 1000,             // How long the slide transition takes
		hashTags: true,                 // Should links change the hashtag in the URL?
		buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
		startText: "Go",             // Start text
		stopText: "Stop",               // Stop text
		navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
	});
	
	$('#anythingSlider3').anythingSlider({
		easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
		autoPlay: false,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
		delay: 5000,                    // How long between slide transitions in AutoPlay mode
		startStopped: false,            // If autoPlay is on, this can force it to start stopped
		animationTime: 1000,             // How long the slide transition takes
		hashTags: true,                 // Should links change the hashtag in the URL?
		buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
		startText: "Go",             // Start text
		stopText: "Stop",               // Stop text
		navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
	});
	
});

function MM_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}

function MM_goToURL() { //v3.0
	var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
	for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

var headline_count;
var headline_interval;
var old_headline = 0;
var current_headline = 0;

var headline_count2;
var headline_interval2;
var old_headline2 = 0;
var current_headline2 = 0;
 
$(document).ready(function(){
	headline_count = $("#scrollup1 div.headline").size();
	$("#scrollup1 div.headline:eq("+current_headline+")").css('top','5px');
	headline_interval = setInterval(headline_rotate,5000); //time in milliseconds
	$('#scrollup').hover(function(){
		clearInterval(headline_interval);
	}, function() {
		headline_interval = setInterval(headline_rotate,5000); //time in milliseconds
		headline_rotate();
	});
	
	headline_count2 = $("#scrollup1 div.headline").size();
	$("#scrollup2 div.headline:eq("+current_headline2+")").css('top','5px');
	headline_interval2 = setInterval(headline_rotate2,5000); //time in milliseconds
	$('#scrollup').hover(function(){
		clearInterval(headline_interval2);
	}, function() {
		headline_interval2 = setInterval(headline_rotate2,5000); //time in milliseconds
		headline_rotate2();
	});
});

function headline_rotate(){
	current_headline = (old_headline + 1) % headline_count; 
	$("#scrollup1 div.headline:eq(" + old_headline + ")").animate({top: -205},"slow", function() {
		$(this).css('top','210px');
	});
	$("#scrollup1 div.headline:eq(" + current_headline + ")").show().animate({top: 5},"slow");  
	old_headline = current_headline;
}

function headline_rotate2(){
	current_headline2 = (old_headline2 + 1) % headline_count2; 
	$("#scrollup2 div.headline:eq(" + old_headline2 + ")").animate({top: -205},"slow", function() {
		$(this).css('top','210px');
	});
	$("#scrollup2 div.headline:eq(" + current_headline2 + ")").show().animate({top: 5},"slow");  
	old_headline2 = current_headline2;
}
