/////////////////////////////////////////////////////////
//		Rotator
/////////////////////////////////////////////////////////

var i = 0;
var j = 0;
var arrow = parseInt(jQuery("#arrow").css("marginTop"));
function cycleBefore() {
	if (i > 5) {
		//reset the count to zero after 6 images (0-5)
		i=0;	
	}
	if (i == 0) {
		j = 5;
		arrow = 58;
	} else {
		j = i - 1;
		arrow = arrow+55;
		
	}

	


	//animate last article to normal
	jQuery("#article"+j).animate(
							{
								borderColor:'#cccccc',
								backgroundColor:'#e2e2e2',
								color:'#04153A'

							}
	);

	jQuery("#article"+j+" a").animate(
							{
								color:'#04153A'

							}
	);

	//animate arrow
	jQuery("#arrow").animate(
						{
							marginTop: arrow + "px"
						}
	);

	//animate current article to highlight
	jQuery("#article"+i).animate(
							{
								//borderColor:'#847348',
								//backgroundColor:'#fff'
								borderColor:'#957d4a',
								backgroundColor:'#957d4a',
								color:'#ffffff'
							}
	);

	jQuery("#article"+i+" a").animate(
							{
								color:'#ffffff'

							}
	);
	
		//hide old teaser
		jQuery("#teaser_"+j).hide(500, ieRemoveFilter);
		//show new teaser
		jQuery("#teaser_"+i).show(500, ieRemoveFilter);
		
		thisArtColor = '#ffffff';
		lastArtColor = '#04153A';
		thisArtHoverColor = '#ffffff';
		lastArtHoverColor = '#ffffff';


		//increment iterator
		i++;

	
}

function ieRemoveFilter() {
  if (jQuery.browser.msie){
	this.style.removeAttribute('filter');
	}
}


function cycleAfter() {
	// clean up the hover css that jQuery changes
		//changeJ(j);
	//jQuery(".articleSlug:hover").css("color","#ffffff");
}

// have to make this outside scope so j does not change with iterator (in case you mouseout between cycles)
/*
function changeJ(thisj){

jQuery("#article"+thisj).mouseover(function () {
		//alert('mouseover #article'+thisj);
		jQuery("#article"+thisj).css("color","#ffffff");
		jQuery("#article"+thisj+" a").css("color","#ffffff");
	});

	
	
	jQuery("#article"+thisj).mouseout(function () {
		//alert('mouseout #article'+thisj);
		jQuery("#article"+thisj).css("color","#04153A");
		jQuery("#article"+thisj+" a").css("color","#04153A");

	});

}
*/


/////////////////////////////////////////////////////////
//		Fan Poll
/////////////////////////////////////////////////////////

				// use a global var
				var pieColorCount = 0;

				//set your possible colors here
					var pieColorSet = [];
					//pieColorSet[1] = '#47597F'; //dull blue
					
					pieColorSet[1] = '#0E2456'; //navy blue
					//pieColorSet[2] = '#d7ceba'; //beige
					pieColorSet[2] = '#957d4a'; //beige
					pieColorSet[3] = '#29ad76'; //green
					pieColorSet[4] = '#cccccc'; //grey
					pieColorSet[5] = '#ca474f'; //pink
					pieColorSet[6] = '#94DF6F'; //light green
					pieColorSet[7] = '#007AC2'; //light blue
					pieColorSet[8] = '#FFF04F'; //yellow

				// redefining getPieColor function
				function getPieColor() {

					if (pieColorCount == 8)
					{
						pieColorCount = 0;
					}
					pieColorCount++;
					return pieColorSet[pieColorCount];
					
				}

//make blank functions to avoid js errors (IE6 will rewrite them)
function MoreMenuOver(){
}

function MoreMenuOut(){
}