// JavaScript Document

var int, arrayNum, currentArray, newArrayNum, count;

//don't forget to remove target blank for onsite links

//test comment

var text = new Array();
text[0] = "<h4><a target=\"_blank\"  href=\"http://www.indystar.com/article/20111023/LOCAL/110230361/Doctors-fighting-childhood-obesity-begun-looking-habits-preschool-children-young-2-including-what-s-their-sippy-cups-\">MEK helps score dominant front page Star coverage</a></h4><p>Major Easy 3 Obesity prevention profiled in major Indy Star front page article. <a target=\"_blank\"  href=\"http://www.indystar.com/article/20111023/LOCAL/110230361/Doctors-fighting-childhood-obesity-begun-looking-habits-preschool-children-young-2-including-what-s-their-sippy-cups-\">[Read more...]</a></p>";
text[1] = "<h4><a href=\"releases/westgate_recieves_economic_award.html\">MEK, Daviess County capture economic development award</a></h4><p>Building Indiana magazine tapped Daviess Co, MEK for their strategic tech park work. <a href=\"releases/westgate_recieves_economic_award.html\">[Read more...]</a></p>";
text[2] = "<h4><a href=\"releases/lizton_recieves_quantum_fiber_optics.html\">Smithville lights up Hoosier town</a></h4><p>State fiber-optic &ldquo;champion&rdquo; Smithville brings super-fast Gigabit connectivity <a href=\"releases/lizton_recieves_quantum_fiber_optics.html\">[Read more...]</a></p>";
text[3] = "<h4><a href=\"whitepapers/creativeadvantage.html\">Stop Commoditizing Communication &mdash; Capture Strategic Creative</a></h4><p>Is your marketing become digital tapioca? Where's the all-compelling &ldquo;Big Idea&rdquo; that drives your brand? MEK's Creative Director serves up real answers. <a href=\"whitepapers/creativeadvantage.html\">[Read more...]</a></p>";

var img = new Array();
img[0] = "<a href=\"#\" onclick=\"rotateText(0); return false\"><img src=\"images/hpColumnSquareLight.jpg\" alt=\"Text selection link square\" width=\"17\" height=\"18\" /></a><a href=\"#\" onclick=\"rotateText(1); return false\"><img src=\"images/hpColumnSquareDark.jpg\" alt=\"Text selection link square\" width=\"17\" height=\"18\" /></a><a href=\"#\" onclick=\"rotateText(2); return false\"><img src=\"images/hpColumnSquareDark.jpg\" alt=\"Text selection link square\" width=\"17\" height=\"18\" /></a><a href=\"#\" onclick=\"rotateText(3); return false\"><img src=\"images/hpColumnSquareDark.jpg\" alt=\"Text selection link square\" width=\"17\" height=\"18\" /></a>";
img[1] = "<a href=\"#\" onclick=\"rotateText(0); return false\"><img src=\"images/hpColumnSquareDark.jpg\" alt=\"Text selection link square\" width=\"17\" height=\"18\" /></a><a href=\"#\" onclick=\"rotateText(1); return false\"><img src=\"images/hpColumnSquareLight.jpg\" alt=\"Text selection link square\" width=\"17\" height=\"18\" /></a><a href=\"#\" onclick=\"rotateText(2); return false\"><img src=\"images/hpColumnSquareDark.jpg\" alt=\"Text selection link square\" width=\"17\" height=\"18\" /></a><a href=\"#\" onclick=\"rotateText(3); return false\"><img src=\"images/hpColumnSquareDark.jpg\" alt=\"Text selection link square\" width=\"17\" height=\"18\" /></a>";
img[2] = "<a href=\"#\" onclick=\"rotateText(0); return false\"><img src=\"images/hpColumnSquareDark.jpg\" alt=\"Text selection link square\" width=\"17\" height=\"18\" /></a><a href=\"#\" onclick=\"rotateText(1); return false\"><img src=\"images/hpColumnSquareDark.jpg\" alt=\"Text selection link square\" width=\"17\" height=\"18\" /></a><a href=\"#\" onclick=\"rotateText(2); return false\"><img src=\"images/hpColumnSquareLight.jpg\" alt=\"Text selection link square\" width=\"17\" height=\"18\" /></a><a href=\"#\" onclick=\"rotateText(3); return false\"><img src=\"images/hpColumnSquareDark.jpg\" alt=\"Text selection link square\" width=\"17\" height=\"18\" /></a>";
img[3] = "<a href=\"#\" onclick=\"rotateText(0); return false\"><img src=\"images/hpColumnSquareDark.jpg\" alt=\"Text selection link square\" width=\"17\" height=\"18\" /></a><a href=\"#\" onclick=\"rotateText(1); return false\"><img src=\"images/hpColumnSquareDark.jpg\" alt=\"Text selection link square\" width=\"17\" height=\"18\" /></a><a href=\"#\" onclick=\"rotateText(2); return false\"><img src=\"images/hpColumnSquareDark.jpg\" alt=\"Text selection link square\" width=\"17\" height=\"18\" /></a><a href=\"#\" onclick=\"rotateText(3); return false\"><img src=\"images/hpColumnSquareLight.jpg\" alt=\"Text selection link square\" width=\"17\" height=\"18\" /></a>";


function rotateText(newArrayNum){
	if(newArrayNum<5){
		int = clearInterval(int); 
		display(newArrayNum);  
		int = setInterval(rotate,7000);
	} // end if
	else {
		arrayNum = 0;
		display(arrayNum);
		arrayNum++;
		int = setInterval(rotate,7000);
	} //end else
	function rotate(){
		display(arrayNum);
		if (arrayNum == text.length - 1)
			arrayNum = 0;
		else
			arrayNum++;
	} //end rotate
	
	function display(currentArray){
		document.getElementById("hpSelectionText").innerHTML = text[currentArray];
		document.getElementById("hpSelectionSquares").innerHTML = img[currentArray];
	} //end display
	
} //end rotateText

	

	
