

function trim(A){return A.replace(/(^\s*)|(\s*$)/g,"")}function QuickSearch(A,D,B,C){$.o=this;this.varname=B;this.div=$("#"+D).attr("QuickSearch_varname",this.varname).html("<span>"+C+"</span>");this.input=$("#"+A);this.input.attr("QuickSearch_varname",this.varname);this.userValue=this.input.val();this.temporisation=200;this.chaineprecedente=this.input.val();this.handler_timeout=null;this.position=null;this.baseURL="/searchCompletion?s=";this.domaine=document.location.host.substr(document.location.host.indexOf("."));this.input.click(function(){$.o.onclick()});this.input.keydown(function(E){$.o.keypress(E)})}QuickSearch.prototype.keypress=function(B){if(!B){var B=window.event}switch(window.event?B.keyCode:B.which){case 27:this.moveTo(-1);this.div.hide();break;case 38:this.moveBy(-1);break;case 40:this.moveBy(1);break;case 13:if(this.position!=null){$(this.input).val($(this.div).find("td:eq("+this.position+")").attr("value"))}break;default:this.userValue=trim(this.input.val());if(this.handler_timeout!=null){clearTimeout(this.handler_timeout);this.handler_timeout=null}var A=trim(this.input.val());if((A!=this.chaineprecedente)&&(A.length>=2)){if(!$(this.div).find("td").length>0){this.SendRequest(A)}else{this.handler_timeout=setTimeout(this.varname+'.SendRequest( "'+A+'" )',this.temporisation)}}break}if(this.input.val()==""){this.div.hide()}};QuickSearch.prototype.SendRequest=function(A){this.chaineprecedente=A;$.get(this.baseURL+A,function(B){quicksearch.GetRequest(B)})};QuickSearch.prototype.GetRequest=function(A){this.position=null;if($(A).find("vide").length==1){this.hide();return false}this.div.find("#qs_ctc").remove();$.table=$("<table/>").attr("id","qs_ctc");$(A).find("resultat").each(function(B){$.table=$.table.append($("<tr />").append($("<td />").html($(this).text().replace(new RegExp($.o.userValue,"i"),"<span>"+$.o.userValue+"</span>")).bind("mouseenter",function(){$.o.moveTo(B)}).bind("mouseleave",function(){$(this).removeClass("selected")}).click(function(){$.o.input.val($(this).text());$("#frecherche").submit()}).attr("value",$(this).text())))});this.div.append($.table);this.show()};QuickSearch.prototype.show=function(){$("body").click($.o.hide);$.o.div.show()};QuickSearch.prototype.hide=function(){$("body").unbind("click",$.o.hide);$.o.div.hide()};QuickSearch.prototype.moveBy=function(A){this.moveTo((this.position==null?-1:this.position)+A)};QuickSearch.prototype.moveTo=function(B){if(!this.div.is(":visible")){return false}var A=$(this.div).find("td");A.each(function(){$(this).removeClass("selected")});this.position=B;if(this.position>=A.length){this.position=A.length-1}A.eq(this.position).addClass("selected")};QuickSearch.prototype.onclick=function(D){var A=new urloperations();var C=A.getUrlParam("s");var B=A.isUrlComposedOf("/index/");if(!(C!=""||B)){this.input.val("")}}; function getCookie(G){var H=document.cookie;var E=H.indexOf(G+"=");if(E==-1){return null}E=H.indexOf("=",E)+1;var F=H.indexOf(";",E);if(F==-1){F=H.length}return unescape(H.substring(E,F))}function setCookie(O,N){var I=setCookie.arguments;var J=setCookie.arguments.length;var P=(J>2)?I[2]:null;var K=(J>3)?I[3]:null;var M=(J>4)?I[4]:null;var L=(J>5)?I[5]:false;document.cookie=O+"="+escape(N)+((P==null)?"":("; expires="+P.toGMTString()))+((K==null)?"":("; path="+K))+((M==null)?"":("; domain="+M))+((L==true)?"; secure":"");return }; function callHttpRequestRdc(){var liste_appel=null;var url=null;var fnCallBackOnSent=null;var fnCallBack=null;var fnCallBackErreur=null;var params=null;var msgErreur="Erreur de paramètres";var method="GET";var paramPost=null;try{if(arguments.length==1){liste_appel=arguments[0];var appel=liste_appel[0];url=appel[0];fnCallBack=appel[1];fnCallBackErreur=(appel.length>=3?appel[2]:null);params=(appel.length==4?appel[3]:null);fnCallBackOnSent=(appel.length>=5?appel[4]:null);method=(appel.length>=6?appel[5]:"GET");paramPost=(appel.length==7?appel[6]:null);liste_appel.shift()}else{if((arguments.length>=2)&&(arguments.length<=7)){url=arguments[0];fnCallBack=arguments[1];fnCallBackErreur=(arguments.length>=3?arguments[2]:null);params=(arguments.length>=4?arguments[3]:null);fnCallBackOnSent=(arguments.length>=5?arguments[4]:null);method=(arguments.length>=6?arguments[5]:"GET");paramPost=(arguments.length==7?arguments[6]:null)}else{return msgErreur}}}catch(err){return msgErreur}var xmlHttpReq=null;if(window.XMLHttpRequest){xmlHttpReq=new XMLHttpRequest()}else{if(window.ActiveXObject){xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP")}else{alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");return"Navigateur non compatible"}}if(xmlHttpReq.overrideMimeType){xmlHttpReq.overrideMimeType("text/xml")}xmlHttpReq.open(method,url,true);if(method=="post"){xmlHttpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}xmlHttpReq.onreadystatechange=function(){if(xmlHttpReq.readyState==2&&fnCallBackOnSent!=null){eval(fnCallBackOnSent+"(xmlHttpReq , params)")}if(xmlHttpReq.readyState==4){if(xmlHttpReq.status==200&&fnCallBack!=null){if(typeof fnCallBack=="string"){eval(fnCallBack+"(xmlHttpReq.responseXML.documentElement , params)")}else{fnCallBack.callback(xmlHttpReq.responseXML.documentElement,params)}}else{if(fnCallBackErreur!=null){if(typeof fnCallBackErreur=="string"){eval(fnCallBackErreur+" (params , xmlHttpReq.status)")}else{fnCallBackErreur.callbackError(params,xmlHttpReq.status)}}}if((liste_appel!=null)&&(liste_appel.length>0)){callHttpRequestRdc(liste_appel)}}};xmlHttpReq.send(paramPost)}; function initHeader(){if($.browser.msie&&$.browser.version.indexOf("6.")>=0){$("ul#nav li.f").hover(function(){$(this).addClass("hov");$("ul.sub li",this).hover(function(){$(this).addClass("hov")},function(){$(this).removeClass("hov")});hideShowSelectIE("hide")},function(){$(this).removeClass("hov");$("ul.sub li",this).unbind("hover");hideShowSelectIE("show")})}var H=new urloperations();var F=H.getUrlParam("recherche");var G=H.isUrlComposedOf("/index/");$("#text_rech").data("tmpText",$("#text_rech").attr("value")).focus(function(){if(this.value==$(this).data("tmpText")){if(!(F!=""||G)){this.value=""}}}).blur(function(){if(this.value==""){this.value=$(this).data("tmpText")}});var E=$.cookie("SID");if(E==5){$("#frecherche").append("<input type='hidden' name='pro' value='1'/> ")}$("#fauxSelect_rech,#btn_fauxSelect_rech").click(function(){$("#list_univers_rech").toggle()});$("#list_univers_rech li a").click(function(A){A.preventDefault();A.stopPropagation();$("#fauxSelect_rech").attr("value",$(this).text()).trigger("click")})}_.q.a(function(){initHeader()},1);function hideShowSelectIE(B){if($.browser.msie&&$.browser.version.indexOf("6.")>=0){switch(B){case"hide":$("select").each(function(){$(this).css("visibility","hidden")});break;case"show":$("select").each(function(){$(this).css("visibility","visible")});break}}}function vcis(E){if(document.all){var F=document.getElementsByTagName("select");for(var D=0;D<F.length;D++){F[D].style.visibility=E}}}function toggleRSS(){var D=document.getElementsByTagName("img");for(var C=0;C<D.length;C++){if(D[C].className=="rss"){D[C].style.display=(disprss?"none":"inline")}}disprss=!disprss}; function urloperations(){}urloperations.prototype.getUrlParam=function(N){var I=window.location;var M=window.location.toString().split("?");var J=M[1];var K=new RegExp("^.*"+N+"=([^&]+).*$","gi");var L=K.exec(J);var H="";if(L!=null&&L.length>1){H=L[1]}return H};urloperations.prototype.isUrlComposedOf=function(D){var E=window.location;var F=window.location.toString().split(D);if(F.length>1){return true}else{return false}}; <!--

function trim(string) { return string.replace(/(^\s*)|(\s*$)/g,''); }
Array.prototype.find = function(searchStr)
  {
    var returnArray = false;
    for (i=0; i<this.length; i++)
      {
        if (this[i]==searchStr) return i;
      }
    return -1;
  }

// [[ 0. Portable event handler registration functions for IE DOM2. ]]
/*
This code is from the book JavaScript: The Definitive Guide, 5th Edition, by David Flanagan. Copyright 2006 O'Reilly Media, Inc. (ISBN #0596101996)
Source : http://www.davidflanagan.com/javascript5/display.php?n=17-2&f=17/eventHandler.js
*/
var eventHandler = {};

// In DOM-compliant browsers, our functions are trivial wrappers around addEventListener() and removeEventListener().
if ( document.addEventListener )
	{
		eventHandler.add = function(element, eventType, handler) { element.addEventListener(eventType, handler, false); };
		eventHandler.del = function(element, eventType, handler) { element.removeEventListener(eventType, handler, false); };
	}
// In IE 5 and later, we use attachEvent() and detachEvent(), with a number of hacks to make them compatible with addEventListener and removeEventListener.
else if ( document.attachEvent )
	{
		eventHandler.add = function(element, eventType, handler)
			{
    // Don't allow duplicate handler registrations _find() is a private utility function defined below.
				if ( eventHandler._find(element, eventType, handler) != -1 )
					{ return; }

    // To invoke the handler function as a method of the element, we've got to define this nested function and register it instead of the handler function itself.
				var wrappedHandler = function(e)
					{
						if ( !e ) { e = window.event; }

      // Create a synthetic event object with partial compatibility with DOM events.
						var event = {
							_event: e,       // In case we really want the IE event object
							type: e.type,      // Event type
							target: e.srcElement,  // Where the event happened
							currentTarget: element, // Where we're handling it
							relatedTarget: ( e.fromElement ? e.fromElement:e.toElement ),
							eventPhase: ( e.srcElement == element ? 2:3 ),

       // Mouse coordinates
							clientX: e.clientX, clientY: e.clientY,
							screenX: e.screenX, screenY: e.screenY,

       // Key state
							altKey: e.altKey, ctrlKey: e.ctrlKey,
							shiftKey: e.shiftKey, charCode: e.keyCode,

       // Event management functions
							stopPropagation: function() { this._event.cancelBubble = true; },
							preventDefault: function() { this._event.returnValue = false; }
						}

      // Invoke the handler function as a method of the element, passing the synthetic event object as its single argument.
      // Use Function.call() if defined; otherwise do a hack
						if ( Function.prototype.call )
							{ handler.call(element, event); }
						else // If we don't have Function.call, fake it like this
							{
								element._currentHandler = handler;
								element._currentHandler(event);
								element._currentHandler = null;
							}
					};

     // Now register that nested function as our event handler.
					element.attachEvent('on'+ eventType, wrappedHandler);

     // Now we must do some record keeping to associate the user-supplied handler function and the nested function that invokes it.
     // We have to do this so that we can deregister the handler with the del() method and also deregister it automatically on page unload.

     // Store all info about this handler into an object
					var h = {
						element: element,
						eventType: eventType,
						handler: handler,
						wrappedHandler: wrappedHandler
					};

    // Figure out what document this handler is part of.
    // If the element has no "document" property, it is not a window or a document element, so it must be the document object itself.
				var d = ( element.document || element );
    // Now get the window associated with that document
				var w = d.parentWindow;

    // We have to associate this handler with the window, so we can remove it when the window is unloaded
				var id = eventHandler._uid();            // Generate a unique property name
				if ( !w._allHandlers ) { w._allHandlers = {}; } // Create object if needed
				w._allHandlers[id] = h;             // Store the handler info in this object

    // And associate the id of the handler info with this element as well
				if ( !element._handlers ) { element._handlers = []; }
				element._handlers.push(id);

    // If there is not an onunload handler associated with the window, register one now.
				if ( !w._onunloadHandlerRegistered )
					{
						w._onunloadHandlerRegistered = true;
						w.attachEvent('onunload', eventHandler._removeAllHandlers);
					}
			};

		eventHandler.del = function(element, eventType, handler)
			{
    // Find this handler in the element._handlers[] array.
				var i = eventHandler._find(element, eventType, handler);
				if (i == -1) { return; } // If the handler was not registered, do nothing

    // Get the window of this element
				var d = ( element.document || element );
				var w = d.parentWindow;

				var handlerId = element._handlers[i];          // Look up the unique id of this handler
				var h = w._allHandlers[handlerId];           // And use that to look up the handler info
				element.detachEvent('on'+ eventType, h.wrappedHandler); // Using that info, we can detach the handler from the element
				element._handlers.splice(i, 1);             // Remove one element from the element._handlers array
				delete w._allHandlers[handlerId];            // And delete the handler info from the per-window _allHandlers object
			};

  // A utility function to find a handler in the element._handlers array Returns an array index or -1 if no matching handler is found
		eventHandler._find = function(element, eventType, handler)
			{
				var handlers = element._handlers;
				if (!handlers) { return -1; } // if no handlers registered, nothing found

    // Get the window of this element
				var d = element.document || element;
				var w = d.parentWindow;

    // Loop through the handlers associated with this element, looking for one with the right type and function.
    // We loop backward because the most recently registered handler is most likely to be the first removed one.
				for(var i = handlers.length - 1; i >= 0; i--)
					{
						var handlerId = handlers[i];    // get handler id
						var h = w._allHandlers[handlerId]; // get handler info
      // If handler info matches type and handler function, we found it.
						if (h.eventType == eventType && h.handler == handler)
							{ return i; }
					}
				return -1; // No match found
			};

		eventHandler._removeAllHandlers = function()
			{
    // This function is registered as the onunload handler with attachEvent. This means that the this keyword refers to the window in which the event occurred.
				var w = this;
    // Iterate through all registered handlers
				for ( id in w._allHandlers )
					{
						var h = w._allHandlers[id];                  // Get handler info for this handler id
						h.element.detachEvent('on'+ h.eventType, h.wrappedHandler); // Use the info to detach the handler
						delete w._allHandlers[id];                  // Delete the handler info from the window
					}
			}

  // Private utility to generate unique handler ids
		eventHandler._counter = 0;
		eventHandler._uid = function() { return 'h'+ eventHandler._counter++; };
	}


function rdc_clk(param)
{
	document.location.href=param;
	return true;
}

function rdc_click(param1, param2)
{
	document.location.href=param1;
	return true;
}

function rdc_click4(arg, popup_name , popup_args ) {
	arg = arg.replace(/\[hostrdc\]/g,    'www.rueducommerce.fr');
	arg = arg.replace(/\[hostavd\]/g,    'www.avenidadelcomercio.es');
	arg = arg.replace(/\[hostalp\]/g, 'www.alapage.com');
	arg = arg.replace(/\[prot\]/g,       'http://');
	arg = arg.replace(/\[\|\]/g,   	      '/');
	arg = arg.replace(/\[@\]/g,   	      '.');
	arg = arg.replace(/\[!\]/g,   	      '?');
	arg = arg.replace(/\[hostsearch\]/g, 'search.rueducommerce.fr');
	if (popup_name != undefined && popup_args != undefined && popup_name + popup_args != "")
		window.open(arg,popup_name,popup_args)
	else
		document.location=arg;
	return true;
}

function rc4(arg, popup_name , popup_args ) {
	arg = arg.replace(/\[hostrdc\]/g,    'www.rueducommerce.fr');
	arg = arg.replace(/\[hostavd\]/g,    'www.avenidadelcomercio.es');
	arg = arg.replace(/\[prot\]/g,       'http://');
	arg = arg.replace(/\[\|\]/g,   	      '/');
	arg = arg.replace(/\[@\]/g,   	      '.');
	arg = arg.replace(/\[!\]/g,   	      '?');
	arg = arg.replace(/\[hostsearch\]/g, 'search.rueducommerce.fr');
	if ( popup_name + popup_args != "" )
		window.open(arg,popup_name,popup_args)
	else
		document.location=arg;
	return true;
}

function rck(arg,pn,pa) {
	arg = arg.replace(/\[r\]/g,    'www.rueducommerce.fr');
	arg = arg.replace(/\[a\]/g,    'www.avenidadelcomercio.es');
	arg = arg.replace(/\[p\]/g,       'http://');
	arg = arg.replace(/\[\|\]/g,   	      '/');
	arg = arg.replace(/\[@\]/g,   	      '.');
	arg = arg.replace(/\[!\]/g,   	      '?');
	arg = arg.replace(/\[s\]/g, 'search.rueducommerce.fr');
	if ( pn + pa != "" )
		window.open(arg,pn,pa)
	else
		document.location=arg;
	return true;
}

function bookmarkRDC(url,title){
if (window.sidebar) // Firefox
window.sidebar.addPanel(title, url, "");
else if(document.all) // IE
window.external.AddFavorite(url, title);
}


// une variable javascript déclenchée en debut de page pour mesurer les temps de chargement de page si on la compare avec une autre variable calculée en bas de page
var rdc_perf_start=new Date();

// une variable pour l'affichage de publicite
var rdc_bln_pub = 1;
// --------------------------------------------------------------------------------------------------
// Cookie de VISITOR_ID
// --------------------------------------------------------------------------------------------------

if (document.cookie.indexOf("RDC_VISITOR_ID")==-1) {

	var guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); return v.toString(16);  }).toUpperCase(); 
	var rdc_td_d=new Date();
	rdc_td_d.setTime(rdc_td_d.getTime()+(10*365*24*3600*1000)); 
	document.cookie="RDC_VISITOR_ID="+guid+"; expires="+rdc_td_d.toGMTString()+"; path=/; domain=.rueducommerce.fr";

}


// --------------------------------------------------------------------------------------------------
// on stocke le xtor dans un cookie rdc_xtor
// --------------------------------------------------------------------------------------------------
// determination de la source Xtor : si elle est fournie dans l'url , on la prend, sinon, on la calcule

var rdc_xtor="";
if((document.location.href.toLowerCase().indexOf("#xtor")>0)||(document.location.href.toLowerCase().indexOf("?xtor")>0)||(document.location.href.toLowerCase().indexOf("&xtor")>0)){
	rdc_xtor=document.location.href.toLowerCase().replace(/(.*)(#|\?|&)xtor(=*)([^&$#\?]*).*/g,"$4");
}
else{
	if(document.referrer) {
		var rdc_tab_ref=document.referrer.toLowerCase().match(".?://(www.)?([^/:]+)");
		if(rdc_tab_ref!=null) {
			var rdc_rdc_ref=rdc_tab_ref[2];
			if(rdc_rdc_ref.indexOf("google.")>=0)
			{
				rdc_xtor="SEC-1";
				var rdc_query_match = document.referrer.toLowerCase().match(/(.*)(\?|&)q=([^&$#\?]*).*/);
				if (rdc_query_match != null)
				 {
		 			var rdc_query = rdc_query_match[3];
		 			if ((rdc_query=='rue+du+commerce') || (rdc_query=='rueducommerce') || (rdc_query=='rue%20du%20commerce'))
		 			{
						rdc_xtor="SEC-100";
		 			}
		 			else {
						if(rdc_query.indexOf("commerce")>=0)
						{
							rdc_xtor="SEC-100";
						}
						if(rdc_query.indexOf("rdc")>=0)
						{
							rdc_xtor="SEC-100";
						}
					}
				}
			}
	
			if(document.referrer.toLowerCase().match(/http:\/\/www\.google\.[^\/]*\/products/i)) {
					rdc_xtor="sec-1000";
					
			}

			if(document.referrer.toLowerCase().match(/http:\/\/www\.bing\.com\/search/i)) {
					rdc_xtor="SEC-2";
			}

			if(document.referrer.toLowerCase().match(/http:\/\/fr\.search\.yahoo\.com\/search/i)) {
					rdc_xtor="SEC-3";
			}


			if(document.referrer.toLowerCase().match(/http:\/\/search\.free\.fr\/google/i)) {
					rdc_xtor="SEC-400";
			}
				

			if(document.referrer.toLowerCase().match(/http:\/\/rechercher\.aliceadsl\.fr\/google/i)) {
					rdc_xtor="SEC-500";
			}


			if(document.referrer.toLowerCase().match(/http:\/\/www\.sfr\.fr\/recherche/i)) {
					rdc_xtor="SEC-600";
			}


			if(document.referrer.toLowerCase().match(/http:\/\/lo\.st\/cgi\-bin\/eolost\.cgi/i)) {
					rdc_xtor="SEC-900";
			}

			if(document.referrer.toLowerCase().match(/http:\/\/search\.conduit\.com/i)) {
					rdc_xtor="SEC-900";
			}
				
                        
}}}


// on supprime quelques cookies
// --------------------------------------------------------------------------------------------------
rdc_xtor=rdc_xtor.toLowerCase();
rdc_xtor=rdc_xtor.replace(/al\-252379(.*)/g,"al-252379");
if((rdc_xtor!="")&&(rdc_xtor!="al-25")&&(rdc_xtor!="al-29")&&(rdc_xtor!="al-24")&&(rdc_xtor!="al-252378")&&(rdc_xtor!="al-34"))
{
	var rdc_d=new Date();
	document.cookie="VISITOR_ID_15J=; expires="+rdc_d.toGMTString()+"; path=/; domain=www.rueducommerce.fr"
}

// on corrige à la volée, certaines valeurs de xtor
// --------------------------------------------------------------------------------------------------
var rdc_visite_id="";
rdc_xtor = rdc_xtor.toLowerCase().replace('%255b','%5b');	
rdc_xtor = rdc_xtor.toLowerCase().replace('%255d','%5d');	

// si on a un xtor ou bien qu'on n'a pas encore de cookie de visite
// on pose un cookie rdc_xtor et un cookie rdc_visite_id (grace a l'ajax)
// et on regle 15 jours de cookie si il y a un xtor  si il n'y en a pas (acces direct par exemple)
// --------------------------------------------------------------------------------------------------
if((rdc_xtor!="")||(document.cookie.indexOf("RDC_VISITE_ID")==-1))
{
	var rdc_referrer="";
	if(document.referrer){
		rdc_referrer=document.referrer
	}
	var rdc_atterrissage="";
	if(document.location.href)
	{
		rdc_atterrissage=document.location.href
	}

	var rdc_tracker="$"+rdc_xtor+"$"+rdc_referrer+"$"+rdc_atterrissage+"$";

	if (location.host.indexOf("rueducommerce.fr") >= 0) {

		var guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); return v.toString(16);  }).toUpperCase(); 
		document.cookie="RDC_VISITE_ID_V2="+guid+"; path=/; domain=.rueducommerce.fr";

		$.get('/shared/tracking/visiteajax.cfm?'+encodeURI(rdc_tracker), function(data) { SetCookieRDCVISITEID(data); },'text');
	}

	if (rdc_xtor!="") {
		document.cookie="rdc_xtor="+rdc_xtor+"; path=/; domain=.rueducommerce.fr";
		var rdc_last_xtor_date=new Date();
		rdc_last_xtor_date.setTime(rdc_last_xtor_date.getTime()+(24*3600*1000));
		rdc_last_xtor_date_UTC_ISO_Format = rdc_last_xtor_date.getUTCFullYear() + '-' + (((rdc_last_xtor_date.getUTCMonth()+1)<10)?'0':'') + (rdc_last_xtor_date.getUTCMonth()+1) + '-' + rdc_last_xtor_date.getUTCDate() + ' ' + ((rdc_last_xtor_date.getUTCHours()<10)?'0':'') + rdc_last_xtor_date.getUTCHours() + ':' + ((rdc_last_xtor_date.getUTCMinutes()<10)?'0':'') + rdc_last_xtor_date.getUTCMinutes() + ':' + ((rdc_last_xtor_date.getUTCSeconds()<10)?'0':'') + rdc_last_xtor_date.getUTCSeconds();  
		document.cookie="rdc_last_xtor="+rdc_xtor+"; expires="+rdc_last_xtor_date.toUTCString()+"; path=/; domain=.rueducommerce.fr";
		document.cookie="rdc_last_xtor_expires="+rdc_last_xtor_date_UTC_ISO_Format+"; expires="+rdc_last_xtor_date.toUTCString()+"; path=/; domain=.rueducommerce.fr";
	}
}

// on deplace tous les sites unders sur un compte xiti a part, pour ne pas pourrir les stats
var rdcads = document.location.href.toLowerCase();
if (rdcads.indexOf('/adsiteunder/') > 0) {
	xtsite=345749;
}


function SetCookieRDCVISITEID(rdc_visite_id) {
	var rdc_td_d=new Date();
	rdc_td_d.setTime(rdc_td_d.getTime()+(15*24*3600*1000)); 
	document.cookie="RDC_VISITE_ID="+rdc_visite_id+"; expires="+rdc_td_d.toGMTString()+"; path=/; domain=.rueducommerce.fr";
}


function changeObjSrc(id,url)
{
	$('#'+id).attr("src",url.replace(/&amp;/g, '&'));
}

function include(fileName,type)
{
	var headID = document.getElementsByTagName("head")[0];
	if (type == 'js'){
		var newScript = document.createElement('script');
		newScript.type = 'text/javascript';
		newScript.src   =  fileName;
		headID.appendChild(newScript);
	} 
	else if (type == 'css'){
		var newCSS = document.createElement('link');
		newCSS.type = 'text/css';
		newCSS.rel  = 'stylesheet';
		newCSS.src   =  fileName;
		headID.appendChild(newCSS);
	}
}

function addElementBefore(node,tag,id,htm)
{
        var ne = document.createElement(tag);
        if(id) ne.id = id;
        if(htm) ne.innerHTML = htm;
        node.parentNode.insertBefore(ne,node);
}

function addElementAfter(node,tag,id,htm)
{
        var ne = document.createElement(tag);
        if(id) ne.id = id;
        if(htm) ne.innerHTML = htm;
        node.parentNode.insertBefore(ne,node.nextSibling);
}

// traitement de cas particuliers en cas de listes vides ou produits obso !! ;-)
$(document).ready(function() {
 if(!($.browser.msie && $.browser.version=="6.0")) {

   // Si fiche produit gm en erreur car indisponible
   if (document.location.href.toLowerCase().indexOf("/m/ps/")>0) { 
     if($("div.error").length) {
       if($("div.error").text().indexOf('indisponible',1) > 0) {
		   $.getScript('http://s1.static69.com/shared/js/ergo_fp_obso_gm.js', function(data, textStatus)  {
           	   });
        }
     }
   }

 // Si liste offre vide
   if (document.location.href.toLowerCase().indexOf("/m/pl/")>0) { 
     if($("#zm_error").length) {
       if($("#zm_error").text().indexOf('offre',1) > 0) {
	   	$.getScript('http://s1.static69.com/shared/js/ergo_liste_offre_vide_gm.js', function(data, textStatus)  {
           	});
        }
     }
   }


  }
});


//-->

var nbProduct = 0;

function loadNbrProduct ()
{
		var o = $.cookie('ORDERID');
		var r = $.cookie('R');
		var s = $.cookie('ST');
		
		
		if(r==null){
			var fRd = Math.random();
			var sRd = fRd.toString();
			r = sRd.substring(2,sRd.length)
		}
		if (( o!=null ) && ( r!=null ) && ( s!=null ))
		{
			$("#sbButtons").show();
			 $.ajax({  
				   url: "/basket/shoppingbox/getCountBasketController.php",
				   data: "o=" + o + "&r=" + r + "&s=" + s,
				   success: function(xml){
				 	nbProduct = parseInt($(xml).find("total").text() );
				 	if (parseInt($(xml).find("gm").text() ) > 0) {
				 		$.ajax({
							   url: "/m/cart/cart.php",
							   data: "gui=countitems&order_id=" + o + "&r=" + r + "&s=" + s,
							   success: function(xml){
							 	nbProduct += parseInt($(xml).find("total").text() );
							 	$("#popQtArt").text(nbProduct==0?txt_SB_vide:nbProduct + " " +(nbProduct==1?txt_SB_article:txt_SB_articles)) ;
							   }
							 });
				 	}
				 	else
				 		$("#popQtArt").text(nbProduct==0?txt_SB_vide:nbProduct + " " +(nbProduct==1?txt_SB_article:txt_SB_articles)) ;
				   }
				 });
		}
		else
		{
			$("#sbButtons").hide();
			$("#popQtArt").text(txt_SB_vide);
		}
}
_.q.a( function() {
	if(typeof(txt_SB_vide) != "undefined")
  loadNbrProduct();
  $('#btn_detailsPanier').click(function(){
  	if ($('#btn_detailsPanier').hasClass('on')){
		$('#contentPanier').slideToggle(300,function(){$('#contentPanierProducts').html("");
		$('#btn_detailsPanier').removeClass("on");})
		}	
	if ($('#contentPanierProducts').children().length == 0) {
		$("#contentPanierWaiter").show();$('#contentPanier').slideToggle(300); 
		loadProducts();
		$('#btn_detailsPanier').addClass("on")} 
	});
$('#btn_closePanier').click(function(){$('#btn_detailsPanier').removeClass("on");$('#contentPanier').slideToggle(300,function(){$('#contentPanierProducts').html("")})});  
} , 1 );


function loadProducts(){
	var o = $.cookie('ORDERID');
	var r = $.cookie('R');
	var s = $.cookie('ST');
	
	if(r==null){
		var fRd = Math.random();
		var sRd = fRd.toString();
		r = sRd.substring(2,sRd.length)
	}
	if (( o!=null ) && ( r!=null ) && ( s!=null ) )
	{
		$.ajax({
		   url: "/basket/shoppingbox/GetBasketContentController.php",
		   data: "o=" + o + "&r=" + r + "&s=" + s,
		   success: function(xml){
			$("#contentPanierWaiter").hide();
		 	$("#contentPanierProducts").html($(xml).find("content").text()) ;
		   }
		 });

	}
	else
	{
	}
	
}

/* shopping box */
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

var shop_timeout_Loading = null
function Shop_loading(from)
  {
  
  	if (from == 0){
  	var txt_message = "Ajout";
  	}else{
  	var txt_message = "Chargement";
  	}
	var div_opaque = document.getElementById("div_opaque");
	div_opaque.style.cssText="position:absolute;z-index:100;top:0px;left:0px;filter:alpha(opacity:47);display:;background:black"
	div_opaque.style.opacity = .47
	div_opaque.style.height = document.body.scrollHeight + "px"
	div_opaque.style.width =  document.body.scrollWidth + "px"  
    var shop_resultat = document.getElementById("shop_resultat"); 
  	shop_resultat.innerHTML = '<div style="text-align:center;margin:30 0 50 0;"><img src="/images/img-loading-mini.gif" width="20" height="20" vspace="10"><br>' + txt_message + '</div>';
  	shop_resultat.style.filter = 'alpha(opacity:100)'
  	shop_resultat.style.opacity = 1
  	shop_resultat.style.filter = 'alpha(opacity=80)'
	
	//FIXME fix pour Chrome - remplacement documentElement.scrollTop par window.pageYOffset
	// pour IE on fais la detection car dans IE6 de window.pageYOffset

	var scrollHeight = window.pageYOffset;
	if (navigator.appName=="Microsoft Internet Explorer")
		scrollHeight = document.documentElement.scrollTop;

	shop_resultat.style.top = 50 + scrollHeight + 'px';
  	shop_resultat.style.left = (((document.body.clientWidth-550)/2)+document.body.scrollLeft) + "px"
  	shop_resultat.style.display="block";

  }
function Shop_AddProduct(GetUrl)
  {
   if (typeof(pageTracker._trackEvent) != 'undefined') {
	   pageTracker._trackEvent('Boutons', 'FicheProduitHT', 'Ajouter_au_panier');//tracking xiti pour le button acheter
   }
   tmp = GetUrl;
   if (tmp.indexOf("shoppingBox") > -1 ){
   	shop_timeout_Loading = setTimeout( "Shop_loading(1)" , 1 );
   	}else{
   	shop_timeout_Loading = setTimeout( "Shop_loading(0)" , 0 );
   	}
   GetUrl += "&r=" + Math.floor(Math.random()*100000000);
	 callHttpRequestRdc( GetUrl , "shop_AddProduct_retour" , "shop_AddProduct_Err" )
	}

function shop_AddProduct_retour(resultxml)
{
  if ( $(resultxml).find("err").length == 1 ) {
     document.location.href='/info/basket/';
  }
  
  clearTimeout(shop_timeout_Loading);
	var div_opaque = document.getElementById("div_opaque");
	div_opaque.style.cssText="position:absolute;z-index:100;top:0px;left:0px;filter:alpha(opacity:47);display:;background:black";
	div_opaque.style.opacity = .47;
	div_opaque.style.height = document.body.scrollHeight + "px";
	div_opaque.style.width =  document.body.scrollWidth + "px";
	var shop_resultat = document.getElementById("shop_resultat");
	shop_resultat.style.filter = 'alpha(opacity:100)'
	shop_resultat.style.opacity = 1;
  shop_resultat.style.left = (((document.body.clientWidth-550)/2)+document.body.scrollLeft) + "px";
  
	shop_resultat.style.display="block";
	if (typeof(vcis) != "undefined" ) vcis('hidden');

	try
		{
      var err = resultxml.getElementsByTagName("ErreurAchat");
      if ( err.length != 0 ) shop_AddProduct_Err(err[0].childNodes[0].nodeValue);
      else
        {
          ContenuAff = resultxml.getElementsByTagName("content");
        	var html = ContenuAff[0].childNodes[0].nodeValue;
    			shop_resultat.innerHTML = html;    			
        }
		}
	catch( exep )
		{
			shop_AddProduct_Err("");
		}
	loadNbrProduct();
	$(".servprop div.nocheck").toggle(
	function(){nbProduct++;$("#popQtArt").text(nbProduct==0?txt_SB_vide:nbProduct + " " +(nbProduct==1?txt_SB_article:txt_SB_articles)) ;}
	,
	function(){nbProduct--;$("#popQtArt").text(nbProduct==0?txt_SB_vide:nbProduct + " " +(nbProduct==1?txt_SB_article:txt_SB_articles)) ;}
	);
 }

function shop_AddProduct_Err( msg )
{
  var shop_resultat = document.getElementById("shop_resultat");
  var html = "<div class='popAjoutPrdErr'>";
  html += "<a href='#' onclick='shop_popAjPrd_continuer(false);return false;' style='float:right' class='popFermer'>";
  html += "Fermer la fenêtre";
  html += "</a>";
  html += "<div class='popAPCentre' style='height:80px'>";
  html += "<div class='popAPPrd' style='position:absolute;top:30px;width:100%;left:0;text-align:center;color:red;font-weight:bold'>";
	html += ( msg != "" ? msg : Txt_shoperreur );
	html += "</div>";
	html += "</div>";
	html += "</div>";
  shop_resultat.innerHTML=html + "";
}

function shop_valider( mode , order_id , esdfilename )
  {
  	if ( mode == "continuer" ) {
      loadNbrProduct()
      shop_popAjPrd_continuer( false );
	  return false;
	}

    var div = document.getElementById("shop_resultat").getElementsByTagName("div")
    div = div[div.length-1]
    div.style.textAlign="center"
    div.innerHTML = "Enregistrement en cours" + "<br><img src='/images/img-loading-mini.gif' width='20' height='20' vspace='10'>"
    var f = document.forms["shop_addServ"]
    var haschecked = false;
    
    if ( f != null )
      {
        var haschecked_co_only = true;
        var request = new Array();

        for ( var i = 0 ; i < f.elements.length ; i ++)
          {
            var elt = f.elements[i];
            if (elt.type=="checkbox")
              {
                if ( elt.checked)
                  {
                    haschecked = true;
                    if ( elt.name == "contrator" )
                      {
                        var url_addco = "/info/basket/add_contrator.cfm?esd=" + esdfilename + "&addedFrom=" + f.addedFrom.value
                        request[0] = new Array( url_addco , "shop_popAjPrd_purchase" , "shop_popAjPrd_purchase_error" , mode );
                      }
                    else haschecked_co_only = false;
                  }
              }
          }
      }

    if (haschecked)
      {
        if ( ! haschecked_co_only )
          {
           var url_purchase = f.action + "?";
           var s = "";
           for ( var i = 0 ; i < f.elements.length ; i ++)
             {
               var elt = f.elements[i];
               if ((elt.type=="checkbox")&&(elt.checked))
                {
                  if (elt.getAttribute("service")=="yes") s += (s==""?"":",") + elt.value ;
                }
             }
            url_purchase += "od=" + f.od.value + "&s=" + s
            request[request.length] = new Array( url_purchase , "shop_popAjPrd_purchase" , "shop_popAjPrd_purchase_error" , mode );
          }

        callHttpRequestRdc ( request );
      }
    else
      {
        document.location.href="/info/basket/t_caddie.cfm?r=" + Math.floor(Math.random()*100000000);
      }
    
  }

function shop_popAjPrd_purchase_error ()
  {
    var div = document.getElementById("shop_resultat").getElementsByTagName("div")
    div = div[div.length-1]
    div.style.fontWeight="bold"
    div.style.color="red"
    div.innerHTML = "Erreur lors de l'enregistrement"
  }

function shop_popAjPrd_purchase ( xmlrequest , mode )
  {
    switch( mode )
      {
        case "continuer" :
          loadNbrProduct()
          shop_popAjPrd_continuer( false );
          break;
        case "terminer" :
          document.location.href="/info/basket/t_caddie.cfm?r=" + Math.floor(Math.random()*100000000);
          break;
      }
  }

function shop_popAjPrd_continuer( aff )
	{
		if (typeof(vcis) != "undefined" ) vcis('visible');
		document.getElementById("div_opaque").style.display='none'
		document.getElementById("shop_resultat").style.display='none'
		if ( ( aff != false ) ) document.getElementById("DV").style.display='block'
	}
	
function mycb_click( div )
  {
    inpt = document.getElementById( div.getAttribute('inpt') );
    inpt.click();
    if ( inpt.checked ) div.className="checkover"; else div.className="nocheckover";
  }
function mycb_over( div ){div.className=div.className+'over';}
function mycb_out( div ){div.className=div.className.replace(/over/gi,"");}

/* fin shopping box */
function getObjInfo ( obj , detail )
	{
		var tmp = ""
		for ( i in obj )
			{
				if ( detail )
					{
						tmp2 = obj[i];
						tmp += "<font color='red'>" + i + "</font>"  + " = " + tmp2 + "<br>";
					}
				else tmp += i + "<br>"
			}
		w = window.open('','','')
		w.document.write( tmp )
	}
function ventesFlash(){var A=$("#menuVf");if(A.length==1){if($.browser.msie&&/6.0/.test(navigator.userAgent)){$("#menuVf").mousemove(function(){ventesFlash_DisplayOn();hideShowSelectIE("hide");$(this).addClass("hov");$("#menuVf li",this).hover(function(){$(this).addClass("hov")},function(){$(this).removeClass("hov")})})}else{if($("#vfList").length==1&&$("#vfList").css("display")=="block"){ventesFlash_DisplayOn()}}$("#menuVf").hover(function(){ventesFlash_DisplayOn();if($.browser.msie&&$.browser.version.indexOf("6.")>=0){hideShowSelectIE("hide");$(this).addClass("hov");$("#menuVf li",this).hover(function(){$(this).addClass("hov")},function(){$(this).removeClass("hov")})}},function(){if($.browser.msie&&$.browser.version.indexOf("6.")>=0){hideShowSelectIE("show");$(this).removeClass("hov");$("ul#menuVf li",this).unbind("hover")}})}}function ventesFlash_DisplayOn(){var B=$("#vfList li");if(B.length==0){var A="/ventesflash/listeVenteFlashController.php?code="+$("#vfList").attr("class").replace(/sub /gi,"");callHttpRequestRdc(A,"ventesFlash_DisplayOnBack")}}function ventesFlash_DisplayOnBack(A){$("#vfList").html(A.getElementsByTagName("ctc")[0].childNodes[0].nodeValue);if($.browser.msie&&$.browser.version.indexOf("6.")>=0){$("#menuVf li.vfProd").hover(function(){$(this).addClass("hov")},function(){$(this).removeClass("hov")})}}; 
