$(document).ready(function(){
  reldist=Array(0,67,134,214,301,384,494);
  curpos=-331;
  if (document.getElementById("frontpage")){curpos=reldist[0];}
  if (document.getElementById("introduction")){curpos=reldist[1];}
  if (document.getElementById("performers")){curpos=reldist[2];}
  if (document.getElementById("events")){curpos=reldist[3];}
  if (document.getElementById("sales")){curpos=reldist[4];}
  if (document.getElementById("gallery")){curpos=reldist[5];}
  if (document.getElementById("contact")){curpos=reldist[6];}
  startpos=curpos;
  $("#navlinks li").hover(
    function(){
      if (this.className=="front"){nextpos=reldist[0];}
      if (this.className=="intro"){nextpos=reldist[1];}
      if (this.className=="performers"){nextpos=reldist[2];}
      if (this.className=="events"){nextpos=reldist[3];}
      if (this.className=="sales"){nextpos=reldist[4];}
      if (this.className=="gallery"){nextpos=reldist[5];}
      if (this.className=="contact"){nextpos=reldist[6];}
      
      $("#slider img").stop().animate(
        { paddingLeft: 331+startpos+(nextpos-curpos)}, 700
      );
    },function(){
      $("#slider img").stop().animate({ paddingLeft: 331+startpos }, 2000)
      }
  );
});