/*
 * Copyright (C) 2008 Paul Uithol, SMARTposition <http://www.smartposition.nl>
 *
 */
if(!window.console||!console.firebug){var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];window.console={};for(var i=0;i<names.length;++i){window.console[names[i]]=function(){};}}var SmartPosition=window.SmartPosition=SmartPosition||{};document.addEventListener&&document.addEventListener("DOMContentLoaded",function(){SmartPosition.Loader.documentReady=true;},false);SmartPosition.Loader={batches:[],documentReady:false,isLoading:false,script:function(b,a){a=a||{};a.files=b;a.element="script";a.attributes=a.attributes||{};a.attributes.type="text/javascript";if(b.length){this.batches.push(a);if(!this.isLoading){this.loadBatch(this.batches.shift());}}},loadBatch:function(c){var a=this;var e=document.getElementsByTagName("head")[0];var h=[];this.isLoading=true;for(var d=0;d<c.files.length;d++){var f=document.createElement(c.element);f.src=c.files[d];for(var b in c.attributes){f[b]=c.attributes[b];}new this.l(f,c.timeout||10000,g);h.push(f);e.appendChild(f);}function g(k){for(var j=0;j<h.length;j++){if(k===h[j]){h.splice(j,1);break;}}if(!h.length){if(typeof(c.complete)==="function"){window.setTimeout(function(){c.complete();},10);}if(a.batches.length){window.setTimeout(function(){a.loadBatch(a.batches.shift());},10);}else{a.isLoading=false;}}}},l:function(d,e,f){d.onreadystatechange=a;d.onerror=d.onload=c;var b=setTimeout(c,e);function c(){clearTimeout(b);d.onreadystatechange=d.onload=d.onerror=null;f(d);}function a(){if(d.readyState=="loaded"||d.readyState=="complete"){d.onload();}}return this;}};

