﻿function ShowMetadata(Button, Target){
	var Elm = document.getElementById(Target);
	if (Elm != null){
		if (Elm.style.display != 'block'){
			Elm.style.display = 'block';
			Button.className = 'MetadataButtonDown';
			document.getElementById('ShowMetadata').style.display = 'none';
			document.getElementById('HideMetadata').style.display = 'inline';
		}
		else{
			Elm.style.display = 'none';
			Button.className = 'MetadataButtonUp';
			document.getElementById('ShowMetadata').style.display = 'inline';
			document.getElementById('HideMetadata').style.display = 'none';
		}
	}
}

function ShowElement(Button, Target){
	var Elm = document.getElementById(Target);
	if (Elm != null){
		if (Elm.style.display != 'block'){
			var Sibs = Button.parentNode.childNodes;
			for (var i=0; i<Sibs.length; i++){
				if (Sibs[i].tagName != null){
					if (Sibs[i].tagName.toLowerCase() == 'button'){
						Sibs[i].className = 'TabUp';
					}
				}
			} 
			Sibs = Elm.parentNode.childNodes;
			for (var i=0; i<Sibs.length; i++){
				if (Sibs[i].tagName != null){
					if (Sibs[i].tagName.toLowerCase() == 'div'){
						Sibs[i].style.display = 'none';
					}
				}
			} 
			Elm.style.display = 'block';
			Button.className = 'TabDown';
		}
		else{
			Elm.style.display = 'none';
			Button.className = 'TabUp';
		}
	}
}

function ShowHideElement(ElName){
	var El = document.getElementById(ElName);
	if (El != null){
		if (El.style.display != 'block'){
			El.style.display = 'block';
		}
		else{
			El.style.display = 'none';
		}
	}
}

/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  Copyright 2003 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

// leave in page for way to customize layout of tooltip 
// and avoid errors if onmouseovers/outs before page completely loaded
function doTooltip(e, msg) {
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.show(e, msg);
}

function hideTip() {
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.hide();
}
	
// preload images that will be displayed in tooltip  
// put images to preload in this array
//var preload_list = new Array("dot-com-btn.gif", "sm-duck.gif");
//var path_to_images = "images/";

//jawalsh: commented out code below. Getting preload_list undefined error.
//if (document.images) {
//	var image_list = new Array();
//	for (var preload_counter=0; preload_counter<preload_list.length; //preload_counter++) {
//  	image_list[preload_counter] = new Image(); 
//		image_list[preload_counter].src = path_to_images + //preload_list[preload_counter];	
//  }
//}