//$(document).ready(function(){
//	//Hide the container on load
//	$(".accordion div").hide();
//	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
//	$("h4").click(function(){
//		$(this).next().slideToggle('fast');
//	});
//
//});
//
//	var promoSlideshow = null;
//	var promoSlideCurrent = 0;
//	function promoSlideNext() {
//		var promo = $j('#systemCat>li');
//		activatePromoSample(promo[promoSlideCurrent]);
//		promoSlideCurrent++;
//		if (promoSlideCurrent>=promo.length) {
//			promoSlideCurrent = 0;
//		}
//	}
//	function activatePromoSample(li) {
//		$j('#systemCat>li').each(function() {
//			if (this==li) {
//				$j(this).addClass('active');
//			}
//			else {
//				$j(this).removeClass('active');
//			}
//		});
//	}
//	$j().ready(function(){
//		$j('#systemCat>li').each(function() {
//			$j(this).mouseover(function() {
//				if (promoSlideshow) {
//					clearInterval(promoSlideshow);
//				}
//				activatePromoSample(this);
//			});
//		});
//		promoSlideNext();
//		// loop through the promo until mouseover
//		promoSlideshow = setInterval(promoSlideNext,4500);
//	});

$(document).ready(function(){
    /*
     * this gives a fade effect
     */
       $('.menuContainer h2').click(function(){
               $('ul#systemCat li').removeClass('active');
               $(this).parent('li').addClass('active');
      }); 

        $("a.overlay").live("click", function(){
            if ($('.' + $(this).attr('id')).find('img').size() > 0){
                    $.fancybox({content:$('.' + $(this).attr('id')).clone()});
                    return false;
            }
        });

       $('.btnNext').live("click", function(){
                var currentPage = $('.active');
                $('.active').removeClass();

                if (currentPage.next().size() > 0){
                        currentPage.next().addClass('active');
                } else {
                        currentPage.closest('ul').find('li:first').addClass('active');
                }

                return false;
       });
       
       $('.btnPrevious').live("click", function(){
                var currentPage = $('.active');
                $('.active').removeClass();

                if (currentPage.prev().size() > 0){
                        currentPage.prev().addClass('active');
                } else {
                       $('#lastPage').addClass('active');
                }

                return false;
       });

});
