(function($){

$.fn.tinySlide = function(){
	var element = this;		// Clipping element
	$(element).before("<a href='#' class='prev_thumb'>< Prev</a><a href='#' class='next_thumb'>Next ></a>");	// Create nav links
	
	
	
	var width = 625;	// Image width
	var count = 3;  	// Number of items in list

    $(".prev_thumb").hide();		// Hides previous link initially
    
	$(".prev_thumb").click(function() {
		var wrap = $(this).parent();
		var next = $(wrap).find(".next_thumb");		// Next link
		var thumbs = $(wrap).find(".project_thumbs");		// Scrolled items immediate parent
		var pos = $(thumbs).css("left");   
		$(next).fadeIn('slow');
		if(pos == "-" + 0 - width + "px"){
			$(this).fadeOut('slow');
		}
        $(thumbs).animate({"left": "+=" + width + "px"}, "slow");
        return false;
                                    });
                                    
                                    
    $(".next_thumb").click(function() {
		var wrap = $(this).parent();
		var prev = $(wrap).find(".prev_thumb");		// Previous link
		var thumbs = $(wrap).find(".project_thumbs");		// Scrolled items immediate parent
		var pos = $(thumbs).css("left");   
		$(prev).fadeIn('slow');
		if(pos == (count - 2) * width * -1 + "px"){
			$(this).fadeOut('slow');
		}				
        $(thumbs).animate({"left": "-=" + width + "px"}, "slow");
        return false;
                                    });

};
    
})(jQuery);
