function clearinput ( item, text ) {
   if ( document.getElementById ( item ).value == text ) {
      document.getElementById ( item ).value = '';
   }
}

function prefillinput ( item, text ) {
   if ( document.getElementById ( item ).value == '' ) {
      document.getElementById ( item ).value = text;
   }
}

function viewtab ( item ) {
   jQuery ( 'div.tabitem' ).css({display: 'none'});
   jQuery ( '.optionalitem' ).css({display: 'none'});
   jQuery ( '.' + item + 'item' ).css({display: 'block'});
   jQuery ( 'li.selected' ).removeClass ( 'selected' );
   jQuery ( 'li#articlenav' + item ).addClass ( 'selected' );
   if ( document.getElementById ( 'tab' + item ) )
      document.getElementById ( 'tab' + item ).style.display = 'block';
}
