jQuery(document).ready(function($) {

$("#mainmenu li")
	.mouseover(function(){
		$(this).addClass('hover')
		})
	.mouseout(function(){
		$(this).removeClass('hover')
		})
	;

$(".panels-wrap").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
		mouseWheel: true,
		vertical: false,
		//auto: 4300,
		speed: 700,
		circular: false,
		visible: 1,
		buttonNextEvent: 'mouseover',
        buttonPrevEvent: 'mouseover',
		
    });

//$("#portfolio").tabs({fx: {opacity: "toggle"}});


	
$(".next").not(".disabled").click(  
function() {  
var $tabs = $('#portfolio').tabs(); 
var totalSize = $(".ui-tabs-panel").size() - 1; 
var selected = $tabs.data('selected.tabs');
if (selected == totalSize) {
//because we know we are only using 5 tabs, we know the last one will be #3. If we were to have a dynamic # of tabs declared by the user under Theme Options, we would have to calculate the total #of tabs using var totalSize and then modify the logic accordingly.  
$tabs.tabs('select', 0); return false;
} else {
$tabs.tabs('select', selected + 1); return false;
} 
} 
);

$(".prev").not(".disabled").click(  
function() {
var $tabs = $('#portfolio').tabs();
var totalSize = $(".ui-tabs-panel").size() - 1; 
var selected = $tabs.data('selected.tabs'); 
if (selected == 0) {
//because we know we are only using 5 tabs, we know the last one will be #3. If we were to have a dynamic # of tabs declared by the user under Theme Options, we would have to calculate the total #of tabs using var totalSize and then modify the logic accordingly.  
$tabs.tabs('select', totalSize); return false;
} else {
$tabs.tabs('select', selected - 1); return false;
} 
} 
);

});


