var subNavMouseover=0;
var rotationTime=2000;
function subOver(object,showPic) {
 subNavMouseover=1;
 for (i=0;i<serviceList.length;i++) {
  if (document.getElementById('sn_'+serviceList[i])) {
   document.getElementById('sn_'+serviceList[i]).style.backgroundColor='';
   document.getElementById('sn_'+serviceList[i]).style.color='';
  }
 }
 document.getElementById('sn_'+object).style.backgroundColor='#ABB4BB';
 if (showPic && document.getElementById('spic')) {
  document.getElementById('spic').src='img/pic-home-'+object+'.jpg';
 }
}

function subOut(object) {
 if (serviceList[currentService]!=object) {
  document.getElementById('sn_'+object).style.backgroundColor='';
 }
 subNavMouseover=0;
}

//build list of rotation order
var serviceList = new Array('snow','lines','landscaping','grounds','graffitti'/*,'washing'*/,'sweeping','paving','concrete'/*,'signage','rentals'*/);
var currentService=serviceList.length-1;
var previousService="";

function rotatePics() {
 setTimeout("rotatePics()",rotationTime);
 if (subNavMouseover!=1) {
  previousService=currentService;
  currentService++;
  if (currentService>=serviceList.length) currentService=0;
  var pic2Load = new Image();
  pic2Load.src="img/pic-home-"+serviceList[currentService]+".jpg";
  document.getElementById('sn_'+serviceList[previousService]).style.backgroundColor='';
  document.getElementById('sn_'+serviceList[previousService]).style.color='';
  document.getElementById('sn_'+serviceList[currentService]).style.backgroundColor='#ABB4BB';
  document.getElementById('sn_'+serviceList[currentService]).style.color='#FFFFFF';
  document.getElementById('spic').src=pic2Load.src;
 }
}
