// launch sized popup window ##
function launch(url, w, h) { p=open(url,"image","width="+w+",height="+h+",toolbar=yes,resizable=yes, scrollbars=yes,menubar=no,status=no,directories=no,location=no,top=50,left=130");
	if (p.focus) p.focus(); }

// open selected image in autoresized window ##
function PopupPicWID(sPicURL) { 
	window.open("../docs/viewer.asp?IMG="+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200,top=200,left=300"); }

// level 3 wID image opener ##	
function PopupPicWID3(sPicURL) { 
	window.open("../../docs/viewer.asp?IMG="+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200,top=200,left=300"); }	
	
// level 4 wID image opener ##	
function PopupPicWID4(sPicURL) { 
	window.open("../../../docs/viewer.asp?IMG="+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200,top=200,left=300"); }		
	
function PopupPic(sPicURL) { 
	window.open("../docs/viewer.asp?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200,top=200,left=300"); }	

// clear field ##
function clearBox(objElement) { objElement.value="" } 

// if trapped in frame then break out ##
//function break_out() {
//	if (top.location != location) {
//   top.location.href = document.location.href ; } }
  
// onresize for ns4
var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
	}    
var cur_lyr; // holds id of currently visible layer
function swapLayers(id) {
	if (cur_lyr) hideLayer(cur_lyr);
	showLayer(id);
	cur_lyr = id;
	}
function showLayer(id) {
	var lyr = getElemRefs(id);
	if (lyr && lyr.css) lyr.css.visibility = "visible";
	}
function hideLayer(id) {
	var lyr = getElemRefs(id);
	if (lyr && lyr.css) lyr.css.visibility = "hidden";
	}
function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
	}