//  This code is the intellectual property of Mark Groseth (Silicon Solutions) and
//  should not be used without permission.  mark@sisnet.biz, www.sisnet.biz

var isDHTML = 0;
var isLayers = 0;
var isAll = 0;
var isSTD = 0;
var isNav = 0;
var isIE = 0;
var fdObject = 0;
var fdStyle = 1;
var fdImage = 2;
// both netscape and IE allow addressing an image as 
// document.imagename
// this is not supported by the ww3 DOM and should not be used
// instead, give the image an ID and address it as an object

// onerror = null doesn't work
// The following works except while debugging
onerror = errFunction
	
if (navigator.appName.indexOf('Netscape') != -1){
	isNav = 1; }
else {
	isIE = 1; }
if (document.getElementById) {
	isSTD = 1; 
	isDHTML = 1;}
else {
	browserVersion = parseInt(navigator.appVersion);
	if (isNav && (browserVersion == 4)) {
		isLayers = 1; 
		isDHTML = 1;}
	else {
		if (document.all) {
			isAll = 1; 
			isDHTML = 1;}
		}
	}

// call this function to return a object or object style reference
// set withStyle to 1 if you want a style reference
// set withStyle to 2 if you want an image object by its name
// with IE you can do an image as either 0 or 2, but NS needs 2
function findDOM(objectID,withStyle) {
	var menuArea = "menuArea";
	if (withStyle == 1) {
		if (isSTD) { 
			return (document.getElementById(objectID).style) ; }
		else { 
			if (isAll) { 
				return (document.all[objectID].style); }
			else {
				if (isLayers) { 
					return (document.layers[menuArea].layers[objectID]); }
				}
			}
		}
	else {
		if (withStyle == 0) {
			if (isSTD) { 
				return (document.getElementById(objectID)) ; }
			else { 
				if (isAll) { 
					return (document.all[objectID]); }
				else {
					if (isLayers) { 
						return (document.layers[menuArea].layers[objectID]); }
					}
				}
			}
		else {
			//image object
			return eval("document." + objectID); }
		}
}

// call this function to return a object or object style reference
// in another frame
// set withStyle to 1 if you want a style reference
// set withStyle to 2 if you want an image object by its name
function findDOMFrames(objectID, frameName, withStyle) {
	if (withStyle == 1) {
		if (isSTD) { 
			return (top[frameName].document.getElementById(objectID).style) ; }
		else { 
			if (isAll) { 
				return (top[frameName].document.all[objectID].style); }
			else {
				if (isLayers) { 
					return (top[frameName].document.layers[menuArea].layers[objectID]); }
				}
			}
		}
	else {
		if (withStyle == 0) {
			if (isSTD) { 
				return (top[frameName].document.getElementById(objectID)) ; }
			else { 
				if (isAll) { 
					return (top[frameName].document.all[objectID]); }
				else {
					if (isLayers) { 
						return (top[frameName].document.layers[menuArea].layers[objectID]); }
					}
				}
			}
		else {
			// image obj
			return top[frameName].document[objectID] }
	}
}

// call this function to return a object or object style reference
// set withStyle to 1 if you want a style reference
// set withStyle to 2 if you want an image object by its name
// with IE you can do an image as either 0 or 2, but NS needs 2
function findDOMParent(objectID,withStyle) {
	var menuArea = "menuArea";
	if (withStyle == 1) {
		if (isSTD) { 
			return (parent.document.getElementById(objectID).style) ; }
		else { 
			if (isAll) { 
				return (parent.document.all[objectID].style); }
			else {
				if (isLayers) { 
					return (parent.document.layers[menuArea].layers[objectID]); }
				}
			}
		}
	else {
		if (withStyle == 0) {
			if (isSTD) { 
				return (parent.document.getElementById(objectID)) ; }
			else { 
				if (isAll) { 
					return (parent.document.all[objectID]); }
				else {
					if (isLayers) { 
						return (parent.document.layers[menuArea].layers[objectID]); }
					}
				}
			}
		else {
			//image object
			return eval("parent.document." + objectID); }
		}
}

function errFunction() {
	// supress error messages
	return true
}