///////////////////////////////////////////////////////////////////////////////
//                              Rotating Photos                              //
///////////////////////////////////////////////////////////////////////////////

// put images to preload in this array
   var imgAr = new Array("../advising/images/studentservices.jpg","../advising/images/lindy.jpg","../advising/images/ryan.jpg","../advising/images/susan.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='With our advising coordinator and two academic professionals,' + 
				'the CSS expands our ability to recruit prospective students, develop internship and career opportunities, implement new' +
				'programs for improving communication skills, and support the broad range of services we offer to our students, both inside and outside the classroom.'; 
     				 break;

  			case 1 :
  				document.pict.src = pic[num].src;
				document.getElementById('myText').innerHTML='<br><b>Lindy Johnson</b><br>' +
				'Assistant Lecturer from Lander, Wyoming<br>'+
				'UW Graduate Civil Engineering B.S 2001, M.S. 2002<br><br>'+
				'Her other interests include hiking and hunting.<br>'+
				'<a href="../dean/faculty/lindyJohnson.html">More About Lindy Johnson</a>';
    			  	break;

   			case 2 :
    				document.pict.src = pic[num].src;
				document.getElementById('myText').innerHTML='<br><b>Ryan Kobbe</b><br>' +
				'Assistant Lecturer from Farson, Wyoming<br>' +
				'2003 B.S. Architectural Engineering from UW, 2005 MS Civil Engineering from WSU<br>' +
				'He enjoys outdoor recreational activities with his family and carpentry.<br>'+
				'<a href="../dean/faculty/ryanKobbe.html">More About Ryan Kobbe</a>';
     				break;

   			case 3 :
  				document.pict.src = pic[num].src;
				document.getElementById('myText').innerHTML='<br><b>Susan McCormack</b><br>' +
				'Provides Provide College-wide support to students, faculty, academic professionals,' +
				' and staff on student advising issues, including College and UW ' +
				'policies, Banner, WyoWeb, and CAPP as well as registration issues and much more.<br>'+
' <a href="http://wwweng.uwyo.edu/dean/faculty/susanMcCormack.html" title="more about Susan McCormack">More About Susan McCormack</a>';
				break;

			}

   intId = setTimeout('rotateImg()', 6500);
}

function stop() {
   clearTimeout(intId);
}

function restart() {
   clearTimeout(intId);
   num = 0;
   document.pict.src = pic[0].src;
   intId = setTimeout('rotateImg()', 6500);
}

function die(max) {
   return Math.ceil(Math.random() * max) ;
}

function aRandom( a ) {
   num = a[ die(a.length)-1 ];
   return num;
}



        function switchit(id, link_id){
          if(document.getElementById(id).style.display=='none'){
           document.getElementById(id).style.display='block';}
          else if(document.getElementById(id).style.display=='block'){
           document.getElementById(id).style.display='none';}
          if(document.getElementById(link_id).innerHTML.charAt(0)=='+'){
             document.getElementById(link_id).innerHTML='-'+document.getElementById(link_id).innerHTML.substr(1);}
          else{
             document.getElementById(link_id).innerHTML='+'+document.getElementById(link_id).innerHTML.substr(1);}
        }

