Jquery localscroll and hashtags
<p>I'm using localscroll jquery plugin, and I wanted a safe option when someone enter's url with hashtag at the end of url, so I wrote these lines of code:</p>

<pre><code>        if (window.location.hash == "#home") {
      $('#menu-main a').removeClass('sel');
      $("#a1").addClass("sel");
      $('#about,#collections,#contact,#brides,#gallery').animate({ opacity: 0 }, 0);
    } else if (window.location.hash == "#about") {
      $('#menu-main a').removeClass('sel');
      $("#a2").addClass("sel");
      $('#home,#collections,#contact,#brides,#gallery').animate({ opacity: 0 }, 0);
    } else if (window.location.hash == "#collections") {
      $('#menu-main a').removeClass('sel');
      $("#a3").addClass("sel");
      $('#about, #home, #contact, #brides, #gallery').animate({ opacity: 0 }, 0);
    } else if (window.location.hash == "#brides") {
      $('#menu-main a').removeClass('sel');
      $("#a4").addClass("sel");
      $('#about, #collections, #contact, #home, #gallery').animate({ opacity: 0 }, 0);
    } else if (window.location.hash == "#gallery") {
      $('#menu-main a').removeClass('sel');
      $("#a5").addClass("sel");
      $('#about, #collections, #home, #contact, #brides').animate({ opacity: 0 }, 0);
    } else if (window.location.hash == "#contact") {
      $('#menu-main a').removeClass('sel');
      $("#a6").addClass("sel");
      $('#about, #collections, #home, #brides, #gallery').animate({ opacity: 0 }, 0);
    } else if (window.location.hash == "") {
      $('#menu-main a').removeClass('sel');
      $("#a1").addClass("sel");
      $('#about,#collections,#contact,#brides,#gallery').animate({ opacity: 0 }, 0);
    }
</code></pre>

<p>But, there definately must be better solution for this, some foreach function maybe, and since I'm not really a jquery guru, I'd like to ask for your advice ...</p>

<p>Thanks, Mart</p>
