//****************************************************************
//****************************************************************
// COPYRIGHT 2005, Vertex Software, Inc
//
// AUTHOR: rmatejka
// DATE: 07JUN2005
//****************************************************************
//****************************************************************


//****************************************************************
//****************************************************************
// Allows list of functions to be set up that is run when document's
// ready state changes to Complete.
//****************************************************************
//****************************************************************

var gDocumentReadStateChangedHandlers = new Array();


//===========================================================
// AddDocumentReadyStateChangedHandler
// Adds handlerFunction to a list of functions that will be called
// when the document's readyState changes to Complete.
//===========================================================
function AddDocumentReadyStateChangedHandler( handlerFunction ) {
	try {
		gDocumentReadStateChangedHandlers.push( handlerFunction );
		}
	catch ( error) {
		window.status = ( "AddDocumentReadyStateChangedHandler: " + error.description );
		}
	}



//===========================================================
// RunDocumentReadStateyChangedHandlers
// Assigned to document.onreadystatechanged. Runs all functions
// added via AddDocumentReadyStateChangedHandler when document's
// ready state changes to Complete.
//===========================================================
function RunDocumentReadyStateChangedHandlers(  ) {
	try {
		if (document.readyState != "complete") return;
		for (var item=0; item<gDocumentReadStateChangedHandlers.length; item++) {
			gDocumentReadStateChangedHandlers[item]();
			}
		}
	catch ( error) {
		window.status = ( "RunDocumentReadStateChangedHandler: " + error.description );
		}
	}

// 04APR2008 RFM - Changed to window.onload which works cross-browser
//document.onreadystatechange = RunDocumentReadyStateChangedHandlers;
window.onload = RunDocumentReadyStateChangedHandlers;
