/********************************************************
* former DHTMLapi.js functions                          *
*  Custom API for cross-platform object positioning     *
********************************************************/
var isCSS, isW3C, isIE4, isNN4, isIE6CSS;
var fudgeFactor = {top:-1, left:-1};	// global 'corrector' for IE, but doesn't hurt others

// fInitBrowserFlags - Initialize upon load
function fInitBrowserFlags() {
	if (document.images) {
		isCSS = (document.body && document.body.style) ? true : false;
		isW3C = (isCSS && document.getElementById) ? true : false;
		isIE4 = (isCSS && document.all) ? true : false;
		isNN4 = (document.layers) ? true : false;
		isIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;
	}
	if (!isW3C && !isIE4 && !isIE6CSS) {
		alert("This browser does not support DHTML. Please upgrade to the latest version of Internet Explorer.");
	}
}
// Convert object name string or object ref into valid element reference.
function fGetRawObject(pObj) { 
	var theObj;
	if (typeof pObj == "string") {
		if (isW3C) {
			theObj = document.getElementById(pObj);
		} else if (isIE4) {
			theObj = document.all(pObj);
		} 
	} else {
		// pass through object reference
		theObj = pObj;
	}
	return theObj;
}
// Convert object name string or object ref into valid style reference
function fGetObject(pObj) {
	var theObj = fGetRawObject(pObj);
	if (theObj && isCSS) {
		theObj = theObj.style;
	}
	return theObj;
}
// Set visibility of object to visible
function fShow(pObj) {
	var theObj = fGetObject(pObj);
	if (theObj) {
		theObj.visibility = "visible";
	} else { alert("object not found: " + pObj); }
}
// Set visibility of object to hidden
function fHide(pObj) {
	var theObj = fGetObject(pObj);
	if (theObj) {
		theObj.visibility = "hidden";
	}
}
 
function fGetIFrameDocument(pID) {
	var vIframeDoc;
	var myIframe = fGetRawObject(pID);
	if (myIframe) {
		if (myIframe.contentDocument) {
			// W3C DOM syntax for NN 6
			vIframeDoc = myIframe.contentDocument;
		} else if (myIframe.Document) {
			// IE DOM syntax
			vIframeDoc = myIframe.Document;
		}
	}
	return vIframeDoc;
} 
