///////////////////////////////////////////////////////////////////////////////
//                              Rotating Photos                              //
///////////////////////////////////////////////////////////////////////////////

// put images and links to preload in these arrays
        var imgAr = new Array("/news/090422/splashnews.jpg","/news/090810/splashnews.jpg","/news/091201/splashnews.jpg","/news/080901/splashnews.jpg");
        var linkAr = new Array("/news/090422/","/news/090810/","/news/091201/","/news/080901/");

if (document.images) {
   var pic = new Array();
   for (var i=0; i<imgAr.length; i++) {
      pic[i] = new Image(593,255); // 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;   
   switch (num){

  			case 0 :
  				document.getElementById('pict').src = pic[num].src;
   				document.getElementById('pict_link').href = linkAr[num];
    			  	break;

   			case 1 :
    			document.getElementById('pict').src = pic[num].src;
   				document.getElementById('pict_link').href = linkAr[num];
     				break;

   			case 2 :
  				document.getElementById('pict').src = pic[num].src;
   				document.getElementById('pict_link').href = linkAr[num];
				break;
				
			case 3 :
  				document.getElementById('pict').src = pic[num].src;
   				document.getElementById('pict_link').href = linkAr[num];
				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

//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(
'<a id="pict_link" href="/news/080901/"><img id="pict" src="/news/080901/splashnews.jpg" alt="splashnews"  width="593" height="255" align="left" border="0" style="padding: 0px 0px 0px 0px;"/></a> ');
      break;
   
   case 0 :

  document.write(
'<a id="pict_link" href="/news/090422/"><img id="pict" src="/news/090422/splashnews.jpg" alt="splashnews"  width="593" height="255" align="left" border="0" style="padding: 0px 0px 0px 0px;"/></a> ');
      break;

   case 1 :

  document.write(
'<a id="pict_link" href="/news/090810/"><img id="pict" src="/news/090810/splashnews.jpg" alt="splashnews"  width="593" height="255" align="left"  border="0" style="padding: 0px 0px 0px 0px;"/></a> ');
      break;
	  
	  
   case 2 :
   
 document.write(
'<a id="pict_link" href="/news/091201/"><img id="pict" src="/news/091201/splashnews.jpg" alt="splashnews"  width="593" height="255" align="left" border="0" style="padding: 0px 0px 0px 0px;"/></a> ');
      break;	  
	  	   
}

////// Did You Know Section//////

function die(max) {
   return Math.ceil(Math.random() * max) ;
}

function aRandom( a ) {
   cat = a[ die(a.length)-1 ];
   return cat;
}

   var QuoteLine = new Array() ;
QuoteLine[0] = "UW engineering seniors consistently perform above the national average on the Fundamentals of Engineering Exam. Approximately 80% of UW seniors pass this exam on the first try, compared to about 70% nationally." ;
QuoteLine[1] = "UW is surrounded by excellent outdoor recreation opportunities including hiking, skiing, fishing, climbing, biking, and kayaking." ;
QuoteLine[2] = "At an elevation of 7200 ft., UW has the highest engineering college in the United States. " ;
