var the_layer = '';

function toggleVisibility(div_id, the_visibility)
{

   if (document.getElementById || document.all)
   {
   the_visibility == 0 ? the_visibility = 'hidden': the_visibility = 'visible';
   }
   else if (document.layers)
   {
   the_visibility == 0 ? the_visibility = 'hide': the_visibility = 'show';
   }
   else return;

the_layer = determineDOM(the_layer, div_id);
the_layer.visibility = the_visibility;

}





function determineDOM(the_layer, div_id)
{

   if (document.getElementById)
   {
   the_layer = document.getElementById(div_id).style;
   }
   else if (document.all)
   {
   the_layer = document.all(div_id).style;
   }
   else if (document.layers)
   {
   the_layer = document.layers[div_id];
   }   

return the_layer;

}





function showImage(title, file_path, file_width, file_height, close_window)
{

var xpos = 0;

   if (self.screen.width)
   {
   xpos = (self.screen.width / 2) - (file_width / 2);
   }

var query  = '?';
query += 'title=' + escape(title);
query += '&';
query += 'file_path=' + escape(file_path);
query += '&';
query += 'file_width=' + escape(file_width);
query += '&';
query += 'file_height=' + escape(file_height);
query += '&';
query += 'close_window=' + escape(close_window);

file_height += 30;

var the_window = window.open('show_image.php' + query,'','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,scrollbars=no,left=' + xpos + ',top=100,screenX=' + xpos + ',screenY=100,width=' + file_width + ',height=' + file_height);

}
