﻿
// JScript source code

 var ArticleNum=2; 
 var NewNum=0;




function swapFaculty() 
 { 

  if(document.getElementById) 
   { 
   var thePicture=document.getElementById("FeaturedFaculty"); 

   var PicNum=rnd(ArticleNum);
   
   FacultyText(PicNum);
   } 
 } 

 
 
 
 function FacultyText(x)
    {   
        alert ("NewNum:" + NewNum + " x:" + x);
        if (x>0)  
        {       alert ("inside x>0");
                alert ("NewNum:" + NewNum + " x:" + x);
                SetArrays (x);
                NewNum=eval(parseInt(x)+1);
        }
        
        else      
        {
            if (NewNum>ArticleNum)
                {
                alert ("inside NewNum>ArticleNum");
                alert ("NewNum:" + NewNum + " x:" + x);
                NewNum=0;
                }
            alert("NewNum: " + NewNum); 
            SetArrays (NewNum);
            NewNum=NewNum+1;
         }
                
                       
    }
    
    
    function SetArrays (x)
        
     {
                alert ("inside SetArrays");
                alert("x: " + x); 
                
                var FacultyHeader = new Array(ArticleNum)
                    FacultyHeader[0]="Wernsman Seminar Series"; 
                    FacultyHeader[1]="A Symposium on Genetic Diversity in Maize and Teosinte"; 
                   
                var FacultyPic = new Array(ArticleNum)
                    FacultyPic[0]="/pictures/WernsmanSeminar.gif"; 
                    FacultyPic[1]="/pictures/MajorGoodman_Small.jpg"; 
                                    
                var FacultyAltText = new Array(ArticleNum)
                    FacultyAltText[0]="NCSU Acheive Magazine discusses Dr. Wernsman, Crops Scientists work."; 
                    FacultyAltText[1]="A Symposium on Genetic Diversity in Maize and Teosinte, honoring NCSU Crop Science Professor Dr. Major Goodman."; 

                var FacultyDetail= new Array(ArticleNum) 
                    FacultyDetail[0]="<P style='padding:5px;color:#666666;font-size:smaller;'><STRONG>Dr. Earl A. Wernsman</STRONG> - &quot; Dr. Earl A. Wernsman is a consummate scientist who is as generous with his time, ideas, and advice as he is skilled in his craft.  He is the human face of science itself.&quot; - P. Stephen Baenziger. </p><p style='padding:5px;color:#666666;font-size:smaller;'>With Dr. Wernsman's approval and assistance, the students this year are striving to create a permanent endowment in the North Carolina Agricultural Foundation to sustain the seminar in perpetuity. You may contribute to the endowment by using the attached forms or by visiting this website:<A CLASS='Content' HREF='http://www.cals.ncsu.edu/advancement/wernsman.html'>learn more</A></p>";       
                    FacultyDetail[1]="<P style='padding:5px;color:#666666;font-size:smaller;'><STRONG> Dr. Major Goodman </strong> was honored at the Symposium on Genetic Diversity in Maize and Teosinte Friday, February 24<sup>th</sup>. He will be featured in the next volume of the journal Maydica and was on hand to receive a leather bound copy. </p> <p style='padding:5px;color:#666666;font-size:smaller;'>Students, faculty, researchers, and members of industry were gathered for the symposium where several colleagues of Dr. Goodman outline important historical events that helped shape maize storage and production in America. </p>"; 
                  
                   
                var theFacultyHeader=document.getElementById("FacultyHeader_Title");  
                var theFacultyPic=document.getElementById("FacultyPic");  
                var theFactultyDetails=document.getElementById("FacultyDetails_Content");

                if (x>0)
                    {var FacultyCounter=x-1;}
                else
                    {var FacultyCounter=x;}    
                
                
                
                theFacultyPic.src = eval("FacultyPic["+ FacultyCounter +"]");
                theFacultyHeader.innerHTML = eval("FacultyHeader["+ FacultyCounter +"]");
                theFactultyDetails.innerHTML = eval("FacultyDetail["+ FacultyCounter +"]");
             
               
     
     
     
     }   