
function slideLeft(id,callback){var pageWidth=$(id).firstDescendant().getWidth();var currOffset=parseInt($(id).getStyle('margin-left'))-pageWidth;new Effect.Morph(id,{style:'margin-left:'+currOffset+'px;',duration:0.8,afterFinish:function(){for(x in callback){Event.observe(x,'click',callback[x]);}}});}
function slideRight(id,callback){var pageWidth=$(id).firstDescendant().getWidth();var currOffset=parseInt($(id).getStyle('margin-left'))+pageWidth;new Effect.Morph(id,{style:'margin-left:'+currOffset+'px;',duration:0.8,afterFinish:function(){for(x in callback){Event.observe(x,'click',callback[x]);}}});}
function slideTo(id,deltaPages,callback){var pageWidth=$(id).firstDescendant().getWidth();var currOffset=parseInt($(id).getStyle('margin-left'))-(pageWidth*deltaPages);new Effect.Morph(id,{style:'margin-left:'+currOffset+'px;',duration:0.8,beforeStart:function(){for(x in callback){Event.stopObserving(x,'click',callback[x]);}},afterFinish:function(){for(x in callback){Event.observe(x,'click',callback[x]);}}});}