/* Copyright 2008 Google Inc. All Rights Reserved. */ (function(){
var global=this;if(!Function.prototype.apply)Function.prototype.apply=function(a,b){var c=[],d,f;a||(a=global);var g=b||[];for(var e=0;e<g.length;e++)c[e]="args["+e+"]";f="oScope.__applyTemp__.peek()("+c.join(",")+");";if(!a.__applyTemp__)a.__applyTemp__=[];a.__applyTemp__.push(this);d=eval(f);a.__applyTemp__.pop();return d};if(!Array.prototype.push)Array.prototype.push=function(){for(var a=0;a<arguments.length;a++)this[this.length]=arguments[a];return this.length};
if(!Array.prototype.pop)Array.prototype.pop=function(){if(!this.length)return;var a=this[this.length-1];this.length--;return a};Array.prototype.peek=function(){return this[this.length-1]};if(!Array.prototype.shift)Array.prototype.shift=function(){if(this.length==0)return;var a=this[0];for(var b=0;b<this.length-1;b++)this[b]=this[b+1];this.length--;return a};
if(!Array.prototype.unshift)Array.prototype.unshift=function(){var a=arguments.length;for(var b=this.length-1;b>=0;b--)this[b+a]=this[b];for(var c=0;c<a;c++)this[c]=arguments[c];return this.length};if(!Array.prototype.forEach)Array.prototype.forEach=function(a,b){for(var c=0;c<this.length;c++)a.call(b,this[c],c,this)};
function bind(a,b){var c=a.boundArgs_||[];c=c.concat(Array.prototype.slice.call(arguments,2));if(typeof a.boundSelf_!="undefined")b=a.boundSelf_;if(typeof a.boundFn_!="undefined")a=a.boundFn_;var d=function(){var f=c.concat(Array.prototype.slice.call(arguments));return a.apply(b,f)};d.boundArgs_=c;d.boundSelf_=b;d.boundFn_=a;return d}Function.prototype.bind=function(a){return bind.apply(null,[this,a].concat(Array.prototype.slice.call(arguments,1)))};var DB_mode=false;function DumpError(a){try{throw a;}catch(b){DumpException(b)}}function DumpException(a,b){var c="Javascript exception: "+(b?b:"")+" "+a;if(BR_IsIE())c+=" "+a.name+": "+a.message+" ("+a.number+")";var d="";if(typeof a=="string")d=a+"\n";else for(var f in a)try{d+=f+": "+a[f]+"\n"}catch(g){}d+=DB_GetStackTrace(DumpException.caller);DB_WriteDebugMsg(c+"\n"+d,1)}var function_name_re_=/function (\w+)/;
function DB_GetFunctionName(a){var b=function_name_re_.exec(String(a));if(b)return b[1];return""}
function DB_GetStackTrace(a){try{if(!BR_IsIE()&&!(BR_AgentContains_("safari")||BR_AgentContains_("konqueror"))&&BR_AgentContains_("mozilla"))return Error().stack;if(!a)return"";var b="- "+DB_GetFunctionName(a)+"(";for(var c=0;c<a.arguments.length;c++){if(c>0)b+=", ";var d=String(a.arguments[c]);if(d.length>40)d=d.substr(0,40)+"...";b+=d}b+=")\n";b+=DB_GetStackTrace(a.caller);return b}catch(f){return"[Cannot get stack trace]: "+f+"\n"}}var DB_starttime,DB_win=null,DB_winopening=false;
function DB_OpenDebugWindow(){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 a="<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(a)}catch(b){}}
function DB_WriteDebugMsg(a,b){if(!DB_mode){typeof log!="undefined"&&log(HtmlEscape(a));return}try{var c=(new Date).getTime()-DB_starttime,d="["+c+"] "+HtmlEscape(a).replace(/\n/g,"<br>")+"<br>";if(b==1){d="<font color=#ff0000><b>Error: "+d+"</b></font>";DB_win.focus()}}catch(f){}DB_WriteDebugHtml(d)}function DB_WriteDebugHtml(a){if(!DB_mode)return;try{DB_OpenDebugWindow();DB_win.document.write(a);DB_win.scrollTo(0,1000000)}catch(b){}};function BR_AgentContains_(a){if(a in BR_AgentContains_cache_)return BR_AgentContains_cache_[a];return BR_AgentContains_cache_[a]=navigator.userAgent.toLowerCase().indexOf(a)!=-1}var BR_AgentContains_cache_={};function BR_IsIE(){return BR_AgentContains_("msie")&&!window.opera}var amp_re_=/&/g,lt_re_=/</g,gt_re_=/>/g;function HtmlEscape(a){if(!a)return"";return a.replace(amp_re_,"&amp;").replace(lt_re_,"&lt;").replace(gt_re_,"&gt;").replace(quote_re_,"&quot;")}var quote_re_=/\"/g;
function forid_1(a){return document.getElementById(a)}function forid_2(a){return document.all[a]}var forid=document.getElementById?forid_1:forid_2;function log(a){try{if(window.parent!=window&&window.parent.log){window.parent.log(window.name+"::"+a);return}}catch(b){}var c=forid("log");if(c){var d="<p class=logentry><span class=logdate>"+new Date+"</span><span class=logmsg>"+a+"</span></p>";c.innerHTML=d+c.innerHTML}else window.status=a};function AS_Assert(){}AS_Assert.raise=function(a){if(typeof Error!="undefined")throw new Error(a||"Assertion Failed");else throw a;};AS_Assert.fail=function(a){a=a||"Assertion failed";typeof DumpError=="undefined"||DumpError(a+"\n");AS_Assert.raise(a)};AS_Assert.isTrue=function(a,b){if(!a){if(b===undefined)b="Assertion failed";AS_Assert.fail(b)}};AS_Assert.equals=function(a,b,c){if(a!=b){if(c===undefined)c="AS_Assert.equals failed: <"+a+"> != <"+b+">";AS_Assert.fail(c)}};
AS_Assert.typeOf=function(a,b,c){if(typeof a==b)return;if(a||a=="")try{if(b==AS_Assert.TYPE_MAP[typeof a]||a instanceof b)return}catch(d){}if(c===undefined){if(typeof b=="function"){var f=b.toString().match(/^\s*function\s+([^\s\{]+)/);if(f)b=f[1]}c="AS_Assert.typeOf failed: <"+a+"> not typeof "+b}AS_Assert.fail(c)};AS_Assert.TYPE_MAP={string:String,number:Number,"boolean":Boolean};
AS_Assert.numArgs=function(a,b){var c=AS_Assert.numArgs.caller;if(c&&c.arguments.length!=a){if(b===undefined)b=c.name+" expected "+a+" arguments  but received "+c.arguments.length;AS_Assert.fail(b)}};Function.prototype.bind=function(a){if(typeof this!="function")throw new Error("Bind must be called as a method of a function object.");var b=this,c=Array.prototype.splice.call(arguments,1,arguments.length);return function(){var d=c.concat();for(var f=0;f<arguments.length;f++)d.push(arguments[f]);return b.apply(a,d)}};var listen,unlisten,unlistenByKey;
(function(){var a={},b=0;function c(g){if(g.listen_hc_==null)g.listen_hc_=++b;return g.listen_hc_}function d(g,e,h,j){var i=c(g),k=c(h);j=!!j;var l=i+"_"+e+"_"+k+"_"+j;return l}listen=function(g,e,h,j){var i=d(g,e,h,j);if(i in a)return i;var k=f.bind(null,i);a[i]={listener:h,proxy:k,event:e,node:g,useCapture:j};if(g.addEventListener)g.addEventListener(e,k,j);else if(g.attachEvent)g.attachEvent("on"+e,k);else throw new Error("Node {"+g+"} does not support event listeners.");return i};unlisten=function(g,
e,h,j){var i=d(g,e,h,j);return unlistenByKey(i)};unlistenByKey=function(g){if(!(g in a))return false;var e=a[g],h=e.proxy,j=e.event,i=e.node,k=e.useCapture;if(i.removeEventListener)i.removeEventListener(j,h,k);else i.detachEvent&&i.detachEvent("on"+j,h);delete a[g];return true};function f(g){var e=Array.prototype.splice.call(arguments,1,arguments.length);return a[g].listener.apply(null,e)}})();function Point(a,b,c){this.x=a;this.y=b;this.coordinateFrame=c||null}Point.prototype.toString=function(){return"[P "+this.x+","+this.y+"]"};function Delta(a,b){this.dx=a;this.dy=b}Delta.prototype.toString=function(){return"[D "+this.dx+","+this.dy+"]"};function Rect(a,b,c,d,f){this.x=a;this.y=b;this.w=c;this.h=d;this.coordinateFrame=f||null}Rect.prototype.contains=function(a){return this.x<=a.x&&a.x<this.x+this.w&&this.y<=a.y&&a.y<this.y+this.h};
Rect.prototype.toString=function(){return"[R "+this.w+"x"+this.h+"+"+this.x+"+"+this.y+"]"};var XH_ieProgId_;function XH_XmlHttpInit_(){var a=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];if(typeof XMLHttpRequest=="undefined"&&typeof ActiveXObject!="undefined"){for(var b=0;b<a.length;b++){var c=a[b];try{new ActiveXObject(c);XH_ieProgId_=c;break}catch(d){}}if(!XH_ieProgId_)throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed.");}}XH_XmlHttpInit_();
function XH_XmlHttpPOST(a,b,c,d){a.open("POST",b,true);a.onreadystatechange=d;a.setRequestHeader("Content-Type","application/x-www-form-urlencoded");a.setRequestHeader("Content-Length",c.length);XH_XmlHttpSend(a,c)}function XH_XmlHttpSend(a,b){try{a.send(b)}catch(c){log("XMLHttpSend failed "+c.toString()+"<br>"+c.stack);throw c;}};if("undefined"==typeof log)log=function(){};function Dom(a){this.doc=a||document;this.getElementById_=this.doc.getElementById?function(b){return this.doc.getElementById(b)}:function(b){return this.doc.all[b]}}Dom.remove=function(a){AS_Assert.isTrue(a.parentNode);a.parentNode.removeChild(a)};Dom.insertAfter=function(a,b){AS_Assert.isTrue(b.parentNode);b.parentNode.insertBefore(a,b.nextSibling)};Dom.insertBefore=function(a,b){AS_Assert.isTrue(b.parentNode);b.parentNode.insertBefore(a,b)};
Dom.replace=function(a,b){AS_Assert.isTrue(b.parentNode);b.parentNode.replaceChild(a,b)};Dom.getInnerText=function(a){var b=[];Dom.getInnerTextHelp_(a,b);return b.join("")};Dom.getInnerTextHelp_=function(a,b){if(a.innerText)b.push(a.innerText);else if(a.data)b.push(a.data);else if(a.hasChildNodes()){var c=a.firstChild;while(c){arguments.callee(c,b);c=c.nextSibling}}};new Dom;if(window.jstiming)window.jstiming.report=function(a,b){var c="";if(window.jstiming.pt){c+="&srt="+window.jstiming.pt;delete window.jstiming.pt}if(window.external&&window.external.tran)c+="&tran="+window.external.tran;var d=a.t,f=d.start;delete d.start;var g=[],e=[];for(var h in d){if(h.indexOf("_")==0)continue;var j=d[h][1];if(j)d[j][0]&&e.push(h+"."+(d[h][0]-d[j][0]));else f&&g.push(h+"."+(d[h][0]-f[0]))}if(b)for(var i in b)c+="&"+i+"="+b[i];(new Image).src=["http://csi.gstatic.com/csi?v=3","&s=codesite&action=",
a.name,e.length?"&it="+e.join(",")+c:c,"&rt=",g.join(",")].join("")};var CS_STAR_OFF="http://www.gstatic.com/codesite/ph/images/star_off.gif";function CS_toggleStar(a,b,c,d,f){var g=a.src.indexOf(CS_STAR_OFF)!=-1?1:0;if(c){var e=document.getElementById(c);e.innerHTML=g?d:f}a.src=g?"http://www.gstatic.com/codesite/ph/images/star_on.gif":CS_STAR_OFF;b.starred=g;CS_setStar(b)}var CS_starXmlHttp=undefined;
function CS_setStar(a){CS_starXmlHttp=XH_ieProgId_?new ActiveXObject(XH_ieProgId_):new XMLHttpRequest;var b="/hosting/stars.do";a.token="dummy";var c="";for(var d in a)c+=d+"="+encodeURIComponent(a[d])+"&";XH_XmlHttpPOST(CS_starXmlHttp,b,c,CS_setStarCallback)}function CS_setStarCallback(){CS_starXmlHttp.readyState==4&&CS_starXmlHttp.status==200&&CS_gotSetStar(CS_starXmlHttp.responseText)}
function CS_gotSetStar(a){try{eval("_d="+a)}catch(b){alert("CS: error parsing response of issue starring");return null}};_CS_toggleStar=CS_toggleStar;(function(){function a(f){var g=/http:\/\/[^\/]*\/(u|hosting|p)\/([^\/]*)\/?([^\/]*)\/?([^\?\/]*)?/,e=g.exec(f);if(e[1]=="hosting"){if(e[2])return"hosting_"+e[2];return"hosting_home"}if(e[1]=="u")return"user_profile";if(e[1]=="p"){if(!e[3]&&!e[4])return"summary";if(e[3]=="wiki")return e[3];if(e[3]&&!e[4])return e[3];if(e[3]&&e[4]){var h=e[3]=="w"?"wiki":e[3];return h+"_"+e[4]}}return"other"}function b(){var f=["codesite","ph"],g="project_"+a(window.location.href);f.push(g);return f.join(",")}function c(){var f=
window.jstiming.load;f.tick("plt");f.name=b();window.setTimeout(function(){window.jstiming.report(f)},500)}function d(){if(window.attachEvent)window.attachEvent("onload",c);else window.addEventListener&&window.addEventListener("load",c,false)}window._CS_reportToCsi=d})();(function(){function a(){window.setTimeout(function(){var b="https:"==document.location.protocol?"https://ssl.":"http://www.",c=b+"google-analytics.com/ga.js",d=document.createElement("script");d.src=c;d.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(d);_CS_reportAnalytics()},0)}if(window.attachEvent)window.attachEvent("onload",a);else window.addEventListener&&window.addEventListener("load",a,false)})();
})()

