/* 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. 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("Phylogenetic Tree REV2.jpg", "His 151 in IGnRHR.jpg", "home_gnrhorigin.jpg", "gnrh3-movie.gif", "home_homologymodel.jpg");
	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(
							   "Uchida, K., S. Moriyama, H. Chiba, T. Shimotani, K. Honda, M. Miki, A. Takahashi, S.A. Sower and M. Nozaki. 2010. Evolutionary origin of a functional gonadotropin in the pituitary of the most primitive vertebrate, hagfish. Proc. Natl Acad Sci U. S. A. 07(36): 15832-15837. <a href='http://www.ncbi.nlm.nih.gov/pubmed/ 20733079?ordinalpos=1&itool=EntrezSystem2.PEntrez.Pubmed.Pubmed_ResultsPanel.Pubmed_RVDocSum' target='_blank'>PubMed</a>", 
							   "Kosugi, T. and S.A Sower. 2010. A role of Histidine (151) in the lamprey gonadotropin-releasing hormone receptor-1 (lGnRHR-1): Functional insight of diverse amino acid residues in the position of Tyr of the DRY motif in GnRHR from an ancestral type II receptor. Gen Comp Endocrinol. 166:498-503. <a href='http://www.ncbi.nlm.nih.gov/pubmed/20005226?ordinalpos=1&itool=EntrezSystem2.PEntrez.Pubmed.Pubmed_ResultsPanel.Pubmed_RVDocSum' target='_blank'>PubMed</a>", 
							   "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>.", 
							   "Joseph,N., Aquilina-Beck,A., MacDonald,C., Kavanaugh,S.I., Freamat,M., and Sower,S.A. Identification and Characterization of Two Additional Type II GnRH Receptors (lGnRH-R2 and lGnRH-R3) in the Sea Lamprey, Petromyzon marinus. Manuscript in preparation. Model of lGnRH-R3 by Wayne Decatur, using I-TASSER.", 
							   "Freamat, M. and S.A. Sower. 2010. Functional divergence of glycoprotein hormone receptors. Integrative and Comparative Biology. 50:110-123. <a href='http://icb.oxfordjournals.org/content/50/1/110.full.abstract.Oxford Journals.Pubmed_ResultsPanel.Pubmed_RVDocSum' target='_blank'>Oxford Journals</a>"
						   );
	textToUse =randomPicsText[picNum];			
	return textToUse; 
}
	
/* Background color of filler div.*/
	var fillerBkgnd = new Array("#c3e5dc","#00937e","#c3e5dc","#00937e","#c3e5dc"/*065F51","#cfd1a2","#96bde2", "#c3e5dc", "#323199", "#a00100", "#00937e"*/);
						
/* Color of text in randomPicsText */
	var captionColor = new Array("#000","#000", "#000", "#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>");






