var MAG = Object.extend({}, MAG || {});
var flag;

MAG.Projects = {
	Init : function(options) {
			this.options = {};
		Object.extend(this.options, options || {});
	   
	    $('slid_right').observe('click',function()
		{  
			flag = 1;
			MAG.Projects.promosObserve();
			
			
		  });
		  
		$('slid_left').observe('click',function()
		{ 
			flag = 2;
			MAG.Projects.promosObserve();
			
		 });	
		 
	   this.total = 0; 
	},

		
	promosObserve: function()
	{ 			
		this.total = (this.total == 0) ? total :this.total;
		
		if(flag == 1)
		{	
			if(this.total > 3 && total > 3) 
			{ 
				var pos = -1;
			
				new Effect.Move($('slide_projects'), {
					x: pos * 515
				})
				
				this.total = this.total - 3;
			}				
		}
		
		if(flag == 2)
		{ 
			if(total > 3 && (this.total <= total - 3 )) 
			{ 
				pos = 1;
			
				new Effect.Move($('slide_projects'), {
					x: pos * 515
				});
				
				this.total += 3;
			}
		}
		
		flag = false;
		
	}
	
}


