require.def("core/lib",["core/trace"],function(l){var d={},j=navigator.userAgent.toLowerCase();d.isFirefox=/firefox/.test(j);d.isOpera=/opera/.test(j);d.isSafari=/webkit/.test(j);d.isIE=/msie/.test(j)&&!/opera/.test(j);d.isIE6=/msie 6/i.test(navigator.appVersion);d.browserVersion=(j.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1];d.isIElt8=d.isIE&&d.browserVersion-0<8;d.extend=function(a,b){var c={};d.append(c,a);d.append(c,b);return c};d.append=function(a,b){for(var c in b)a[c]=b[c];return a}; d.bind=function(){var a=d.cloneArray(arguments),b=a.shift(),c=a.shift();return function(){return b.apply(c,d.arrayInsert(d.cloneArray(a),0,arguments))}};d.bindFixed=function(){var a=d.cloneArray(arguments),b=a.shift(),c=a.shift();return function(){return b.apply(c,a)}};d.dispatch=function(a,b,c){for(var e=0;a&&e=a.top&&c<=a.top+a.height&&b>=a.left&&b<=a.left+a.width};d.cloneArray=function(a,b){var c=[];if(b)for(var e=0;e2?2:b;b=b<-1?-1:b;if(b==-1)return a+" B";b=Math.pow(10,b);return a==-1||a==undefined?"?":a==0?"0":a<1024?a+" B":a<1048576?Math.round(a/1024*b)/b+" KB":Math.round(a/1048576*b)/b+" MB"};d.formatTime=function(a){return a==-1?"-":a<1E3?a+"ms":a<6E4?Math.ceil(a/10)/100+"s":Math.ceil(a/6E4*100)/100+"m"};d.formatNumber=function(a){a+="";var b=a.split(".");a=b[0];b=b.length>1?"."+b[1]:"";for(var c=/(\d+)(\d{3})/;c.test(a);)a=a.replace(c,"$1,$2");return a+b};d.formatString= function(a){var b=d.cloneArray(arguments);a=b.shift();for(var c=0;c"+a}else{e.name=a.name;e.path=a.path}}else{e.hasOwnProperty("path")||(e.path="data:");e.hasOwnProperty("name")||(e.name=decodeURIComponent(e.encodedContent.substr(0,200)).replace(/\s*$/,""))}return e};d.splitURLTrue=function(a){var b=/:\/{1,3}(.*?)\/([^\/]*?)\/?($|\?.*)/.exec(a);return b?b[2]?{path:b[1],name:b[2]+b[3]}:{path:b[1],name:b[1]}:{name:a,path:a}};d.getURLParameter=function(a){for(var b= window.location.search.substring(1).split("&"),c=0;c25E3&&!b)i=d.$STR("LargeData");e.push({name:c(h),value:c(i)})}else{h=a[f];e.push({name:c(h),value:""})}}catch(p){}e.sort(function(k,n){return k.name<=n.name?-1:1});return e};d.getBody=function(a){if(a.body)return a.body; if(a=a.getElementsByTagName("body")[0])return a;return null};d.getHead=function(a){return a.getElementsByTagName("head")[0]};d.getAncestorByClass=function(a,b){for(a=a;a;a=a.parentNode)if(d.hasClass(a,b))return a;return null};d.$=function(){return d.getElementByClass.apply(this,arguments)};d.getElementByClass=function(a){if(!a)return null;var b=d.cloneArray(arguments);b.splice(0,1);for(var c=a.firstChild;c;c=c.nextSibling){var e=d.cloneArray(b);e.unshift(c);if(d.hasClass.apply(this,e))return c;else if(e= d.getElementByClass.apply(this,e))return e}return null};d.getElementsByClass=function(a){function b(f,g,h){for(f=f.firstChild;f;f=f.nextSibling){var i=d.cloneArray(g);i.unshift(f);d.hasClass.apply(null,i)&&h.push(f);b(f,g,h)}}var c=[],e=d.cloneArray(arguments);e.shift();b(a,e,c);return c};d.getChildByClass=function(a){for(var b=1;b=0){b=b.length;a.className=a.className.substr(0,c-1)+a.className.substr(c+b)}}};d.toggleClass=function(a,b){if(d.hasClass(a, b)){d.removeClass(a,b);return false}else{d.setClass(a,b);return true}};d.trim=function(a){return a.replace(/^\s*|\s*$/g,"")};d.wrapText=function(a,b){var c=/[^A-Za-z_$0-9'"-]/,e=[];a=d.splitLines(a);for(var f=0;f100;){var h=c.exec(g.substr(100,100));h=100+(h?h.index:0);var i=g.substr(0,h);g=g.substr(h);b||e.push("
");e.push(b?i:d.escapeHTML(i));b||e.push("
")}b||e.push("
");e.push(b?g:d.escapeHTML(g));b||e.push("
")}return e.join(b?"\n":"")}; d.insertWrappedText=function(a,b,c){b.innerHTML="
"+d.wrapText(a,c)+"
"};d.splitLines=function(a){var b=/\r\n|\r|\n/;if(a){if(a.split)return a.split(b)}else return[];return(a+"").split(b)};d.getPrettyDomain=function(a){return(a=/[^:]+:\/{1,3}(www\.)?([^\/]+)/.exec(a))?a[2]:""};d.escapeHTML=function(a){function b(c){switch(c){case "<":return"<";case ">":return">";case "&":return"&";case "'":return"'";case '"':return"""}return"?"}return String(a).replace(/[<>&"']/g,b)};d.cropString= function(a,b){a+="";var c=b?b/2:50;return a.length>b?d.escapeNewLines(a.substr(0,c)+"..."+a.substr(a.length-c)):d.escapeNewLines(a)};d.escapeNewLines=function(a){return a.replace(/\r/g,"\\r").replace(/\n/g,"\\n")};d.cloneJSON=function(a){if(a==null||typeof a!="object")return a;try{var b=a.constructor();for(var c in a)b[c]=cloneJSON(a[c]);return b}catch(e){l.exception(a)}return null};d.getOverflowParent=function(a){for(a=a.parentNode;a;a=a.offsetParent)if(a.scrollHeight>a.offsetHeight)return a};d.getElementBox= function(a){var b={};if(a.getBoundingClientRect){a=a.getBoundingClientRect();var c=d.isIE?document.body.clientTop||document.documentElement.clientTop:0,e=d.getWindowScrollPosition();b.top=Math.round(a.top-c+e.top);b.left=Math.round(a.left-c+e.left);b.height=Math.round(a.bottom-a.top);b.width=Math.round(a.right-a.left)}else{c=d.getElementPosition(a);b.top=c.top;b.left=c.left;b.height=a.offsetHeight;b.width=a.offsetWidth}return b};d.getElementPosition=function(a){var b=0,c=0;do{b+=a.offsetLeft;c+=a.offsetTop}while(a= a.offsetParent);return{left:b,top:c}};d.getWindowSize=function(){var a=0,b=0,c;if(typeof window.innerWidth=="number"){a=window.innerWidth;b=window.innerHeight}else if((c=document.documentElement)&&(c.clientHeight||c.clientWidth)){a=c.clientWidth;b=c.clientHeight}else if((c=document.body)&&(c.clientHeight||c.clientWidth)){a=c.clientWidth;b=c.clientHeight}return{width:a,height:b}};d.getWindowScrollSize=function(){var a=0,b=0,c;if(!d.isIEQuiksMode&&(c=document.documentElement)&&(c.scrollHeight||c.scrollWidth)){a= c.scrollWidth;b=c.scrollHeight}if((c=document.body)&&(c.scrollHeight||c.scrollWidth)&&(c.scrollWidth>a||c.scrollHeight>b)){a=c.scrollWidth;b=c.scrollHeight}return{width:a,height:b}};d.getWindowScrollPosition=function(){var a=0,b=0,c;if(typeof window.pageYOffset=="number"){a=window.pageYOffset;b=window.pageXOffset}else if((c=document.body)&&(c.scrollTop||c.scrollLeft)){a=c.scrollTop;b=c.scrollLeft}else if((c=document.documentElement)&&(c.scrollTop||c.scrollLeft)){a=c.scrollTop;b=c.scrollLeft}return{top:a, left:b}};d.addStyleSheet=function(a,b){if(!a.getElementById(b)){var c=a.createElement("link");c.type="text/css";c.rel="stylesheet";c.href=b;c.setAttribute("id",b);d.getHead(a).appendChild(c)}};return d});