///////////////////////////////////////////////////////////////////////////////
//                              Rotating Photos                              //
///////////////////////////////////////////////////////////////////////////////

// put images to preload in this array
   var imgAr = new Array();
   imgAr[0]="/mechanical/images/wind2.jpg";
   imgAr[1]="images/FE_superior.png";
   imgAr[2]="/news/090422/topnews1.jpg";
   imgAr[3]="/news/090810/topnews2.jpg";

var pic = new Array();
if (document.images) {
   for (var i=0; i<imgAr.length; i++) {
      pic[i] = new Image(320,247); // width, height
      pic[i].src =  imgAr[i];
   }
}

   var intId;
   var num = 0;            // global to track current image, and get its url

function rotateImg() {
   if (num < pic.length-1)
      num++;
   else
 num =0;
   //document.pict.src = pic[num].src;

			switch (num){


  			case 0 :
  				document.pict.src=pic[num].src;
				document.getElementById('myText').innerHTML='<b>NEW Energy Systems Degree</b><br>' +
				'Energy Systems Engineering (ESE) is a new undergraduate degree offering by the Dept. of Mechanical Engineering.  The ESE program emphasizes the energy conversion aspect of mechanical engineering and broadens the students education.<br>'
+'<a href="/mechanical/undergrad/curriculum/ESE_program.html">[more info]</a>';
    			  	break;

   			case 2 :
  				document.pict.src=pic[num].src;
				document.getElementById('myText').innerHTML=
'<b>Mechanical FE Exam Pass Rate is Superior</b><br>' +
'On the October 2008 FE Exam, all 27 Mechanical Engineering students passed!  This is the third exam in a row for which ME students have a perfect pass record.  The 10-year pass rate for ME students is 96%, compared to 85% for MEs nation-wide.';
    			  	break;
				
			case 3 :
  				document.pict.src=pic[num].src;
				document.getElementById('myText').innerHTML=
'<b>UW Takes 3rd in National Moonbuggy Race</b><br>' +
'Four University of Wyoming students brought national attention to UW when they places third at the recent NASA Great Moonbuggy Race in Huntsville, Al.<br>'+
'<a href="/news/090422/">[more]</a>';
    			  	break;

			case 4 :
				document.pict.src=pic[num].src;
				document.getElementById('myText').innerHTML=
'<b>Energy Systems Engineering Program Signs First Student</b><br />' +
'Matt Haigler from Laramie is expected to be the first student to graduate with an ESE degree from the UW College of Engineering and Applied Sciences.  A former mechanical engineering major, Matt decided to switch his major to ESE because of his interest in the energy industry. <a href="/news/090810/">[More]</a>';
				break;

			}

   intId = setTimeout('rotateImg()', 5500);
}
		
///////////////////////////////////////////////////////////////////////////////
//                              Random Rotating Photos on Load               //
///////////////////////////////////////////////////////////////////////////////

var names=new Array();
names[0]=-1;
names[1]=0;
names[2]=1;
names[3]=2;
num=names[Math.floor(Math.random()*names.length)];
//use=names[4]

switch (num){

case -1 :

  document.write(
'<img name="pict" src="/news/090422/topnews1.jpg" alt=""  width="320" height="247" align="left" style="padding: 5px 5px 5px 5px;"/> ' +
'<fieldset class="darkTop_field">' +
'<legend class="darkTop_field_legend">' +
'News' +
'</legend>' +
'<p id="myText">'+
'<b>UW Takes 3rd in National Moonbuggy Race</b><br>'+
'Four University of Wyoming students brought national attention to UW when they places third at the recent NASA Great Moonbuggy Race in Huntsville, Al.'+
'<br><a href="/news/090422/">[More]</a></p>' +
'</fieldset>');
      break;

case 0 :

  document.write(
'<img name="pict" src="/mechanical/images/wind2.jpg" alt=""  width="320" height="247" align="left" style="padding: 5px 5px 5px 5px;"/> ' +
'<fieldset class="darkTop_field">' +
'<legend class="darkTop_field_legend">' +
'News' +
'</legend>' +
'<p id="myText">'+
'<b>NEW Energy Systems Degree</b><br>'+
'Energy Systems Engineering (ESE) is a new undergraduate degree offering by the Dept. of Mechanical Engineering.  The ESE program emphasizes the energy conversion aspect of mechanical engineering and broadens the students education.<br>'+
'<br><a href="/mechanical/undergrad/curriculum/ESE_program.html">[More]</a></p>' +
'</fieldset>');
      break;


   

   case 1 :

  document.write(
'<img name="pict" src="images/FE_superior.png" alt="Superior FE Scores"  width="320" height="247" align="left" style="padding: 5px 5px 5px 5px;"/> ' +
'<fieldset class="darkTop_field">' +
'<legend class="darkTop_field_legend">' +
'News' +
'</legend>' +
'<p id="myText">'+
'<b>Mechanical FE Exam Pass Rate is Superior</b><br>'+
'On the October 2008 FE Exam, all 27 Mechanical Engineering students passed!  This is the third exam in a row for which ME students have a perfect pass record.  The 10-year pass rate for ME students is 96%, compared to 85% for MEs nation-wide.'+
'<br><a href=""></a></p>' +
'</fieldset>');
      break;
	   
   case 2 :
	document.write(
	'<img name="pict" src="/news/090810/topnews2.jpg" alt="Matt Haigler" width="320" height="247" align="left" style="padding: 5px 5px 5px 5px;" />' +
'<fieldset class="darkTop_field">' +
'<legend class="darkTop_field_legend">' +
'News' +
'</legend>' +
'<p id="myText">'+
'<b>Energy Systems Engineering Signs First Student</b><br>'+
'Matt Haigler from Laramie is expected to be the first student to graduate with and ESE degree from the UW college of Engineering and Applied Sciences.  A former mechanical engineering major, Matt decided to switch his major to ESE because of his interest in the energy industry.'+
'<a href="/news/090810/">[More]</a></p>' +
'</fieldset>');
      break;
}
