/* Copyright 2011 Google Inc. All Rights Reserved. */ (function(){var global=this;String.prototype.startsWith=function(a){return 0==this.lastIndexOf(a,0)};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};Function.prototype.apply||(Function.prototype.apply=function(a,b){var c=[];a||(a=global);for(var d=b||[],e=0;e/g,quote_re_=/\"/g;
function GetCursorPos(a,b){try{if(IsDefined(b.selectionEnd))return b.selectionEnd;if(a.document.selection&&a.document.selection.createRange){var c=a.document.selection.createRange();if(c.parentElement()!=b)return-1;var d=c.duplicate();d.moveToElementText(b);d.setEndPoint("EndToStart",c);var e=d.text.length;return e>b.value.length?-1:e}DB_WriteDebugMsg("Unable to get cursor position for: "+navigator.userAgent,0);return b.value.length}catch(f){DumpException(f,"Cannot get cursor pos")}return-1}
function FindInArray(a,b){for(var c=0;c"+new Date+""+a+"
",c.innerHTML=a+c.innerHTML):window.status=a};function AS_Assert(){}AS_Assert.raise=function(a){if("undefined"!=typeof Error)throw Error(a||"Assertion Failed");throw a;};AS_Assert.fail=function(a){a=a||"Assertion failed";"undefined"!=typeof DumpError&&DumpError(a+"\n");AS_Assert.raise(a)};AS_Assert.isTrue=function(a,b){a||(void 0===b&&(b="Assertion failed"),AS_Assert.fail(b))};AS_Assert.equals=function(a,b,c){a!=b&&(void 0===c&&(c="AS_Assert.equals failed: <"+a+"> != <"+b+">"),AS_Assert.fail(c))};
AS_Assert.typeOf=function(a,b,c){if(typeof a!=b){if(a||""==a)try{if(b==AS_Assert.TYPE_MAP[typeof a]||a instanceof b)return}catch(d){}void 0===c&&("function"==typeof b&&(c=b.toString().match(/^\s*function\s+([^\s\{]+)/))&&(b=c[1]),c="AS_Assert.typeOf failed: <"+a+"> not typeof "+b);AS_Assert.fail(c)}};AS_Assert.TYPE_MAP={string:String,number:Number,"boolean":Boolean};Function.prototype.bind=function(a,b){if("function"!=typeof this)throw Error("Bind must be called as a method of a function object.");var c=this,d=Array.prototype.splice.call(arguments,1,arguments.length);return function(){for(var b=d.concat(),f=0;f"+c.stack),c;}};"undefined"==typeof log&&(log=function(){});function Dom(a){this.doc=a||document;this.getElementById_=this.doc.getElementById?function(a){return this.doc.getElementById(a)}:function(a){return this.doc.all[a]}}Dom.prototype.$=function(a){return this.getElementById_(a)};Dom.prototype.create=function(a){return this.doc.createElement(a)};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())for(var c=a.firstChild;c;)arguments.callee(c,b),c=c.nextSibling};var DM_GlobalDom=new Dom;
function $(a){return DM_GlobalDom.$(a)};function PopupController(){this.activePopups_=[]}function _PC_Install(a){if(gPopupControllerInstalled)return!1;gPopupControllerInstalled=!0;a=a?a:document;listen(a.body,"mousedown",PC_notifyPopups);return!0}function PC_notifyPopups(a){if(0==gPopupController.activePopups_.length)return!1;a=a||window.event;for(var b=gPopupController.activePopups_.length-1;0<=b;--b){var c=gPopupController.activePopups_[b];PC_assertIsPopup(c);c.deactivate(a)&&gPopupController.activePopups_.splice(b,1)}return!0}
function PC_assertIsPopup(a){a:{a=a.deactivate;var b=Function,c="popup missing deactivate function";if(typeof a!=b){if(a||""==a)try{if(b==AssertTypeMap[typeof a]||a instanceof b)break a}catch(d){}var e=void 0===c;e&&("function"==typeof b&&(c=b.toString().match(/^\s*function\s+([^\s\{]+)/))&&(b=c[1]),c="AssertType failed: <"+a+"> not typeof "+b);a=(a=c)||"Assertion failed";IsDefined(DumpError)&&DumpError(a+"\n");if("undefined"!=typeof Error)throw Error(a||"Assertion Failed");throw a;}}}
var gPopupController=new PopupController,gPopupControllerInstalled=!1;function _ac_install(){ac_addHandler_(document.body,"onkeydown",ac_keyevent_);ac_addHandler_(document.body,"onkeypress",ac_keyevent_)}function _ac_register(a){for(var b=ac_storeConstructors.length;0<=--b;)if(ac_storeConstructors[b]===a)return;ac_storeConstructors.push(a)}function _ac_onfocus(a){ac_keyevent_(a)}function _ac_isCompleting(){return!!ac_store&&!ac_suppressCompletions}function _ac_isCompleteListShowing(){return!!ac_store&&!ac_suppressCompletions&&ac_completions&&ac_completions.length}
function _ac_cancel(){ac_suppressCompletions=!0;ac_updateCompletionList(!1)}function ac_addHandler_(a,b,c){var d=a[b];a[b]=d?ac_fnchain_(a[b],c):c;return d}function ac_cancelEvent_(a){"stopPropagation"in a?a.stopPropagation():a.cancelBubble=!0;"preventDefault"in a&&a.preventDefault()}function ac_fnchain_(a,b){return function(){var c=a.apply(this,arguments),d=b.apply(this,arguments);return!1===c||!1===d?!1:!0}}
function ac_keyevent_(a){a=a||window.event;var b=a.target||a.srcElement;if("INPUT"==b.tagName&&b.type.match(/^text$/i)||"TEXTAREA"==b.tagName){var c=GetKeyCode(a),d="keydown"==a.type,e=a.shiftKey,f=!0;if(b!==ac_focusedInput||null===ac_store)if(ac_focusedInput=b,f=!1,13!==c&&27!==c){for(var g=0;g"+ac_preTextToHtml(g[2])+""+ac_preTextToHtml(g[3]),g=new _AC_Completion(b[f].value,g,this.docstrings[b[f].value]),d.push(g),d.length>this.countThreshold))break}return d};
_AC_SimpleStore.prototype.autoselectFirstRow=function(){return!0};function _AC_CompareACCompletion(a,b){var c=a.value.toLowerCase().replace(/^\W*/,""),d=b.value.toLowerCase().replace(/^\W*/,"");return a.value===b.value?0:cac_selected&&1<=e&&ac_store.autoselectFirstRow()&&(ac_selected=0),0<=ac_selected&&(b=ac_focusedInput,c=ac_completions[ac_selected].value,ac_complete(),ac_store.oncomplete))ac_store.oncomplete(!0,a,b,c)}else{switch(a){case 27:ac_selected=-1;d=!1;break;case 38:b&&(ac_selected=Math.max(0<=e?0:-1,ac_selected-1));break;case 40:b&&(ac_selected=Math.min(e-1,ac_selected+
1))}if(b)switch(a){case 27:case 13:case 38:case 40:case 39:case 37:case 9:case 16:case 8:case 46:break;default:ac_everTyped=!0}}ac_focusedInput&&ac_updateCompletionList(d)}function _ac_select(a){ac_selected=a;ac_complete();if(ac_store.oncomplete)ac_store.oncomplete(!0,null,ac_focusedInput,ac_focusedInput.value);ac_checkCompletions();ac_updateCompletionList(!0)}function _ac_mouseover(a){ac_selected=a;ac_updateCompletionList(!0)}
function ac_complete(){var a=ac_getCaretPosition_(ac_focusedInput),b=ac_completions[ac_selected];ac_focusedInput.value=ac_store.substitute(ac_focusedInput.value,a,ac_lastCompletable,b);a=a-ac_lastCompletable.length+b.value.length;'""'==b.value.substring(b.value.length-2)?a--:":"!=b.value.substring(b.value.length-1)&&a++;ac_selected=-1;ac_lastCompletable=ac_completions=null;ac_everTyped=!1;var b=window,c=ac_focusedInput;IsDefined(c.selectionEnd)&&IsDefined(c.selectionStart)?(c.selectionStart=a,c.selectionEnd=
a):b.document.selection&&c.createTextRange&&(b=c.createTextRange(),b.collapse(!0),b.move("character",a),b.select())}var ac_everTyped=!1;
function ac_checkCompletions(){if(ac_suppressCompletions)ac_completions=ac_lastCompletable=null,ac_selected=-1;else{var a=ac_getCaretPosition_(ac_focusedInput),a=ac_store.completable(ac_focusedInput.value,a);if(a!=ac_lastCompletable){var b;ac_lastCompletable&&ac_lastCompletable.lengthac_selected&&ac_store&&ac_store.autoselectFirstRow()&&(ac_selected=0);a=[];var c=0;a.push("