
//<script>
// The above commented out "script" tag is there expressly for the purpose of having Dreamweaver highlight the code properly.

// 1. Basic functions
// 1. Menu functions
// 2. Image gallery functions

//----------------------------------------------------------------------
//-- BASIC FUNCTIONS ---------------------------------------------------
//----------------------------------------------------------------------
function find_height() {
	var main_div = document.getElementById( 'container' );
	var new_height = "";
	if( navigator.appName == "Microsoft Internet Explorer" ) {
		if( main_div.scrollHeight >= document.body.scrollHeight )
			new_height = main_div.scrollHeight + "px";
		else
			new_height = document.body.scrollHeight + "px";
		}
	else {
		if( main_div.scrollHeight >= document.height )
			new_height = main_div.scrollHeight + "px";
		else
			new_height = document.height + "px";
		}
	return new_height;
	}

function find_width() {
	var main_div = document.getElementById( 'container' );
	var new_width = "";
	if( navigator.appName == "Microsoft Internet Explorer" ) {
		if( main_div.scrollWidth >= document.body.scrollHeight )
			new_width = main_div.scrollWidth;
		else
			new_width = document.body.scrollWidth;
		}
	else {
		if( main_div.scrollWidth >= document.width )
			new_width = main_div.scrollWidth;
		else
			new_width = document.width;
		}
	return new_width;
	}

function stretch_pads() {
	var pad_left = document.getElementById( 'pad_left' );
	var pad_right = document.getElementById( 'pad_right' );
	var new_height = find_height();
	pad_left.style.height = new_height;
	pad_right.style.height = new_height;
	return true;
	}
//----------------------------------------------------------------------
//-- END BASIC FUNCTIONS -----------------------------------------------
//----------------------------------------------------------------------




//----------------------------------------------------------------------
//-- IMAGE GALLERY FUNCTIONS -------------------------------------------
//----------------------------------------------------------------------
function hon( p_id, color ) {
  var handle = document.getElementById( p_id );
  handle.style.backgroundColor = color;
  }

function main_screen_turn_on( image_name, this_caption, img_offset ) {
  var img_tag  = document.getElementById( "main_screen" );
  var shader   = document.getElementById( "shade" );
  var body_tag = document.getElementById( "body_tag" );
  var div_tag  = document.getElementById( "image_view" );
  var cap_tag  = document.getElementById( "caption" );

	img_offset = '100';

  img_tag.src = "images/gallery/" + image_name;
  shader.style.top    = "0px";
  shader.style.left   = "0px";
  shader.style.width  = "100%";
	shader.style.height = find_height();
  shader.style.visibility = "visible";

	screen_width = find_width();
	left_value = ( screen_width - 770 ) / 2;
  div_tag.style.left = left_value + "px";
  if( navigator.appName == "Microsoft Internet Explorer" ) {
    if( img_offset.substr(-2,2) == 'px' )
      div_tag.style.top = img_offset;
    else {
      var true_offset = parseInt( document.documentElement.scrollTop ) + parseInt( img_offset );
      div_tag.style.top = true_offset + 'px';
      }
    }
  else {
    if( img_offset.substr(-2,2) == 'px' )
      true_offset = img_offset;
    else
      true_offset = parseInt( window.scrollY ) + parseInt( img_offset ) + 'px';
    div_tag.style.top = true_offset;
    }
  cap_tag.innerHTML = this_caption;
  div_tag.style.visibility = "visible";
  }

function main_screen_turn_off()
  {
  var img_tag = document.getElementById( "main_screen" );
  var div_tag = document.getElementById( "image_view" );
  var cap_tag = document.getElementById( "caption" );
  var shader  = document.getElementById( "shade" );
  img_tag.src = "";
  div_tag.style.visibility = "hidden";
  div_tag.style.top = "-2000px";
  cap_tag.innerHTML = "";
  shader.style.top    = "-2000px";
  shader.style.left   = "0px";
  shader.style.width  = "0px";
  shader.style.height = "0px";
  shader.style.visibility = "hidden";
  }
//----------------------------------------------------------------------
//-- END IMAGE GALLERY FUNCTIONS ---------------------------------------
//----------------------------------------------------------------------








