// DOM detector and access builder

// setting main DOM variables
var isALL	 = 0; 
var isID	 = 0;
var isLAYERS = 0;
var isDHTML	 = 0;

// checking for DOM types
if(document.getElementById) { isID=1; isDHTML=1; }
else{
	if(document.all) { isALL=1; isDHTML=1; }
	else{
		browserVersion = parseInt(navigator.appVersion);
		if((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) { isLAYERS=1; isDHTML=1;}	
	}
}

// creating the function to be called
function getDOM(objectID,withStyle) {
	if (withStyle == 1)	{
		if (isID) { return(document.getElementById(objectID).style); }
		else{
			if(isAll) { return(document.all[objectID].style); }
			else{
				if(isLAYERS) { return(document.layers[objectID].style); }			
			}
		}
	}
	else{
		if (isID) { return(document.getElementById(objectID)); }
		else{
			if(isAll) { return(document.all[objectID]); }
			else{
				if(isLAYERS) { return(document.layers[objectID]); }			
			}
		}
	}
// end getDOM
}
