var $j = jQuery.noConflict();

$j(document).ready(function($) {
	
	/* Clearing inputs
	---------------------------------------------- */
	$('.clear-me').each(function() {	
		var VALUE = $(this).attr('value');
			
		$(this).focus(function() {
		 	if ($(this).attr('value') == VALUE)
				$(this).attr('value', '');
		});		
		$(this).blur(function() {
		 	if ($(this).attr('value') == '')
				$(this).attr('value', VALUE);
		});
	});
	
	/* Banner
	---------------------------------------------- */
	$('#banner .animation').jCarouselLite({
		btnNext: ".next",
		btnPrev: ".prev",
		auto: 4000,
		speed: 500
    });
    
    /* Tabs
	---------------------------------------------- */
	$('.tabs .tabs-menu li:last-child').addClass('last');
	$('.tabs[class!=no-tabs] .tabs-item').hide();
	$('.tabs[class!=no-tabs] .tabs-menu li').each(function() {
		if($(this).hasClass('active'))
			$($(this).find('a').attr('href')).show();
	});
	
	$('.tabs[class!=no-tabs] .tabs-menu a').click(function() {
		$(this).parent().parent().parent().find('.tabs-item').hide();
		$($(this).attr('href')).fadeIn(1000);
		
		$(this).parent().parent().find('li').removeClass('active');
		$(this).parent().addClass('active');
		
		return false;
	});
	
	$(".fancy").fancybox();
	
});