// Support for services - Table search - Common functions

function addForm () {
	var form = '<div id="searchBox"><form id="finder"><label>Search for your device model in the table below:</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">Search</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');
	$('#clear').hide();
}

function highlightThis() {
	// Hide the previous selection
	$('#found').attr('id','');
	$(this).parent().attr('id','found');
	$('#msg').text('');
}

