';
// hide sort by the year and author unless SJ Library
$('label[for="input_unified_author.keyword"]').hide();
$('label[for="input_year_of_publication.plain_text.keyword"]').hide();
// show sort by the reference number unless SJ Library
$('label[for="input_object_number_ordering.keyword"]').show();
switch( tab ){
case 'Archive records':
db = 'archive';
html += '
';
html += '';
html += '';
html += '
';
html += '
';
html += '';
html += '';
html += '
';
html += '
';
html += '';
html += '';
html += '
';
html += '
';
html += '';
html += '';
html += '
';
break;
case 'SJ Library':
// Get rid of the Object Number field
html = '';
db = 'document';
html += '
';
html += '';
html += '';
html += '
';
html += '
';
html += '';
html += '';
html += '
';
html += '
';
html += '';
html += '';
html += '
';
html += '
';
html += '';
html += '';
html += '
';
html += '
';
html += '';
html += '';
html += '
';
html += '
';
html += '';
html += '';
html += '
';
$('label[for="input_unified_author.keyword"]').show();
$('label[for="input_year_of_publication.plain_text.keyword"]').show();
$('label[for="input_object_number_ordering.keyword"]').hide();
break;
case 'Archaeology':
db = 'collect';
html += '
';
html += '';
html += '';
html += '
';
html += '
';
html += '';
html += '';
html += '
';
html += '
';
html += '';
html += '';
html += '
';
html += '
';
html += '';
html += '';
html += '
';
html += '
';
html += '';
html += '';
html += '
';
/*
html += '
';
html += '';
html += '';
html += '
';
*/
html += '
';
html += '';
html += '';
html += '
';
html += '
';
html += '';
html += '';
html += '
';
break;
case 'Museum and Art':
db = 'collect';
html += '