var state = 'hidden';

function showhide(layer_ref) {
if (state == 'visible') {
  state = 'hidden';
} else {
  state = 'visible';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.visibility = state");
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].visibility = state;
}
if (document.getElementById && !document.all) {
maxwell_smart = document.getElementById(layer_ref);
maxwell_smart.style.visibility = state;
}
}

frontoffice = new Image();
frontoffice.src = "images/puzzle/frontoffice.gif";
reservations = new Image();
reservations.src = "images/puzzle/reservations.gif";
accounting = new Image();
accounting.src = "images/puzzle/accounting.gif";
maintenance = new Image();
maintenance.src = "images/puzzle/maintenance.gif";
housekeeping = new Image();
housekeeping.src = "images/puzzle/housekeeping.gif";
gm = new Image();
gm.src = "images/puzzle/gm.gif";

function highlight(state) {
 if (state == 'frontoffice') {
  document['map'].src=frontoffice.src;
  showhide('frontoffice');
 }

 if (state == 'reservations') {
  document['map'].src=reservations.src;
  showhide('reservations');
 }  

 if (state == 'accounting') {
  document['map'].src=accounting.src;
  showhide('accounting');
 }

 if (state == 'maintenance') {
  document['map'].src=maintenance.src;
  showhide('maintenance');
 }

 if (state == 'housekeeping') {
  document['map'].src=housekeeping.src;
  showhide('housekeeping');
 }

 if (state == 'gm') {
  document['map'].src=gm.src;
  showhide('gm');
 }
}

function revert(state) {
  document['map'].src='images/puzzle/staff-puzzle_sml.gif';
  showhide(state);
}