var _rpcIFrameObj; 
var _rpcIFrameDoc; // iFRAME object and Document of above IFRAME element.
var IFRAME_ID = "_rpcIFrame";

function _rpc(URL)
{
	if(!document.createElement) { return; }
	if (_rpcIFrameObj)
	{
		document.body.removeChild(document.getElementsByName(IFRAME_ID)[0]);
		_rpcIFrameObj = null; _rpcIFrameDoc = null;
	}
	if (!_rpcIFrameObj) {_setupRpcIFrame();}
	if(_rpcIFrameDoc)
	   _rpcIFrameDoc.location.replace(URL);  // Set URL to make the RPC
}

// Creates the IFRAME element used by the RPC code.
function _setupRpcIFrame()
{
	var tempIFrame = document.createElement("iframe");	
	tempIFrame.src = "/includes/oVoid.htm";
	tempIFrame.setAttribute("id", IFRAME_ID);
	tempIFrame.setAttribute("name", IFRAME_ID);
	tempIFrame.style.border = "0px";  tempIFrame.style.width = "0px";  tempIFrame.style.height = "0px";
	_rpcIFrameObj = document.body.appendChild(tempIFrame);

	if (document.frames){_rpcIFrameObj = document.frames[IFRAME_ID];}  // FOR IE5 MAC	
	if (_rpcIFrameObj.contentDocument){ _rpcIFrameDoc = _rpcIFrameObj.contentDocument; }  // FOR NS6
	else if (_rpcIFrameObj.contentWindow){_rpcIFrameDoc = _rpcIFrameObj.contentWindow.document;}  // For IE5.5 and IE6
	else if (_rpcIFrameObj.document){_rpcIFrameDoc = _rpcIFrameObj.document; }// For IE5
	else if (window.frames && window.frames[IFRAME_ID]){ _rpcIFrameDoc = window.frames[IFRAME_ID].document; }//Konqueror, Safari
}
