hm... maybe there's an easier way, is there some DOM event that gets fired before a resource is loaded?