// PCsuite table search -  common functions

function addForm () {

var form = '<div id="searchBox"><form id="finder"><label>ابحث عن طراز جهازك في اللائحة أدناه</label><input id="model" type="text" title="Type in your device\'s model name or number"/><div class="btn-left" id="findModel"> <span class="btn-right">بحث</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">إعادة </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('');
}
