/* Copyright 2009 Google Inc. All Rights Reserved. */ (function(){var DB_mode=false;function DumpError(d){try{throw d;}catch(f){DumpException(f)}}
function DumpException(d,f){f="Javascript exception: "+(f?f:"")+" "+d;if(BR_AgentContains_("msie")&&!window.opera)f+=" "+d.name+": "+d.message+" ("+d.number+")";var g="";if(typeof d=="string")g=d+"\n";else for(var m in d)try{g+=m+": "+d[m]+"\n"}catch(w){}g+=DB_GetStackTrace(DumpException.caller);d=f+"\n"+g;if(DB_mode){try{var s=(new Date).getTime()-DB_starttime,z="["+s+"] "+HtmlEscape(d).replace(/\n/g,"<br>")+"<br>";z="<font color=#ff0000><b>Error: "+z+"</b></font>";DB_win.focus()}catch(J){}DB_WriteDebugHtml(z)}else typeof log!=
"undefined"&&log(HtmlEscape(d))}var function_name_re_=/function (\w+)/;
function DB_GetStackTrace(d){try{if(!(BR_AgentContains_("msie")&&!window.opera)&&!(BR_AgentContains_("safari")||BR_AgentContains_("konqueror"))&&BR_AgentContains_("mozilla"))return Error().stack;if(!d)return"";var f;var g=function_name_re_.exec(String(d));f=g?g[1]:"";f="- "+f+"(";for(g=0;g<d.arguments.length;g++){if(g>0)f+=", ";var m=String(d.arguments[g]);if(m.length>40)m=m.substr(0,40)+"...";f+=m}f+=")\n";f+=DB_GetStackTrace(d.caller);return f}catch(w){return"[Cannot get stack trace]: "+w+"\n"}}
var DB_starttime,DB_win=null,DB_winopening=false;
function DB_WriteDebugHtml(d){if(DB_mode)try{if((DB_win==null||DB_win.closed)&&!DB_winopening)try{DB_winopening=true;DB_win=window.open("","debug","width=700,height=500,toolbar=no,resizable=yes,scrollbars=yes,left=16,top=16,screenx=16,screeny=16");DB_win.blur();DB_win.document.open();DB_winopening=false;var f="<font color=#ff0000><b>To turn off this debugging window,hit 'D' inside the main caribou window, then close this window.</b></font><br>";DB_WriteDebugHtml(f)}catch(g){}DB_win.document.write(d);DB_win.scrollTo(0,
1E6)}catch(m){}};function BR_AgentContains_(d){if(d in BR_AgentContains_cache_)return BR_AgentContains_cache_[d];return BR_AgentContains_cache_[d]=navigator.userAgent.toLowerCase().indexOf(d)!=-1}var BR_AgentContains_cache_={};function HasClass(d,f){if(d==null||d.className==null)return false;if(d.className==f)return true;d=d.className.split(" ");for(var g=0;g<d.length;g++)if(d[g]==f)return true;return false}function AddClass(d,f){HasClass(d,f)||(d.className+=" "+f)}
function RemoveClass(d,f){if(d.className!=null)if(d.className==f)d.className="";else{for(var g=d.className.split(" "),m=[],w=false,s=0;s<g.length;s++)if(g[s]!=f)g[s]&&m.push(g[s]);else w=true;if(w)d.className=m.join(" ")}}var amp_re_=/&/g,lt_re_=/</g,gt_re_=/>/g;function HtmlEscape(d){if(!d)return"";return d.replace(amp_re_,"&amp;").replace(lt_re_,"&lt;").replace(gt_re_,"&gt;").replace(quote_re_,"&quot;")}var quote_re_=/\"/g;function forid_1(d){return document.getElementById(d)}
function forid_2(d){return document.all[d]}var forid=document.getElementById?forid_1:forid_2;function log(d){try{if(window.parent!=window&&window.parent.log){window.parent.log(window.name+"::"+d);return}}catch(f){}var g=forid("log");if(g){d="<p class=logentry><span class=logdate>"+new Date+"</span><span class=logmsg>"+d+"</span></p>";g.innerHTML=d+g.innerHTML}else window.status=d};var global=this;function getObjectProps(d){var f=[];for(var g in d)f.push(g);return f}function isEmptyObject(d){if(!(d&&typeof d=="object"))return false;for(var f in d)return false;return true}if(!Function.prototype.apply)Function.prototype.apply=function(d,f){var g=[];d||(d=global);f=f||[];for(var m=0;m<f.length;m++)g[m]="args["+m+"]";g="oScope.__applyTemp__.peek()("+g.join(",")+");";if(!d.__applyTemp__)d.__applyTemp__=[];d.__applyTemp__.push(this);g=eval(g);d.__applyTemp__.pop();return g};
if(!Array.prototype.push)Array.prototype.push=function(){for(var d=0;d<arguments.length;d++)this[this.length]=arguments[d];return this.length};if(!Array.prototype.pop)Array.prototype.pop=function(){if(this.length){var d=this[this.length-1];this.length--;return d}};if(!Array.prototype.shift)Array.prototype.shift=function(){if(this.length!=0){for(var d=this[0],f=0;f<this.length-1;f++)this[f]=this[f+1];this.length--;return d}};
if(!Array.prototype.unshift)Array.prototype.unshift=function(){for(var d=arguments.length,f=this.length-1;f>=0;f--)this[f+d]=this[f];for(f=0;f<d;f++)this[f]=arguments[f];return this.length};if(!Array.prototype.forEach)Array.prototype.forEach=function(d,f){for(var g=0;g<this.length;g++)d.call(f,this[g],g,this)};function AS_Assert(){}AS_Assert.raise=function(d){if(typeof Error!="undefined")throw new Error(d||"Assertion Failed");else throw d;};AS_Assert.fail=function(d){d=d||"Assertion failed";typeof DumpError!="undefined"&&DumpError(d+"\n");AS_Assert.raise(d)};AS_Assert.isTrue=function(d,f){if(!d){if(f===undefined)f="Assertion failed";AS_Assert.fail(f)}};AS_Assert.equals=function(d,f,g){if(d!=f){if(g===undefined)g="AS_Assert.equals failed: <"+d+"> != <"+f+">";AS_Assert.fail(g)}};
AS_Assert.typeOf=function(d,f,g){if(typeof d!=f){if(d||d=="")try{if(f==AS_Assert.TYPE_MAP[typeof d]||d instanceof f)return}catch(m){}if(g===undefined){if(typeof f=="function")if(g=f.toString().match(/^\s*function\s+([^\s\{]+)/))f=g[1];g="AS_Assert.typeOf failed: <"+d+"> not typeof "+f}AS_Assert.fail(g)}};AS_Assert.TYPE_MAP={string:String,number:Number,"boolean":Boolean};
AS_Assert.numArgs=function(d,f){var g=AS_Assert.numArgs.caller;if(g&&g.arguments.length!=d){if(f===undefined)f=g.name+" expected "+d+" arguments  but received "+g.arguments.length;AS_Assert.fail(f)}};var XH_ieProgId_,JSCompiler_inline_XH_ACTIVE_X_IDENTS_23=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];
if(typeof XMLHttpRequest=="undefined"&&typeof ActiveXObject!="undefined"){for(var JSCompiler_inline_i$$25_24=0;JSCompiler_inline_i$$25_24<JSCompiler_inline_XH_ACTIVE_X_IDENTS_23.length;JSCompiler_inline_i$$25_24++){var JSCompiler_inline_candidate_25=JSCompiler_inline_XH_ACTIVE_X_IDENTS_23[JSCompiler_inline_i$$25_24];try{new ActiveXObject(JSCompiler_inline_candidate_25);XH_ieProgId_=JSCompiler_inline_candidate_25;break}catch(JSCompiler_inline_e$$11_26){}}if(!XH_ieProgId_)throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed.");
};if("undefined"==typeof log)log=function(){};(function(){function d(c){return c.replace(/\/$/,"").replace(/^\//,"")}function f(c,a,b,e){e=e?e:"----";var h=document.createElement("td");a&&AddClass(h,a);h.innerHTML=b?['<a href="',b,'">',e,"</a>"].join(""):e;h.onclick=function(){if(!K)document.location=b};c.appendChild(h);return h}function g(){var c=H?"/a/"+H:"";return c+"/"+L+"/"+M}function m(c,a){j.selectDir(c,a)}function w(c){c=c.tagName=="LI"?c:j.getParent(c);return j.getPath(c)}function s(c){c=c.tagName=="LI"?c:j.getParent(c);return HasClass(c,
"opened")}function z(c,a){o.selectFilePage(c,a)}function J(c){i.updateTree(c,"");j.updateTree();i.propogateLevels(c,3);i.startDirInfoWorker()}function R(c){H=c}function S(c){L=c}function T(c){M=c}function U(c){A=c}function V(c){N=c}function W(c){I=c}function X(c){O=c}function Y(c){E=(c=d(c))?c+"/":""}var H,L,M,E,A=null,I=null,O=null,N=null,u=1,K=false,F=[],G=[],B={},C=[],P,Q,y=[],D={},i=function(){var c;return{getDirInfoRemotely:function(a){var b={c:a.context,p:a.paths,l:a.level,fp:a.filePage,sp:a.subdirPage};
b.r=O;if(A)b.repo=A;var e=g()+"/source/dirfeed";jQuery.get(e,b,function(h){h=eval("("+h+")");a.callback(h);delete B[i.getRequestKey(a)];o.showLoadedFiles()})},requestFileInfo:function(a,b,e,h){a={context:e,paths:a,level:1,callback:h,filePage:b,subdirPage:1};b=i.getRequestKey(a);if(!(b in B)){F.push(a);B[b]=true}},requestDirInfo:function(a,b,e,h,l){a={context:e,paths:a,level:h,callback:l,filePage:1,subdirPage:b};b=i.getRequestKey(a);if(!(b in B)){G.push(a);B[b]=true}},getRequestKey:function(a){var b=
"";for(var e in a)b+=a[e]+":";return b},startDirInfoWorker:function(){function a(){for(var b=(new Date).getTime()+1E3;G.length&&(new Date).getTime()<b;){var e=G.shift();i.getDirInfoRemotely(e)}for(;F.length&&(new Date).getTime()<b;){e=F.shift();i.getDirInfoRemotely(e)}b=G.length+F.length;window.setTimeout(a,b?100:300)}window.setTimeout(a,300)},getDirLocally:function(a){var b=c;a=d(a);a=a.length?a.split("/"):[];for(var e=0;e<a.length;++e){var h=a[e];if(b&&"subdirs"in b&&h in b.subdirs)b=b.subdirs[h];
else return null}return b},propogateLevels:function(a,b){var e=-1;if("subdirs"in a)jQuery.each(a.subdirs,function(h,l){h=i.propogateLevels(l,b-1);e=Math.min(h,e)});else e=Number.POSITIVE_INFINITY;b=Math.max(b,e+1);return a.level=b},isFullFetched:function(a){if("subdirs"in a){var b=true;jQuery.each(a.subdirs,function(e,h){"subdirs"in h||(b=false)});return b}else return false},setFullFetched:function(a){a.level=Number.POSITIVE_INFINITY},hasFilePage:function(a,b){if("filePages"in a)if(b in a.filePages)return true;
return false},isLoading:function(a){return"loading"in a&&a.loading},setLoading:function(a){a.loading=true},update:function(a,b){a||(a={filePages:{}});if("error"in b)a.error=b.error;else{i.updateFilePages(a,b);if("subdirs"in b){"subdirs"in a||(a.subdirs={});for(var e in b.subdirs)a.subdirs[e]=i.update(null,b.subdirs[e])}a.totalFiles=b.totalFiles;a.totalFilePages=b.totalFilePages;a.totalSubdirs=b.totalSubdirs;a.totalSubdirPages=b.totalSubdirPages}return a},updateFilePages:function(a,b){if("filePage"in
b){var e=b.filePage.pageNum;if(!("filePages"in a))a.filePages={};a.filePages[e]=b.filePage}},updateTree:function(a,b){if(b=="/"||b=="")c=i.update(c,a);else{var e=b.split("/");if(e.length>1){b=e[e.length-1];e=e.slice(0,e.length-1).join("/")}else{b=b;e=""}e=i.getDirLocally(e);if(!("subdirs"in e))e.subdirs={};e.subdirs[b]=i.update(e.subdirs[b],a)}}}}(),o=function(){var c=null;return{showFiles:function(a){var b=i.getDirLocally(a),e=b.filePages[u],h=a.split("/");h.shift();var l=h.join("/");c=null;h=getObjectProps(e.files);
h.sort();var n=document.createElement("tbody");n.id="filelist_body";jQuery.each(h,function(v,t){v=e.files[t];var p=document.createElement("tr");p.onmouseover=function(){AddClass(p,"hover")};p.onmouseout=function(){RemoveClass(p,"hover");K=false};var q=encodeURIComponent([E,l,l?"/":"",t].join(""));q=q.replace(/%2F/g,"/");var r=[];A&&r.push("repo="+A);I&&r.push("r="+I);q=[g(),"/source/browse/",q,r.length?"?"+r.join("&"):""].join("");f(p,"id",q,HtmlEscape(t));f(p,"",q,v[0]);f(p,"",q,v[1]?"r"+v[1]:"----");
f(p,"",q,v[2]);f(p,"",q,v[3]);n.appendChild(p)});if(h.length==0){h=document.createElement("tr");var k=document.createElement("td");k.id="nofiles";k.innerHTML="<em>No files in this directory. You may select another directory from the tree on the left.</em>";h.appendChild(k);n.appendChild(h)}h=jQuery("#filelist_body")[0];h.parentNode.replaceChild(n,h);if(b.totalFilePages>1){o.showFilePageInfo(true);h=document.createElement("div");h.id="file_flipper";if(u>1){k=document.createElement("a");k.href="#";
k.innerHTML="&lsaquo; Prev";k.onclick=function(){o.selectFilePage(a,u-1);return false};h.appendChild(k)}k=document.createElement("span");k.id="visiblefiles";k.innerHTML="Files "+(e.offset+1)+" - "+(e.offset+e.fileCount)+" of "+b.totalFiles;h.appendChild(k);if(u<b.totalFilePages){b=document.createElement("a");b.href="#";b.innerHTML="Next &rsaquo;";b.onclick=function(){o.selectFilePage(a,u+1);return false};h.appendChild(b)}b=jQuery("#file_flipper")[0];b.parentNode.replaceChild(h,b)}else o.showFilePageInfo(false)},
showFilePageInfo:function(a){var b=jQuery("#file_flipper")[0];b.style.display=a?"":"none";b.className=""},selectFilePage:function(a,b){u=b;var e=i.getDirLocally(a);if(e&&"error"in e)o.showErrorMessage(e.error);else if(e&&i.hasFilePage(e,u))o.showFiles(a);else{o.showLoadingFiles(a);o.fetchFilePage(a,b)}if(e&&"totalFilePages"in e){if(b>1){var h=b-1;i.hasFilePage(e,h)||o.fetchFilePage(a,h)}if(b<e.totalFilePages){b=b+1;i.hasFilePage(e,b)||o.fetchFilePage(a,b)}}},fetchFilePage:function(a,b){var e=a.split("/");
e.shift();var h=e.join("/");e=E;i.requestFileInfo(h,b,e,function(l){if(l=l[h]){var n=i.getDirLocally(a);i.updateFilePages(n,l)}})},showLoadingFiles:function(a){c=a;a=document.createElement("tbody");a.id="filelist_body";var b=document.createElement("tr"),e=document.createElement("td");e.id="nofiles";e.innerHTML='<em class="ifOpened loading">Loading...</em>';b.appendChild(e);a.appendChild(b);b=jQuery("#filelist_body")[0];b.parentNode.replaceChild(a,b);o.showFilePageInfo(false)},showErrorMessage:function(){c=
null;var a=document.createElement("tbody");a.id="filelist_body";var b=document.createElement("tr"),e=document.createElement("td");e.id="nofiles";e.innerHTML="<em>Error retrieving directory contents.</em>";b.appendChild(e);a.appendChild(b);b=jQuery("#filelist_body")[0];b.parentNode.replaceChild(a,b);o.showFilePageInfo(false)},showLoadedFiles:function(){if(c){var a=i.getDirLocally(c);if("error"in a)o.showErrorMessage(a.error);else i.hasFilePage(a,u)&&o.showFiles(c)}}}}(),j=function(){return{getSubdirsList:function(c){return jQuery(">ul",
c)[0]},toggleCollapsed:function(c){!HasClass(c,"leaf")&&!HasClass(c,"unfetched")&&_toggleHidden(c)},setCollapsed:function(c,a){if(a){RemoveClass(c,"opened");AddClass(c,"closed")}else{RemoveClass(c,"closed");AddClass(c,"opened")}},expandParents:function(c){for(c=c.parentNode;c&&c.id!="root";){j.setCollapsed(c,false);c=c.parentNode}},makeVisible:function(c){var a=jQuery("span",c).offset(),b=jQuery("span",c).height();c=jQuery("#dirlist");var e=c.offset();e=e.top;var h=c.offset().top+c.height();if(a.top<
e||a.top+b>h){a=a.top-jQuery("#topdir").offset().top;c.animate({scrollTop:a},0)}},updateAllTreeElements:function(){for(;y.length;){var c=y.shift();j.updateTreeElement(c)}},updateTreeElement:function(c){if(c.parentNode){var a=j.getPath(c);D[a]-=1;if(!(D[a]>0)){var b=i.getDirLocally(a);a=j.getSubdirsList(c);if("subdirs"in b||"error"in b){if(isEmptyObject(b.subdirs)||"error"in b){AddClass(c,"leaf");RemoveClass(c,"loading");RemoveClass(c,"opened");i.setFullFetched(b);a.innerHTML=""}else{HasClass(c,"opened")||
AddClass(c,"closed");if(b.totalSubdirPages>1){var e=jQuery(">span",c)[0];e.innerHTML+='<em class="ifOpened partialdirs">Partial list - use SVN tools for complete view.</em>'}e=getObjectProps(b.subdirs);e.sort();var h=[];jQuery.each(e,function(l,n){l=b.subdirs[n];var k="unfetched";if("subdirs"in l)k=isEmptyObject(l.subdirs)?'"unfetched leaf"':'"unfetched closed"';h.push("<li class=",k,'><span onclick="selectDirClick(this)">','<a onclick="return false" href=#>',HtmlEscape(n),'</a><em class="ifOpened loading">Loading...</em>',
"</span><ul class=ifOpened></ul></li>")});a.innerHTML=h.join("");j.updateTree(c)}RemoveClass(c,"unfetched");jQuery(">span .loading",c).remove()}}}},updateTree:function(){function c(){for(var a=(new Date).getTime()+1E3;y.length&&(new Date).getTime()<a;){var b=y.shift();j.updateTreeElement(b)}window.setTimeout(c,y.length?100:300)}window.setTimeout(c,300);return function(a){a=jQuery(".unfetched",a||"#root");a.each(function(){if(this.parentNode){var b=j.getPath(this),e=b in D?D[b]+1:1;if(!(e>=2)){D[b]=
e;y.push(this)}}})}}(),markSelected:function(){var c=null;return function(a){a=jQuery(">span",a)[0];c&&c!=a&&RemoveClass(c,"selected");AddClass(a,"selected");c=a}}(),getPath:function(c,a){var b=j.getDirName(c);for(c=j.getParent(c);c!=null&&c!=a;){b=[j.getDirName(c),b].join("/");c=j.getParent(c)}return d(b)},getDirName:function(c){c=jQuery(">span>a",c).text();return d(c)},getParent:function(c){for(c=c.parentNode;c&&c.tagName!="LI";){if(c.id=="root")return null;c=c.parentNode}return c},getElsToUpdate:function(c,
a){if(a>0)for(var b=0,e=">ul>li";b<a;b++,e+=">ul>li");else e=c;return jQuery(e,c).filter(".unfetched")},getDirElement:function(c,a){c=d(c).split("/");var b=c.shift();if(!b)return a||null;a=a||jQuery("#root");var e=null;jQuery("li",a).each(function(){if(jQuery("span:first",this).text()==b){e=this;return false}});if(e)return j.getDirElement(c.join("/"),e);return null},selectDirHelper:function(){var c=P,a=Q,b=j.getDirElement(c);if(!b){j.updateAllTreeElements();b=j.getDirElement(c)}j.markSelected(b);
j.setCollapsed(b,a);j.expandParents(b);j.makeVisible(b);o.selectFilePage(c,1)},fetchDirectories:function(c,a,b){for(var e=0;e<c.length;e+=4){var h=c.slice(e,e+4),l=2;i.requestDirInfo(h,1,a,l,function(n){for(var k in n){var v=n[k],t=d(k);if(a=="")t=N+"/"+t;else{var p=d(a).split("/");t=p[p.length-1]+"/"+t}C.push({path:t,info:v})}for(var q=true;q;){q=false;n=C.slice();n.forEach(function(r){var x=i.getDirLocally(r.path);if(x&&"subdirs"in x){i.updateTree(r.info,r.path);for(x=0;x<C.length;++x)if(r==C[x]){C.splice(x,
1);break}q=true;b(r.path)}})}})}},selectDir:function(c,a){P=c=d(c);Q=a;var b=i.getDirLocally(c);b&&j.selectDirHelper();a=[];for(var e=null,h=c.length?c.split("/"):[],l=0;l<h.length;++l){var n=h.slice(0,l+1).join("/");b=i.getDirLocally(n);if(!b||!i.isFullFetched(b)&&!i.isLoading(b)){b&&i.setLoading(b);b=n.split("/");b.shift();b=encodeURIComponent(b.join("/"));a.push(b);if(e==null)e=n}}if(a.length){h=E;j.fetchDirectories(a,h,function(k){if(c==k){k=j.getDirElement(e);j.updateTree(k);j.selectDirHelper()}})}}}}();
_selectDir=m;_getDirPath=w;_isDirExpanded=s;_selectFilePage=z;_setDomainName=R;_setUrlPrefix=S;_setProjectName=T;_setRepoName=U;_setRootName=V;_setRevision=W;_setViewedRevision=X;_setBasePath=Y;_init=J})();})()
