
YAHOO.example = function() 
{
	var $D = YAHOO.util.Dom;
	var $E = YAHOO.util.Event;
	var $A = YAHOO.util.Anim;
	var $M = YAHOO.util.Motion;
	var $DD = YAHOO.util.DD;
	var $ = $D.get;
	var x = 1;
	return {
		init : function()
		{
			this.load;
			$E.on(['move-left','move-right'], 'click', this.move);
            	
		},
	
		move : function(e)
		{
			//$E.stopEvent(e);
		
			switch(this.id)
			{

				case 'move-left':
				if ( x === 1 )
				{
					return;
				}
				var attributes =
				{
					points : {
						by : [size, 0]
					}
				};
				x--;
				break;
				case 'move-right':
				if ( x >= xcount ) 
				{
				    
					return;
				}
				var attributes =
				{
					points :
					{
						by : [-size, 0]
					}
				};
				x++;
				break;
			};

			var anim = new $M('slider_sub', attributes, 0.5, YAHOO.util.Easing.easeOut);
			anim.animate();
		},
		
	load : function()
		{
			var xpos=YAHOO.util.Dom.getX('slider_sub')
		
			if(current)
			{
				xpos= (xpos-(305 *(current-1)));
				x=current;
			}
			YAHOO.util.Dom.setX('slider_sub', xpos);
		
		}

	};
}();
//YAHOO.util.Event.onAvailable('slider_sub',YAHOO.example.load, YAHOO.example, true);
YAHOO.util.Event.onAvailable('slider_sub',YAHOO.example.init, YAHOO.example, true);


