﻿//SAM

function mainmenu(){
  $("#nav ul").css({"display": "none"}); // Opera Fix
  $("#nav li").hover(function(){
    $(this).find('ul:first').css({visibility: "visible", display: "none"}).show(10);
    },function(){
    $(this).find('ul:first').css({visibility: "hidden"});
   });
}

$(document).ready(function(){					
 mainmenu();
});


function JquerySAM() {
  $('.ListElementGallerySAM a').lightBox({fixedNavigation:false});

  $("#MenuRight img").pngfix();
  $("#MenuRight div, ul li").pngfix({sizingMethod: "scale"});

  //$('.ScrollSAM').jScrollHorizontalPane({showArrows:true});

  $("input[name='Enviar']").css({'height' : '18px', 'color' : '#666666', 'font-size' : '10px', 'background' : 'none', 'border' : '1px solid #CCCCCC', 'background' : '#E1E1E1'});;

  $(".TimeTables tr:nth-child(even)").addClass("gray");
  $(".TimeTables tr:nth-child(1)").addClass('gray');
  $(".TimeTables tr:nth-child(3)").addClass('TimeTextBold');
  $(".TimeTables tr:nth-child(4)").addClass('TimeTablesSmall');

  $(".FeesTables tr:nth-child(odd)").addClass("gray");

  $(".AreaTablesSub tr:nth-child(odd)").addClass("gray");

  $(".TimeTablesOrange tr:nth-child(odd)").addClass("gray");
  $(".TableOrange tr:visible td:nth-child(4)").addClass("NoBorder");
  $('.TableOrange .TimeTablesOrange tr:nth-child(1)').addClass('TimesTablesWeekOrange');
  $('.TableOrange .TimeTablesOrange tr:nth-child(2)').addClass('gray');
  $('.TableOrange tr:visible td:last-child').addClass('BgColorTop').css({'border-right': 'none', 'white-space' : 'nowrap'});
  $('.TableOrange .FirstColumnOrange').css({'border' : 'none'});

  $(".TimeTablesRates tr:nth-child(even)").addClass("gray");
  $(".TimeTablesRates  tr:nth-child(1)").addClass("OrangeRate");

  //$(".TimeRates tr:nth-child(even)").addClass("gray");

  $(".SAMViewRates a").click(function () {
    var index = parseInt($(".SAMViewRates a").index(this));

    if ($(".ContentRates:eq(" + index + ")").is(":hidden")) {
       $(this).removeClass("Show");
       $(this).addClass("Hide");
      
      $(this).html('Ocultar tarifários');
      $(".ContentRates:eq(" + index + ")").slideDown("slow");
    }
    else {
       $(this).removeClass("Hide");
       $(this).addClass("Show");
      
      $(this).html('Ver tarifários');
      $(".ContentRates:eq(" + index + ")").slideUp("slow");
    }
  });

}
