// JavaScript Document

jQuery(document).ready(function() {
								
								
      $('#mycarousel').jcarousel({
		wrap: 'circular',
		scroll:1,
		animation: '800'
    });						

    
	$('#main-nav ul li:first-child').addClass('first-child');
	$('#main-nav ul li:last-child').addClass('last-child');
	$('<b>&nbsp;</b>').appendTo('#main-nav ul li.current_page_item');
	$('#main-content #top-products a.box-wrapper:first-child').addClass('first');
	$('#main-content #top-products a.box-wrapper:last-child').addClass('last');
	
	//Table
	$('table tr:last-child').addClass('lasttd');
	$('table tr:odd').addClass('odd');
	$('table tr:even').addClass('even');
	$('table tr td:first-child').addClass('first-td');
	$('table tr th:first-child').addClass('first-th');
	//$('ul.page-numbers a:Prev').addClass('prev');

	//fancybox
    $("a.myfancybox").fancybox({ 'zoomSpeedIn': 500, 'zoomSpeedOut': 500, 'overlayShow':true,'overlayOpacity':0.3 });

	
	
	//Sidebar categories accordition
	$('#sidebar-category-post-list div.post-container').not(':first').hide();
	$('#sidebar-category-post-list li:first h3').addClass('active');
	$('#sidebar-category-post-list h3').hover(function() {
		if (!$(this).hasClass('active')) {
			var $div = $(this).siblings('div.post-container');
			var $a = $(this);
			$('#sidebar-category-post-list h3').removeClass('active').siblings('div.post-container').slideUp();
			$a.addClass('active');$div.slideDown();
		}
		return false;
	});
	
$('#sidebar-category-post-list a').each(function(){
   var pathname = window.location.pathname;
   var href = $(this).attr('href');
   if (href.match(pathname)) {
     $(this).addClass('current');
   } 
  });
 
 $('#sidebar-category-post-list .post-container li').hover(
  function () {
    $(this).addClass("hover");
  },
  function () {
    $(this).removeClass("hover");
  }
);
 
  $('#sidebar-category-post-list ul li h3').hover(
  function () {
    $(this).addClass("hover");
  },
  function () {
    $(this).removeClass("hover");
  }
);

});

