function checkComplete() { var finishedLoading = true; for (var i=0;i