//  Copright 2003-2006 SurfWax Inc. All rights reserved. Patents pending.
//  This javascript and the algorithms herein are Copyright 2003-2006 SurfWax Inc.
//    and may not be copied or re-used in any form or in any manner.
//  Do  not remove this Copyright statement.

function make0(aRSN, aEntry, aCount, aType, aExtra) {
  setResults();
  for (var i = 0; i < aRSN.length; i++) {
    var dA = document.createElement('DIV');
    dA.id = 'a';
    var an = document.createElement('A');

    // use this line to link directly to the related URL:
    an.href = 'javascript:g(' + aRSN[i] + ', "' + aEntry[i].replace(" ( art)","").replace(" ","-").replace(/<\/?[^>]+(>|$)/g, "").replace("&","-").replace("/", "").replace("\\", "").replace("\"", "").replace("1", "").replace("2", "").replace("3", "").replace("4", "").replace("5", "").replace("6", "").replace("7", "").replace("8", "").replace("9", "").replace("0", "").replace("ô", "o").replace("í", "i").replace("é", "e").replace("ä", "a").replace("á", "a").replace("ó", "o").replace("ü", "u").replace("î", "i").replace("\\", "").replace("/", "").replace("/", "").replace("nbsp;", "").replace("ß", "s").replace("î", "i").replace("î", "i").replace("ú", "u").toLowerCase() + '")';
    // use this line to put the selected item into the search field:
    // an.href = "javascript:setF('" + aEntry[i].replace(/<\/?[^>]+(>|$)/g, "") + "')";

    an.innerHTML = aEntry[i];
    dA.appendChild(an);
    laDiv[0].appendChild(dA);
  }
}

function multiMake0(aRSN, aEntry, aCount) {
  setResults();
  for (var i = 0; i < aRSN.length; i++) {
    var d1 = document.createElement('DIV');
    d1.id = 'pc';
    d1.innerHTML = aCount[i];
    laDiv[0].appendChild(d1);
    var d2 = document.createElement('DIV');
    d2.id = 'p';
    var an = document.createElement('A');
    if (aCount[i] == 1)
      an.href ='javascript:g(' + aRSN[i] + ')';
    else
      an.href = 'javascript:m(' + aRSN[i] + ')';
    an.innerHTML = aEntry[i];
    d2.appendChild(an);
    laDiv[0].appendChild(d2);
  }
}

function noResults() {
  setNoResults();
  var d = document.createElement('DIV');
  d.id = 'mb';
  d.innerHTML = 'Nu exista tinte similare. Va rugam sa completati formularul de mai jos daca doriti sa introduceti tinta in sistem.';
  laDiv[curLA].appendChild(d); 
  document.getElementById('divadd_tinta').style.display="block";
  flashtxtoff('fltxtadd1');
  flashtxtoff('fltxtadd2');
  document.getElementById('divsub_addtinta').style.display="none";
  
}

function urlList0(rsn, entry, aUrl, aTitle) {
  var d = document.createElement('DIV');
  d.id = 'mb';
  var back = document.createElement('A');
  back.href = 'javascript:r()';
  back.innerHTML = '[ Inapoi la lista de tinte ]';
  d.appendChild(back);
  laDiv[0].appendChild(d);

  d = document.createElement('DIV');
  d.id = 'mh';
  d.innerHTML = 'Titluri sau pagini continand: ' + entry;
  laDiv[0].appendChild(d);

  for (var i = 0; i < aUrl.length; i++) {
    var dA = document.createElement('DIV');
    dA.id = 'a';
    var an = document.createElement('A');
    an.href = aUrl[i];
    an.innerHTML = aTitle[i];
    dA.appendChild(an);
    laDiv[0].appendChild(dA);
  }
}
