//back to top
$(document).ready(function(){
  $('a[href*=#]').click(function() {
 if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
 && location.hostname == this.hostname) {
   var $target = $(this.hash);
   $target = $target.length && $target
   || $('[name=' + this.hash.slice(1) +']');
   if ($target.length) {
  var targetOffset = $target.offset().top;
  $('html,body')
  .animate({scrollTop: targetOffset}, 1000);
    return false;
   }
 }
  });
});

//home page images
  $(document).ready(function(){
 
    $(".modPicLnks a").mouseover(function () {
    	var this_title = $(this).attr("title");
    	//.slice(0, -2);
    	var this_id = $(this).closest(".modPicLnks");
      swap_image(this_id, this_title);
    });

  });
  
  function swap_image(this_id,this_title){
  	var img_id = $(this_id).find("img");
  	$(img_id).attr("src","/images/home/"+this_title+".jpg");
  	$(img_id).attr("alt",this_title);
   }
   
//suckerfish    
startList = function() {
    if (document.all&&document.getElementById) {
    navRoot = document.getElementById("nav");
    for (i=0; i<navRoot.childNodes.length; i++) {
    node = navRoot.childNodes[i];
    if (node.nodeName=="LI") {
    node.onmouseover=function() {
    this.className+=" over";
      }
      node.onmouseout=function() {
      this.className=this.className.replace(" over", "");
       }
       }
      }
     }
    }

function disableSelection(element) {
    element.onselectstart = function() {
        return false;
    };
    element.unselectable = "on";
    element.style.MozUserSelect = "none";
    element.style.cursor = "default";
}