var Slider=Class.create();Slider.prototype={options:{shift:900},initialize:function(container,controlLeft,controlRight){this.animating=false;this.containerSize={width:$(container).offsetWidth,height:$(container).offsetHeight},this.content=$(container).down();this.controlLeft=$(controlLeft);this.controlRight=$(controlRight);this.initControls();},initControls:function(){this.controlLeft.href=this.controlRight.href='javascript:void(0)';Event.observe(this.controlLeft,'click',this.shiftLeft.bind(this));Event.observe(this.controlRight,'click',this.shiftRight.bind(this));this.updateControls(1,0);},shiftRight:function(){if(this.animating)
return;var left=isNaN(parseInt(this.content.style.left))?0:parseInt(this.content.style.left);if((left+this.options.shift)<0){var shift=this.options.shift;this.updateControls(1,1);}else{var shift=Math.abs(left);this.updateControls(1,0);}
this.moveTo(shift);},shiftLeft:function(){if(this.animating)
return;var left=isNaN(parseInt(this.content.style.left))?0:parseInt(this.content.style.left);var lastItemLeft=this.content.childElements().last().positionedOffset()[0];var lastItemWidth=this.content.childElements().last().getWidth();var contentWidth=lastItemLeft+lastItemWidth+8;if((contentWidth+left-this.options.shift)>this.containerSize.width){var shift=this.options.shift;this.updateControls(1,1);}else{var shift=contentWidth+left-this.containerSize.width;this.updateControls(0,1);}
this.moveTo(-shift);},moveTo:function(shift){var scope=this;this.animating=true;new Effect.Move(this.content,{x:shift,duration:0.4,delay:0,afterFinish:function(){scope.animating=false;}});},updateControls:function(left,right){if(!left)
this.controlLeft.addClassName('disabled');else
this.controlLeft.removeClassName('disabled');if(!right)
this.controlRight.addClassName('disabled');else
this.controlRight.removeClassName('disabled');}};var ProductInfo=Class.create();ProductInfo.prototype={settings:{'loadingMessage':'Please wait ...'},initialize:function(selector,x_image,settings)
{Object.extend(this.settings,settings);this.createWindow();var that=this;$$(selector).each(function(el,index){el.observe('click',that.loadInfo.bind(that));})
$$(x_image).each(function(el,index){el.observe('mouseover',that.showButton);el.observe('mouseout',that.hideButton);})},createLoader:function()
{var loader=new Element('div',{id:'ajax-preloader'});loader.innerHTML="<p class='loading'><img src="+this.settings.loader+" /><br/>"+this.settings.loadingMessage+"</p>";document.body.appendChild(loader);$('ajax-preloader').setStyle({position:'absolute',top:document.viewport.getScrollOffsets().top+200+'px',left:document.body.clientWidth/2-75+'px'});},destroyLoader:function()
{$('ajax-preloader').remove();},showButton:function(e)
{el=this;while(el.tagName!='P'){el=el.up();}
$(el).getElementsBySelector('.ajax')[0].setStyle({display:'block'})},hideButton:function(e)
{el=this;while(el.tagName!='P'){el=el.up();}
$(el).getElementsBySelector('.ajax')[0].setStyle({display:'none'})},createWindow:function()
{var qWindow=new Element('div',{id:'quick-window'});qWindow.innerHTML='<div id="quickview-header"><a href="javascript:void(0)" id="quickview-close"></a></div><div class="quick-view-content"></div>';document.body.appendChild(qWindow);$('quickview-close').observe('click',this.hideWindow.bind(this));},showWindow:function()
{$('quick-window').setStyle({top:document.viewport.getScrollOffsets().top+100+'px',left:document.body.clientWidth/2-$('quick-window').getWidth()/2+'px',display:'block'});},setContent:function(content)
{$$('.quick-view-content')[0].insert(content);},clearContent:function()
{$$('.quick-view-content')[0].replace('<div class="quick-view-content"></div>');},hideWindow:function()
{this.clearContent();$('quick-window').hide();},loadInfo:function(e)
{e.stop();var that=this;this.createLoader();new Ajax.Request(e.element().href,{onSuccess:function(response){that.clearContent();that.setContent(response.responseText);that.destroyLoader();that.showWindow();}});}}
