// PCsuite table search -  common functions

function addForm () {

var form = '<div id="searchBox"><form id="finder"><label>Recherche de votre mod&egrave;le d&acute;appareil dans le tableau ci-dessous</label><input id="model" type="text" title="Recherche de votre mod&egrave;le d&acute;appareil dans le tableau ci-dessous"/><div class="btn-left" id="findModel"> <span class="btn-right">Rechercher</span></div></form><div id="msg">&nbsp;</div><div id="titleContainer"></div></div>';
$('.table-container').before(form);
$('#findModel').after('<div class="btn-left" id="clear"> <span class="btn-right">Reset </span></div>');

$('#clear').click(function(){
  clearResults();
  $('#model').val('');
}).hide();
}

function clearResults() {
  $('#msg').html('');
  $('#found').attr('id','');
  $('.found').removeClass('found');
  $('#resultTable').remove();
  $('#clear').hide();
}

function highlightThis() {
//hide previous selection
$('#found').attr('id','');
$(this).parent().attr('id','found');
$('#msg').text('');
}

