﻿

sfHover = function() {
   var sfEls = document.getElementById("nav").getElementsByTagName("li"); /* gets selected eliments of nav + li and stores then */
   for (var i=0; i<sfEls.length; i++) { /* creates a loop */
      sfEls[i].onmouseover=function() { /* when mouse over the nav sfhover function is used */
         this.className+=" sfhover";
      }
      sfEls[i].onmouseout=function() { /* when mouse out of the nav sfhover function is stopped and reloaded */ 
         this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
      }
   }
}
if (window.attachEvent) window.attachEvent("onload", sfHover); /* start function when window is loaded */


