// JavaScript Document
function product_detail(product_id, direction, url) {

		pageTracker._trackPageview(url);
		
  		new Effect.Opacity('content_ajax', {duration:0.5, from:1.0, to:0.0});
		if(direction) {
			new Effect.Move ('content_ajax',{ x: -200, y: 0, mode: 'absolute', duration:0.5});
		} else {
			new Effect.Move ('content_ajax',{ x: 200, y: 0, mode: 'absolute', duration:0.5});
		}
		
		new Ajax.Request('/projects/view', { 
			method:'post', 
			parameters:{id: product_id},
			onComplete:function(response){
				$('content_ajax').innerHTML = response.responseText;
				
				if(direction) {
					new Effect.Move ('content_ajax',{ x: 200, y: 0, mode: 'absolute', duration:0});
				} else {
					new Effect.Move ('content_ajax',{ x: -200, y: 0, mode: 'absolute', duration:0});
				}
				new Effect.Opacity('content_ajax', {duration:0.5, from:0.0, to:1.0});	
				
				if(direction) {
					new Effect.Move ('content_ajax',{ x: 0, y: 0, mode: 'absolute', duration:0.5});
				} else {
					new Effect.Move ('content_ajax',{ x: 0, y: 0, mode: 'absolute', duration:0.5});
				}
				
			},
			onFailure:function(response){
				// make sure the link is activated
				return true;
			}
		});
		return false;
}