var LazyLoad=function(){var d=document,pending=null,queue=[],ua;function getUserAgent(){if(ua){return;}
var nua=navigator.userAgent,m;ua={gecko:0,ie:0,webkit:0};m=nua.match(/AppleWebKit\/(\S*)/);if(m&&m[1]){ua.webkit=parseFloat(m[1]);}else{m=nua.match(/MSIE\s([^;]*)/);if(m&&m[1]){ua.ie=parseFloat(m[1]);}else if((/Gecko\/(\S*)/).test(nua)){ua.gecko=1;m=nua.match(/rv:([^\s\)]*)/);if(m&&m[1]){ua.gecko=parseFloat(m[1]);}}}}
return{load:function(urls,callback,obj,scope){var head=d.getElementsByTagName('head')[0],i,script;if(urls){urls=urls.constructor===Array?urls:[urls];for(i=0;i<urls.length;++i){queue.push({'url':urls[i],'callback':i===urls.length-1?callback:null,'obj':obj,'scope':scope});}}
if(pending||!(pending=queue.shift())){return;}
getUserAgent();script=d.createElement('script');script.src=pending.url;if(ua.ie){script.onreadystatechange=function(){if(this.readyState==='loaded'||this.readyState==='complete'){LazyLoad.requestComplete();}};}else if(ua.gecko||ua.webkit>=420){script.onload=LazyLoad.requestComplete;script.onerror=LazyLoad.requestComplete;}
head.appendChild(script);if(!ua.ie&&!ua.gecko&&!(ua.webkit>=420)){script=d.createElement('script');script.appendChild(d.createTextNode('LazyLoad.requestComplete();'));head.appendChild(script);}},loadOnce:function(urls,callback,obj,scope,force){var newUrls=[],scripts=d.getElementsByTagName('script'),i,j,loaded,url;urls=urls.constructor===Array?urls:[urls];for(i=0;i<urls.length;++i){loaded=false;url=urls[i];for(j=0;j<scripts.length;++j){if(url===scripts[j].src){loaded=true;break;}}
if(!loaded){newUrls.push(url);}}
if(newUrls.length>0){LazyLoad.load(newUrls,callback,obj,scope);}else if(force){if(obj){if(scope){callback.call(obj);}else{callback.call(window,obj);}}else{callback.call();}}},requestComplete:function(){if(pending.callback){if(pending.obj){if(pending.scope){pending.callback.call(pending.obj);}else{pending.callback.call(window,pending.obj);}}else{pending.callback.call();}}
pending=null;if(queue.length){LazyLoad.load();}}};}();