﻿TopPosCorrection = 75;
LeftPosCorrection = 310;

$(function() {
  if ($('#NoticiasHolder').length) {
    $('#NoticiasHolder .Paragraph:last').css({'border-bottom':'0px', 'padding-bottom':'30px' });
  }
 if ($('#SlideShow').length) {
  $("div#Tabs").tabs("#SlideShow > div", {  
    effect: 'fade',  
    fadeOutSpeed: 'slow', 
    rotate: true  
    }).slideshow({autoplay: true, interval: 5000}); 
    setCurrent();
  }
  $('#Tabs a:first-child').hover(
    function () {
      $(this).addClass("current");
    }, 
    function () {
      $(this).removeClass("current");
    }
  );
  $('.GalleryJCH a, .LightBoxJCH a').lightBox();
  $('.GalleryJCHRes a').lightBox();
  $('.GalleryJCHBar a').lightBox();
  $('.Bx-Tx_image a').lightBox();
  $('.B11-T11_image a').lightBox();
  $('.T11-B11_image a').lightBox();
  $('.Tx-Bx_image a').lightBox();
  $('.ItemImageGallery').lightBox();
 /* Corrigir os https */
  var src = "";
  $('body').find('a').each(function(){
    if ($(this).attr("href")) {
      src = $(this).attr("href");
      if (src.substring(0, 5) == "https") {
        $(this).attr("href", "http" + src.substring(5, src.length));
      }
    }
  });
});
/* trocar a cor da esquina dos tabs do slideshow */
function setCurrent() {
  if ($('#Tabs a:first-child').hasClass('current')) {
    $('#TabsBG').css('background-image', 'url("/Files/System/JCHotels/layout/leftBGSlideshow_current.png")');
  }
  if (!$('#Tabs a:first-child').hasClass('current')) {
    $('#TabsBG').css('background-image', 'url("/Files/System/JCHotels/layout/leftBGSlideshow.png")');
  }
  setTimeout('setCurrent()', 50);
}
