function test(){ 
alert("In here");
} 
var interval = 8000;
var random_display = 0;
var imageDir = "video/testimonials/images/";

var imageNum = 0;

/*industryImage = new Array();
industryContent = new Array();
industryURL = new Array ();*/


var hospitalNum = 4;
hospitalImage = new Array();
hospitalContent = new Array();
hospitalURL = new Array ();

/*
industryContent[imageNum] = "Donec rhoncus, elit in vestibulum conse ctetuer, tellus ligula nonummy mi, in dapibus magna dolor sit amet mi.";
industryImage[imageNum++] = new imageItem(imageDir + "bigThumbnail_general_electric.gif");

industryContent[imageNum] =  "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat";
industryImage[imageNum++] = new imageItem(imageDir + "smallThumbnail_ibm.gif");

industryContent[imageNum] = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean eros lorem, ultrices vitae, rhoncus accumsan, egestas eleifend, enim.";
industryImage[imageNum++] = new imageItem(imageDir + "smallThumbnail_intel.gif");

industryContent[imageNum] = "Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.";
industryImage[imageNum++] = new imageItem(imageDir + "smallThumbnail_palm.gif");
*/

/*Last*/

/*First*/
hospitalContent[0] = '<h4>Saving Time</h4><p>Using PatientKeeper, clinicians save time, get the information they need, and spend more time with their patients. No more hunting for a free workstation, and having current clinical...<br /><a href="success_stories/customer_testimonials/" class="navLink">More</a><br /></p>';
hospitalURL[0] = "success_stories/customer_testimonials/";
hospitalImage[0] = new imageItem(imageDir + "MichaelBlackman_small.jpg");
/*Second*/
hospitalContent[1] = '<h4>Ease of Use</h4><p>PatientKeeper is designed by physicians for physicians. Essential patient information is always available with just a few taps.<br /><a href="success_stories/customer_testimonials/" class="navLink">More</a></p>';
hospitalURL[1] = "success_stories/customer_testimonials/";
hospitalImage[1] = new imageItem(imageDir + "PatriciaHale_small.jpg");
/*Next*/
hospitalContent[2] = '<h4>Generating Revenue</h4><p>PatientKeeper has helped healthcare organizations increase revenue and improve their cash cycle - with the savings realized often paying for the entire system many times over.<br /><a href="success_stories/customer_testimonials/" class="navLink">More</a><br /></p>';
hospitalURL[2] = "success_stories/customer_testimonials/";
hospitalImage[2] = new imageItem(imageDir + "DonaldBurt_small.jpg");

/*Next*/
hospitalContent[3] = '<h4>Enhancing Patient Safety</h4><p>PatientKeeper provides physicians with access to the latest patient information - when and where they need it - allowing them to make the most informed decisions about treatment....<br /><a href="success_stories/customer_testimonials/" class="navLink">More</a><br /></p>';
hospitalURL[3] = "success_stories/customer_testimonials/";
hospitalImage[3] = new imageItem(imageDir + "PaulDebian_small.jpg");

hospitalContent[4] = '<h4>The PatientKeeper Difference</h4><p>PatientKeeper is the First Place Winner of the TEPR 2005 Award, in the category of Mobile Applications for Use in Healthcare. Breadth of functionality, simplicity and flexibility of design...<br /><a href="success_stories/customer_testimonials/" class="navLink">More</a></p>';
hospitalURL[4] = "success_stories/customer_testimonials/";
hospitalImage[4] = new imageItem(imageDir + "JeffreyHay_small.jpg");



/*var totalIndustry = industryImage.length;*/
var totalHospital = hospitalImage.length;

function imageItem(image_location) {
	this.image_item = new Image();
	this.image_item.src = image_location;
}
function get_ImageItemLocation(imageObj) {
	return(imageObj.image_item.src)
}


function randNum(x, y) {
	var range = y - x + 1;
	return Math.floor(Math.random() * range) + x;
}

/*
function getNextIndustry() {
	if (random_display) {
		imageNum = randNum(0, totalIndustry-1);
	}
	else {
		imageNum = (imageNum+1) % totalIndustry;
	}
	var new_image = get_ImageItemLocation(industryImage[imageNum]);
	return(new_image);
}
*/

function getNextHospital() {

	if (random_display) {
		hospitalNum = randNum(0, totalHosptial-1);
	}
	else {
		hospitalNum = (hospitalNum+1) % totalHospital;
	}
	var new_image = get_ImageItemLocation(hospitalImage[hospitalNum]);
	return(new_image);
}

function switchImage(place) {

	/*place = "industryImg";
	var new_industry = getNextIndustry();
	document.getElementById('industryText').innerHTML =  industryContent[imageNum];
	document[place].src = new_industry;*/
	
	
	place = "hospitalImg";
	var new_hospital = getNextHospital();
	document.getElementById('hospitalText').innerHTML = hospitalContent[hospitalNum];
	
	document[place].src = new_hospital;	
	document.getElementById('hospitalURL').href = hospitalURL[hospitalNum];
	
	var recur_call = "switchImage('"+place+"')";
	timerID = setTimeout(recur_call, interval);
}




