// check TYPE
var myDOMtype = '';
if (document.getElementById) {
	myDOMtype = "std";
}
else if (document.all) {
	myDOMtype = "ie4";
}
else if (document.layers) {
	myDOMtype = "ns4";
}


// function to emulate document.getElementById
function fetch_object( idname )
{
	switch (myDOMtype)
	{
		case "std": {
			return document.getElementById(idname);
		}
		break;

		case "ie4": {
			return document.all[idname];
		}
		break;

		case "ns4": {
			return document.layers[idname];
		}
		break;
	}
}

function fetch_image( name ) {
	document.images[ name ];
}


function Sax_openBrWindow(theURL) {
  return window.open(theURL,"theWin","width=800,height=600,toolbar=no, location=no, directory=no, status=no, menubar=no, resizable=no, scrollbars=no ");
}


function openImageWinAutoSize(theURL) {
  return window.open("/html/zoomImage.html?url="+theURL,"theImg","width=550,height=750,toolbar=no, location=no, directory=no, status=no, menubar=no, resizable=no, scrollbars=no ");
}

function Querystring() {
	this.data = [];
	
	// get the query string, ignore the ? at the front.
	var querystring=location.search.substring(1,location.search.length);

	// parse out name/value pairs separated via &
	var args = querystring.split('&');

	// split out each name = value pair
	for (var i=0; i<args.length; i++) {
		var pair = args[i].split('=');
		
		// Fix broken unescaping
		temp = unescape(pair[0]).split('+');
		name = temp.join(' ');
		
		temp = unescape(pair[1]).split('+');
		value = temp.join(' ');
		
		this.data[name] = value;
	}
	
	this.get = function ( strKey, strDefault ) {
		var value = this.data[ strKey ];
		if (value == null) {
			value = strDefault;
		}
		return value;
	}
}