$(document).ready(function(){
	$('#fade').cycle({ 
		fx:    'fade', 
		speed:  1000,
		pause: 1,
		timeout:  6000,
		before: beforeSlide,
		pager: '#header_rotation_images',
		pagerAnchorBuilder: function(idx, slide) {
			return '#header_rotation_images li:eq(' + idx + ') img'; 
		}
	 }); 
	 
	 function beforeSlide() {
		var stage = $(this).attr("class");
		$("#header_rotation_images li img").removeClass("on");
		if (stage == "one") { $("#header_rotation_images li:eq(0) img").addClass("on"); }
		if (stage == "two") { $("#header_rotation_images li:eq(1) img").addClass("on"); }
		if (stage == "three") { $("#header_rotation_images li:eq(2) img").addClass("on"); }							
	 }
});