function setFocus(field_id)
{

   if (document.forms[0])
   {

      for (loop = 0; loop < document.forms[0].length; loop++)
      {

         if (document.forms[0].elements[loop].name == field_id && document.forms[0].elements[loop].focus)
         {
         document.forms[0].elements[loop].focus();
         }

      }

   }

}





function showImage(title, filepath, width, height)
{

var xpos = 0;

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

var query  = '?';
query += 'title=' + escape(title);
query += '&';
query += 'filepath=' + escape(filepath);
query += '&';
query += 'filewidth=' + escape(width);
query += '&';
query += 'fileheight=' + escape(height);

height += 35;

var the_window = window.open('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=' + width + ',height=' + height);

}

function showDescription(title, filepath, width, height)
{

var xpos = 0;

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

var query  = '?';
query += 'id=' + escape(title);
//query += '&';
//query += 'filepath=' + escape(filepath);
//query += '&';
//query += 'filewidth=' + escape(width);
//query += '&';
//query += 'fileheight=' + escape(height);

height += 35;

var the_window = window.open('description.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=' + width + ',height=' + height);

}




function showDiv(div_id)
{

   if (document.getElementById && document.getElementById(div_id))
   {
   document.getElementById(div_id).style.display = 'block';
   }

}

function hideDiv(div_id)
{

   if (document.getElementById && document.getElementById(div_id))
   {
   document.getElementById(div_id).style.display = 'none';
   }

}

function toggleDiv(div_id)
{

   if (document.getElementById && document.getElementById(div_id))
   {
   var div_ref = document.getElementById(div_id).style;

      if (div_ref.display == 'none')
      {
      div_ref.display = 'block';
      }
      else if (div_ref.display == 'block' || div_ref.display == '')
      {
      div_ref.display = 'none';
      }

   }

}





function hideWindowStatus()
{
window.status='';
return true;
}





function showSpecialOffers()
{

var width = 625;
var height = 500;
var xpos = 0;

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

var the_window = window.open('Special-Offers-List.php','','toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,left=' + xpos + ',top=100,screenX=' + xpos + ',screenY=100,width=' + width + ',height=' + height);

}





function printPage()
{

   if (window.print)
      window.print();
   else
      alert('Windows users: please press Ctrl+P.\nMac users: please press Command+P.');

}





function resizeWindow(width, height)
{

   if (window.resizeTo) window.resizeTo(width, height);

}





function showStoneFinderHelp()
{

var width = 590;
var height = 210;
var xpos = 0;

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

var the_window = window.open('Stone-Finder-Help.php','','toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,left=' + xpos + ',top=100,screenX=' + xpos + ',screenY=100,width=' + width + ',height=' + height);

}
