/**
 * @fileoverview EasyGUI XP remote scripting Object (AJAX)
 *
 * There are two implementations of this.
 * One uses a javascript tag to update the current page widgets
 * the other uses the new XMLHttpRequestObject (experimental)
 * @todo implement as a javascript class
 *
 * @version $Id: class.request.js 241 2007-02-06 11:00:54Z glauff $
 */
function onComplete( obj )
{
	/*
	if (obj.src.indexOf('javascript:') != -1 ) {
		return;
	}
	*/
		
	if ( obj.responseText ) 
	{
		var serverResponse = obj.responseText.stripTags();
	} 
	else
	{
		var serverResponse = extractIframeBody( obj ).body.innerHTML;
	}
	
	eval( serverResponse );
}

function extractIframeBody( IFrameObj ) 
{
	if (IFrameObj.contentDocument)
	{
    	return IFrameObj.contentDocument; 
	}
  	else if (IFrameObj.contentWindow)
  	{
    	return IFrameObj.contentWindow.document;
  	}
  	else if (IFrameObj.document)
  	{
    	return IFrameObj.document;
  	}
  	else
  	{
    	return false;
  	}
}