###User Defined Function###
_IELoadWait

###Description###
Wait for a browser page load to complete before returning.

###Syntax###
#include <IE.au3>
_IELoadWait ( ByRef $o_object [, $i_delay = 0 [, $i_timeout = -1]] )


###Parameters###
@@ParamTable@@
$o_object
	Object variable of an InternetExplorer.Application or DOM element
$i_delay
	[optional] Milliseconds to wait before checking status
$i_timeout
	[optional] Period of time to wait before exiting function (default = 300000 ms aka 5 min)
@@End@@

###ReturnValue###
@@ReturnTable@@
Success:	1.
Failure:	0 and sets the @error flag to non-zero.
@error:	1 ($_IEStatus_GeneralError) - General Error
	3 ($_IEStatus_InvalidDataType) - Invalid Data Type
	4 ($_IEStatus_InvalidObjectType) - Invalid Object Type
	6 ($_IEStatus_LoadWaitTimeout) - Load Wait Timeout
	8 ($_IEStatus_AccessIsDenied) - Access Is Denied
	9 ($_IEStatus_ClientDisconnected) - Client Disconnected
@extended:	Contains invalid parameter number
@@End@@


###Remarks###
Several IE.au3 functions call <a href="_IELoadWait.htm">_IELoadWait()</a> automatically (e.g. <a href="_IECreate.htm">_IECreate()</a>, <a href="_IENavigate.htm">_IENavigate()</a> etc.).
Most functions that do this also allow you to turn this off with a $f_wait parameter if you do not want the wait or if you want to call it yourself.

When document objects or DOM elements are passed to <a href="_IELoadWait.htm">_IELoadWait()</a>, it will check the readyState of the container elements up to and including the parentWindow.

Browser scripting security restrictions may sometimes prevent <a href="_IELoadWait.htm">_IELoadWait()</a> from guaranteeing that a page is fully loaded and can occasionally result in untrapped errors.
In these cases you may need to avoid calling <a href="_IELoadWait.htm">_IELoadWait()</a> and attempt to employ other methods of insuring that the page load has completed.
These methods might include using a Sleep command, examining browser status bar text and other methods.  When using functions that call <a href="_IELoadWait.htm">_IELoadWait()</a> for objects other than the InternetExplorer (browser) object, you may also be successful by calling <a href="_IELoadWait.htm">_IELoadWait()</a> for the browser yourself (e.g. <a href="_IELoadWait.htm">_IELoadWait</a>($oIE)).

The most common causes of trouble are page redirects and cross-site scripting security restrictions associated with frames.  Page re-writing techniques employed by some applications (e.g. Gmail) can also cause trouble here.


###Related###
_IELoadWaitTimeout, _IECreate, _IENavigate, _IEFormSubmit, _IELinkClickByText, _IELinkClickByIndex, _IEImgClick, _IEFormImageClick, _IEBodyWriteHTML, _IEDocWriteHTML, _IEAction


###Example###
@@IncludeExample@@
