var lbl_error = 'Erreur';
var txt_minicart_total_note = 'Le sous-total de la commande ne couvre pas les remises et les frais supplémentaires comme les frais d\'expédition, etc. Le coût final de la commande sera calculé à l\'étape finale.';
$(".box-carousel").jCarouselLite({
	    auto: 4000,
    btnGo: [
            ".carousel-pagination .c0",
            ".carousel-pagination .c1",
            ".carousel-pagination .c2",
            ],
	    speed: 1000,
    vertical: true,
    visible: 1
});
/*
$Id: ajax.minicart.js,v 1.9.2.1 2009/11/10 07:57:31 joy Exp $
vim: set ts=2 sw=2 sts=2 et:
*/
/*
Minicart
*/
// Facntory
ajax.widgets.minicart = function(elm){
if (!elm){
elm = $('.menu-minicart');
} else {
elm = $(elm);
}
elm.each(
function(){
if (!this.minicartWidget)
new ajax.widgets.minicart.obj(this);
}
);
return true;
}
// Class
ajax.widgets.minicart.obj = function(elm){
this.elm = $(elm);
elm.minicartWidget = this;
this.msie6 = $.browser.msie && parseInt($.browser.version)< 7;
var s = this;
$(ajax.messages).bind(
'cartChanged',
function(e, data){
return s._add2cartListener(data);
}
);
this._minicartReposition = function(e){
return s.minicartReposition(e);
}
this._callbackMB = function(e){
s.click2Minicart = true;
return s.minicartVisible ? s.hideMinicart(): s.showMinicart();
}
this._callbackUM = function(responseText, textStatus, XMLHttpRequest){
return s._callbackUpdateMinicart(responseText, textStatus, XMLHttpRequest);
}
this._deleteItem = function(e){
return !s.deleteItem(this, e);
}
this._updateCart = function(e){
return !s.updateCart(this, e);
}
this._clearCart = function(){
return !s.clearCart();
}
this._showCheckoutPopup = function(e){
return s.checkoutPopupVisible ? !s.hideCheckoutPopup(this, e): !s.showCheckoutPopup(this, e);
}
if (this.elm.hasClass('ajax-minicart')){
this._constructMinicartButton();
}
$('body').click(
function(){
if (!s.click2Minicart)
s.hideMinicart();
s.click2Minicart = false;
}
);
}
// Options
ajax.widgets.minicart.obj.prototype.errorTTL = 3000;
ajax.widgets.minicart.obj.prototype.minicartBorder = 0;
// Properties
ajax.widgets.minicart.obj.prototype.elm = false;
ajax.widgets.minicart.obj.prototype.minicart = false;
ajax.widgets.minicart.obj.prototype.minicartButton = false;
ajax.widgets.minicart.obj.prototype.minicartState = false;
ajax.widgets.minicart.obj.prototype.minicartVisible = false;
ajax.widgets.minicart.obj.prototype.minicartChanged = false;
ajax.widgets.minicart.obj.prototype.checkoutPopupVisible = false;
// Widget :: check widget status
ajax.widgets.minicart.obj.prototype.isReady = function(){
return this.minicart.length > 0 && this.checkElement();
}
// Widget :: check element
ajax.widgets.minicart.obj.prototype.checkElement = function(elm){
if (!elm)
elm = this.elm;
return elm && elm.hasClass('menu-minicart');
}
// Widget :: update cart total block
ajax.widgets.minicart.obj.prototype.updateTotal = function(){
return this.checkElement()&& ajax.core.loadBlock($('div.minicart, span.minicart', this.elm), 'minicart_total');
}
// Widget :: update minicart block
ajax.widgets.minicart.obj.prototype.updateMinicart = function(){
if (!this.isReady())
return false;
this._markMinicartBoxAsLoaded();
return ajax.core.loadBlock(this.minicart, 'minicart', {}, this._callbackUM);
}
// Widget :: show minicart
ajax.widgets.minicart.obj.prototype.showMinicart = function(){
this._constructMinicartBox();
if (this.minicartVisible)
return false;
this.minicartButton.addClass('minicart-button-show');
if (this.minicartState == 1 || this.minicartChanged){
this._markMinicartBoxAsLoaded();
this.updateMinicart();
}
if (this._iframe){
this._iframe.show();
}
this.minicart.show();
this.minicartVisible = true;
this.minicartReposition();
return true;
}
// Widget :: hide minicart
ajax.widgets.minicart.obj.prototype.hideMinicart = function(){
if (!this.minicart || !this.minicartVisible)
return false;
this.minicartButton.removeClass('minicart-button-show');
if (this.checkoutPopupVisible)
this.hideCheckoutPopup();
this.minicart.hide();
if (this._iframe){
this._iframe.hide();
}
this.minicartVisible = false;
return true;
}
// Widget :: minicart reposition
ajax.widgets.minicart.obj.prototype.minicartReposition = function(){
if (!this.isReady()|| !this.minicartVisible)
return false;
if (this.elm.parents().filter('#left-bar').length > 0 ||this.elm.hasClass('left-dir-minicart')){
var l = $('.ajax-minicart-icon', this.elm).position().left;
var ml = $('.ajax-minicart-icon', this.elm).css('margin-left');
if (ml){
ml = parseInt(ml);
if (isNaN(ml))
ml = 0;
}
l += ml;
this.minicart.css('left', l - this.minicartBorder);
} else if (this.elm.parents().filter('#right-bar').length > 0 || this.elm.hasClass('right-dir-minicart')){
var rb = $('.ajax-minicart-icon', this.elm).width()+ $('.ajax-minicart-icon', this.elm).position().left;
var ml = $('.ajax-minicart-icon', this.elm).css('margin-left');
if (ml){
ml = parseInt(ml);
if (isNaN(ml))
ml = 0;
}
rb += ml;
var pw = $('.ajax-minicart-icon', this.elm).parents().eq(0).width();
this.minicart.css('right', pw - rb - this.minicartBorder);
}
this._iframeReposition();
return true;
}
// Widget :: delete cart item
ajax.widgets.minicart.obj.prototype.deleteItem = function(item, e){
if (!this.isReady()|| !item || !item.href)
return false;
this._markMinicartBoxAsLoaded();
return ajax.query.add({ url: item.href })!== false;
}
// Widget :: update cart
ajax.widgets.minicart.obj.prototype.updateCart = function(item, e){
if (!this.isReady()|| !item || !item.form)
return false;
this._markMinicartBoxAsLoaded();
return ajax.query.add(
{
type: 'POST',
url: 'cart.php',
data: $(item.form).serialize()
}
)!== false;
}
// Widget :: clear cart
ajax.widgets.minicart.obj.prototype.clearCart = function(){
if (!this.isReady())
return false;
this._markMinicartBoxAsLoaded();
return ajax.query.add({ url: 'cart.php?mode=clear_cart' })!== false;
}
// Widget :: show checkout popup
ajax.widgets.minicart.obj.prototype.showCheckoutPopup = function(item, e){
var p = $('.checkout-popup-link .buttons-box', this.minicart);
if (this.checkoutPopupVisible || p.length == 0)
return false;
$('.checkout-popup-link', this.minicart).children('a').addClass('show');
if (this._iframe_checkout)
this._iframe_checkout.show();
p.show();
this.checkoutPopupVisible = true;
return true;
}
// Widget :: hide checkout popup
ajax.widgets.minicart.obj.prototype.hideCheckoutPopup = function(item, e){
var p = $('.checkout-popup-link .buttons-box', this.minicart);
if (!this.checkoutPopupVisible || p.length == 0)
return false;
$('.checkout-popup-link', this.minicart).children('a').removeClass('show');
p.hide();
if (this._iframe_checkout)
this._iframe_checkout.hide();
this.checkoutPopupVisible = false;
return true;
}

/* Private */
// Widget :: add2cart message listener
ajax.widgets.minicart.obj.prototype._add2cartListener = function(data){
if (data.status == 1){
this._constructMinicartButton();
this.updateTotal();
if (data.isEmpty){
// Cart is empty
this._cartIsEmpty();
} else if (this.minicart && this.minicartVisible){
// Update minicart
this._constructMinicartBox();
this.updateMinicart();
} else {
// Save cart changed status
this.minicartChanged = true;
}
}
return true;
}
// Widget :: empty is cart
ajax.widgets.minicart.obj.prototype._cartIsEmpty = function(){
this.hideMinicart();
this._destructMinicartButton();
$('.ajax-minicart-icon', this.elm).eq(0)
.removeClass('full').addClass('empty')
.parents('.full').removeClass('full').addClass('empty');
ajax.core.trigger('cartCleaned');
return true;
}
// Widget :: construct minicart box
ajax.widgets.minicart.obj.prototype._constructMinicartBox = function(){
if (this.minicart)
return false;
var p = $('.ajax-minicart-icon', this.elm).get(0).parentNode;
if (this.msie6){
this._iframe = document.createElement('IFRAME');
this._iframe.className = 'minicart-bg';
this._iframe = $(p.appendChild(this._iframe));
this._iframe_checkout = document.createElement('IFRAME');
this._iframe_checkout.className = 'minicart-checkout-bg';
this._iframe_checkout = $(p.appendChild(this._iframe_checkout));
}
this.minicart = $(p.appendChild(document.createElement('DIV')));
this.minicart.addClass('minicart-box');
$(window).resize(this._minicartReposition);
var s = this;
this.minicart.click(
function(e){
if (!s.click2CheckoutPopup)
s.hideCheckoutPopup();
s.click2CheckoutPopup = false;
s.click2Minicart = true;
s.showMinicart();
return true;
}
);
this.minicartState = 1;
this.minicartVisible = false;
return true;
}
// Widget :: mark minicart box as loaded
ajax.widgets.minicart.obj.prototype._markMinicartBoxAsLoaded = function(){
if (this.minicart.hasClass('wait'))
return false;
var block = document.createElement('DIV');
block.className = 'progress';
this.minicart.empty().addClass('wait').append(block);
this._iframeReposition();
return true;
}
// Widget :: unmark minicart box as loaded
ajax.widgets.minicart.obj.prototype._unmarkMinicartBoxAsLoaded = function(){
this.minicart.removeClass('wait').children('.progress').remove();
this._iframeReposition();
return true;
}
// Widget :: prepare minicart box
ajax.widgets.minicart.obj.prototype._prepareMinicart = function(){
var s = this;
$('.delete', this.minicart).click(this._deleteItem);
$('.update-cart', this.minicart).click(this._updateCart);
if ($('.clear-cart a', this.minicart).length > 0){
$('.clear-cart', this.minicart).click(
function(){
return false;
}
);
$('.clear-cart a', this.minicart).click(this._clearCart);
} else {
$('.clear-cart', this.minicart).click(this._clearCart);
}
if ($('.checkout-popup-link .buttons-box', this.minicart).length > 0){
$('.checkout-popup-link a.link', this.minicart).click(this._showCheckoutPopup);
$('.checkout-popup-link .buttons-box', this.minicart).click(
function(){
s.click2CheckoutPopup = true;
}
);
}
return true;
}
// Widget :: display error message
ajax.widgets.minicart.obj.prototype._displayMinicartError = function(){
this.minicart.empty().html(lbl_error).addClass('error');
return true;
}
// Widget :: construct minicart button
ajax.widgets.minicart.obj.prototype._constructMinicartButton = function(){
if (this.minicartButton)
return false;
this.minicartButton = $('.ajax-minicart-icon', this.elm);
if (this.minicartButton.length == 0)
return false;
this.elm.addClass('ajax-minicart');
this.minicartButton
.addClass('minicart-button')
.click(this._callbackMB);
return true;
}
// Widget :: destruct minicart button
ajax.widgets.minicart.obj.prototype._destructMinicartButton = function(){
if (!this.minicartButton)
return false;
this.elm.removeClass('ajax-minicart full-mini-cart');
this.minicartButton
.removeClass('minicart-button')
.unbind('click', this._callbackMB);
this.minicartButton = false;
return true;
}
// Widget :: update minicart listener
ajax.widgets.minicart.obj.prototype._callbackUpdateMinicart = function(responseText, textStatus, XMLHttpRequest){
this._unmarkMinicartBoxAsLoaded();
if (this.minicartState == 1){
// Minicart exists as empty box
if (XMLHttpRequest.status == 200){
this.minicartState = 2;
} else {
this._displayMinicartError();
var s = this;
setTimeout(
function(){
s.hideMinicart();
s._destructMinicartButton();
},
this.errorTTL
);
}
}
if (XMLHttpRequest.status == 200){
// Display new content
this.minicartChanged = false;
this._prepareMinicart();
} else if (XMLHttpRequest.getResponseHeader('X-Request-Error-Code')== 1){
// Cart is empty
this._cartIsEmpty();
} else {
// Error
this._displayMinicartError();
var s = this;
setTimeout(
function(){
s.hideMinicart();
s._destructMinicartButton();
},
this.errorTTL
);
}
return true;
}
// Widget :: iframe reposition
ajax.widgets.minicart.obj.prototype._iframeReposition = function(){
if (!this._iframe)
return false;
var pos = this.minicart.position();
this._iframe
.css({ top: pos.top + 'px', left: pos.left + 'px' })
.width(this.minicart.width())
.height(this.minicart.height());
var box = $('.checkout-popup-link .buttons-box', this.minicart);
if (box.length > 0){
pos = box.position();
this._iframe_checkout
.css({ top: pos.top + 'px', left: pos.left + 'px' })
.width(box.width())
.height(box.height());
}
return true;
}
// onload handler
$(ajax).bind(
'load',
function(){
return ajax.widgets.minicart();
}
);
;(function($){var helper={},current,title,tID,IE=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;$.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){$.tooltip.blocked=!$.tooltip.blocked;}};$.fn.extend({tooltip:function(settings){settings=$.extend({},$.tooltip.defaults,settings);createHelper(settings);return this.each(function(){$.data(this,"tooltip",settings);this.tOpacity=helper.parent.css("opacity");this.tooltipText=this.title;$(this).removeAttr("title");this.alt="";}).mouseover(save).mouseout(hide).click(hide);},fixPNG:IE?function(){return this.each(function(){var image=$(this).css('backgroundImage');if(image.match(/^url\(["']?(.*\.png)["']?\)$/i)){image=RegExp.$1;$(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"}).each(function(){var position=$(this).css('position');if(position!='absolute'&&position!='relative')$(this).css('position','relative');});}});}:function(){return this;},unfixPNG:IE?function(){return this.each(function(){$(this).css({'filter':'',backgroundImage:''});});}:function(){return this;},hideWhenEmpty:function(){return this.each(function(){$(this)[$(this).html()?"show":"hide"]();});},url:function(){return this.attr('href')||this.attr('src');}});function createHelper(settings){if(helper.parent)return;helper.parent=$('<div id="'+settings.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if($.fn.bgiframe)helper.parent.bgiframe();helper.title=$('h3',helper.parent);helper.body=$('div.body',helper.parent);helper.url=$('div.url',helper.parent);}function settings(element){return $.data(element,"tooltip");}function handle(event){if(settings(this).delay)tID=setTimeout(show,settings(this).delay);else
show();track=!!settings(this).track;$(document.body).bind('mousemove',update);update(event);}function save(){if($.tooltip.blocked||this==current||(!this.tooltipText&&!settings(this).bodyHandler))return;current=this;title=this.tooltipText;if(settings(this).bodyHandler){helper.title.hide();var bodyContent=settings(this).bodyHandler.call(this);if(bodyContent.nodeType||bodyContent.jquery){helper.body.empty().append(bodyContent)}else{helper.body.html(bodyContent);}helper.body.show();}else if(settings(this).showBody){var parts=title.split(settings(this).showBody);helper.title.html(parts.shift()).show();helper.body.empty();for(var i=0,part;(part=parts[i]);i++){if(i>0)helper.body.append("<br/>");helper.body.append(part);}helper.body.hideWhenEmpty();}else{helper.title.html(title).show();helper.body.hide();}if(settings(this).showURL&&$(this).url())helper.url.html($(this).url().replace('http://','')).show();else
helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)helper.parent.fixPNG();handle.apply(this,arguments);}function show(){tID=null;if((!IE||!$.fn.bgiframe)&&settings(current).fade){if(helper.parent.is(":animated"))helper.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else
helper.parent.is(':visible')?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade);}else{helper.parent.show();}update();}function update(event){if($.tooltip.blocked)return;if(event&&event.target.tagName=="OPTION"){return;}if(!track&&helper.parent.is(":visible")){$(document.body).unbind('mousemove',update)}if(current==null){$(document.body).unbind('mousemove',update);return;}helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;if(event){left=event.pageX+settings(current).left;top=event.pageY+settings(current).top;var right='auto';if(settings(current).positionLeft){right=$(window).width()-left;left='auto';}helper.parent.css({left:left,right:right,top:top});}var v=viewport(),h=helper.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){left-=h.offsetWidth+20+settings(current).left;helper.parent.css({left:left+'px'}).addClass("viewport-right");}if(v.y+v.cy<h.offsetTop+h.offsetHeight){top-=h.offsetHeight+20+settings(current).top;helper.parent.css({top:top+'px'}).addClass("viewport-bottom");}}function viewport(){return{x:$(window).scrollLeft(),y:$(window).scrollTop(),cx:$(window).width(),cy:$(window).height()};}function hide(event){if($.tooltip.blocked)return;if(tID)clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity","");}if((!IE||!$.fn.bgiframe)&&tsettings.fade){if(helper.parent.is(':animated'))helper.parent.stop().fadeTo(tsettings.fade,0,complete);else
helper.parent.stop().fadeOut(tsettings.fade,complete);}else
complete();if(settings(this).fixPNG)helper.parent.unfixPNG();}})(jQuery);
