/*******************************************************************************
*	preload.js
*
*	Copyright 2010 Guidance Software, LLC
*	All Rights Reserved Worldwide
*
*	Javascript functions to preload images
*
*   Dependecny:
*       
*       - Prototype.js
*
*	History:
*
*	06-09-10  sa	First
******************************************************************************/
var Preloader={callbacks:[],images:[],loadedImages:[],imagesLoaded:0,add:function(b){if(typeof b=="string"){this.images.push(b)}if(typeof b=="array"||typeof b=="object"){for(var a=0;a<b.length;a++){this.images.push(b[a])}}},onFinish:function(b){if(typeof b=="function"){this.callbacks.push(b)}if(typeof b=="array"||typeof b=="object"){for(var a=0;a<b.length;a++){this.callbacks.push(b[a])}}},load:function(){for(var a=0;a<this.images.length;a++){this.loadedImages[a]=new Image();this.loadedImages[a].onload=function(){Preloader.checkFinished.apply(Preloader)};this.loadedImages[a].src=this.images[a]}},checkFinished:function(){this.imagesLoaded++;if(this.imagesLoaded==this.images.length){this.fireFinish()}},fireFinish:function(){for(var a=0;a<this.callbacks.length;a++){this.callbacks[a]()}this.images=[];this.loadedImages=[];this.imagesLoaded=0;this.callbacks=[]}};
