PM.Offers.Templates.comparator_right = {
  body: '<div id="blk_offer_vert"><div class="blk_title">{{headline}}</div><div class="blk_offer_content"><table class="table_compare">{{content}}</table><p><a class="under" href="javascript:popHelp(\'/help?action=comparez_ensavoirplus&amp;popup=true\',500,500,\'true\')">{{help}}</a></p></div></div>',
  element: '<td><a class="link_nostyle" href="{{url}}" target="_blank"{{tk}}><img alt="{{label}}" src="{{image}}" class="cadre"/></a><p><a class="link_nostyle" href="{{url}}" target="_blank"{{tk}}><span class="pr_n">{{price}}</span><br/><div class="offer_label">{{label}}</div></a></p><p><a href="{{url}}" target="_blank"{{tk}}>Ver la oferta</a></p></td>',
  emptyElement: '<td></td>',
  line: '<tr>{{line}}</tr>',
  maxPerLine: 1,
  format: "rect300",
  
  // custom content
  customContent: function(content, params) {
    var pageType = "";
    if (params.isSearch) {
      content = PM.Util.variableReplace(content, "headline", "Compara las ofertas");
      pageType = "Search";
    } else if (params.isNavigation) {
      content = PM.Util.variableReplace(content, "headline", "Top productos de la web");
      pageType = "Navigation";
    } else {
      content = PM.Util.variableReplace(content, "headline", "Top productos de la web");
      pageType = "Product";
    }
    content = PM.Util.variableReplace(content, "help", "Saber más.");
    
    return content;
  }
}
/**
 * Comparator body display template
 *
 * @base PM.Offers.Templates
 */
PM.Offers.Templates.comparator_body = {
  body: '<div id="blk_offer_horiz"><a name=\"compare_prices\"></a><h4>{{headline}}</h4><div class=\"blk_offer_content\"><table class=\"table_compare\">{{content}}</table>{{help}}</div></div>',
  element: '<td><a class="link_nostyle" href="{{url}}" target="_blank"{{tk}}><img alt="{{label}}" src="{{image}}" class="cadre"/></a><p><a class="link_nostyle" href="{{url}}" target="_blank"{{tk}}><span class="pr_n">{{price}}</span><br/><span>{{label}}</span></a></p><p><a href="{{url}}" target="_blank"{{tk}}>Ver la oferta</a></p></td>',
  emptyElement: '<td></td>',
  line: '<tr>{{line}}</tr>',
  maxPerLine: 3,
  
  // custom content
  customContent: function(content, params) {
    var newHeadline = "";
    var helpText = "";
    var pageType = "";
    var nbOffers = "";

    if (params.isSearch) {
      newHeadline = "Resultados de tu búsqueda en la selección de Webs";
      pageType = "Search";
      nbOffers = "1 y 9";
    } else if (params.isNavigation) {
      newHeadline = "Top Productos de la web";
      pageType = "Navigation";
      nbOffers = "1 y 9";
    } else {
      newHeadline = "Compara las ofertas con esta selección de las mejores Webs";
      pageType = "Product";
      nbOffers = "1 y 6";
    }
    
    if (params.isSearch) {
      helpText = "<p>Consulta las ofertas que te proponen los otros comerciales. <a class=\"under\" href=\"javascript:popHelp('/help?action=comparez_ensavoirplus&amp;popup=true',500,500,'true')\">Saber más</a>.<br/> En los resultados de la búsqueda, ";
    } else {
      helpText = "<p>Compara con las ofertas y los precios que proponen otros comerciales de la web para productos nuevos, idénticos o equivalentes. <a class=\"under\" href=\"javascript:popHelp('/help?action=comparez_ensavoirplus&amp;popup=true',500,500,'true')\">Saber más</a>.<br/> En cada producto, ";
    }
    
    helpText += "te indicaremos entre <a class=\"under\" href=\"javascript:popHelp('/help?action=comparez_noticelegale&amp;popup=true',500,180,'true')\"> " + nbOffers + " ofertas</a> encontradas en la Web. No dudes en contactarnos para comunicarnos cualquier observación.</p>";

    content = PM.Util.variableReplace(content, "headline", newHeadline);
    content = PM.Util.variableReplace(content, "help", helpText);
    
    if($('compare_price_anchor')) {
      $('compare_price_anchor').style.display = '';
    }

    return content;
  }
}

/**
 * Google display template
 *
 * @base PM.Offers.Templates
 */
PM.Offers.Templates.google = {
  body: '<div id="g_horiz"><div id="google_block"><div class="blk_title">{{headline}}</div><div class="blk_st"><ul class="glist">{{content}}</ul></div></div></div>',
  element: '<li style="padding: 0pt;"><a style="padding: 5px; text-decoration: none; display: block; background-color: white;" onmouseover="this.style.backgroundColor=\'#ebf2fe\'; window.status=\'{{visible_url}}\'; return true;" onmouseout="this.style.backgroundColor=\'white\'; window.status=\'\'; return true;" target="_blank" href="{{url}}"{{tk}}><h4>{{line1}}</h4><br/>{{line2}} {{line3}} <span class="glink" style="color: rgb(102, 102, 102); font-size: 11px;">{{visible_url}}</span></a></li>',

  // custom content
  customContent: function(content, params) {
    if (params.isSearch) {
      content = PM.Util.variableReplace(content, "headline", "Enlaces comerciales");
    } else {
      content = PM.Util.variableReplace(content, "headline", "Anuncios Google");
    }
    
    return content;
  }
}
/**
 * Google in search display template
 *
 * @base PM.Offers.Templates
 */
PM.Offers.Templates.google_in_search = {
  body: '<div class="pub_google"><h4><span>Liens commerciaux</span></h4><div class="ads_google">{{content}}</div></div>',
  element: '<dl{{lastContent}}><dd><a href="{{url}}" target="_blank" onmouseover="window.status=\'go to {{visible_url}}\'; return true;" onmouseout="window.status=\'\';"><span class="title">{{line1}}</span><span class="descr">{{line2}} {{line3}}</span><span class="url">{{visible_url}}</span></a></dd></dl>',
  lastContent: ' class="last"'
}
