// JavaScript Document
$(document).ready(function() {
  var t;
  var rotateDelay = 5000;
  
  function rotateThemes()
  {
   $("#home-top-themes-content > div:visible").fadeOut("fast", function() {
    if($(this).next().html() == null)
    {
     $("#home-top-themes-content > div:first").fadeIn();
    }
    else
    {
     $(this).next().fadeIn();
    }
    t=setTimeout(rotateThemes,rotateDelay);
   });
  }
  
  $("#home-top-themes-menu a.stopTime").mouseover(function() {
   $("#home-top-themes-content > div:visible").hide();
   $("#" + $(this).attr("id") + "-content").show();
   clearTimeout(t);
  });
  
  $("#home-top-themes-menu a.startTime").mouseover(function() {
   clearTimeout(t);
  });
  
  $("#home-top-themes-menu a.startTime").mouseout(function() {
   t=setTimeout(rotateThemes,rotateDelay);
  });
    
  $(".carousel .jCarouselLite").jCarouselLite({
   btnNext: ".carousel .next",
   btnPrev: ".carousel .prev",
   visible: 4,
   scroll: 1,
   start: 4
  });
  
  t=setTimeout(rotateThemes,rotateDelay);
 
 });

function PopUp(page, w, h) {
  window.open(page,"PopUp","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width="+w+",height="+h+",top=20,left=25");
}
