var A = new Template('<tr id="i_#{b}" class="ligneItem#{k}"><td class="li_cbx"><input type="checkbox"  id="cbx_i_#{b}" class="#{k}" #{v} /></td><td>#{x}</td><td class="li_thumb"><div style="width:100px;text-align:center;"><a href="#{d}">#{n}</a></div></td><td class="li_titre"><a href="#{d}" id="i_#{l}_#{b}" onclick="return false;">#{a}</a><br/>Vendeur : <a href="/fr/Appreciations/#{p}">#{p}</a>#{y} - #{q}/#{r} - #{s} % - #{w}<td class="li_enchere">#{f}</td><td class="li_prix">#{e}</td><td class="li_prix">#{t}</td><td class="li_prix">#{u}</td><td class="li_temps">#{g}<input type="hidden" id="latitude" value="#{i}"/><input type="hidden" id="longitude" value="#{j}"/><input type="hidden" id="distance" value="#{h}"/></td></tr>');
var gLigneItemSellerTpl = new Template('<tr id="i_#{b}" class="ligneItem#{k}"><td class="li_cbx"><input type="checkbox"  id="cbx_i_#{b}" class="#{k}" #{v} /></td><td>#{x}</td><td class="li_thumb"><div style="width:100px;text-align:center;"><a href="#{d}">#{n}</a></div></td><td class="li_titre"><a href="#{d}" id="i_#{l}_#{b}" onclick="return false;">#{a}</a><br/>R&#233;f&#233;rence : #{pReference}<br/>Vendeur : <a href="/fr/Appreciations/#{p}">#{p}</a>#{y} - #{q}/#{r} - #{s} % - #{w}<td class="li_enchere">#{f}</td><td class="li_prix">#{e}</td><td class="li_prix">#{t}</td><td class="li_prix">#{u}</td><td class="li_temps">#{g}<input type="hidden" id="latitude" value="#{i}"/><input type="hidden" id="longitude" value="#{j}"/><input type="hidden" id="distance" value="#{h}"/></td></tr>');
var gTitleMarkerTpl = new Template('<a href="#{d}" id="i_#{l}_#{id}" onclick="return false;">#{a}<br/>Vendeur : #{p} - #{q}/#{r} - #{s} % - #{w}</a>');
var B = new Template('<table id="tblItems"><col style="width:2%;" id="colsel" /><col style="width:3%;" id="colsuivi" /><col id="colimg" /><col id="coltitre" /><col id="colenchere" /><col id="colprix" /><col id="colprix" /><col id="colprix" /><col id="coltmps" /><thead><tr class="headerTblItem"><td class="li_cbx"></td><td class="li_cbx"></td><td class="li_thumb"></td><td class="li_titre" id="li_titre" title="tri"><a class="tri"><div style="width:100%;" id="tri_6">Titre</div></a></td><td class="li_enchere"><a class="tri" ><div style="width:100%;"id="tri_10">Ench&#232;re</div></a></td><td class="li_prix"><a class="tri"><div style="width:100%;" id="tri_2">Prix</div></a></td><td class="li_prix"><a class="tri"><div style="width:100%;" id="tri_2">Ach. Im</div></a></td><td class="li_prix"><a class="tri"><div style="width:100%;" id="tri_2">Livraison</div></a></td><td class="li_temps"><a class="tri"><div style="width:100%;" id="tri_0">Temps restant</div></a></td></tr></thead><tbody id="tbody_tblItems">#{pCorpsTblItems}</tbody></table>');
var C=new Template('/fr/Acheter/#{b}/#{c}');
var D=new Template('/image?im=#{b}');
var E=new Template('<div style="width: 100px; text-align: center;" class="thumb"><img alt="#{pAlt}" title="#{a}" src="#{d}" class="thumb" style="border: 0pt none ;"/></div>');
var gHTMLMap ='<div style="width: 100%;"><div style="width:800px; font-family:Arial,sans-serif; font-size:11px; border:1px solid black; margin:auto;"><table><tbody><tr id="cm_mapTR"><td style="width:400px;" valign="top"> <div id="sidebar" style="overflow: auto; height: 400px; font-size: 11px; color: #000"></div>';
gHTMLMap +='</td><td><div id="map" style="overflow: hidden; width:400px; height:400px"></div> </td></tr></tbody></table></div></div>';      
var cA = Class.create();
cA.prototype = {
  initialize: function( o ) {
    this.a = o.title;
    this.pReference = o.reference;
    this.b = o.id;
    this.c = o.urltitle;
    this.d = C.evaluate(this);
    this.e = o.prixEUR;
    this.f = o.enchere;
    this.g = o.tps;
    this.h = o.distance;
    this.i = o.latitude;
    this.j = o.longitude;
    this.k = o.class_css;
    this.p = o.username;
    this.q = o.indice;
    this.r = o.nbre_app;
    this.s = o.taux;
    this.t = o.buyitprice;
    this.u = o.livraison;
	
    this.v = (o.selection=="1")?' checked="checked"':'';
    this.w = (o.pro=="1")?"professionnel":"particulier";
	this.x=(o.favori)?'<img class="p" id="unstar_i_'+this.b+'" src="/images/etoile_j.gif" />':'<img class="p" id="star_i_'+this.b+'" src="/images/etoile_b.png" />';
	this.y=(o.certified==1)?'<img src="/images/etoile_v.png" alt="membre certif&#233;"/>':'<img src="/images/etoile_r.png"  title="membre non certif&#233;"/>';
    this.l = o.country_code;
	m="";
	o.Thumbs.each(function(pThumb){oThumb=new cC(pThumb);m=m+oThumb.fHTMLThumb();});
    this.n = m;
  },
  fa : function(){
  if(this.pReference=='')
  return A.evaluate(this);
  else
  return gLigneItemSellerTpl.evaluate(this);  
  }, 
  fTitleMarker : function(){
  return gTitleMarkerTpl.evaluate(this);
  }  
};
var cC = Class.create();
cC.prototype = {
  initialize: function( json ) {
    this.b = json.id.gsub(/t_/,"t");
    this.d = D.evaluate(this);
    this.pAlt = json.alt;
    this.a = json.title;
},
  fHTMLThumb : function(){
  return E.evaluate(this);
  }  
};

var I={"1":"ToutesLesCategories","2":"Arts-et-Antiquites","3":"Auto-Moto","4":"Autres-Categories","5":"Bandes-Dessinees","6":"Beaute-Sante","7":"Bebe","8":"Bijoux","9":"Cartes-Postales","10":"Cinema-et-DVD","11":"Collections","12":"Informatique","13":"Jeux-Jouets","14":"Livres","15":"Maison","16":"Mode-Vetement","17":"Musique-et-Instrument","18":"Numismatique","19":"Philatelie","20":"Photographie","21":"Sport-et-Loisirs","22":"Telecartes","23":"Telephonie","24":"TV-Hifi-Electromenager","25":"Vins-et-Alcool"};
var J={"1":"Toutes les cat&#233;gories","2":"Art et Antiquités","3":"Auto-Moto","4":"Autres Catégories","5":"Bandes Dessinées","6":"Beauté-Santé","7":"Bébé","8":"Bijoux","9":"Cartes Postales","10":"Cinéma et DVD","11":"Collections","12":"Informatique","13":"Jeux, Jouets","14":"Livres","15":"Maison","16":"Mode Vêtements","17":"Musique et instruments","18":"Numismatique","19":"Philatelie","20":"Photographie","21":"Sports, Loisirs","22":"Télécartes","23":"Téléphonie","24":"TV Hifi Electroménager","25":"Vins Alcools"};
var cB= Class.create();
var K=new Template('/fr/#{pNombigcat}/#{b}/#{pNomurl}');
var L=new Template('/fr/#{pNombigcat}');
var M=new Template('<li id="cat#{b}"><strong><a href="#{d}" id="cat_#{b}" onclick="return false;">#{pNom} <x-small>(#{pNombreEncheres})</x-small></a></strong></li>');
var N=new Template('<li id="cat#{bbigcat}" style="margin:auto;"><strong><a href="#{dBigCat}" id="cat_#{bbigcat}" onclick="return false;">#{pLibellebigcat}</a></strong></li>');
var O=new Template('<li id="cat1" style="margin:auto;"><strong><a href="#{dAllCat}" id="cat_1" onclick="return false;">#{pLibelleallcat}</a></strong></li>');
var P=new Template('<ul id="li_cat#{b}"></ul>');
var gTblCategoriePereTpl=new Template('<ul id="li_cat#{bPere}"></ul>');
var Q=new Template('<div class="module_menu" id="containerBoxCat"><div><div><div><h3 class="entete" id="nom_cat">#{pLibellebigcat}</h3><ul id="menu_sous_cat"></ul></div></div></div></div>');
var cB= Class.create();
cB.prototype = {
  initialize: function( json ) {
    this.pNom = json.nom;
    this.pNomurl = json.nomurl;
    this.b = json.id;
    this.bPere = json.idpere;
    this.bbigcat = json.idbigcat;	
    this.pNombigcat = I[json.idbigcat];	
    this.pLibellebigcat = J[json.idbigcat];	
    this.pLibelleallcat = J[1];	
    this.pNomallcat = I[1];	
    this.pNombreEncheres = json.nbreEncheres;	
    this.pHasleaf = json.hasleaf;
    this.d = K.evaluate(this);
    this.dBigCat = L.evaluate(this);
    this.dAllCat = L.evaluate({"pNombigcat":this.pNomallcat});
    this.pBackList = json.backlist;
    this.pCombo = json.combo_cat;
  },
  fLigneCategorie : function(){
  return M.evaluate(this);
  },
  fLigneBigCat : function(){
  return N.evaluate(this);
  },
  fLigneAllCat : function(){
  return O.evaluate(this);
  },  
  fTblCategorie : function(){
  return P.evaluate(this);
  },  
  fTblCategoriePere : function(){
  return gTblCategoriePereTpl.evaluate(this);
  },
  fBoxCategorie : function(){
  return Q.evaluate(this);
  }  
};
var R = "<p id=\"pbv\">";
var S = "Page suivante";
var T = "<b>Derni&#232;re page </b>";
var U = " Page pr&#233;c&#233;dente ";
var V = " <b>Premi&#232;re page </b>";
var W = "</p>";
var cPage = Class.create();
cPage.prototype = {
  initialize: function( json ) {
    this.pPage = json.Page;
    this.pItemsPerPage = json.ItemsPerPage;
    this.pNumberOfItems = json.NumberOfItems;
    this.pNumberOfPages = Math.ceil(this.pNumberOfItems/this.pItemsPerPage);
	this.d = "";
},
  fPageBreakView : function(d){
  		if (this.pNumberOfPages > 1){
		d=d.gsub(/\page=[0-9]{1,3}/,'');
		d=d.gsub(/ipp=[0-9]{1,3}/,'');
		d=d.gsub(/format=[a-z]{1,10}/,'');
		d=d.gsub(/\?[&]{1,10}/,'?');
		d=d.gsub(/[&]{1,10}/,'&');
		e=d.match(/\?/)?"&":"?"; 
		d=d+e;

		content = R;
		if(this.pPage > 1) content = content + " <a onclick=\"return false;\" href=\""+d+"page="+(this.pPage-1)+"&ipp="+this.pItemsPerPage+"\" id=\"page_"+(this.pPage-1)+"\">"+ U +"</a> ";
		else content = content + V;
		content =content + "<b>|</b>";
		for(i=1;i<=this.pPage-1;i++) {content =content + " <a onclick=\"return false;\" href=\""+d+"page="+i+"&ipp="+this.pItemsPerPage+"\" id=\"page_"+i+"\">"+i+"</a>";}
		content = content +" <b> "+this.pPage+" </b> ";
		for(i=parseInt(this.pPage)+1;i<=this.pNumberOfPages;i++){content =content +" <a onclick=\"return false;\" href=\""+d+"page="+i+"&ipp="+ this.pItemsPerPage +"\" id=\"page_"+i+"\">"+i+"</a> ";}
		content = content + "<b>|</b>";
		if(this.pPage < this.pNumberOfPages) content = content +" <a onclick=\"return false;\" href=\""+d+"page="+(parseInt(this.pPage)+1)+"&ipp="+this.pItemsPerPage+"\" id=\"page_"+(parseInt(this.pPage)+1)+"\">"+S+"</a> ";
		else content =content + T;
		content =content + W;
		} else {content='<span id="pbv"></span>';}
		return content;
  },
  fSelectItemsView : function(pFiltre){
		content = '<div style="float:left;width:80px;text-align:right;" >Montrer : </div><span style="padding-left:1px;" id="a_all" class="p'+((pFiltre=="all")?" selected":"")+'">Tous</span> - <span id="a_selection" class="p'+((pFiltre=="selection")?" selected":"")+'">Ma s&#233;lection</span> - <span id="a_favoris" class="p'+((pFiltre=="favoris")?" selected":"")+'">Mes favoris</span><br/>';
		return content;
  } 
};
var cModule = Class.create();
cModule.prototype = {
  initialize: function(pContent,b,a) {
    this.a = a;
    this.pContent = pContent;
    this.b = b;
},
  fRenderBoxLeftView : function(){
  		content = '<div class="module_menu" id="'+this.b+'"><div><div><div><h3 id="open_'+this.b+'" class="entete">'+this.a+'</h3><div id="menu_'+this.b+'">'+this.pContent+'</div></div></div></div></div>';
		return content;
  }  
};
var cSearch = Class.create();
cSearch.prototype = {
  initialize: function(  ) {
this.pMotsClefs="";
this.pComboCat="";
this.pVenteNormale="";
this.pVenteMultiple="";
this.pAchatImmediat="";
this.pNombreBidMin="";
this.pNombreBidMax="";
this.pReference="";
this.pPrixMin="";
this.pPrixMax="";
this.pTypeTri="";
this.pRayon="";
this.pCodePostal="";
},
		
fRenderFormSearchView : function(){
		content = '<div class="module_menu" id="containerBoxSearch"><div><div><div><h3 id="open_search_l" class="entete">Recherche<span id="s_approfondie" onclick="toggleSearch(event);" style="position:relative;left:56%;">[+]</span></h3>';
		content += '<form method="get" action="/fr/RechercheApprofondie" style="margin:auto;" id="form_recherche_test">';
		content += '<input type="text" id="search_app" name="mots_cles" value="'+this.pMotsClefs+'" />';
		content += '<div id ="suggestions_app" class="autocomplete" style="display:none;"></div>';
		content += '<input class="miniBtn"  type="image" src="/images/loupe.png" name="submitRechercheAppronfondie" value="Rechercher" id="recherche_test" onclick="return false;"/>';
		content += '<select name="cat" id="combo_cat" style="width:150px;"><option value="1">Toutes les cat&#233;gories</option><option value="1">---------------------</option><option value="2">Art et Antiquités</option><option value="3">Auto-Moto</option><option value="4">Autres Catégories</option><option value="5">Bandes Dessinées</option><option value="6">Beauté-Santé</option><option value="7">Bébé</option><option value="8">Bijoux</option><option value="9">Cartes Postales</option><option value="10">Cinéma et DVD</option><option value="11">Collections</option><option value="12">Informatique</option><option value="13">Jeux, Jouets</option><option value="14">Livres</option><option value="15">Maison</option><option value="16">Mode Vêtements</option><option value="17">Musique et instruments</option><option value="18">Numismatique</option><option value="19">Philatelie</option><option value="20">Photographie</option><option value="21">Sports, Loisirs</option><option value="22">Télécartes</option><option value="23">Téléphonie</option><option value="24">TV Hifi Electroménager</option><option value="25">Vins Alcools</option></select>';
		content += '<ul id="menu_search_l" style="display:none;">';
		content += '<li><input type="radio" name="where" value="site" onchange="toggleSearchCompte(event)" checked="checked"> sur tout le site</li><li><input type="radio" name="where" id="search_compte" value="compte" onchange="toggleSearchCompte(event)" /> dans mon compte';
		content += '<ul id="menu_search_compte" style="display:none;"><li style="height:15px;font-size:0.9em;"><input style="-moz-appearance:radio;" type="checkbox" name="achats_encours" value="achats" checked="checked"/> achats en cours</li><li style="height:15px;font-size:0.9em;"><input style="-moz-appearance:radio;" type="checkbox" name="objets_achetes" value="achats" checked="checked"/> objets achet&#233;s</li><li style="height:15px;font-size:0.9em;"><input style="-moz-appearance:radio;" type="checkbox" name="ventes_encours" value="ventes" checked="checked"/> ventes en cours</li><li style="height:15px;font-size:0.9em;"><input style="-moz-appearance:radio;" type="checkbox" name="objets_programmes" value="ventes" checked="checked"/> ventes programm&#233;es</li><li style="height:15px;font-size:0.9em;"><input style="-moz-appearance:radio;" type="checkbox" name="objets_vendus" value="ventes" checked="checked"/> objets vendus</li><li style="height:15px;font-size:0.9em;"><input style="-moz-appearance:radio;" type="checkbox" name="objets_invendus" value="ventes" checked="checked"/> objets invendus</li><li style="height:15px;font-size:0.9em;margin-top:10px;"><h4 style="display:inline;padding-top:10px;">R&#233;f.</h4> <input style="margin:right:15px;" type="text" name="reference" value="'+this.pReference+'" size="16"/></li></ul></li>';
		content += '<p><h4 style="display:inline;">Prix</h4> Min <input style="margin:right:15px;" type="text" name="prix_min" value="'+this.pPrixMin+'" size="3"/> Max <input style="margin:right:15px;" type="text" name="prix_max" value="'+this.pPrixMax+'" size="3" /> EUR</p>';
		content += '<h4>Type de vente <x-small>(afficher uniquement)<x-small></h4><ul><li><input style="-moz-appearance:radio;" type="checkbox" name="vente_normal" value="1" '+((this.pVenteNormale=="1")?'checked="checked"':'')+'><span style="padding-left:10px;">Ench&#232;re normale</span></li>';
        content += '<li><input style="-moz-appearance:radio;" type="checkbox" name="vente_multiple" value="2" '+((this.pVenteMultiple=="1")?'checked="checked"':'')+'><span style="padding-left:10px;">Ench&#232;re multiple</span></li><li><input style="-moz-appearance:radio;" type="checkbox" name="achat_immediat" value="3" '+((this.pAchatImmediat=="1")?'checked="checked"':'')+'><span style="padding-left:10px;">Achat imm&#233;diat</span></li></ul>';
		content += '<p><div><span style="color:#656565;font-weight:800;">Pays</span> <select name="coutry" id="country_search"><option value="">Tous</option><option value="FR">France</option><option value="BE">Belgique</option></select></div>';
		content += '<p><div style="float:left;width:95px;"><span style="color:#656565;font-weight:800;">Lieu</span> CP <input type="text" name="code_postal" value="'+this.pCodePostal+'"  size="5" /></div><div style="float:left;width:40px;font-size:xx-small;line-height:10px;">dans un rayon de</div><input type="text" size="3" mmaxlength="3" name="rayon" value="'+this.pRayon+'" /> km</p><h4>Nombre d\'ench&#233;res minimal</h4>';
		content += 'Min <input size="3" style="margin:right:15px;" type="text" name="bid_min" value="'+this.pNombreBidMin+'" />';
		content += 'Max <input size="3" style="margin:right:15px;" type="text" name="bid_max" value="'+this.pNombreBidMax+'" />';
		content += '<h4>Trier par</h4>';
		content += '<select style="margin:auto;" name="tri">';
		content += '<option value="0" '+((this.pTypeTri=="0")?'selected="selected"':'')+'>temps restant - -> +</option>';
		content += '<option value="1" '+((this.pTypeTri=="1")?'selected="selected"':'')+'>temps restant + -> -</option>';
		content += '<option value="2" '+((this.pTypeTri=="2")?'selected="selected"':'')+'>prix - -> +</option>';
		content += '<option value="3" '+((this.pTypeTri=="3")?'selected="selected"':'')+'>prix + -> -</option>';
		content += '<option value="4" '+((this.pTypeTri=="4")?'selected="selected"':'')+'>date mise en vente - -> +</option>';
		content += '<option value="5" '+((this.pTypeTri=="5")?'selected="selected"':'')+'>date mise en vente + -> -</option>';
		content += '<option value="6" '+((this.pTypeTri=="6")?'selected="selected"':'')+'>par cat&#234;gorie</option>';
		content += '</select>';
		content += '<h4><input type="checkbox" value="1" id="carte" name="carte" style="-moz-appearance: radio;"/>afficher les r&#233;sultats sur une carte</h4>';
		content += '<p><input style="margin-left:20px;margin-top:20px;font-size:large;" type="submit" name="submitRechercheAppronfondie" value="Rechercher" id="recherche_test" onclick="return false;"/><input style="margin-left:20px;margin-top:20px;" type="submit" name="submitSaveRecherche" value="Enregistrer cette recherche" id="submitSaveRecherche" style="width:180px;" onclick="return false;"/></p>';
		content += '<div id="resultSaveSearch" class="message_to_user_search"></div>';
		content += '</ul></form></div></div></div></div>';
		return content;
  },
  fSelectItemsView : function(pFiltre){
		content = '<div style="float:left;width:80px;text-align:right;" >Montrer : </div><span style="padding-left:1px;" id="a_all" class="p'+((pFiltre=="all")?" selected":"")+'">Tous</span> - <span id="a_selection" class="p'+((pFiltre=="selection")?" selected":"")+'">Ma s&#233;lection</span> - <span id="a_favoris" class="p'+((pFiltre=="favoris")?" selected":"")+'">Mes favoris</span><br/>';
		return content;
  }  
};
function fRenderItemJSON(requester,id,href) {
	//gFiltre="all";
	$('up').scrollTo();
	if($('resultat_search')) $('resultat_search').remove();
	document.getElementsByTagName('BODY')[0].setStyle({'cursor':'pointer'});
	
	var retour=requester.responseText;
	Element.update($('maincolumn'),B.evaluate({'pCorpTblItems':""}));
	$$('#tblItems a.tri').each(function(pElm){Event.observe(pElm,'mouseover',fToggleTri);});
	$$('#tblItems a.tri').each(function(pElm){Event.observe(pElm,'mouseout',fToggleTri_1);});	
	var data = retour.evalJSON();
	if(data.Erreur){
	$('message_to_user').update(data.Erreur);
	$('message_to_user').insert({'bottom':'<span style="color:black;cursor:pointer;" onclick="$(\'message_to_user\').update(\'\');">[x]</span>'});
	return;
	}
	var infoPage=data.Page;
	
	gTypeTri=infoPage.TypeTri;
	if(!$('containerBoxSearch')){
	oSearch=new cSearch();
	$('leftcolumn').insert({'top':oSearch.fRenderFormSearchView()});
	}
	cat=infoPage.Categorie;
	goCategorie = new cB(cat);
	
	if($('cat'+goCategorie.b)) {
		if(goCategorie.pHasleaf==1){	
			$('cat'+goCategorie.b).replace(goCategorie.fLigneCategorie());
			$('cat'+goCategorie.b).insert(goCategorie.fTblCategorie());
		} else {
			if($('li_cat'+goCategorie.bPere))$('li_cat'+goCategorie.bPere).update("");
			else $('menu_sous_cat').update(goCategorie.fTblCategoriePere());
			//$('cat'+goCategorie.bPere).insert(goCategorie.fLigneCategorie());		
		}
		//$('nom_cat').update(goCategorie.pLibellebigcat);
	}else if($('menu_sous_cat')) {
		if(goCategorie.pHasleaf==1){	
			$('menu_sous_cat').update(goCategorie.fTblCategorie());
		} else {
			$('menu_sous_cat').update(goCategorie.fTblCategoriePere());
		}	
		
		$('nom_cat').update(goCategorie.pLibellebigcat);
	}
	else {
		if($('leftcolumn')) $('containerBoxSearch').insert({'after':goCategorie.fBoxCategorie()});
		if(goCategorie.pHasleaf==1){	
			$('menu_sous_cat').update(goCategorie.fTblCategorie());
		} else {
			$('menu_sous_cat').update(goCategorie.fTblCategoriePere());
		}			
	}
	if($('combo_cat'))	$('combo_cat').replace(goCategorie.pCombo);	
	$('titre_page').update(goCategorie.pBackList);

	aCategories=infoPage.Categories;

	if(aCategories){
	if(goCategorie.pHasleaf==1){
		$('li_cat'+goCategorie.b).update('');
		aCategories.each(function(pElm){poCategorie = new cB(pElm);$('li_cat'+goCategorie.b).insert(poCategorie.fLigneCategorie());});	
	}
	else aCategories.each(function(pElm){
	poCategorie = new cB(pElm);
	$('li_cat'+goCategorie.bPere).insert(poCategorie.fLigneCategorie());
	});	
	//else aCategories.each(function(pElm){poCategorie = new cB(pElm);$('menu_sous_cat').insert(poCategorie.fLigneCategorie());});	
	//if(goCategorie.b!="1") $('menu_sous_cat').insert(goCategorie.fLigneAllCat());
	//if(!(goCategorie.b==goCategorie.bBigCat) && !(goCategorie.bPere==0))$('menu_sous_cat').insert(goCategorie.fLigneBigCat());
	}
	aItems=infoPage.Items;
	if (aItems.length>0){
		if($('carte')&&$('carte').checked) {
		if (!$('map')) {
		$('tblItems').insert({'after':gHTMLMap});
		}
		if($('map')){
			var booMap=Try.these(
				function() {
				initMap();
				map.setCenter(new GLatLng(46.52863469527167, 2.43896484375), 5);
				$('sidebar').innerHTML="";
				return true;
				},
				function() {
				return false;
				}
			  )
			}
		}
		aItems.each(function(pElm){
		var booItem=true;
			oItem = new cA(pElm);
			$('tbody_tblItems').insert(oItem.fa());
			if (booMap){
			var point = new GLatLng(parseFloat(oItem.i),parseFloat(oItem.j));		
			var marker = createMarker(point, oItem.n, oItem.a);
			map.addOverlay(marker);
			var sidebarEntry = createSidebarEntry(marker,oItem.n, oItem.fTitleMarker(),'');
			sidebar.appendChild(sidebarEntry);
			}
		});
	} else {
	$('maincolumn').update("<div style=\"font-style:italic;font-weight:800;\">d&#233;sol&#233;, aucune vente ne r&#233;pond &#224; votre demande.</div>");
	}
	if (infoPage.Recherche!=""){
		$('maincolumn').insert({'top':infoPage.Recherche});
	}
	if (infoPage.RechercheFavorite!=""){
		oModule = new cModule(infoPage.RechercheFavorite,"recherches_favorites","Recherches favorites");
		if($('recherches_favorites'))
		$('recherches_favorites').replace(oModule.fRenderBoxLeftView());
		else 
		$('containerBoxSearch').insert({'after':oModule.fRenderBoxLeftView()});
	}
	goPage=new cPage(infoPage);
	goPage.d=url_tri;

	$('tblItems').insert({'after':goPage.fPageBreakView(href)});
	$('tblItems').insert({'after':goPage.fSelectItemsView(gFiltre)});
	$('tblItems').insert({'before':goPage.fSelectItemsView(gFiltre)});
	if(gTypeTri%2) {gTypeTri=gTypeTri-1;tblTri[gTypeTri]=0;}
	else {tblTri[gTypeTri]=1;}
	fAppendImageTri(gTypeTri,tblTri[gTypeTri]);
	}