$(document).ready(function(){	
						   
	// Featured projects carousel
	$(".feat_projects").jCarouselLite({
        visible: 2,  
        auto:2000,  
        speed:1000,
		scroll:1,
		easing:'swing',
       	btnNext: ".next",
       	btnPrev: ".prev"
    });
    
    	// Banner carousel
	$(".banner").jCarouselLite({
        visible: 1, 
        vertical:true,	 
        auto:10000,  
        speed:300,
		scroll:1,
		easing:'swing',
       	btnNext: ".next",
       	btnPrev: ".prev"
    });
    
    
    
    	// Mobiliario carousel
	$(".mobiliario").jCarouselLite({
        visible: 2,  
        auto:2000,  
        speed:800,
		scroll:1,
		easing:'swing',
       	btnNext: ".next",
       	btnPrev: ".prev"
    });
    
    
	
	// Testimonials carousel
	$(".testimonials").jCarouselLite({
		vertical:true,									 
        visible: 1,  
        auto:7000,  
        speed:1000,
		scroll:1,
		easing:'swing',
       	btnNext: ".next2",
       	btnPrev: ".prev2"
    });	
    
    
    	// noticias carousel
	$(".noticias").jCarouselLite({
		vertical:true,									 
        visible: 1,  
        auto:10000,  
        speed:1000,
		scroll:1,
		easing:'swing',
       	btnNext: ".next2",
       	btnPrev: ".prev2"
    });	
    
    
    

	
	//Subscribe Field Text disappearance
	//-------------------------------
	$('#subscribe_field').example(function() {
		return $(this).attr('title');
	});
	
	//lightbox on images
	//-------------------

	$("a[rel^='lightbox[3d]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[2008]']").lightBox();
	$("a[rel^='lightbox[200801]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200802]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200803]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200804]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200805]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200806]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200807]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200808]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200809]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200810]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200811]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200812]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200813]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[2009]']").lightBox();
	$("a[rel^='lightbox[200901]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200902]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200903]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200904]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200905]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200906]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200907]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200908]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[200909]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[2010]']").lightBox();	
	$("a[rel^='lightbox[201001]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[201002]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[201003]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[201004]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[201005]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[201006]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[201007]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[201008]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[201009]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[2011]']").lightBox();	
	$("a[rel^='lightbox[201101]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[201102]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[201103]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[premium]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[estan]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[gondo]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[mostra]']").lightBox({showNumbers:true});
	$("a[rel^='lightbox[video]']").lightBox({showNumbers:false});
	$("a[rel^='lightbox[feat]']").lightBox({showNumbers:false});
	
	//portfolio filter
	//-----------------	
	$('ul.portfolio_holder').before('<ul id="port_filter"><li class="active"><a href="#">Todos</a></li><li><a href="#">2011</a></li><li><a href="#">2010</a></li><li><a href="#">2009</a></li><li><a href="#">2008</a></li><li><a href="#">3d</a></li>');  
	
	$('ul#port_filter a').click(function() {  
		$(this).css('outline','none');  
		$('ul#port_filter .active').removeClass('active');  
		$(this).parent().addClass('active');  
		
		var cats = $(this).text().toLowerCase().replace(' ','-');  
		var count1 = 1;
		var count2 = 1;
		if(cats == 'todos') {  
			$('ul.portfolio_holder li.hidden').fadeIn('fast').removeClass('hidden');  
			$('ul.portfolio_holder li').each(function() { 
							if(count1 % 4 == 0)
							{
								if(!$(this).hasClass('last'))
									{
										$(this).addClass('last');
									}
							}
							else
							{
								if($(this).hasClass('last'))
								{
									$(this).removeClass('last'); 
								}
							}
							count1++;

					});  
		} 
		else {  
					$('ul.portfolio_holder li').each(function() { 
							if(!$(this).hasClass(cats)) {  
								$(this).fadeOut('fast').addClass('hidden');  
							} 
							else {  
								$(this).fadeIn('fast').removeClass('hidden');
								
							
							if(count2 % 4 == 0)
							{
								if(!$(this).hasClass('last'))
									{
										$(this).addClass('last');
									}
							}
							else
							{
								if($(this).hasClass('last'))
								{
									$(this).removeClass('last'); 
								}
							}
							count2++;
					} 
					});  
			}  
		
		return false;  
	}); 
	
}) // end document.ready call

