
var Skin;var SkinManager=new Class({skins:new Array(),active:-1,initialize:function(){$('page').setStyles({'z-index':1000,'position':'relative'});},register:function(object){var f=-1;this.skins.each(function(skin,idx){if(skin.background==object.background&&skin.color==object.color){f=idx;}});if(f>=0){return f;}
if(!$type(object.background)&&!$type(object.color))
return-1;var id=this.skins.length;this.skins.push(object);var clone=new Element('div',{'id':'skin-'+id}).setStyles($(document.body).getCoordinates()).setStyles({'position':'absolute','background-position':'50% 0px','background-repeat':'no-repeat','z-index':id+1,'visibility':'hidden'});clone.inject($(document.body));if(object.background)
clone.setStyle('background-image',(object.background=='none'?'none':'url('+object.background+')'));if(object.color)
clone.setStyle('background-color',object.color);clone.fx=new Fx.Style(clone,'opacity',{duration:300,transition:Fx.Transitions.linear,fps:50});this.skins[id].skin=clone;$(window).addEvent('resize',function(){clone.setStyles($(document.body).getCoordinates())});return id;},set:function(object){id=this.register(object);if(id==-1)
return;if(this.active==-1){$('skin-'+id).setStyle('opacity',1);this.active=id;return;}
old=this.active;this.skins.each(function(s,i){var c=this.skins.length;s.skin.setStyles((i==old?{'z-index':c}:(i==id?{'z-index':c-1}:{'z-index':0,'opacity':0})));},this);$('skin-'+old).fx.start(1,0);$('skin-'+id).fx.start(0,1);this.active=id;return;}});var Basket;var BasketManager=new Class({options:{onProductAdd:Class.empty,onProductRemove:Class.empty,onEmpty:Class.empty},initialize:function(options){this.setOptions(options);},add:function(product,qty){new Ajax('/panier.nt.html',{method:'get',data:{'op':'prodmod','prod':product,'qte':qty||1},onComplete:function(response){this.fireEvent('onProductAdd',[response]);}.bind(this)}).request();},remove:function(product,qty){new Ajax('/panier.nt.html',{method:'get',data:{'op':'prodmod','prod':product,'qte':-1*(qty||1)},onComplete:function(response){this.fireEvent('onProductRemove',[response]);}.bind(this)}).request();},empty:function(){new Ajax('/panier.nt.html',{method:'get',data:{'op':'empty'},onComplete:function(response){this.fireEvent('onEmpty',[response]);}.bind(this)}).request();}});BasketManager.implement(new Options,new Events);Element.extend({toggle:function(){this.setStyle('display',this.getStyle('display')=='none'?'':'none');}});window.ie8=function(){return $type(document.querySelectorAll)=='object'}();window.addEvent('domready',function(){if(window.ie6)$(document.body).addClass('ie-6');else if(window.ie8)$(document.body).addClass('ie-8');else if(window.ie7)$(document.body).addClass('ie-7');else if(window.ie)$(document.body).addClass('ie');else if(window.gecko)$(document.body).addClass('gecko');else if(window.opera)$(document.body).addClass('presto');else if(window.webkit)$(document.body).addClass('webkit');if(navigator.userAgent.match(/Linux/i))
$(document.body).addClass('linux');else if(navigator.userAgent.match(/Mac OS/i))
$(document.body).addClass('mac-os');Skin=new SkinManager();Basket=new BasketManager();$$('input[type=hidden]').each(function(o){o.setProperty('autocomplete','off');});var aPanel=$E('#account .panel');if(!window.ie6){$$('#account .panel input').each(function(o){o.addEvents({'blur':function(){aPanel.setStyle('display','');},'focus':function(){aPanel.setStyle('display','block');}});});}
else{$('account').addEvent('mouseover',function(){$$('#account .panel').setStyle('display','block');});$('account').addEvent('mouseout',function(){$$('#account .panel').setStyle('display','none');});}});