(function($){

i=0;

	$.houseGallery = {
		themeDir : '',
					
		slide : function (direction) {
		
			x = $('.houses li').length - 3;			
			if ((i<x)&&(direction == 'left')) {			
					operator = '-';
					i++;
			 	$.houseGallery.move(operator);
			}else{
				if ((i>0)&&(direction == 'right')) {			
						operator = '+';
						i--;
					$.houseGallery.move(operator);  
				}
			}
		},
		
		
		move : function (operator) {
		
			$('.houses').animate({
				left: operator + '=' + 330}, 
				300); 	
			$('#next_projects').hide().delay(300).fadeIn(400);
			$('#previous_projects').hide().delay(300).fadeIn(400);	    
		},		
		
		
		buttons : function() {

			if (i==0){
				$('#previous_projects').css("background-image", "url("+ $.houseGallery.themeDir +"/images/projects/house_left_off.png)"); 
			}else{	
				$('#previous_projects').css("background-image", "url("+ $.houseGallery.themeDir +"/images/projects/house_left.png)"); 
			}
			
			if (i==x){
				$('#next_projects').css("background-image", "url("+ $.houseGallery.themeDir +"/images/projects/house_right_off.png)"); 
			}else{	
				$('#next_projects').css("background-image", "url("+ $.houseGallery.themeDir +"/images/projects/house_right.png)"); 
			}
		
		}

		
	}
})(jQuery);

