var xINCCache=new Object();function xINC(b){this.libraries=new Array();this.including=new Object();this.cached=0;this.toInclude=0;this.libsTotal=new Array();this.libsToLoad=new Array();if(b==undefined){return false}if(b.librairies==undefined||b.librairies==null){return false}if(b.librairies.length==0){return false}if(b.callback==undefined){b.callback=null}if(b.args==undefined){b.args=null}this.callBack=b.callback;this.args=b.args;for(i=0;i<b.librairies.length;i++){var a=this.trim(b.librairies[i]);if(a!=""){this.libsTotal.push(a);this.toInclude++;if(this.isCached(a)){this.cached++}else{this.libsToLoad.push(a)}}}if(this.toInclude==this.cached){if(this.isFunction(this.callBack)){if(this.args==null){setTimeout(this.callBack,1300)}else{setTimeout(this.callBack(this.args),1300)}}if(this.isString(this.callBack)){if(this.args==null){setTimeout(this.callBack+"()",1300)}else{setTimeout(this.callBack+"("+JSON.stringify(this.args)+")",1300)}}}else{for(i=0;i<this.libsToLoad.length;i++){var c=this;xINCLoader.load(this.libsToLoad[i],{beginLoading:function(d){c.juststarted(d)},endLoading:function(d){c.justfinished(d)}})}}}xINC.prototype.trim=function(a){if(typeof a=="string"){return a.replace(/^\s*|\s*$/gi,"")}else{return a}};xINC.prototype.isFunction=function(b){if(b==undefined){return false}return typeof b=="function"};xINC.prototype.isString=function(b){return typeof b=="string"};xINC.prototype.juststarted=function(a){this.including[a]="1"};xINC.prototype.justfinished=function(a){this.cached++;xINCCache[a]="1";if(this.toInclude==this.cached){if(this.isFunction(this.callBack)){if(this.args==null){setTimeout(this.callBack,1300)}else{setTimeout(this.callBack(this.args),1300)}}if(this.isString(this.callBack)){if(this.args==null){setTimeout(this.callBack+"()",1300)}else{setTimeout(this.callBack+"("+JSON.stringify(this.args)+")",1300)}}}};xINC.prototype.isCached=function(b){var a=xINCLoader.hash(b);if(xINCCache[a]!=undefined){return true}else{return false}};var xINCLoader={getAgent:function(){if(this.ua){return}var b=navigator.userAgent,a;this.ua={gecko:0,ie:0,webkit:0};a=b.match(/AppleWebKit\/(\S*)/);if(a&&a[1]){this.ua.webkit=parseFloat(a[1])}else{a=b.match(/MSIE\s([^;]*)/);if(a&&a[1]){this.ua.ie=parseFloat(a[1])}else{if((/Gecko\/(\S*)/).test(b)){this.ua.gecko=1;a=b.match(/rv:([^\s\)]*)/);if(a&&a[1]){this.ua.gecko=parseFloat(a[1])}}}}},hash:function(e){if(!e||e==""){return 1}var b=0,d=0;for(var a=e.length-1;a>=0;a--){var f=parseInt(e.charCodeAt(a));b=((b<<6)&268435455)+f+(f<<14);if((d=b&266338304)!=0){b=(b^(d>>21))}}return b.toString()},load:function(fileName,options){if(typeof(fileName)=="object"){for(s in fileName){if(typeof(fileName[s])=="string"){xINCLoader.load(fileName[s],options)}}return}if(this.loaded[fileName]||this.loading[fileName]){return}var head=document.getElementsByTagName("body")[0];var dotPosition=fileName.lastIndexOf(".");var sExtension=fileName.substr(dotPosition);var filehash=xINCLoader.hash(fileName);this.getAgent();switch(sExtension){case".css":fileName+="?rnd="+Math.random();var obj=document.createElement("link");obj.rel="stylesheet";obj.href=fileName;obj.type="text/css";head.appendChild(obj);break;default:var script=document.createElement("script");script.src=fileName;script.type="text/javascript";if(this.ua.ie){script.onreadystatechange=function(){if(this.readyState==="loaded"||this.readyState==="complete"){xINCLoader.endLoading[filehash]()}}}else{if(this.ua.gecko||this.ua.webkit>=420){script.onload=xINCLoader.endLoading[filehash];script.onerror=xINCLoader.endLoading[filehash]}}if(!this.ua.ie&&!this.ua.gecko&&!(this.ua.webkit>=420)){script=document.createElement("script");script.appendChild(document.createTextNode('xINCLoader.endLoading["'+filehash+'"]();'))}document.getElementsByTagName("head")[0].appendChild(script);break}with(xINCLoader){options=options||{};var emptyFunction=function(){};_beginLoading[filehash]=(options.beginLoading||emptyFunction);_endLoading[filehash]=(options.endLoading||emptyFunction);xINCLoader.beginLoading[filehash]=function(e){loading[filehash]=true;_beginLoading[filehash](e)};xINCLoader.endLoading[filehash]=function(e){loading[filehash]=false;loaded[filehash]=true;_endLoading[filehash](e)};beginLoading[filehash](filehash);endLoading[filehash](filehash)}},loading:{},loaded:{},_beginLoading:function(){},_endLoading:function(){},beginLoading:function(){},endLoading:function(){}};
