// JavaScript Document
$(document).ready(function()
{
  var i = 0;
  lang = $("html").attr("lang");


  if($.browser.msie) {
    $("div#sm_slide1 h2").each(function() {
        switch(lang) {
           case 'he':
           case 'il':
             $(this).addClass('msieCrapH2FixHebrew');
           break;
           default:
             $(this).addClass('msieCrapH2Fix');
        }
    });

    if(lang=='he' || lang=='il') {
      $(".storeLocatorScrollBox").addClass("msieCrapScrollBoxFixHebrew");
    } else {
      $(".storeLocatorScrollBox").addClass("msieCrapScrollBoxFix");
    }

  }
  $("div#sm_slide1 h2").each(function() {
    if(i==0) {
      i++;
      $(this).removeClass('unselected');
      $(this).addClass('selected');
    } else {
      $(this).removeClass('selected');
      $(this).addClass('unselected');
    }
    var myId = $(this).attr("id").replace('button_', '');
    $(this).click(function() {
      $("div#sm_slide1 h2").each(function() {
        $(this).removeClass('selected');
        $(this).addClass('unselected');
      });
      $(this).removeClass('unselected');
      $(this).addClass('selected');
      $("div#sm_slide1 div.storeLocatorScrollBox").stop().hide(500);
      $("div#sm_slide1 div#"+myId).stop().show(500);
    });
  });

});
