///////////////////////////////////////////////////////////////////////////////
//                              Rotating Photos                              //
///////////////////////////////////////////////////////////////////////////////

// put images to preload in this array
   var imgAr = new Array();
   imgAr[0]="/news/091015/topnews1.jpg"
   imgAr[1]="/news/091026/topnews1.jpg"
   imgAr[2]="/civil/images/beam2.jpg"
   imgAr[3]="/news/090820/topnews1.jpg"
   imgAr[4]="/news/090611/topnews1.jpg"
   imgAr[5]="/news/091009/topnews1.jpg"

if (document.images) {
   var pic = new Array();
   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>Large Flume Research</b><br>' +
				'The Universitys growing programs of water science and engineering will benefit substantially from the availability of a large flume for re-circulating water and sediment. <a href="/news/091015">[more]</a>';
    			  	break;

   			case 1 :
    				document.pict.src = pic[num].src;
				document.getElementById('myText').innerHTML='<b>Panama Canal Watershed</b><br>' +
				'UW is involved with projects around the world. Inside the water resources lab, located in the College, Fred Ogden is leading hydrologic research on the Panama Canal Watershed study- Agua Salud project.<a href="/news/091026/"> [More]</a>';
     				break;

   			case 2 :
  				document.pict.src = pic[num].src;
				document.getElementById('myText').innerHTML='<b>Beam Behavior</b><br>' +
				'Civil and Architectural engineering students in Design of Concrete Structures predict the behavior of a reinforced concrete beam.<a href="/news/090406/index1.html"> [More]</a>';
				break;
				
			case 3 :
  				document.pict.src = pic[num].src;
				document.getElementById('myText').innerHTML='<b>Charles Dolan Releases Textbook</b><br>' +
				'Dr. Charles Dolan, H.T. Person Chair and Professor of Civil and Architectural Engineering, recently released a co-authored text Design of Concrete Structures.<a href="/news/090820/"> [More]</a>';
				break;
				
			case 4 :
  				document.pict.src = pic[num].src;
				document.getElementById('myText').innerHTML='<b>Tony Denzer Awarded Grant</b><br>' +
				'Assistant Professor Anthony Denzer from the Department of Civil & Architectural Engineering is the recipient of the 2009 grant from the John and Sally Steadman Endowment for Undergraduate Teaching Improvement.<a href="/news/090611/"> [More]</a>';
				break;

			case 5 :
                                document.pict.src = pic[num].src;
                                document.getElementById('myText').innerHTML='<b>UW Outstanding Alumni</b><br>' +                                
				'J Kenneth "Ken" Kennedy will be honored as a recipient of the 2009 University of Wyoming Distinguished Alumni Award during Homecoming activities October 8-10.<a href="/news/091009/"> [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
names[4]= 3
names[5]= 4

//use the last picture in the rotating photos array as case -1 here, make the original -1 case the last case, increase all other case numbers accordingly

num=names[Math.floor(Math.random()*names.length)]


switch (num){

  case -1 :

 document.write(
'<img name="pict" src="/news/091009/topnews1.jpg" alt="Ken Kennedy"  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 Outstanding Alumni</b><br>J Kenneth "Ken" Kennedy will be honored as a recipient of the 2009 University of Wyoming Distinguished Alumni Award during Homecoming activities October 8-10.<a href="/news/091009"> [More]</a></p>' +
'</fieldset>');
      break;
   
   case 0 :

  document.write(
'<img name="pict" src="/news/091015/topnews1.jpg" alt="Flow Field"  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>Large Flume Research</b><br>The Universitys growing programs of water science and engineering will benefit substantially from the availability of a large flume for re-circulating water and sediment. <a href="/news/091015">[more]</a></p>' +
'</fieldset>');
      break;

   case 1 :

  document.write(
'<img name="pict" src="/news/091026/topnews1.jpg" alt="Large Flume"  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>Panama Canal Watershed Study</b><br>UW is involved with projects around the world. Inside the water resources lab, located in the College, Fred Ogden is leading hydrologic research on the Panama Canal Watershed study- Agua Salud project.<a href="/news/091026/"> [More]</a></p>' +
'</fieldset>');
      break;
	  
	  
   case 2 :
   
 document.write(
'<img name="pict" src="/civil/images/beam2.jpg" alt="Students Predict Concrete Beam Behavior "  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>Beam Behavior</b><br>Civil and Architectural engineering students in Design of Concrete Structures predict the behavior of a reinforced concrete beam.<a href="/news/090406/index1.html"> [More]</a></p>' +
'</fieldset>');
      break;
	  
	  
   case 3 :

 document.write(
'<img name="pict" src="/news/090820/topnews1.jpg" alt="Design of Concrete Structures"  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>Charles Dolan Releases Textbook</b><br>Dr. Charles Dolan, H.T. Person Chair and Professor of Civil and Architectural Engineering, recently released a co-authored text Design of Concrete Structures.<a href="/news/090820/"> [More]</a></p>' +
'</fieldset>');
      break;
	   
    case 4 :

 document.write(
'<img name="pict" src="/news/090611/topnews1.jpg" alt="Tony Denzer"  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>Tony Denzer Awarded Grant</b><br>Assistant Professor Anthony Denzer from the Department of Civil & Architectural Engineering is the recipient of the 2009 grant from the John and Sally Steadman Endowment for Undergraduate Teaching Improvement.<a href="/news/090611/index1.html"> [More]</a></p>' +
'</fieldset>');
      break;

}
