Best way to create a function like this for wait in milli seconds, this function will wait for milliseconds provided in the argument:
function waitSeconds(iMilliSeconds) {_x000D_
var counter= 0_x000D_
, start = new Date().getTime()_x000D_
, end = 0;_x000D_
while (counter < iMilliSeconds) {_x000D_
end = new Date().getTime();_x000D_
counter = end - start;_x000D_
}_x000D_
}
_x000D_