<commit_before>

/* platform.js */

SimileAjax.Platform.os={isMac:false,isWin:false,isWin32:false,isUnix:false};SimileAjax.Platform.browser={isIE:false,isNetscape:false,isMozilla:false,isFirefox:false,isOpera:false,isSafari:false,majorVersion:0,minorVersion:0};(function(){var an=navigator.appName.toLowerCase();var ua=navigator.userAgent.toLowerCase();SimileAjax.Platform.os.isMac=(ua.indexOf('mac')!=-1);SimileAjax.Platform.os.isWin=(ua.indexOf('win')!=-1);SimileAjax.Platform.os.isWin32=SimileAjax.Platform.isWin&&(ua.indexOf('95')!=-1||ua.indexOf('98')!=-1||ua.indexOf('nt')!=-1||ua.indexOf('win32')!=-1||ua.indexOf('32bit')!=-1);SimileAjax.Platform.os.isUnix=(ua.indexOf('x11')!=-1);SimileAjax.Platform.browser.isIE=(an.indexOf("microsoft")!=-1);SimileAjax.Platform.browser.isNetscape=(an.indexOf("netscape")!=-1);SimileAjax.Platform.browser.isMozilla=(ua.indexOf("mozilla")!=-1);SimileAjax.Platform.browser.isFirefox=(ua.indexOf("firefox")!=-1);SimileAjax.Platform.browser.isOpera=(an.indexOf("opera")!=-1);SimileAjax.Platform.browser.isSafari=(an.indexOf("safari")!=-1);var parseVersionString=function(s){var a=s.split(".");SimileAjax.Platform.browser.majorVersion=parseInt(a[0]);SimileAjax.Platform.browser.minorVersion=parseInt(a[1]);};var indexOf=function(s,sub,start){var i=s.indexOf(sub,start);return i>=0?i:s.length;};if(SimileAjax.Platform.browser.isMozilla){var offset=ua.indexOf("mozilla/");if(offset>=0){parseVersionString(ua.substring(offset+8,indexOf(ua," ",offset)));}}
if(SimileAjax.Platform.browser.isIE){var offset=ua.indexOf("msie ");if(offset>=0){parseVersionString(ua.substring(offset+5,indexOf(ua,";",offset)));}}
if(SimileAjax.Platform.browser.isNetscape){var offset=ua.indexOf("rv:");if(offset>=0){parseVersionString(ua.substring(offset+3,indexOf(ua,")",offset)));}}
if(SimileAjax.Platform.browser.isFirefox){var offset=ua.indexOf("firefox/");if(offset>=0){parseVersionString(ua.substring(offset+8,indexOf(ua," ",offset)));}}
if(!("localeCompare"in String.prototype)){String.prototype.localeCompare=function(s){if(this<s)return-1;else if(this>s)return 1;else return 0;};}})();SimileAjax.Platform.getDefaultLocale=function(){return SimileAjax.Platform.clientLocale;};

/* ajax.js */

SimileAjax.ListenerQueue=function(wildcardHandlerName){this._listeners=[];this._wildcardHandlerName=wildcardHandlerName;};SimileAjax.ListenerQueue.prototype.add=function(listener){this._listeners.push(listener);};SimileAjax.ListenerQueue.prototype.remove=function(listener){var listeners=this._listeners;for(var i=0;i<listeners.length;i++){if(listeners[i]==listener){listeners.splice(i,1);break;}}};SimileAjax.ListenerQueue.prototype.fire=function(handlerName,args){var listeners=[].concat(this._listeners);for(var i=0;i<listeners.length;i++){var listener=listeners[i];if(handlerName in listener){try{listener[handlerName].apply(listener,args);}catch(e){SimileAjax.Debug.exception("Error firing event of name "+handlerName,e);}}else if(this._wildcardHandlerName!=null&&this._wildcardHandlerName in listener){try{listener[this._wildcardHandlerName].apply(listener,[handlerName]);}catch(e){SimileAjax.Debug.exception("Error firing event of name "+handlerName+" to wildcard handler",e);}}}};

/* date-time.js */

SimileAjax.DateTime=new Object();SimileAjax.DateTime._dateRegexp=new RegExp("^(-?)([0-9]{4})("+["(-?([0-9]{2})(-?([0-9]{2}))?)","(-?([0-9]{3}))","(-?W([0-9]{2})(-?([1-7]))?)"].join("|")+")?$");SimileAjax.DateTime._timezoneRegexp=new RegExp("Z|(([-+])([0-9]{2})(:?([0-9]{2}))?)$");SimileAjax.DateTime._timeRegexp=new RegExp("^([0-9]{2})(:?([0-9]{2})(:?([0-9]{2})(\.([0-9]+))?)?)?$");SimileAjax.DateTime.setIso8601Date=function(dateObject,string){var d=string.match(SimileAjax.DateTime._dateRegexp);if(!d){throw new Error("Invalid date string: "+string);}
var sign=(d[1]=="-")?-1:1;var year=sign*d[2];var month=d[5];var date=d[7];var dayofyear=d[9];var week=d[11];var dayofweek=(d[13])?d[13]:1;dateObject.setUTCFullYear(year);if(dayofyear){dateObject.setUTCMonth(0);dateObject.setUTCDate(Number(dayofyear));}else if(week){dateObject.setUTCMonth(0);dateObject.setUTCDate(1);var gd=dateObject.getUTCDay();var day=(gd)?gd:7;var offset=Number(dayofweek)+(7*Number(week));if(day<=4){dateObject.setUTCDate(offset+1-day);}else{dateObject.setUTCDate(offset+8-day);}}else{if(month){dateObject.setUTCDate(1);dateObject.setUTCMonth(month-1);}
if(date){dateObject.setUTCDate(date);}}
return dateObject;};SimileAjax.DateTime.setIso8601Time=function(dateObject,string){var d=string.match(SimileAjax.DateTime._timezoneRegexp);var offset=0;if(d){if(d[0]!='Z'){offset=(Number(d[3])*60)+Number(d[5]);offset*=((d[2]=='-')?1:-1);}
string=string.substr(0,string.length-d[0].length);}
var d=string.match(SimileAjax.DateTime._timeRegexp);if(!d){SimileAjax.Debug.warn("Invalid time string: "+string);return false;}
var hours=d[1];var mins=Number((d[3])?d[3]:0);var secs=(d[5])?d[5]:0;var ms=d[7]?(Number("0."+d[7])*1000):0;dateObject.setUTCHours(hours);dateObject.setUTCMinutes(mins);dateObject.setUTCSeconds(secs);dateObject.setUTCMilliseconds(ms);return dateObject;};SimileAjax.DateTime.setIso8601=function(dateObject,string){var comps=(string.indexOf("T")==-1)?string.split(" "):string.split("T");SimileAjax.DateTime.setIso8601Date(dateObject,comps[0]);if(comps.length==2){SimileAjax.DateTime.setIso8601Time(dateObject,comps[1]);}
return dateObject;};SimileAjax.DateTime.parseIso8601DateTime=function(string){try{return SimileAjax.DateTime.setIso8601(new Date(0),string);}catch(e){return null;}};

/* debug.js */

SimileAjax.Debug={silent:false};SimileAjax.Debug.log=function(msg){var f;if("console"in window&&"log"in window.console){f=function(msg2){console.log(msg2);}}else{f=function(msg2){if(!SimileAjax.Debug.silent){alert(msg2);}}}
SimileAjax.Debug.log=f;f(msg);};SimileAjax.Debug.warn=function(msg){var f;if("console"in window&&"warn"in window.console){f=function(msg2){console.warn(msg2);}}else{f=function(msg2){if(!SimileAjax.Debug.silent){alert(msg2);}}}
SimileAjax.Debug.warn=f;f(msg);};SimileAjax.Debug.exception=function(msg,e){var f;if("console"in window&&"error"in window.console){f=function(msg2,e2){console.error(msg2+" %o",e2);}}else{f=SimileAjax.Platform.browser.isIE?function(msg2,e2){if(!SimileAjax.Debug.silent){alert("Caught exception: "+msg2+"\n\nDetails: "+e2.description);}}:function(msg2,e2){if(!SimileAjax.Debug.silent){alert("Caught exception: "+msg2+"\n\nDetails: "+e2);}};}
SimileAjax.Debug.exception=f;f(msg,e);};SimileAjax.Debug.objectToString=function(o){return SimileAjax.Debug._objectToString(o,"");};SimileAjax.Debug._objectToString=function(o,indent){var indent2=indent+" ";if(typeof o=="object"){var s="{";for(n in o){s+=indent2+n+": "+SimileAjax.Debug._objectToString(o[n],indent2)+"\n";}
s+=indent+"}";return s;}else if(typeof o=="array"){var s="[";for(var n=0;n<o.length;n++){s+=SimileAjax.Debug._objectToString(o[n],indent2)+"\n";}
s+=indent+"]";return s;}else{return o;}};

/* dom.js */

SimileAjax.DOM=new Object();SimileAjax.DOM.registerEventWithObject=function(elmt,eventName,obj,handlerName){SimileAjax.DOM.registerEvent(elmt,eventName,function(elmt2,evt,target){return obj[handlerName].call(obj,elmt2,evt,target);});};SimileAjax.DOM.registerEvent=function(elmt,eventName,handler){var handler2=function(evt){evt=(evt)?evt:((event)?event:null);if(evt){var target=(evt.target)?evt.target:((evt.srcElement)?evt.srcElement:null);if(target){target=(target.nodeType==1||target.nodeType==9)?target:target.parentNode;}
return handler(elmt,evt,target);}
return true;}
if(SimileAjax.Platform.browser.isIE){elmt.attachEvent("on"+eventName,handler2);}else{elmt.addEventListener(eventName,handler2,false);}};SimileAjax.DOM.getPageCoordinates=function(elmt){var left=0;var top=0;if(elmt.nodeType!=1){elmt=elmt.parentNode;}
while(elmt!=null){left+=elmt.offsetLeft;top+=elmt.offsetTop;elmt=elmt.offsetParent;}
return{left:left,top:top};};SimileAjax.DOM.getEventRelativeCoordinates=function(evt,elmt){if(SimileAjax.Platform.browser.isIE){return{x:evt.offsetX,y:evt.offsetY};}else{var coords=SimileAjax.DOM.getPageCoordinates(elmt);return{x:evt.pageX-coords.left,y:evt.pageY-coords.top};}};SimileAjax.DOM.getEventPageCoordinates=function(evt){if(SimileAjax.Platform.browser.isIE){return{x:evt.clientX+document.body.scrollLeft,y:evt.clientY+document.body.scrollTop};}else{return{x:evt.pageX,y:evt.pageY};}};SimileAjax.DOM.hittest=function(x,y,except){return SimileAjax.DOM._hittest(document.body,x,y,except);};SimileAjax.DOM._hittest=function(elmt,x,y,except){var childNodes=elmt.childNodes;for(var i=0;i<childNodes.length;i++){var childNode=childNodes[i];if(childNode==except){continue;}
if(childNode.offsetWidth==0&&childNode.offsetHeight==0){var hitNode=SimileAjax.DOM._hittest(childNode,x,y,except);if(hitNode!=childNode){return hitNode;}}else{var top=0;var left=0;var node=childNode;while(node){top+=node.offsetTop;left+=node.offsetLeft;node=node.offsetParent;}
if(left<=x&&top<=y&&(x-left)<childNode.offsetWidth&&(y-top)<childNode.offsetHeight){return SimileAjax.DOM._hittest(childNode,x,y,except);}else if(childNode.nodeType==1&&childNode.tagName=="TR"){var childNode2=SimileAjax.DOM._hittest(childNode,x,y,except);if(childNode2!=childNode){return childNode2;}}}}
return elmt;};SimileAjax.DOM.cancelEvent=function(evt){evt.returnValue=false;evt.cancelBubble=true;if("preventDefault"in evt){evt.preventDefault();}};SimileAjax.DOM.appendClassName=function(elmt,className){var classes=elmt.className.split(" ");for(var i=0;i<classes.length;i++){if(classes[i]==className){return;}}
classes.push(className);elmt.className=classes.join(" ");};SimileAjax.DOM.createInputElement=function(type){var div=document.createElement("div");div.innerHTML="<input type='"+type+"' />";return div.firstChild;};SimileAjax.DOM.createDOMFromTemplate=function(doc,template){var result={};result.elmt=SimileAjax.DOM._createDOMFromTemplate(doc,template,result,null);return result;};SimileAjax.DOM._createDOMFromTemplate=function(doc,templateNode,result,parentElmt){if(templateNode==null){return null;}else if(typeof templateNode!="object"){var node=doc.createTextNode(templateNode);if(parentElmt!=null){parentElmt.appendChild(node);}
return node;}else{var elmt=null;if("tag"in templateNode){var tag=templateNode.tag;if(parentElmt!=null){if(tag=="tr"){elmt=parentElmt.insertRow(parentElmt.rows.length);}else if(tag=="td"){elmt=parentElmt.insertCell(parentElmt.cells.length);}}
if(elmt==null){elmt=tag=="input"?SimileAjax.DOM.createInputElement(templateNode.type):doc.createElement(tag);if(parentElmt!=null){parentElmt.appendChild(elmt);}}}else{elmt=templateNode.elmt;if(parentElmt!=null){parentElmt.appendChild(elmt);}}
for(attribute in templateNode){var value=templateNode[attribute];if(attribute=="field"){result[value]=elmt;}else if(attribute=="className"){elmt.className=value;}else if(attribute=="id"){elmt.id=value;}else if(attribute=="title"){elmt.title=value;}else if(attribute=="type"&&elmt.tagName=="input"){}else if(attribute=="style"){for(n in value){var v=value[n];if(n=="float"){n=SimileAjax.Platform.browser.isIE?"styleFloat":"cssFloat";}
elmt.style[n]=v;}}else if(attribute=="children"){for(var i=0;i<value.length;i++){SimileAjax.DOM._createDOMFromTemplate(doc,value[i],result,elmt);}}else if(attribute!="tag"&&attribute!="elmt"){elmt.setAttribute(attribute,value);}}
return elmt;}}

/* graphics.js */

SimileAjax.Graphics=new Object();SimileAjax.Graphics.pngIsTranslucent=(!SimileAjax.Platform.browser.isIE)||(SimileAjax.Platform.browser.majorVersion>6);SimileAjax.Graphics._createTranslucentImage1=function(doc,url,verticalAlign){elmt=doc.createElement("img");elmt.setAttribute("src",url);if(verticalAlign!=null){elmt.style.verticalAlign=verticalAlign;}
return elmt;};SimileAjax.Graphics._createTranslucentImage2=function(doc,url,verticalAlign){elmt=doc.createElement("img");elmt.style.width="1px";elmt.style.height="1px";elmt.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+url+"', sizingMethod='image')";elmt.style.verticalAlign=(verticalAlign!=null)?verticalAlign:"middle";return elmt;};SimileAjax.Graphics.createTranslucentImage=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImage1:SimileAjax.Graphics._createTranslucentImage2;SimileAjax.Graphics.setOpacity=function(elmt,opacity){if(SimileAjax.Platform.browser.isIE){elmt.style.filter="progid:DXImageTransform.Microsoft.Alpha(Style=0,Opacity="+opacity+")";}else{var o=(opacity/100).toString();elmt.style.opacity=o;elmt.style.MozOpacity=o;}};SimileAjax.Graphics._bubbleMargins={top:33,bottom:42,left:33,right:40}
SimileAjax.Graphics._arrowOffsets={top:0,bottom:9,left:1,right:8}
SimileAjax.Graphics._bubblePadding=15;SimileAjax.Graphics._bubblePointOffset=6;SimileAjax.Graphics._halfArrowWidth=18;SimileAjax.Graphics.createBubbleForPoint=function(doc,pageX,pageY,contentWidth,contentHeight){function getWindowDims(){if(typeof window.innerHeight=='number'){return{w:window.innerWidth,h:window.innerHeight};}else if(document.documentElement&&document.documentElement.clientHeight){return{w:document.documentElement.clientWidth,h:document.documentElement.clientHeight};}else if(document.body&&document.body.clientHeight){return{w:document.body.clientWidth,h:document.body.clientHeight};}}
var close=function(){if(!bubble._closed){bubble._doc.body.removeChild(bubble._div);bubble._doc=null;bubble._div=null;bubble._content=null;bubble._closed=true;}}
var layer=SimileAjax.WindowManager.pushLayer(close,true);var bubble={_closed:false,_doc:doc,close:function(){SimileAjax.WindowManager.popLayer(layer);}};var dims=getWindowDims();var docWidth=dims.w;var docHeight=dims.h;var margins=SimileAjax.Graphics._bubbleMargins;contentWidth=parseInt(contentWidth,10);contentHeight=parseInt(contentHeight,10);var bubbleWidth=margins.left+contentWidth+margins.right;var bubbleHeight=margins.top+contentHeight+margins.bottom;var pngIsTranslucent=SimileAjax.Graphics.pngIsTranslucent;var urlPrefix=SimileAjax.urlPrefix;var setImg=function(elmt,url,width,height){elmt.style.position="absolute";elmt.style.width=width+"px";elmt.style.height=height+"px";if(pngIsTranslucent){elmt.style.background="url("+url+")";}else{elmt.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+url+"', sizingMethod='crop')";}}
var div=doc.createElement("div");div.style.width=bubbleWidth+"px";div.style.height=bubbleHeight+"px";div.style.position="absolute";div.style.zIndex=1000;bubble._div=div;var divInner=doc.createElement("div");divInner.style.width="100%";divInner.style.height="100%";divInner.style.position="relative";div.appendChild(divInner);var createImg=function(url,left,top,width,height){var divImg=doc.createElement("div");divImg.style.left=left+"px";divImg.style.top=top+"px";setImg(divImg,url,width,height);divInner.appendChild(divImg);}
createImg(urlPrefix+"images/bubble-top-left.png",0,0,margins.left,margins.top);createImg(urlPrefix+"images/bubble-top.png",margins.left,0,contentWidth,margins.top);createImg(urlPrefix+"images/bubble-top-right.png",margins.left+contentWidth,0,margins.right,margins.top);createImg(urlPrefix+"images/bubble-left.png",0,margins.top,margins.left,contentHeight);createImg(urlPrefix+"images/bubble-right.png",margins.left+contentWidth,margins.top,margins.right,contentHeight);createImg(urlPrefix+"images/bubble-bottom-left.png",0,margins.top+contentHeight,margins.left,margins.bottom);createImg(urlPrefix+"images/bubble-bottom.png",margins.left,margins.top+contentHeight,contentWidth,margins.bottom);createImg(urlPrefix+"images/bubble-bottom-right.png",margins.left+contentWidth,margins.top+contentHeight,margins.right,margins.bottom);var divClose=doc.createElement("div");divClose.style.left=(bubbleWidth-margins.right+SimileAjax.Graphics._bubblePadding-16-2)+"px";divClose.style.top=(margins.top-SimileAjax.Graphics._bubblePadding+1)+"px";divClose.style.cursor="pointer";setImg(divClose,urlPrefix+"images/close-button.png",16,16);SimileAjax.WindowManager.registerEventWithObject(divClose,"click",bubble,"close");divInner.appendChild(divClose);var divContent=doc.createElement("div");divContent.style.position="absolute";divContent.style.left=margins.left+"px";divContent.style.top=margins.top+"px";divContent.style.width=contentWidth+"px";divContent.style.height=contentHeight+"px";divContent.style.overflow="auto";divContent.style.background="white";divInner.appendChild(divContent);bubble.content=divContent;(function(){if(pageX-SimileAjax.Graphics._halfArrowWidth-SimileAjax.Graphics._bubblePadding>0&&pageX+SimileAjax.Graphics._halfArrowWidth+SimileAjax.Graphics._bubblePadding<docWidth){var left=pageX-Math.round(contentWidth/2)-margins.left;left=pageX<(docWidth/2)?Math.max(left,-(margins.left-SimileAjax.Graphics._bubblePadding)):Math.min(left,docWidth+(margins.right-SimileAjax.Graphics._bubblePadding)-bubbleWidth);if(pageY-SimileAjax.Graphics._bubblePointOffset-bubbleHeight>0){var divImg=doc.createElement("div");divImg.style.left=(pageX-SimileAjax.Graphics._halfArrowWidth-left)+"px";divImg.style.top=(margins.top+contentHeight)+"px";setImg(divImg,urlPrefix+"images/bubble-bottom-arrow.png",37,margins.bottom);divInner.appendChild(divImg);div.style.left=left+"px";div.style.top=(pageY-SimileAjax.Graphics._bubblePointOffset-bubbleHeight+
SimileAjax.Graphics._arrowOffsets.bottom)+"px";return;}else if(pageY+SimileAjax.Graphics._bubblePointOffset+bubbleHeight<docHeight){var divImg=doc.createElement("div");divImg.style.left=(pageX-SimileAjax.Graphics._halfArrowWidth-left)+"px";divImg.style.top="0px";setImg(divImg,urlPrefix+"images/bubble-top-arrow.png",37,margins.top);divInner.appendChild(divImg);div.style.left=left+"px";div.style.top=(pageY+SimileAjax.Graphics._bubblePointOffset-
SimileAjax.Graphics._arrowOffsets.top)+"px";return;}}
var top=pageY-Math.round(contentHeight/2)-margins.top;top=pageY<(docHeight/2)?Math.max(top,-(margins.top-SimileAjax.Graphics._bubblePadding)):Math.min(top,docHeight+(margins.bottom-SimileAjax.Graphics._bubblePadding)-bubbleHeight);if(pageX-SimileAjax.Graphics._bubblePointOffset-bubbleWidth>0){var divImg=doc.createElement("div");divImg.style.left=(margins.left+contentWidth)+"px";divImg.style.top=(pageY-SimileAjax.Graphics._halfArrowWidth-top)+"px";setImg(divImg,urlPrefix+"images/bubble-right-arrow.png",margins.right,37);divInner.appendChild(divImg);div.style.left=(pageX-SimileAjax.Graphics._bubblePointOffset-bubbleWidth+
SimileAjax.Graphics._arrowOffsets.right)+"px";div.style.top=top+"px";}else{var divImg=doc.createElement("div");divImg.style.left="0px";divImg.style.top=(pageY-SimileAjax.Graphics._halfArrowWidth-top)+"px";setImg(divImg,urlPrefix+"images/bubble-left-arrow.png",margins.left,37);divInner.appendChild(divImg);div.style.left=(pageX+SimileAjax.Graphics._bubblePointOffset-
SimileAjax.Graphics._arrowOffsets.left)+"px";div.style.top=top+"px";}})();doc.body.appendChild(div);return bubble;};SimileAjax.Graphics.createMessageBubble=function(doc){var containerDiv=doc.createElement("div");if(SimileAjax.Graphics.pngIsTranslucent){var topDiv=doc.createElement("div");topDiv.style.height="33px";topDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-top-left.png) top left no-repeat";topDiv.style.paddingLeft="44px";containerDiv.appendChild(topDiv);var topRightDiv=doc.createElement("div");topRightDiv.style.height="33px";topRightDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-top-right.png) top right no-repeat";topDiv.appendChild(topRightDiv);var middleDiv=doc.createElement("div");middleDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-left.png) top left repeat-y";middleDiv.style.paddingLeft="44px";containerDiv.appendChild(middleDiv);var middleRightDiv=doc.createElement("div");middleRightDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-right.png) top right repeat-y";middleRightDiv.style.paddingRight="44px";middleDiv.appendChild(middleRightDiv);var contentDiv=doc.createElement("div");middleRightDiv.appendChild(contentDiv);var bottomDiv=doc.createElement("div");bottomDiv.style.height="55px";bottomDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-bottom-left.png) bottom left no-repeat";bottomDiv.style.paddingLeft="44px";containerDiv.appendChild(bottomDiv);var bottomRightDiv=doc.createElement("div");bottomRightDiv.style.height="55px";bottomRightDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-bottom-right.png) bottom right no-repeat";bottomDiv.appendChild(bottomRightDiv);}else{containerDiv.style.border="2px solid #7777AA";containerDiv.style.padding="20px";containerDiv.style.background="white";SimileAjax.Graphics.setOpacity(containerDiv,90);var contentDiv=doc.createElement("div");containerDiv.appendChild(contentDiv);}
return{containerDiv:containerDiv,contentDiv:contentDiv};};SimileAjax.Graphics.createAnimation=function(f,from,to,duration){return new SimileAjax.Graphics._Animation(f,from,to,duration);};SimileAjax.Graphics._Animation=function(f,from,to,duration){this.f=f;this.from=from;this.to=to;this.current=from;this.duration=duration;this.start=new Date().getTime();this.timePassed=0;};SimileAjax.Graphics._Animation.prototype.run=function(){var a=this;window.setTimeout(function(){a.step();},50);};SimileAjax.Graphics._Animation.prototype.step=function(){this.timePassed+=50;var timePassedFraction=this.timePassed/this.duration;var parameterFraction=-Math.cos(timePassedFraction*Math.PI)/2+0.5;var current=parameterFraction*(this.to-this.from)+this.from;try{this.f(current,current-this.current);}catch(e){}
this.current=current;if(this.timePassed<this.duration){this.run();}else{this.f(this.to,0);}};SimileAjax.Graphics.createStructuredDataCopyButton=function(image,width,height,createDataFunction){var div=document.createElement("div");div.style.position="relative";div.style.display="inline";div.style.width=width+"px";div.style.height=height+"px";div.style.overflow="hidden";div.style.margin="2px";if(SimileAjax.Graphics.pngIsTranslucent){div.style.background="url("+image+") no-repeat";}else{div.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+image+"', sizingMethod='image')";}
var style;if(SimileAjax.Platform.browser.isIE){style="filter:alpha(opacity=0)";}else{style="opacity: 0";}
div.innerHTML="<textarea rows='1' autocomplete='off' value='none' style='"+style+"' />";var textarea=div.firstChild;textarea.style.width=width+"px";textarea.style.height=height+"px";textarea.onmousedown=function(evt){evt=(evt)?evt:((event)?event:null);if(evt.button==2){textarea.value=createDataFunction();textarea.select();}};return div;};

/* history.js */

SimileAjax.History={maxHistoryLength:10,historyFile:"__history__.html",enabled:true,_initialized:false,_listeners:new SimileAjax.ListenerQueue(),_actions:[],_baseIndex:0,_currentIndex:0,_plainDocumentTitle:document.title};SimileAjax.History.formatHistoryEntryTitle=function(actionLabel){return SimileAjax.History._plainDocumentTitle+" {"+actionLabel+"}";};SimileAjax.History.initialize=function(){if(SimileAjax.History._initialized){return;}
if(SimileAjax.History.enabled){var iframe=document.createElement("iframe");iframe.id="simile-ajax-history";iframe.style.position="absolute";iframe.style.width="10px";iframe.style.height="10px";iframe.style.top="0px";iframe.style.left="0px";iframe.style.visibility="hidden";iframe.src=SimileAjax.History.historyFile+"?0";document.body.appendChild(iframe);SimileAjax.DOM.registerEvent(iframe,"load",SimileAjax.History._handleIFrameOnLoad);SimileAjax.History._iframe=iframe;}
SimileAjax.History._initialized=true;};SimileAjax.History.addListener=function(listener){SimileAjax.History.initialize();SimileAjax.History._listeners.add(listener);};SimileAjax.History.removeListener=function(listener){SimileAjax.History.initialize();SimileAjax.History._listeners.remove(listener);};SimileAjax.History.addAction=function(action){SimileAjax.History.initialize();SimileAjax.History._listeners.fire("onBeforePerform",[action]);window.setTimeout(function(){try{action.perform();SimileAjax.History._listeners.fire("onAfterPerform",[action]);if(SimileAjax.History.enabled){SimileAjax.History._actions=SimileAjax.History._actions.slice(0,SimileAjax.History._currentIndex-SimileAjax.History._baseIndex);SimileAjax.History._actions.push(action);SimileAjax.History._currentIndex++;var diff=SimileAjax.History._actions.length-SimileAjax.History.maxHistoryLength;if(diff>0){SimileAjax.History._actions=SimileAjax.History._actions.slice(diff);SimileAjax.History._baseIndex+=diff;}
try{SimileAjax.History._iframe.contentWindow.location.search="?"+SimileAjax.History._currentIndex;}catch(e){var title=SimileAjax.History.formatHistoryEntryTitle(action.label);document.title=title;}}}catch(e){SimileAjax.Debug.exception("Error adding action {"+action.label+"} to history",e);}},0);};SimileAjax.History._handleIFrameOnLoad=function(){try{var q=SimileAjax.History._iframe.contentWindow.location.search;var c=(q.length==0)?0:Math.max(0,parseInt(q.substr(1)));var finishUp=function(){var diff=c-SimileAjax.History._currentIndex;SimileAjax.History._currentIndex+=diff;SimileAjax.History._baseIndex+=diff;SimileAjax.History._iframe.contentWindow.location.search="?"+c;};if(c<SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeUndoSeveral",[]);window.setTimeout(function(){while(SimileAjax.History._currentIndex>c&&SimileAjax.History._currentIndex>SimileAjax.History._baseIndex){SimileAjax.History._currentIndex--;var action=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex];try{action.undo();}catch(e){SimileAjax.Debug.exception("History: Failed to undo action {"+action.label+"}");}}
SimileAjax.History._listeners.fire("onAfterUndoSeveral",[]);finishUp();},0);}else if(c>SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeRedoSeveral",[]);window.setTimeout(function(){while(SimileAjax.History._currentIndex<c&&SimileAjax.History._currentIndex-SimileAjax.History._baseIndex<SimileAjax.History._actions.length){var action=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex];try{action.perform();}catch(e){SimileAjax.Debug.exception("History: Failed to redo action {"+action.label+"}");}
SimileAjax.History._currentIndex++;}
SimileAjax.History._listeners.fire("onAfterRedoSeveral",[]);finishUp();},0);}else{var index=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1;var title=(index>=0&&index<SimileAjax.History._actions.length)?SimileAjax.History.formatHistoryEntryTitle(SimileAjax.History._actions[index].label):SimileAjax.History._plainDocumentTitle;SimileAjax.History._iframe.contentWindow.document.title=title;document.title=title;}}catch(e){}};

/* json.js */

SimileAjax.JSON=new Object();(function(){var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};var s={array:function(x){var a=['['],b,f,i,l=x.length,v;for(i=0;i<l;i+=1){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=='string'){if(b){a[a.length]=',';}
a[a.length]=v;b=true;}}}
a[a.length]=']';return a.join('');},'boolean':function(x){return String(x);},'null':function(x){return"null";},number:function(x){return isFinite(x)?String(x):'null';},object:function(x){if(x){if(x instanceof Array){return s.array(x);}
var a=['{'],b,f,i,v;for(i in x){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=='string'){if(b){a[a.length]=',';}
a.push(s.string(i),':',v);b=true;}}}
a[a.length]='}';return a.join('');}
return'null';},string:function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c;}
c=b.charCodeAt();return'\\u00'+
Math.floor(c/16).toString(16)+
(c%16).toString(16);});}
return'"'+x+'"';}};SimileAjax.JSON.toJSONString=function(o){if(o instanceof Object){return s.object(o);}else if(o instanceof Array){return s.array(o);}else{return o.toString();}};SimileAjax.JSON.parseJSON=function(){try{return!(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(this.replace(/"(\\.|[^"\\])*"/g,'')))&&eval('('+this+')');}catch(e){return false;}};})();

/* string.js */

String.prototype.trim=function(){return this.replace(/^\s+|\s+$/,'');};

/* window-manager.js */

SimileAjax.WindowManager={_initialized:false,_listeners:[],_draggedElement:null,_draggedElementCallback:null,_lastCoords:null,_ghostCoords:null,_dragging:false,_layers:[]};SimileAjax.WindowManager.initialize=function(){if(SimileAjax.WindowManager._initialized){return;}
SimileAjax.DOM.registerEvent(document.body,"click",SimileAjax.WindowManager._onBodyClick);SimileAjax.DOM.registerEvent(document.body,"mousemove",SimileAjax.WindowManager._onBodyMouseMove);SimileAjax.DOM.registerEvent(document.body,"mouseup",SimileAjax.WindowManager._onBodyMouseUp);SimileAjax.WindowManager._layers.push({index:0});SimileAjax.WindowManager._historyListener={onBeforeUndoSeveral:function(){},onAfterUndoSeveral:function(){},onBeforeUndo:function(){},onAfterUndo:function(){},onBeforeRedoSeveral:function(){},onAfterRedoSeveral:function(){},onBeforeRedo:function(){},onAfterRedo:function(){}};SimileAjax.History.addListener(SimileAjax.WindowManager._historyListener);SimileAjax.WindowManager._initialized=true;};SimileAjax.WindowManager.getBaseLayer=function(){SimileAjax.WindowManager.initialize();return SimileAjax.WindowManager._layers[0];};SimileAjax.WindowManager.getHighestLayer=function(){SimileAjax.WindowManager.initialize();return SimileAjax.WindowManager._layers[SimileAjax.WindowManager._layers.length-1];};SimileAjax.WindowManager.registerEventWithObject=function(elmt,eventName,obj,handlerName,layer){SimileAjax.WindowManager.registerEvent(elmt,eventName,function(elmt2,evt,target){return obj[handlerName].call(obj,elmt2,evt,target);},layer);};SimileAjax.WindowManager.registerEvent=function(elmt,eventName,handler,layer){if(layer==null){layer=SimileAjax.WindowManager.getHighestLayer();}
var handler2=function(elmt,evt,target){if(SimileAjax.WindowManager._canProcessEventAtLayer(layer)){SimileAjax.WindowManager._popToLayer(layer.index);return handler(elmt,evt,target);}else{SimileAjax.DOM.cancelEvent(evt);return false;}}
SimileAjax.DOM.registerEvent(elmt,eventName,handler2);};SimileAjax.WindowManager.pushLayer=function(f,ephemeral){var layer={onPop:f,index:SimileAjax.WindowManager._layers.length,ephemeral:(ephemeral)};SimileAjax.WindowManager._layers.push(layer);return layer;};SimileAjax.WindowManager.popLayer=function(layer){for(var i=1;i<SimileAjax.WindowManager._layers.length;i++){if(SimileAjax.WindowManager._layers[i]==layer){SimileAjax.WindowManager._popToLayer(i-1);break;}}};SimileAjax.WindowManager.popAllLayers=function(){SimileAjax.WindowManager._popToLayer(0);};SimileAjax.WindowManager.registerForDragging=function(elmt,callback,layer){SimileAjax.WindowManager.registerEvent(elmt,"mousedown",function(elmt,evt,target){SimileAjax.WindowManager._handleMouseDown(elmt,evt,callback);},layer);};SimileAjax.WindowManager._popToLayer=function(level){while(level+1<SimileAjax.WindowManager._layers.length){try{var layer=SimileAjax.WindowManager._layers.pop();if(layer.onPop!=null){layer.onPop();}}catch(e){}}};SimileAjax.WindowManager._canProcessEventAtLayer=function(layer){if(layer.index==(SimileAjax.WindowManager._layers.length-1)){return true;}
for(var i=layer.index+1;i<SimileAjax.WindowManager._layers.length;i++){if(!SimileAjax.WindowManager._layers[i].ephemeral){return false;}}
return true;};SimileAjax.WindowManager._cancelPopups=function(){var i=SimileAjax.WindowManager._layers.length-1;while(i>0&&SimileAjax.WindowManager._layers[i].ephemeral){i--;}
SimileAjax.WindowManager._popToLayer(i);};SimileAjax.WindowManager._onBodyClick=function(elmt,evt,target){if(!("eventPhase"in evt)||evt.eventPhase==evt.BUBBLING_PHASE){SimileAjax.WindowManager._cancelPopups();}};SimileAjax.WindowManager._handleMouseDown=function(elmt,evt,callback){SimileAjax.WindowManager._draggedElement=elmt;SimileAjax.WindowManager._draggedElementCallback=callback;SimileAjax.WindowManager._lastCoords={x:evt.clientX,y:evt.clientY};SimileAjax.DOM.cancelEvent(evt);return false;};SimileAjax.WindowManager._onBodyMouseMove=function(elmt,evt,target){if(SimileAjax.WindowManager._draggedElement!=null){var callback=SimileAjax.WindowManager._draggedElementCallback;var lastCoords=SimileAjax.WindowManager._lastCoords;var diffX=evt.clientX-lastCoords.x;var diffY=evt.clientY-lastCoords.y;if(!SimileAjax.WindowManager._dragging){if(diffX>2||diffY>2){try{if("onDragStart"in callback){callback.onDragStart();}
if("ghost"in callback&&callback.ghost){var draggedElmt=SimileAjax.WindowManager._draggedElement;SimileAjax.WindowManager._ghostCoords=SimileAjax.DOM.getPageCoordinates(draggedElmt);SimileAjax.WindowManager._ghostCoords.left+=diffX;SimileAjax.WindowManager._ghostCoords.top+=diffY;var ghostElmt=draggedElmt.cloneNode(true);ghostElmt.style.position="absolute";ghostElmt.style.left=SimileAjax.WindowManager._ghostCoords.left+"px";ghostElmt.style.top=SimileAjax.WindowManager._ghostCoords.top+"px";ghostElmt.style.MozOpacity=0.5;ghostElmt.style.zIndex=1000;document.body.appendChild(ghostElmt);callback._ghostElmt=ghostElmt;}
SimileAjax.WindowManager._dragging=true;SimileAjax.WindowManager._lastCoords={x:evt.clientX,y:evt.clientY};}catch(e){SimileAjax.Debug.exception("WindowManager: Error handling mouse down",e);SimileAjax.WindowManager._cancelDragging();}}}else{try{SimileAjax.WindowManager._lastCoords={x:evt.clientX,y:evt.clientY};if("onDragBy"in callback){callback.onDragBy(diffX,diffY);}
if("_ghostElmt"in callback){var ghostElmt=callback._ghostElmt;SimileAjax.WindowManager._ghostCoords.left+=diffX;SimileAjax.WindowManager._ghostCoords.top+=diffY;ghostElmt.style.left=SimileAjax.WindowManager._ghostCoords.left+"px";ghostElmt.style.top=SimileAjax.WindowManager._ghostCoords.top+"px";}}catch(e){SimileAjax.Debug.exception("WindowManager: Error handling mouse move",e);SimileAjax.WindowManager._cancelDragging();}}
SimileAjax.DOM.cancelEvent(evt);return false;}};SimileAjax.WindowManager._onBodyMouseUp=function(elmt,evt,target){if(SimileAjax.WindowManager._draggedElement!=null){try{if(SimileAjax.WindowManager._dragging){var callback=SimileAjax.WindowManager._draggedElementCallback;if("onDragEnd"in callback){callback.onDragEnd();}
if("onDrop"in callback){var coords=SimileAjax.DOM.getEventPageCoordinates(evt);var target=SimileAjax.DOM.hittest(coords.x,coords.y,SimileAjax.WindowManager._ghostElmt);callback.onDrop(target);}}}finally{SimileAjax.WindowManager._cancelDragging();}
SimileAjax.DOM.cancelEvent(evt);return false;}};SimileAjax.WindowManager._cancelDragging=function(){var callback=SimileAjax.WindowManager._draggedElementCallback;if("_ghostElmt"in callback){var ghostElmt=callback._ghostElmt;document.body.removeChild(ghostElmt);delete callback._ghostElmt;}
SimileAjax.WindowManager._draggedElement=null;SimileAjax.WindowManager._draggedElementCallback=null;SimileAjax.WindowManager._lastCoords=null;SimileAjax.WindowManager._ghostCoords=null;SimileAjax.WindowManager._dragging=false;};

/* xmlhttp.js */

SimileAjax.XmlHttp=new Object();SimileAjax.XmlHttp._onReadyStateChange=function(xmlhttp,fError,fDone){switch(xmlhttp.readyState){case 4:try{if(xmlhttp.status==0||xmlhttp.status==200){if(fDone){fDone(xmlhttp);}}else{if(fError){fError(xmlhttp.statusText,xmlhttp.status,xmlhttp);}}}catch(e){SimileAjax.Debug.exception("XmlHttp: Error handling onReadyStateChange",e);}
break;}};SimileAjax.XmlHttp._createRequest=function(){if(SimileAjax.Platform.browser.isIE){var programIDs=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];for(var i=0;i<programIDs.length;i++){try{var programID=programIDs[i];var f=function(){return new ActiveXObject(programID);};var o=f();SimileAjax.XmlHttp._createRequest=f;return o;}catch(e){}}
throw new Error("Failed to create an XMLHttpRequest object");}else{try{var f=function(){return new XMLHttpRequest();};var o=f();SimileAjax.XmlHttp._createRequest=f;return o;}catch(e){throw new Error("Failed to create an XMLHttpRequest object");}}};SimileAjax.XmlHttp.get=function(url,fError,fDone){var xmlhttp=SimileAjax.XmlHttp._createRequest();xmlhttp.open("GET",url,true);xmlhttp.onreadystatechange=function(){SimileAjax.XmlHttp._onReadyStateChange(xmlhttp,fError,fDone);};xmlhttp.send(null);};SimileAjax.XmlHttp.post=function(url,body,fError,fDone){var xmlhttp=SimileAjax.XmlHttp._createRequest();xmlhttp.open("POST",url,true);xmlhttp.onreadystatechange=function(){SimileAjax.XmlHttp._onReadyStateChange(xmlhttp,fError,fDone);};xmlhttp.send(body);};SimileAjax.XmlHttp._forceXML=function(xmlhttp){try{xmlhttp.overrideMimeType("text/xml");}catch(e){xmlhttp.setrequestheader("Content-Type","text/xml");}};<commit_msg>Got the map view to use user-configured center and zoom again.<commit_after>

/* platform.js */

SimileAjax.Platform.os={isMac:false,isWin:false,isWin32:false,isUnix:false};SimileAjax.Platform.browser={isIE:false,isNetscape:false,isMozilla:false,isFirefox:false,isOpera:false,isSafari:false,majorVersion:0,minorVersion:0};(function(){var an=navigator.appName.toLowerCase();var ua=navigator.userAgent.toLowerCase();SimileAjax.Platform.os.isMac=(ua.indexOf('mac')!=-1);SimileAjax.Platform.os.isWin=(ua.indexOf('win')!=-1);SimileAjax.Platform.os.isWin32=SimileAjax.Platform.isWin&&(ua.indexOf('95')!=-1||ua.indexOf('98')!=-1||ua.indexOf('nt')!=-1||ua.indexOf('win32')!=-1||ua.indexOf('32bit')!=-1);SimileAjax.Platform.os.isUnix=(ua.indexOf('x11')!=-1);SimileAjax.Platform.browser.isIE=(an.indexOf("microsoft")!=-1);SimileAjax.Platform.browser.isNetscape=(an.indexOf("netscape")!=-1);SimileAjax.Platform.browser.isMozilla=(ua.indexOf("mozilla")!=-1);SimileAjax.Platform.browser.isFirefox=(ua.indexOf("firefox")!=-1);SimileAjax.Platform.browser.isOpera=(an.indexOf("opera")!=-1);SimileAjax.Platform.browser.isSafari=(an.indexOf("safari")!=-1);var parseVersionString=function(s){var a=s.split(".");SimileAjax.Platform.browser.majorVersion=parseInt(a[0]);SimileAjax.Platform.browser.minorVersion=parseInt(a[1]);};var indexOf=function(s,sub,start){var i=s.indexOf(sub,start);return i>=0?i:s.length;};if(SimileAjax.Platform.browser.isMozilla){var offset=ua.indexOf("mozilla/");if(offset>=0){parseVersionString(ua.substring(offset+8,indexOf(ua," ",offset)));}}
if(SimileAjax.Platform.browser.isIE){var offset=ua.indexOf("msie ");if(offset>=0){parseVersionString(ua.substring(offset+5,indexOf(ua,";",offset)));}}
if(SimileAjax.Platform.browser.isNetscape){var offset=ua.indexOf("rv:");if(offset>=0){parseVersionString(ua.substring(offset+3,indexOf(ua,")",offset)));}}
if(SimileAjax.Platform.browser.isFirefox){var offset=ua.indexOf("firefox/");if(offset>=0){parseVersionString(ua.substring(offset+8,indexOf(ua," ",offset)));}}
if(!("localeCompare"in String.prototype)){String.prototype.localeCompare=function(s){if(this<s)return-1;else if(this>s)return 1;else return 0;};}})();SimileAjax.Platform.getDefaultLocale=function(){return SimileAjax.Platform.clientLocale;};

/* ajax.js */

SimileAjax.ListenerQueue=function(wildcardHandlerName){this._listeners=[];this._wildcardHandlerName=wildcardHandlerName;};SimileAjax.ListenerQueue.prototype.add=function(listener){this._listeners.push(listener);};SimileAjax.ListenerQueue.prototype.remove=function(listener){var listeners=this._listeners;for(var i=0;i<listeners.length;i++){if(listeners[i]==listener){listeners.splice(i,1);break;}}};SimileAjax.ListenerQueue.prototype.fire=function(handlerName,args){var listeners=[].concat(this._listeners);for(var i=0;i<listeners.length;i++){var listener=listeners[i];if(handlerName in listener){try{listener[handlerName].apply(listener,args);}catch(e){SimileAjax.Debug.exception("Error firing event of name "+handlerName,e);}}else if(this._wildcardHandlerName!=null&&this._wildcardHandlerName in listener){try{listener[this._wildcardHandlerName].apply(listener,[handlerName]);}catch(e){SimileAjax.Debug.exception("Error firing event of name "+handlerName+" to wildcard handler",e);}}}};

/* date-time.js */

SimileAjax.DateTime=new Object();SimileAjax.DateTime._dateRegexp=new RegExp("^(-?)([0-9]{4})("+["(-?([0-9]{2})(-?([0-9]{2}))?)","(-?([0-9]{3}))","(-?W([0-9]{2})(-?([1-7]))?)"].join("|")+")?$");SimileAjax.DateTime._timezoneRegexp=new RegExp("Z|(([-+])([0-9]{2})(:?([0-9]{2}))?)$");SimileAjax.DateTime._timeRegexp=new RegExp("^([0-9]{2})(:?([0-9]{2})(:?([0-9]{2})(\.([0-9]+))?)?)?$");SimileAjax.DateTime.setIso8601Date=function(dateObject,string){var d=string.match(SimileAjax.DateTime._dateRegexp);if(!d){throw new Error("Invalid date string: "+string);}
var sign=(d[1]=="-")?-1:1;var year=sign*d[2];var month=d[5];var date=d[7];var dayofyear=d[9];var week=d[11];var dayofweek=(d[13])?d[13]:1;dateObject.setUTCFullYear(year);if(dayofyear){dateObject.setUTCMonth(0);dateObject.setUTCDate(Number(dayofyear));}else if(week){dateObject.setUTCMonth(0);dateObject.setUTCDate(1);var gd=dateObject.getUTCDay();var day=(gd)?gd:7;var offset=Number(dayofweek)+(7*Number(week));if(day<=4){dateObject.setUTCDate(offset+1-day);}else{dateObject.setUTCDate(offset+8-day);}}else{if(month){dateObject.setUTCDate(1);dateObject.setUTCMonth(month-1);}
if(date){dateObject.setUTCDate(date);}}
return dateObject;};SimileAjax.DateTime.setIso8601Time=function(dateObject,string){var d=string.match(SimileAjax.DateTime._timezoneRegexp);var offset=0;if(d){if(d[0]!='Z'){offset=(Number(d[3])*60)+Number(d[5]);offset*=((d[2]=='-')?1:-1);}
string=string.substr(0,string.length-d[0].length);}
var d=string.match(SimileAjax.DateTime._timeRegexp);if(!d){SimileAjax.Debug.warn("Invalid time string: "+string);return false;}
var hours=d[1];var mins=Number((d[3])?d[3]:0);var secs=(d[5])?d[5]:0;var ms=d[7]?(Number("0."+d[7])*1000):0;dateObject.setUTCHours(hours);dateObject.setUTCMinutes(mins);dateObject.setUTCSeconds(secs);dateObject.setUTCMilliseconds(ms);return dateObject;};SimileAjax.DateTime.setIso8601=function(dateObject,string){var comps=(string.indexOf("T")==-1)?string.split(" "):string.split("T");SimileAjax.DateTime.setIso8601Date(dateObject,comps[0]);if(comps.length==2){SimileAjax.DateTime.setIso8601Time(dateObject,comps[1]);}
return dateObject;};SimileAjax.DateTime.parseIso8601DateTime=function(string){try{return SimileAjax.DateTime.setIso8601(new Date(0),string);}catch(e){return null;}};

/* debug.js */

SimileAjax.Debug={silent:false};SimileAjax.Debug.log=function(msg){var f;if("console"in window&&"log"in window.console){f=function(msg2){console.log(msg2);}}else{f=function(msg2){if(!SimileAjax.Debug.silent){alert(msg2);}}}
SimileAjax.Debug.log=f;f(msg);};SimileAjax.Debug.warn=function(msg){var f;if("console"in window&&"warn"in window.console){f=function(msg2){console.warn(msg2);}}else{f=function(msg2){if(!SimileAjax.Debug.silent){alert(msg2);}}}
SimileAjax.Debug.warn=f;f(msg);};SimileAjax.Debug.exception=function(msg,e){var f;if("console"in window&&"error"in window.console){f=function(msg2,e2){console.error(msg2+" %o",e2);}}else{f=SimileAjax.Platform.browser.isIE?function(msg2,e2){if(!SimileAjax.Debug.silent){alert("Caught exception: "+msg2+"\n\nDetails: "+e2.description);}}:function(msg2,e2){if(!SimileAjax.Debug.silent){alert("Caught exception: "+msg2+"\n\nDetails: "+e2);}};}
SimileAjax.Debug.exception=f;f(msg,e);};SimileAjax.Debug.objectToString=function(o){return SimileAjax.Debug._objectToString(o,"");};SimileAjax.Debug._objectToString=function(o,indent){var indent2=indent+" ";if(typeof o=="object"){var s="{";for(n in o){s+=indent2+n+": "+SimileAjax.Debug._objectToString(o[n],indent2)+"\n";}
s+=indent+"}";return s;}else if(typeof o=="array"){var s="[";for(var n=0;n<o.length;n++){s+=SimileAjax.Debug._objectToString(o[n],indent2)+"\n";}
s+=indent+"]";return s;}else{return o;}};

/* dom.js */

SimileAjax.DOM=new Object();SimileAjax.DOM.registerEventWithObject=function(elmt,eventName,obj,handlerName){SimileAjax.DOM.registerEvent(elmt,eventName,function(elmt2,evt,target){return obj[handlerName].call(obj,elmt2,evt,target);});};SimileAjax.DOM.registerEvent=function(elmt,eventName,handler){var handler2=function(evt){evt=(evt)?evt:((event)?event:null);if(evt){var target=(evt.target)?evt.target:((evt.srcElement)?evt.srcElement:null);if(target){target=(target.nodeType==1||target.nodeType==9)?target:target.parentNode;}
return handler(elmt,evt,target);}
return true;}
if(SimileAjax.Platform.browser.isIE){elmt.attachEvent("on"+eventName,handler2);}else{elmt.addEventListener(eventName,handler2,false);}};SimileAjax.DOM.getPageCoordinates=function(elmt){var left=0;var top=0;if(elmt.nodeType!=1){elmt=elmt.parentNode;}
while(elmt!=null){left+=elmt.offsetLeft;top+=elmt.offsetTop;elmt=elmt.offsetParent;}
return{left:left,top:top};};SimileAjax.DOM.getEventRelativeCoordinates=function(evt,elmt){if(SimileAjax.Platform.browser.isIE){return{x:evt.offsetX,y:evt.offsetY};}else{var coords=SimileAjax.DOM.getPageCoordinates(elmt);return{x:evt.pageX-coords.left,y:evt.pageY-coords.top};}};SimileAjax.DOM.getEventPageCoordinates=function(evt){if(SimileAjax.Platform.browser.isIE){return{x:evt.clientX+document.body.scrollLeft,y:evt.clientY+document.body.scrollTop};}else{return{x:evt.pageX,y:evt.pageY};}};SimileAjax.DOM.hittest=function(x,y,except){return SimileAjax.DOM._hittest(document.body,x,y,except);};SimileAjax.DOM._hittest=function(elmt,x,y,except){var childNodes=elmt.childNodes;for(var i=0;i<childNodes.length;i++){var childNode=childNodes[i];if(childNode==except){continue;}
if(childNode.offsetWidth==0&&childNode.offsetHeight==0){var hitNode=SimileAjax.DOM._hittest(childNode,x,y,except);if(hitNode!=childNode){return hitNode;}}else{var top=0;var left=0;var node=childNode;while(node){top+=node.offsetTop;left+=node.offsetLeft;node=node.offsetParent;}
if(left<=x&&top<=y&&(x-left)<childNode.offsetWidth&&(y-top)<childNode.offsetHeight){return SimileAjax.DOM._hittest(childNode,x,y,except);}else if(childNode.nodeType==1&&childNode.tagName=="TR"){var childNode2=SimileAjax.DOM._hittest(childNode,x,y,except);if(childNode2!=childNode){return childNode2;}}}}
return elmt;};SimileAjax.DOM.cancelEvent=function(evt){evt.returnValue=false;evt.cancelBubble=true;if("preventDefault"in evt){evt.preventDefault();}};SimileAjax.DOM.appendClassName=function(elmt,className){var classes=elmt.className.split(" ");for(var i=0;i<classes.length;i++){if(classes[i]==className){return;}}
classes.push(className);elmt.className=classes.join(" ");};SimileAjax.DOM.createInputElement=function(type){var div=document.createElement("div");div.innerHTML="<input type='"+type+"' />";return div.firstChild;};SimileAjax.DOM.createDOMFromTemplate=function(doc,template){var result={};result.elmt=SimileAjax.DOM._createDOMFromTemplate(doc,template,result,null);return result;};SimileAjax.DOM._createDOMFromTemplate=function(doc,templateNode,result,parentElmt){if(templateNode==null){return null;}else if(typeof templateNode!="object"){var node=doc.createTextNode(templateNode);if(parentElmt!=null){parentElmt.appendChild(node);}
return node;}else{var elmt=null;if("tag"in templateNode){var tag=templateNode.tag;if(parentElmt!=null){if(tag=="tr"){elmt=parentElmt.insertRow(parentElmt.rows.length);}else if(tag=="td"){elmt=parentElmt.insertCell(parentElmt.cells.length);}}
if(elmt==null){elmt=tag=="input"?SimileAjax.DOM.createInputElement(templateNode.type):doc.createElement(tag);if(parentElmt!=null){parentElmt.appendChild(elmt);}}}else{elmt=templateNode.elmt;if(parentElmt!=null){parentElmt.appendChild(elmt);}}
for(attribute in templateNode){var value=templateNode[attribute];if(attribute=="field"){result[value]=elmt;}else if(attribute=="className"){elmt.className=value;}else if(attribute=="id"){elmt.id=value;}else if(attribute=="title"){elmt.title=value;}else if(attribute=="type"&&elmt.tagName=="input"){}else if(attribute=="style"){for(n in value){var v=value[n];if(n=="float"){n=SimileAjax.Platform.browser.isIE?"styleFloat":"cssFloat";}
elmt.style[n]=v;}}else if(attribute=="children"){for(var i=0;i<value.length;i++){SimileAjax.DOM._createDOMFromTemplate(doc,value[i],result,elmt);}}else if(attribute!="tag"&&attribute!="elmt"){elmt.setAttribute(attribute,value);}}
return elmt;}}

/* graphics.js */

SimileAjax.Graphics=new Object();SimileAjax.Graphics.pngIsTranslucent=(!SimileAjax.Platform.browser.isIE)||(SimileAjax.Platform.browser.majorVersion>6);SimileAjax.Graphics._createTranslucentImage1=function(doc,url,verticalAlign){elmt=doc.createElement("img");elmt.setAttribute("src",url);if(verticalAlign!=null){elmt.style.verticalAlign=verticalAlign;}
return elmt;};SimileAjax.Graphics._createTranslucentImage2=function(doc,url,verticalAlign){elmt=doc.createElement("img");elmt.style.width="1px";elmt.style.height="1px";elmt.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+url+"', sizingMethod='image')";elmt.style.verticalAlign=(verticalAlign!=null)?verticalAlign:"middle";return elmt;};SimileAjax.Graphics.createTranslucentImage=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImage1:SimileAjax.Graphics._createTranslucentImage2;SimileAjax.Graphics.setOpacity=function(elmt,opacity){if(SimileAjax.Platform.browser.isIE){elmt.style.filter="progid:DXImageTransform.Microsoft.Alpha(Style=0,Opacity="+opacity+")";}else{var o=(opacity/100).toString();elmt.style.opacity=o;elmt.style.MozOpacity=o;}};SimileAjax.Graphics._bubbleMargins={top:33,bottom:42,left:33,right:40}
SimileAjax.Graphics._arrowOffsets={top:0,bottom:9,left:1,right:8}
SimileAjax.Graphics._bubblePadding=15;SimileAjax.Graphics._bubblePointOffset=6;SimileAjax.Graphics._halfArrowWidth=18;SimileAjax.Graphics.createBubbleForPoint=function(doc,pageX,pageY,contentWidth,contentHeight){function getWindowDims(){if(typeof window.innerHeight=='number'){return{w:window.innerWidth,h:window.innerHeight};}else if(document.documentElement&&document.documentElement.clientHeight){return{w:document.documentElement.clientWidth,h:document.documentElement.clientHeight};}else if(document.body&&document.body.clientHeight){return{w:document.body.clientWidth,h:document.body.clientHeight};}}
var close=function(){if(!bubble._closed){bubble._doc.body.removeChild(bubble._div);bubble._doc=null;bubble._div=null;bubble._content=null;bubble._closed=true;}}
var layer=SimileAjax.WindowManager.pushLayer(close,true);var bubble={_closed:false,_doc:doc,close:function(){SimileAjax.WindowManager.popLayer(layer);}};var dims=getWindowDims();var docWidth=dims.w;var docHeight=dims.h;var margins=SimileAjax.Graphics._bubbleMargins;contentWidth=parseInt(contentWidth,10);contentHeight=parseInt(contentHeight,10);var bubbleWidth=margins.left+contentWidth+margins.right;var bubbleHeight=margins.top+contentHeight+margins.bottom;var pngIsTranslucent=SimileAjax.Graphics.pngIsTranslucent;var urlPrefix=SimileAjax.urlPrefix;var setImg=function(elmt,url,width,height){elmt.style.position="absolute";elmt.style.width=width+"px";elmt.style.height=height+"px";if(pngIsTranslucent){elmt.style.background="url("+url+")";}else{elmt.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+url+"', sizingMethod='crop')";}}
var div=doc.createElement("div");div.style.width=bubbleWidth+"px";div.style.height=bubbleHeight+"px";div.style.position="absolute";div.style.zIndex=1000;bubble._div=div;var divInner=doc.createElement("div");divInner.style.width="100%";divInner.style.height="100%";divInner.style.position="relative";div.appendChild(divInner);var createImg=function(url,left,top,width,height){var divImg=doc.createElement("div");divImg.style.left=left+"px";divImg.style.top=top+"px";setImg(divImg,url,width,height);divInner.appendChild(divImg);}
createImg(urlPrefix+"images/bubble-top-left.png",0,0,margins.left,margins.top);createImg(urlPrefix+"images/bubble-top.png",margins.left,0,contentWidth,margins.top);createImg(urlPrefix+"images/bubble-top-right.png",margins.left+contentWidth,0,margins.right,margins.top);createImg(urlPrefix+"images/bubble-left.png",0,margins.top,margins.left,contentHeight);createImg(urlPrefix+"images/bubble-right.png",margins.left+contentWidth,margins.top,margins.right,contentHeight);createImg(urlPrefix+"images/bubble-bottom-left.png",0,margins.top+contentHeight,margins.left,margins.bottom);createImg(urlPrefix+"images/bubble-bottom.png",margins.left,margins.top+contentHeight,contentWidth,margins.bottom);createImg(urlPrefix+"images/bubble-bottom-right.png",margins.left+contentWidth,margins.top+contentHeight,margins.right,margins.bottom);var divClose=doc.createElement("div");divClose.style.left=(bubbleWidth-margins.right+SimileAjax.Graphics._bubblePadding-16-2)+"px";divClose.style.top=(margins.top-SimileAjax.Graphics._bubblePadding+1)+"px";divClose.style.cursor="pointer";setImg(divClose,urlPrefix+"images/close-button.png",16,16);SimileAjax.WindowManager.registerEventWithObject(divClose,"click",bubble,"close");divInner.appendChild(divClose);var divContent=doc.createElement("div");divContent.style.position="absolute";divContent.style.left=margins.left+"px";divContent.style.top=margins.top+"px";divContent.style.width=contentWidth+"px";divContent.style.height=contentHeight+"px";divContent.style.overflow="auto";divContent.style.background="white";divInner.appendChild(divContent);bubble.content=divContent;(function(){if(pageX-SimileAjax.Graphics._halfArrowWidth-SimileAjax.Graphics._bubblePadding>0&&pageX+SimileAjax.Graphics._halfArrowWidth+SimileAjax.Graphics._bubblePadding<docWidth){var left=pageX-Math.round(contentWidth/2)-margins.left;left=pageX<(docWidth/2)?Math.max(left,-(margins.left-SimileAjax.Graphics._bubblePadding)):Math.min(left,docWidth+(margins.right-SimileAjax.Graphics._bubblePadding)-bubbleWidth);if(pageY-SimileAjax.Graphics._bubblePointOffset-bubbleHeight>0){var divImg=doc.createElement("div");divImg.style.left=(pageX-SimileAjax.Graphics._halfArrowWidth-left)+"px";divImg.style.top=(margins.top+contentHeight)+"px";setImg(divImg,urlPrefix+"images/bubble-bottom-arrow.png",37,margins.bottom);divInner.appendChild(divImg);div.style.left=left+"px";div.style.top=(pageY-SimileAjax.Graphics._bubblePointOffset-bubbleHeight+
SimileAjax.Graphics._arrowOffsets.bottom)+"px";return;}else if(pageY+SimileAjax.Graphics._bubblePointOffset+bubbleHeight<docHeight){var divImg=doc.createElement("div");divImg.style.left=(pageX-SimileAjax.Graphics._halfArrowWidth-left)+"px";divImg.style.top="0px";setImg(divImg,urlPrefix+"images/bubble-top-arrow.png",37,margins.top);divInner.appendChild(divImg);div.style.left=left+"px";div.style.top=(pageY+SimileAjax.Graphics._bubblePointOffset-
SimileAjax.Graphics._arrowOffsets.top)+"px";return;}}
var top=pageY-Math.round(contentHeight/2)-margins.top;top=pageY<(docHeight/2)?Math.max(top,-(margins.top-SimileAjax.Graphics._bubblePadding)):Math.min(top,docHeight+(margins.bottom-SimileAjax.Graphics._bubblePadding)-bubbleHeight);if(pageX-SimileAjax.Graphics._bubblePointOffset-bubbleWidth>0){var divImg=doc.createElement("div");divImg.style.left=(margins.left+contentWidth)+"px";divImg.style.top=(pageY-SimileAjax.Graphics._halfArrowWidth-top)+"px";setImg(divImg,urlPrefix+"images/bubble-right-arrow.png",margins.right,37);divInner.appendChild(divImg);div.style.left=(pageX-SimileAjax.Graphics._bubblePointOffset-bubbleWidth+
SimileAjax.Graphics._arrowOffsets.right)+"px";div.style.top=top+"px";}else{var divImg=doc.createElement("div");divImg.style.left="0px";divImg.style.top=(pageY-SimileAjax.Graphics._halfArrowWidth-top)+"px";setImg(divImg,urlPrefix+"images/bubble-left-arrow.png",margins.left,37);divInner.appendChild(divImg);div.style.left=(pageX+SimileAjax.Graphics._bubblePointOffset-
SimileAjax.Graphics._arrowOffsets.left)+"px";div.style.top=top+"px";}})();doc.body.appendChild(div);return bubble;};SimileAjax.Graphics.createMessageBubble=function(doc){var containerDiv=doc.createElement("div");if(SimileAjax.Graphics.pngIsTranslucent){var topDiv=doc.createElement("div");topDiv.style.height="33px";topDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-top-left.png) top left no-repeat";topDiv.style.paddingLeft="44px";containerDiv.appendChild(topDiv);var topRightDiv=doc.createElement("div");topRightDiv.style.height="33px";topRightDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-top-right.png) top right no-repeat";topDiv.appendChild(topRightDiv);var middleDiv=doc.createElement("div");middleDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-left.png) top left repeat-y";middleDiv.style.paddingLeft="44px";containerDiv.appendChild(middleDiv);var middleRightDiv=doc.createElement("div");middleRightDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-right.png) top right repeat-y";middleRightDiv.style.paddingRight="44px";middleDiv.appendChild(middleRightDiv);var contentDiv=doc.createElement("div");middleRightDiv.appendChild(contentDiv);var bottomDiv=doc.createElement("div");bottomDiv.style.height="55px";bottomDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-bottom-left.png) bottom left no-repeat";bottomDiv.style.paddingLeft="44px";containerDiv.appendChild(bottomDiv);var bottomRightDiv=doc.createElement("div");bottomRightDiv.style.height="55px";bottomRightDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-bottom-right.png) bottom right no-repeat";bottomDiv.appendChild(bottomRightDiv);}else{containerDiv.style.border="2px solid #7777AA";containerDiv.style.padding="20px";containerDiv.style.background="white";SimileAjax.Graphics.setOpacity(containerDiv,90);var contentDiv=doc.createElement("div");containerDiv.appendChild(contentDiv);}
return{containerDiv:containerDiv,contentDiv:contentDiv};};SimileAjax.Graphics.createAnimation=function(f,from,to,duration){return new SimileAjax.Graphics._Animation(f,from,to,duration);};SimileAjax.Graphics._Animation=function(f,from,to,duration){this.f=f;this.from=from;this.to=to;this.current=from;this.duration=duration;this.start=new Date().getTime();this.timePassed=0;};SimileAjax.Graphics._Animation.prototype.run=function(){var a=this;window.setTimeout(function(){a.step();},50);};SimileAjax.Graphics._Animation.prototype.step=function(){this.timePassed+=50;var timePassedFraction=this.timePassed/this.duration;var parameterFraction=-Math.cos(timePassedFraction*Math.PI)/2+0.5;var current=parameterFraction*(this.to-this.from)+this.from;try{this.f(current,current-this.current);}catch(e){}
this.current=current;if(this.timePassed<this.duration){this.run();}else{this.f(this.to,0);}};SimileAjax.Graphics.createStructuredDataCopyButton=function(image,width,height,createDataFunction){var div=document.createElement("div");div.style.position="relative";div.style.display="inline";div.style.width=width+"px";div.style.height=height+"px";div.style.overflow="hidden";div.style.margin="2px";if(SimileAjax.Graphics.pngIsTranslucent){div.style.background="url("+image+") no-repeat";}else{div.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+image+"', sizingMethod='image')";}
var style;if(SimileAjax.Platform.browser.isIE){style="filter:alpha(opacity=0)";}else{style="opacity: 0";}
div.innerHTML="<textarea rows='1' autocomplete='off' value='none' style='"+style+"' />";var textarea=div.firstChild;textarea.style.width=width+"px";textarea.style.height=height+"px";textarea.onmousedown=function(evt){evt=(evt)?evt:((event)?event:null);if(evt.button==2){textarea.value=createDataFunction();textarea.select();}};return div;};

/* history.js */

SimileAjax.History={maxHistoryLength:10,historyFile:"__history__.html",enabled:true,_initialized:false,_listeners:new SimileAjax.ListenerQueue(),_actions:[],_baseIndex:0,_currentIndex:0,_plainDocumentTitle:document.title};SimileAjax.History.formatHistoryEntryTitle=function(actionLabel){return SimileAjax.History._plainDocumentTitle+" {"+actionLabel+"}";};SimileAjax.History.initialize=function(){if(SimileAjax.History._initialized){return;}
if(SimileAjax.History.enabled){var iframe=document.createElement("iframe");iframe.id="simile-ajax-history";iframe.style.position="absolute";iframe.style.width="10px";iframe.style.height="10px";iframe.style.top="0px";iframe.style.left="0px";iframe.style.visibility="hidden";iframe.src=SimileAjax.History.historyFile+"?0";document.body.appendChild(iframe);SimileAjax.DOM.registerEvent(iframe,"load",SimileAjax.History._handleIFrameOnLoad);SimileAjax.History._iframe=iframe;}
SimileAjax.History._initialized=true;};SimileAjax.History.addListener=function(listener){SimileAjax.History.initialize();SimileAjax.History._listeners.add(listener);};SimileAjax.History.removeListener=function(listener){SimileAjax.History.initialize();SimileAjax.History._listeners.remove(listener);};SimileAjax.History.addAction=function(action){SimileAjax.History.initialize();SimileAjax.History._listeners.fire("onBeforePerform",[action]);window.setTimeout(function(){try{action.perform();SimileAjax.History._listeners.fire("onAfterPerform",[action]);if(SimileAjax.History.enabled){SimileAjax.History._actions=SimileAjax.History._actions.slice(0,SimileAjax.History._currentIndex-SimileAjax.History._baseIndex);SimileAjax.History._actions.push(action);SimileAjax.History._currentIndex++;var diff=SimileAjax.History._actions.length-SimileAjax.History.maxHistoryLength;if(diff>0){SimileAjax.History._actions=SimileAjax.History._actions.slice(diff);SimileAjax.History._baseIndex+=diff;}
try{SimileAjax.History._iframe.contentWindow.location.search="?"+SimileAjax.History._currentIndex;}catch(e){var title=SimileAjax.History.formatHistoryEntryTitle(action.label);document.title=title;}}}catch(e){SimileAjax.Debug.exception("Error adding action {"+action.label+"} to history",e);}},0);};SimileAjax.History._handleIFrameOnLoad=function(){try{var q=SimileAjax.History._iframe.contentWindow.location.search;var c=(q.length==0)?0:Math.max(0,parseInt(q.substr(1)));var finishUp=function(){var diff=c-SimileAjax.History._currentIndex;SimileAjax.History._currentIndex+=diff;SimileAjax.History._baseIndex+=diff;SimileAjax.History._iframe.contentWindow.location.search="?"+c;};if(c<SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeUndoSeveral",[]);window.setTimeout(function(){while(SimileAjax.History._currentIndex>c&&SimileAjax.History._currentIndex>SimileAjax.History._baseIndex){SimileAjax.History._currentIndex--;var action=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex];try{action.undo();}catch(e){SimileAjax.Debug.exception("History: Failed to undo action {"+action.label+"}");}}
SimileAjax.History._listeners.fire("onAfterUndoSeveral",[]);finishUp();},0);}else if(c>SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeRedoSeveral",[]);window.setTimeout(function(){while(SimileAjax.History._currentIndex<c&&SimileAjax.History._currentIndex-SimileAjax.History._baseIndex<SimileAjax.History._actions.length){var action=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex];try{action.perform();}catch(e){SimileAjax.Debug.exception("History: Failed to redo action {"+action.label+"}");}
SimileAjax.History._currentIndex++;}
SimileAjax.History._listeners.fire("onAfterRedoSeveral",[]);finishUp();},0);}else{var index=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1;var title=(index>=0&&index<SimileAjax.History._actions.length)?SimileAjax.History.formatHistoryEntryTitle(SimileAjax.History._actions[index].label):SimileAjax.History._plainDocumentTitle;SimileAjax.History._iframe.contentWindow.document.title=title;document.title=title;}}catch(e){}};

/* json.js */

SimileAjax.JSON=new Object();(function(){var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};var s={array:function(x){var a=['['],b,f,i,l=x.length,v;for(i=0;i<l;i+=1){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=='string'){if(b){a[a.length]=',';}
a[a.length]=v;b=true;}}}
a[a.length]=']';return a.join('');},'boolean':function(x){return String(x);},'null':function(x){return"null";},number:function(x){return isFinite(x)?String(x):'null';},object:function(x){if(x){if(x instanceof Array){return s.array(x);}
var a=['{'],b,f,i,v;for(i in x){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=='string'){if(b){a[a.length]=',';}
a.push(s.string(i),':',v);b=true;}}}
a[a.length]='}';return a.join('');}
return'null';},string:function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c;}
c=b.charCodeAt();return'\\u00'+
Math.floor(c/16).toString(16)+
(c%16).toString(16);});}
return'"'+x+'"';}};SimileAjax.JSON.toJSONString=function(o){if(o instanceof Object){return s.object(o);}else if(o instanceof Array){return s.array(o);}else{return o.toString();}};SimileAjax.JSON.parseJSON=function(){try{return!(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(this.replace(/"(\\.|[^"\\])*"/g,'')))&&eval('('+this+')');}catch(e){return false;}};})();

/* string.js */

String.prototype.trim=function(){return this.replace(/^\s+|\s+$/,'');};

/* window-manager.js */

SimileAjax.WindowManager={_initialized:false,_listeners:[],_draggedElement:null,_draggedElementCallback:null,_lastCoords:null,_ghostCoords:null,_dragging:false,_layers:[]};SimileAjax.WindowManager.initialize=function(){if(SimileAjax.WindowManager._initialized){return;}
SimileAjax.DOM.registerEvent(document.body,"click",SimileAjax.WindowManager._onBodyClick);SimileAjax.DOM.registerEvent(document.body,"mousemove",SimileAjax.WindowManager._onBodyMouseMove);SimileAjax.DOM.registerEvent(document.body,"mouseup",SimileAjax.WindowManager._onBodyMouseUp);SimileAjax.WindowManager._layers.push({index:0});SimileAjax.WindowManager._historyListener={onBeforeUndoSeveral:function(){},onAfterUndoSeveral:function(){},onBeforeUndo:function(){},onAfterUndo:function(){},onBeforeRedoSeveral:function(){},onAfterRedoSeveral:function(){},onBeforeRedo:function(){},onAfterRedo:function(){}};SimileAjax.History.addListener(SimileAjax.WindowManager._historyListener);SimileAjax.WindowManager._initialized=true;};SimileAjax.WindowManager.getBaseLayer=function(){SimileAjax.WindowManager.initialize();return SimileAjax.WindowManager._layers[0];};SimileAjax.WindowManager.getHighestLayer=function(){SimileAjax.WindowManager.initialize();return SimileAjax.WindowManager._layers[SimileAjax.WindowManager._layers.length-1];};SimileAjax.WindowManager.registerEventWithObject=function(elmt,eventName,obj,handlerName,layer){SimileAjax.WindowManager.registerEvent(elmt,eventName,function(elmt2,evt,target){return obj[handlerName].call(obj,elmt2,evt,target);},layer);};SimileAjax.WindowManager.registerEvent=function(elmt,eventName,handler,layer){if(layer==null){layer=SimileAjax.WindowManager.getHighestLayer();}
var handler2=function(elmt,evt,target){if(SimileAjax.WindowManager._canProcessEventAtLayer(layer)){SimileAjax.WindowManager._popToLayer(layer.index);return handler(elmt,evt,target);}else{SimileAjax.DOM.cancelEvent(evt);return false;}}
SimileAjax.DOM.registerEvent(elmt,eventName,handler2);};SimileAjax.WindowManager.pushLayer=function(f,ephemeral){var layer={onPop:f,index:SimileAjax.WindowManager._layers.length,ephemeral:(ephemeral)};SimileAjax.WindowManager._layers.push(layer);return layer;};SimileAjax.WindowManager.popLayer=function(layer){for(var i=1;i<SimileAjax.WindowManager._layers.length;i++){if(SimileAjax.WindowManager._layers[i]==layer){SimileAjax.WindowManager._popToLayer(i-1);break;}}};SimileAjax.WindowManager.popAllLayers=function(){SimileAjax.WindowManager._popToLayer(0);};SimileAjax.WindowManager.registerForDragging=function(elmt,callback,layer){SimileAjax.WindowManager.registerEvent(elmt,"mousedown",function(elmt,evt,target){SimileAjax.WindowManager._handleMouseDown(elmt,evt,callback);},layer);};SimileAjax.WindowManager._popToLayer=function(level){while(level+1<SimileAjax.WindowManager._layers.length){try{var layer=SimileAjax.WindowManager._layers.pop();if(layer.onPop!=null){layer.onPop();}}catch(e){}}};SimileAjax.WindowManager._canProcessEventAtLayer=function(layer){if(layer.index==(SimileAjax.WindowManager._layers.length-1)){return true;}
for(var i=layer.index+1;i<SimileAjax.WindowManager._layers.length;i++){if(!SimileAjax.WindowManager._layers[i].ephemeral){return false;}}
return true;};SimileAjax.WindowManager._cancelPopups=function(){var i=SimileAjax.WindowManager._layers.length-1;while(i>0&&SimileAjax.WindowManager._layers[i].ephemeral){i--;}
SimileAjax.WindowManager._popToLayer(i);};SimileAjax.WindowManager._onBodyClick=function(elmt,evt,target){if(!("eventPhase"in evt)||evt.eventPhase==evt.BUBBLING_PHASE){SimileAjax.WindowManager._cancelPopups();}};SimileAjax.WindowManager._handleMouseDown=function(elmt,evt,callback){SimileAjax.WindowManager._draggedElement=elmt;SimileAjax.WindowManager._draggedElementCallback=callback;SimileAjax.WindowManager._lastCoords={x:evt.clientX,y:evt.clientY};SimileAjax.DOM.cancelEvent(evt);return false;};SimileAjax.WindowManager._onBodyMouseMove=function(elmt,evt,target){if(SimileAjax.WindowManager._draggedElement!=null){var callback=SimileAjax.WindowManager._draggedElementCallback;var lastCoords=SimileAjax.WindowManager._lastCoords;var diffX=evt.clientX-lastCoords.x;var diffY=evt.clientY-lastCoords.y;if(!SimileAjax.WindowManager._dragging){if(Math.abs(diffX)>5||Math.abs(diffY)>5){try{if("onDragStart"in callback){callback.onDragStart();}
if("ghost"in callback&&callback.ghost){var draggedElmt=SimileAjax.WindowManager._draggedElement;SimileAjax.WindowManager._ghostCoords=SimileAjax.DOM.getPageCoordinates(draggedElmt);SimileAjax.WindowManager._ghostCoords.left+=diffX;SimileAjax.WindowManager._ghostCoords.top+=diffY;var ghostElmt=draggedElmt.cloneNode(true);ghostElmt.style.position="absolute";ghostElmt.style.left=SimileAjax.WindowManager._ghostCoords.left+"px";ghostElmt.style.top=SimileAjax.WindowManager._ghostCoords.top+"px";ghostElmt.style.zIndex=1000;SimileAjax.Graphics.setOpacity(ghostElmt,50);document.body.appendChild(ghostElmt);callback._ghostElmt=ghostElmt;}
SimileAjax.WindowManager._dragging=true;SimileAjax.WindowManager._lastCoords={x:evt.clientX,y:evt.clientY};}catch(e){SimileAjax.Debug.exception("WindowManager: Error handling mouse down",e);SimileAjax.WindowManager._cancelDragging();}}}else{try{SimileAjax.WindowManager._lastCoords={x:evt.clientX,y:evt.clientY};if("onDragBy"in callback){callback.onDragBy(diffX,diffY);}
if("_ghostElmt"in callback){var ghostElmt=callback._ghostElmt;SimileAjax.WindowManager._ghostCoords.left+=diffX;SimileAjax.WindowManager._ghostCoords.top+=diffY;ghostElmt.style.left=SimileAjax.WindowManager._ghostCoords.left+"px";ghostElmt.style.top=SimileAjax.WindowManager._ghostCoords.top+"px";}}catch(e){SimileAjax.Debug.exception("WindowManager: Error handling mouse move",e);SimileAjax.WindowManager._cancelDragging();}}
SimileAjax.DOM.cancelEvent(evt);return false;}};SimileAjax.WindowManager._onBodyMouseUp=function(elmt,evt,target){if(SimileAjax.WindowManager._draggedElement!=null){try{if(SimileAjax.WindowManager._dragging){var callback=SimileAjax.WindowManager._draggedElementCallback;if("onDragEnd"in callback){callback.onDragEnd();}
if("onDrop"in callback){var coords=SimileAjax.DOM.getEventPageCoordinates(evt);var target=SimileAjax.DOM.hittest(coords.x,coords.y,SimileAjax.WindowManager._ghostElmt);callback.onDrop(target);}}}finally{SimileAjax.WindowManager._cancelDragging();}
SimileAjax.DOM.cancelEvent(evt);return false;}};SimileAjax.WindowManager._cancelDragging=function(){var callback=SimileAjax.WindowManager._draggedElementCallback;if("_ghostElmt"in callback){var ghostElmt=callback._ghostElmt;document.body.removeChild(ghostElmt);delete callback._ghostElmt;}
SimileAjax.WindowManager._draggedElement=null;SimileAjax.WindowManager._draggedElementCallback=null;SimileAjax.WindowManager._lastCoords=null;SimileAjax.WindowManager._ghostCoords=null;SimileAjax.WindowManager._dragging=false;};

/* xmlhttp.js */

SimileAjax.XmlHttp=new Object();SimileAjax.XmlHttp._onReadyStateChange=function(xmlhttp,fError,fDone){switch(xmlhttp.readyState){case 4:try{if(xmlhttp.status==0||xmlhttp.status==200){if(fDone){fDone(xmlhttp);}}else{if(fError){fError(xmlhttp.statusText,xmlhttp.status,xmlhttp);}}}catch(e){SimileAjax.Debug.exception("XmlHttp: Error handling onReadyStateChange",e);}
break;}};SimileAjax.XmlHttp._createRequest=function(){if(SimileAjax.Platform.browser.isIE){var programIDs=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];for(var i=0;i<programIDs.length;i++){try{var programID=programIDs[i];var f=function(){return new ActiveXObject(programID);};var o=f();SimileAjax.XmlHttp._createRequest=f;return o;}catch(e){}}
throw new Error("Failed to create an XMLHttpRequest object");}else{try{var f=function(){return new XMLHttpRequest();};var o=f();SimileAjax.XmlHttp._createRequest=f;return o;}catch(e){throw new Error("Failed to create an XMLHttpRequest object");}}};SimileAjax.XmlHttp.get=function(url,fError,fDone){var xmlhttp=SimileAjax.XmlHttp._createRequest();xmlhttp.open("GET",url,true);xmlhttp.onreadystatechange=function(){SimileAjax.XmlHttp._onReadyStateChange(xmlhttp,fError,fDone);};xmlhttp.send(null);};SimileAjax.XmlHttp.post=function(url,body,fError,fDone){var xmlhttp=SimileAjax.XmlHttp._createRequest();xmlhttp.open("POST",url,true);xmlhttp.onreadystatechange=function(){SimileAjax.XmlHttp._onReadyStateChange(xmlhttp,fError,fDone);};xmlhttp.send(body);};SimileAjax.XmlHttp._forceXML=function(xmlhttp){try{xmlhttp.overrideMimeType("text/xml");}catch(e){xmlhttp.setrequestheader("Content-Type","text/xml");}};
{'fraction_non_alphanumeric': 0.18818240205523443, 'fraction_numerical': 0.010850107271211686, 'mean_word_length': 15.654528903049613, 'pattern_counts': {'":': 4, '<': 59, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 52}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1518717', 'n_tokens_mistral': 25584, 'n_tokens_neox': 25368, 'n_words': 1005}