/* JavaScript Document

Developed by: 
	Mike McIntire
	Web Solutions
	April 2004
For:
	Rotating the image, caption, caption color and background color on the unh homepage.
Rights:
	May be used, modified, re-distributed freely dependant that alterations of the manner in which the code behaves
	is well documented to maintain ease of use.
*/

/* Enter width and height, respectively, for image being rotated */	
	var imgWidth = 523;
	var imgHeight = 227;

function imageToUse(picNum){			
/*The following code is where you name your images. .jpg will be automatically appended
so it is only necessary to use the file's name. Image names must be surrounded in quotes and commas must seprate items.*/


		
	var randomPics = new Array("home_lampreygth", "home_clonedgnrh", "home_gnrhorigin", "home_glycoprotein", "home_homologymodel");
	imageDisplayed = randomPics[picNum];
	return imageDisplayed;
			
}


function picsText(picNum){
	
/*place text within this array in the format in the example. Place them in the same order as the 
picture names in the above array. Captions must be surrounded in quotes and commas must seprate items.*/	
	
	
var randomPicsText = new Array(
							   "Sower, S.A. S. Moriyama, M. Kasahara, A. Takahashi, M. Nozaki, J.M. Dahlstrom and H. Kawauchi. 2006. Identification of sea lamprey GTHb cDNA and its evolutionary implications. Gen. Comp. Endocrinol. Gen. Com. Endocrinol. 148:22-32.", 
							   "Silver, M.R., N.V. Nucci, A.R. Root, K.L. Reed and S.A. Sower. 2005. Cloning and characterization of a funstional type II GnRH receptor with a lengthy carboxy-terminal tail from an ancestral vertebrate, the sea lamprey. Endocrinology. 146:3351-61.", 
							   "Kavanaugh SI, Nozaki M, Sower SA. 2008. Origins of gonadotropin-releasing hormone (GnRH) in vertebrates: identification of a novel GnRH in a basal vertebrate, the sea lamprey. Endocrinology. 149(8):3860-9. <a href='http://www.ncbi.nlm.nih.gov/pubmed/18436713?ordinalpos=1&itool=EntrezSystem2.PEntrez.Pubmed.Pubmed_ResultsPanel.Pubmed_RVDocSum' target='_blank'>PubMed</a>.", 
							   "Freamat, M., Kawauchi, H., Nozaki, M., and Sower, S.A. 2006. Identification and cloning of a glycoprotein hormone receptor from sea lamprey, Petromyzon marinus. J Mol Endocrinol <em>37</em>, 135-146.", 
							   "Freamat, M., Kawauchi, H., Nozaki, M., and Sower, S.A. 2006. Identification and cloning of a glycoprotein hormone receptor from sea lamprey, Petromyzon marinus. J Mol Endocrinol <em>37</em>, 135-146."
						   );
	textToUse =randomPicsText[picNum];			
	return textToUse; 
}
	
/* Background color of filler div.*/
	var fillerBkgnd = new Array("#a00100","#323199","#065F51","#cfd1a2","#c3e5dc"/*,"#96bde2","#00937e", "#c3e5dc"*/);
						
/* Color of text in randomPicsText */
	var captionColor = new Array("#fff","#fff", "#fff", "#000","#000"/*, "#fff", "#fff", "#000"*/);
	
			


/*  Make No Other Changes   */	


function getPicNum(){	
			var numItems = captionColor.length;
			var picNum = Math.floor(Math.random()*numItems) + 0;
			
			if(picNum >= numItems){
				picNum = 0;
				}
return picNum;
}
			//document.write("<div id='filler' style='background-color:" + fillerBkgnd[picNum] +";'><div id='holder'><div id='content'><img src=images/i/" + randomPics[picNum] + ".jpg border='0' width='" + imgWidth + "' height='"+ imgHeight + "' >  </div><div id='sidebar-b'><p style='color:" + captionColor[picNum] +"'>" +  randomPicsText[picNum] +"</p>");
			//document.write("<div id='filler'><div id='content'><img src=images/i/" + randomPics[picNum] + ".jpg border=0 width='" + imgWidth + "' height='"+ imgHeight + "' >  </div><div id='sidebar-b'><p>" +  randomPicsText[picNum] +"</p>");





