//This is the list of links to go to with images below


var paragraphText = new Array();
paragraphText[0] = "<strong>Big Belly Solar Trash Compactor</strong> <br /><br />Coghlin Companies helped a team of students take their idea from an initial prototype through a cost-reduction and design for manufacturability phase, and into full production.";
paragraphText[1] = "<strong>Cynosure</strong> asked Coghlin Companies to assist with two objectives. They needed to simultaneously transition to a complex, modular, legacy product line out of their...";
paragraphText[2] = "<strong>Varian Semiconductor</strong> <br /><br />A manufacturer of semiconductor capital equipment approached Coghlin Companies requesting help with developing a high-precision positioning system to locate wafers for processing.";


var linkArray = new Array();
linkArray[0] = "caseStudies/case_study_5.php";
linkArray[1] = "caseStudies/case_study_1.php";
linkArray[2] = "caseStudies/case_study_6.php";


//This is the list of images: Must have connection to above
var images = new Array();
images[0] = "javascript/case_Study_Images/image01.jpg";
images[1] = "javascript/case_Study_Images/Cynosure-Affirm-Photo.jpg";
images[2] = "javascript/case_Study_Images/varian-01.jpg";


//This creates a random number for the index array to display a random item from the array

var arrayCount = images.length;
var position = 0;


function replace() {
	var caseStudyParagraph = document.getElementById("caseStudyParagraph");//This grabs the case Study Paragraph
	//var caseStudyParagraphText = caseStudyParagraph.firstChild.nodeValue;
	caseStudyParagraph.innerHTML  = paragraphText[position];
	var linkTarget = document.getElementById("logoChoice");//This grabs the targeted link
	var targetLink = linkTarget.getAttribute("href");	
	linkTarget.setAttribute("href",linkArray[position]);
	var caseStudyImage = document.getElementById("caseStudyImage");
	caseStudyImage.setAttribute('src',images[position]);
	if (position == arrayCount - 1) {position = 0} else {position = position + 1};

}
function replacePeriodically() {
	setInterval("replace()", 6500);
}
window.onload = replacePeriodically;


