function build(images,path){
	if ( images.length >= 3 ) {
		if(images[0]) jQuery(".leftbox").html("<img src=\""+path+"/timthumb/timthumb.php?src="+images[0].image+"&h=119&w=135&zc=1\" />");
		if(images[1]) jQuery(".mainbox").html("<a href=\"/"+images[1].postname+"/\"><img src=\""+path+"/timthumb/timthumb.php?src="+images[1].image+"&h=144&w=163&zc=1\" /></a>");
		if(images[2]) jQuery(".rightbox").html("<img src=\""+path+"/timthumb/timthumb.php?src="+images[2].image+"&h=119&w=135&zc=1\" />");
		jQuery(".featuredtitle").html(images[1].title)
		var current = 0;
		
		jQuery(".leftbutton").click( function(){
			if(current == 0) {
				current = images.length-1;
			} else {
				current--;
			}
			
			handleBoxes(current,images,path);
			
		}); 
		
		jQuery(".rightbutton").click( function(){
			if(current == images.length-1) {
				current = 0;
			} else {
				current++;
			}
			
			handleBoxes(current,images,path);
			
		}); 
	} else {
		jQuery('.latest-products .products .gallery').hide();
	}
}

function handleBoxes(current,images,path){

	jQuery(".leftbox").html("<img src=\""+path+"/timthumb/timthumb.php?src="+images[current].image+"&h=119&w=135&zc=1\" />");
	
	var mainbox = current + 1;
	
	if( mainbox > ( images.length-1 ) ) {
		mainbox = 0;
	}
	
	jQuery(".mainbox").html("<a href=\"/"+images[mainbox].postname+"/\"><img src=\""+path+"/timthumb/timthumb.php?src="+images[mainbox].image+"&h=144&w=163&zc=1\" /></a>");
	
	jQuery(".featuredtitle").html(images[mainbox].title)
		
	var rightbox = mainbox + 1;
	
	if( rightbox > ( images.length-1 ) ) {
		rightbox = 0;
	}
	
	jQuery(".rightbox").html("<img src=\""+path+"/timthumb/timthumb.php?src="+images[rightbox].image+"&h=119&w=135&zc=1\" />");	

};
