
	_.q.a(function($) {
	 /* if($("div#tabs_vente_flash").length > 0){
	  	$("#tabs_vente_flash").tabs({ fxAutoHeight: true });
	  }*/
	  if ($('#zm_include_file_referencement').length > 0 && $("#zm_page_h1").length>0) {
	 		$('#zm_include_file_referencement').addClass('span-20 last').insertAfter($("#zm_page_h1"));
	  }
	  $("select[name='select-sort']").bind("change", function() {
	      if (!this.value) return;
	      location.href = this.value;
	  });
	  $("img#picture").each(function() {
		this.old_src = this.src;
	  });
	  
	  if ($("#cart-submit").ToolTip) {
	  	$("#cart-submit").ToolTip({
	  		className: "input-tooltip",
	  		position: "bottom"
	  	});
	  }
	  $("#cart-submit").bind("click", function() {
	    // BUGFIX
	    // Hide overlay when input button is clicked
	    $("#tooltipHelper").blur();
	    // --
	  });
	/*  $("#add-cart").submit(function () {
	    var elem = $("#cart-submit");
	
	    if (!elem.length || elem[0].can_submit)
	      return true;
	    return false;
	  });
	*/  
	  $('div.container form#add-cart').submit(function(e){
      e.preventDefault;
      try{
        pageTracker._trackEvent('Boutons', 'FicheProduitGM', 'Ajouter_au_panier');
      }catch(e){}
      return true;});
    
	  $("#section_reviewForm").toggle();
	  
	  $("#open_form").bind("click", function() {
	        $("#section_reviewForm").toggle();
	    });
	    
	  $("span#close_form").bind("click", function() {
	        $("#section_reviewForm").toggle();
	  });  
	    
	  $("a#loupe_link").bind("click", function() {
	//        var elem = $("#offer_image_thumbnails a").get(0);
	        var elem = $("a#thumb_1");
	        elem.click();
	        return false;
	  });
	  $('.lo_zoom').bind('mouseover',function(e){    
	
	var scrollX= 0; // 
	var scrollY= 0;
	var decalageY=210; // Decalage vertical par rapport au positionnement de la souris
	var decalageX=330; // Decalage horizontal par rapport au positionnement de la souris
	var hauteur_encart = 410; // Hauteur de l'encart produit au survol de la souris
	var largeur_encart = 315; // Largeur de l'encart produit au survol de la souris

	// screen_current_height : Hauteur de la fenetre visualisee 
	if (typeof(window.innerHeight) == 'number') {
		screen_current_height = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			screen_current_height = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				screen_current_height = document.body.clientHeight;
			}
		}
	}

	if (document.documentElement.scrollTop > 0) {
		scrollY = document.documentElement.scrollTop;
	} else if (document.body.scrollTop > 0) {
		scrollY = document.body.scrollTop;
	} 
	mouseY = parseInt(e.clientY + scrollY - decalageY);
 
	if (document.documentElement.scrollLeft > 0) {
		scrollX = document.documentElement.scrollLeft;
	} else if (document.body.scrollLeft > 0) {
		scrollX = document.body.scrollLeft;
	} 
	mouseX = parseInt(e.clientX + scrollX - decalageX);
	
	// Cas ou l'encart est trop bas dans la fenetre
	if ( (e.clientY+(hauteur_encart/2)) > screen_current_height) {
		mouseY = (screen_current_height - hauteur_encart - 10 ) + scrollY; 
	}
	
	// Cas ou l'encart est trop haut dans la fenetre
	if ( (e.clientY < (hauteur_encart/2)) ) {
		mouseY = scrollY + 10;
	}
	
	// Cas ou l'encart est trop a gauche dans la fenetre
	if ( e.clientX < largeur_encart ) {
		mouseX = parseInt(e.clientX + scrollX + 15);
	}
    
	    var el = $(this).parent('.photo_produit_conteneur');
	    var lo_desc = el.next();
	    if(lo_desc.hasClass('nod')){       
	      if($('img',lo_desc).length == 0){
          var img_src = $('.lo_img', el).attr('src').replace('150x150', '300x300');
          lo_desc.append('<br /><br /><img height="300" width="300" src="'+img_src+'"  />');
        }

        lo_desc.attr('style','left:'+mouseX+'px;top:'+mouseY+'px;');
        lo_desc.removeClass('nod');
        
        $(this).bind('mouseout',function(e){
            var el = $(this).parent('.photo_produit_conteneur');
            var lo_desc = el.next();
            lo_desc.addClass('nod');
        })
        
      }
    });
	  $('.photo_produit_conteneur').bind('mouseover',function(e){
	    e.stopPropagation();
	    if($('.lo_zoom',this).hasClass('nod')){
	      $('.lo_zoom',this).removeClass('nod');
	    }
	    $(this).bind('mouseout',function(e){
	      e.stopPropagation();
	      $('.lo_zoom',this).addClass('nod');
	    });
	  });
	  
	  
	  if ( $.browser.msie && /6.0/.test(navigator.userAgent) ) {
		$('span[onclick]','div.container').hover(function(){$(this).attr('style','color:#01b5ec;cursor: pointer;')},function(){$(this).attr('style','');});
	}

	}, 1);
	
_.q.a(function($) {
jQuery.fn.newsTicker = function(target,delay)
{
	target= $(target)||false;
	delay = delay || 4000;
	initTicker = function(el)
	{	
		stopTicker(el);
		el.items = $("li", el).not('li.notick');
		el.delay=delay;
		el.currentitem =0;
		var isIe6=($.browser.msie && $.browser.version.indexOf('6.')>=0);
		el.filterHide=(isIe6)?$.fn.hide:$.fn.fadeOut;//ie6 fadeBug
		el.filterShow=(isIe6)?$.fn.show:$.fn.fadeIn;//ie6 fadeBug
		el.speed=(isIe6)?1:"fast";//non 0 value
		$(el).parent().bind('mouseenter', function(){
			var cur=el.currentitem||0;
			var itm=(cur % (el.items.size()))?cur % (el.items.size()):el.items.size();
			$(this).bgIframe();
			$("ul",this).css('display', 'block');
			$("li",this).not(el.items[itm-1]).css('display', 'block');
		});
		$(el).parent().bind('mouseleave', function(){
					$("ul,li",this).css('display', 'none');
		});
		if(el.items.length>1)startTicker(el);
	};
	startTicker = function(el)
	{		
		el.tickfn = setInterval(function() { doTick(el,target) }, el.delay)
	};
	stopTicker = function(el)
	{
		clearInterval(el.tickfn);
	};
	pauseTicker = function(el)
	{
		el.pause = true;
	};
	resumeTicker = function(el)
	{
		el.pause = false;
	};
	doTick = function(el,target)
	{
		if(el.pause) return;
		el.pause = true;		
		if(target){		
					
				var elclone=$(el.items[el.currentitem]);
				el.filterHide.apply($(target),[el.speed,function()
					{	
						//$(this).hide();
						el.currentitem = ++el.currentitem % (el.items.size());
						$(this).html($(elclone).html());			
						el.filterShow.apply($(this),[el.speed,
							function()
							{
								el.pause = false;
							}
						]);
					}]);			
		}else{
	el.filterHide.apply($(el.items[el.currentitem]),[el.speed,
		function()
			{
				
				$(this).hide();
				el.currentitem = ++el.currentitem % (el.items.size());	
				el.filterShow.apply($(el.items[el.currentitem]),[el.speed,function(){
						el.pause = false;
					}]);
			}]);
		}

	};
	if(target){
		var _el=this;
		$(target).bind('mouseover',{el: _el},
		function(event)
		{
			pauseTicker(event.data.el[0]);
		});
		$(target).bind('mouseout',{el: _el},function(event)
		{
			resumeTicker(event.data.el[0]);
		}
	);
	}
	this.each(
		function()
		{
			if(this.nodeName.toLowerCase()!= "ul") return;
			initTicker(this);			
		}
	)
	.hover(
		function()
		{
			pauseTicker(this);
		},
		function()
		{
			resumeTicker(this);
		}
	);
	return this;
};
// ie6 
jQuery.fn.bgIframe = function(s) {
if ( $.browser.msie && /6.0/.test(navigator.userAgent) ) {
 s = $.extend({
 top : 'auto',
 left : 'auto', 
 width : 'auto',
 height : 'auto', 
 opacity : true,
 src : 'javascript:false;'
 }, s || {}); 
 var prop = function(n){return n&&n.constructor==Number?n+'px':n;},
 html = '<iframe class="bgiframe" frameborder="2" tabindex="-1" src="'+s.src+'"'+
 'style="display:block;position:absolute;z-index:-1;'+
 (s.opacity !== false?'filter:Alpha(Opacity=\'0\');':'')+
 'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+
 'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+
 'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+
 'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+
 '"/>'; 
 return this.each(function() {
 if ( $('> iframe.bgiframe', this).length == 0 )
 this.insertBefore( document.createElement(html), this.firstChild );
 });
 }
 return this;
};
jQuery.fn.titleManager = function(options){
	options=jQuery.extend({
		listnerEvent:'',
		dataFixed:null,
		titleMotif:""
	},options);	
	function initialize(dataFixed,docElm){
		options.dataFixed=dataFixed;
		createTitle.call(docElm[0]);
	}
	function createTitle(){
		var tmpTitle=options.titleMotif;
		for(var key in options.dataFixed){
		  
			if(key=="values"){
				var tmpArrStr=$(options.dataFixed[key].split(';')).map(function(){var elm=$('#'+this);if(elm)return $(elm).text()});
				options.dataFixed[key]=jQuery.makeArray(tmpArrStr).join(', ');
			}
			var reg=new RegExp("\\["+key+"\\]", "g");
			if(reg.test(tmpTitle));
			tmpTitle=tmpTitle.replace(reg, options.dataFixed[key]);
		}
	
		this.title=tmpTitle;
	}
	return $(window).bind(options.listnerEvent,this,function(event,data){initialize(data,event.data)});
};
},1);
