var rotateStory = true;
var nextstory = 1;
var storycount = 5; //Change this to match the number of images being displayed

//Define Feature Story
var featureStoryImage = new Array();
var featureStoryLink = new Array();
var featureStoryAltText = new Array();
var featureStoryTarget = new Array();

	featureStoryImage[0] = '';
	featureStoryLink[0] = '';
	featureStoryAltText[0] = '';	
	featureStoryTarget[0] = '';	

//Feature Story One
	featureStoryImage[1] = '/images/autodeploy/27167THM1.jpg';
	featureStoryLink[1] = 'https://service.thrivent.com/forms/marketing/bewise/index.php?wssubject=banner.bewise&wssrc=hpmain';
	featureStoryAltText[1] = 'Be wise. Be generous. Be both. We can help show you the way. See how here.';	
	featureStoryTarget[1] = '_blank';
	
//Feature Story Two
	featureStoryImage[2] = '/images/autodeploy/27317THM.jpg';
	featureStoryLink[2] = '/aboutus/newsroom/features/super_baskets_of_hope.html?wssubject=banner.basketsofhope&wssrc=hpmain';
	featureStoryAltText[2] = 'Super Bowl. Super baskets. Super idea. Our members are helping families in every NFL city.';		
	featureStoryTarget[2] = '_top';	

//Feature Story Three
	featureStoryImage[3] = '/images/autodeploy/27248THM2.jpg';
	featureStoryLink[3] = 'https://service.thrivent.com/forms/marketing/ira_rollover.php?wssubject=banner.t1iraroll&wssrc=hpmain';
	featureStoryAltText[3] = 'Save time, paperwork and fees. Roll your IRAs and 401(k)s.';		
	featureStoryTarget[3] = '_top';	

//Feature Story Four
	featureStoryImage[4] = '/images/autodeploy/27238THM2.jpg';
	featureStoryLink[4] = '/wallstreettoyourstreet?wssubject=banner.wallstreet&wssrc=hpmain';
	featureStoryAltText[4] = 'Welcome to Wall Street to Your Street. Market news and analysis from our pros.';		
	featureStoryTarget[4] = '_top';		
	
//Feature Story Five
	featureStoryImage[5] = '/images/autodeploy/27103THM2.jpg';
	featureStoryLink[5] = '/marketing/investments/debt_ceiling.html?wssubject=banner.strength&wssrc=hpmain';
	featureStoryAltText[5] = 'Volatility in the markets: Thrivent Financial’s viewpoint. See our strategy';		
	featureStoryTarget[5] = '_top';
	

function rotateFeatureStory(story) {
	document.getElementById('home_banner_lnk').href = featureStoryLink[story];
	document.getElementById('home_banner_lnk').target = featureStoryTarget[story];	
	document.getElementById('home_banner_img').alt = featureStoryAltText[story];
	document.getElementById('home_banner_img').src = featureStoryImage[story];

	for (x=1; x<=storycount; x++) {
		storyId = "feature" + x;
		if (x == story) {			
			document.getElementById(storyId).className = "selectedNum";
		}
		else {
			document.getElementById(storyId).className = "";		
		}
	}

}

function stopRotation() { 
	rotateStory = false;
}

function rotateTimer() {
	if (rotateStory == true) {
		rotateFeatureStory(nextstory);
		nextstory++;
		if (nextstory > storycount) {
			nextstory = 1;
		}
		setTimeout("rotateTimer()", 4000);
	}
}
