checkFor things to be true before doing a callback (js)
checkFor = function(check, callback, delay) { delay = delay || 250; if (check()) { callback(); } else { setTimeout(function() { checkFor(check, callback, delay) }, delay); } };