// JavaScript Document
$(document).ready(function() {
	// Cursur position
	var x = $('#tabs ul li.active').position();
	var y = $('#tabs ul li.active').outerWidth() / 2;
	var z = x.left + y - 1;	
	$('#pointer').animate({ left: z }, 500);
	
	$('div.tab_content[id="monotab1"]').show();
	// Click on Tabs
	$('#tabs ul li').click( function() {
		var id = $(this).attr('tab_id');
		
		
		if ( !$(this).hasClass('active') ) {
			
			var c_id = $('#tabs ul li.active').attr('tab_id');
			$('#tabs ul li.active').removeClass('active');
			$(this).addClass('active');
			
			var x = $(this).position();
			var y = $(this).outerWidth() / 2;
			var z = x.left + y - 1;	
			$('#pointer').animate({ left: z }, 500);
			
			$('div.tab_content[id="monotab' + c_id + '"]').fadeOut();
			$('div.tab_content[id="monotab' + id + '"]').fadeIn();
			
		}
	});
	
	$('#tabs #tab_list div.item').click( function() {
		var id = $(this).attr('tab_id');
		
		
		if ( !$(this).hasClass('active') ) {
			
			var c_id = $('#tabs #tab_list div.item.active').attr('tab_id');
			$('#tabs #tab_list div.item.active').removeClass('active');
			$(this).addClass('active');
			
			var x = $(this).position();
			var y = $(this).outerWidth() / 2;
			var z = x.left + y - 1;	
			$('#pointer').animate({ left: z }, 500);
			
			$('div.tab_content[id="monotab' + c_id + '"]').fadeOut();
			$('div.tab_content[id="monotab' + id + '"]').fadeIn();
			
		}
	});
	
	/*jQuery('#mid-ul-slide').jcarousel({
		visible: 3,
		auto: 4,
		scroll: 2,
		wrap: 'both'
    });*/
	
	$(".mid-slider").jCarouselLite({
        btnNext: ".mid-left",
        btnPrev: ".mid-right",
		visible: 3,
		start: 0
    });
	$(".slide-list").jCarouselLite({
        btnNext: ".slide-left",
        btnPrev: ".slide-right",
		visible: 3,
		start: 0
    });
	$(".fun-frame-slider").jCarouselLite({
        btnNext: ".fun-left",
        btnPrev: ".fun-right",
		visible: 2,
		start: 0
    });
});
