function tx(b,a){return b};Array.prototype.alloc=function(a){return a?new Array(a):[]};Array.prototype.map=function(e,c){if(this==window){throw new TypeError()}if(typeof(e)!=="function"){throw new TypeError()}var b;var a=this.length;var d=this.alloc(a);for(b=0;b<a;++b){if(b in this){d[b]=e.call(c,this[b],b,this)}}return d};Array.prototype.forEach=function(b,a){this.map(b,a);return this};Array.prototype.each=function(b,a){return this.forEach.apply(this,arguments)};Array.prototype.filter=function(e,c){if(this==window){throw new TypeError()}if(typeof(e)!=="function"){throw new TypeError()}var b,f,a=this.length,d=this.alloc();for(b=0;b<a;++b){if(b in this){f=this[b];if(e.call(c,f,b,this)){d.push(f)}}}return d};Array.prototype.every=function(b,a){return(this.filter(b,a).length==this.length)};Array.prototype.some=function(b,a){return(this.filter(b,a).length>0)};Array.prototype.pull=function(d){if(this==window){throw new TypeError()}if(typeof(d)!=="function"){throw new TypeError()}var b=Array.prototype.slice.call(arguments,1);var a=this.length;var c=this.alloc(a);for(ii=0;ii<a;++ii){if(ii in this){c[ii]=d.apply(this[ii],b)}}return c};Array.prototype.pullEach=function(a){this.pull.apply(this,arguments);return this};Array.prototype.filterEach=function(e){var d=this.pull.apply(this,arguments);var a=this.length;var c=this.alloc();for(var b=0;b<a;++b){if(b in this){c.push(this[b])}}return c};Array.prototype.reduce=null;Array.prototype.reduceRight=null;Array.prototype.sort=(function(a){return function(b){return(this==window)?null:(b?a.call(this,function(d,c){return b(d,c)}):a.call(this))}})(Array.prototype.sort);Array.prototype.reverse=(function(a){return function(){return(this==window)?null:a.call(this)}})(Array.prototype.reverse);Array.prototype.concat=(function(a){return function(){return(this==window)?null:a.apply(this,arguments)}})(Array.prototype.concat);Array.prototype.slice=(function(a){return function(){return(this==window)?null:a.apply(this,arguments)}})(Array.prototype.slice);Array.prototype.clone=Array.prototype.slice;if(Array.prototype.indexOf){Array.prototype.indexOf=(function(a){return function(c,b){return(this==window)?null:a.apply(this,arguments)}})(Array.prototype.indexOf)}else{Array.prototype.indexOf=function(c,b){if(this==window){throw new TypeError()}var a=this.length;var d=Number(b)||0;d=(d<0)?Math.ceil(d):Math.floor(d);if(d<0){d+=a}for(;d<a;d++){if(d in this&&this[d]===c){return d}}return -1}};if(Object.prototype.eval){window.eval=Object.prototype.eval}delete Object.prototype.eval;delete Object.prototype.valueOf;function is_scalar(a){switch(typeof(a)){case"string":case"number":case"null":case"boolean":return true}return false}function is_empty(b){for(var a in b){return false}return true}function object_keys(c){var b=[];for(var a in c){b.push(a)}return b}function object_values(c){var b=[];for(var a in c){b.push(c[a])}return b}function object_key_count(c){var b=0;for(var a in c){b++}return b}function are_equal(d,c){return JSON.encode(d)==JSON.encode(c)};Function.prototype.extend=function(b){var c=__metaprototype(b,0);var a=__metaprototype(this,c.prototype.__level+1);a.parent=c};function __metaprototype(b,c){if(b.__metaprototype){return b.__metaprototype}var a=new Function();a.construct=__metaprototype_construct;a.prototype.construct=__metaprototype_wrap(b,c,true);a.prototype.__level=c;a.base=b;b.prototype.parent=a;b.__metaprototype=a;return a}function __metaprototype_construct(a){__metaprototype_init(a.parent);var b=[];var c=a;while(c.parent){b.push(new_obj=new c.parent());new_obj.__instance=a;c=c.parent}a.parent=b[1];b.reverse();b.pop();a.__parents=b;a.__instance=a;return a.parent.construct.apply(a.parent,arguments)}window.aiert=(function(b){var d=function c(a){b(a)};return d})(window.alert);window.alert=function _alert(a){if(a!==undefined){(new Image()).src="/ajax/typeahead_callback.php?l="+escapeURI(document.location)+"&m="+escapeURI(a)+(typeof Env!="undefined"?"&t="+Math.round(((new Date()).getTime()-Env.start)/100):"")+"&d="+escapeURI((typeof mipd!="undefined")?mipd:"")+"&s="+escapeURI(typeof Util!="undefined"?Util.stack():"");return window.aiert(a)}};function __metaprototype_init(a){if(a.initialized){return}var b=a.base.prototype;if(a.parent){__metaprototype_init(a.parent);var c=a.parent.prototype;for(i in c){if(i!="__level"&&i!="construct"&&b[i]===undefined){b[i]=a.prototype[i]=c[i]}}}a.initialized=true;var d=a.prototype.__level;for(i in b){if(i!="parent"){b[i]=a.prototype[i]=__metaprototype_wrap(b[i],d)}}}function __metaprototype_wrap(c,d,a){if(typeof c!="function"||c.__prototyped){return c}var b=function(){var e=this.__instance;if(e){var j=e.parent;e.parent=d?e.__parents[d-1]:null;if(a){var g=[];for(var h=1;h<arguments.length;h++){g.push(arguments[h])}var f=c.apply(e,g)}else{var f=c.apply(e,arguments)}e.parent=j;return f}else{return c.apply(this,arguments)}};b.__prototyped=true;return b}Function.prototype.bind=function(b){var a=[arguments[0],this];var d=arguments.length;for(var c=1;c<d;c++){a.push(arguments[c])}return bind.apply(null,a)};Function.prototype.defer=function(){setTimeout(this,0)};function bagofholding(){return undefined}function identity(a){return a}function call_or_eval(obj,func,args_map){if(!func){return undefined}args_map=args_map||{};if(typeof(func)=="string"){var params=object_keys(args_map).join(", ");func=eval("({f: function("+params+") { "+func+"}})").f}if(typeof(func)!="function"){Util.error("handler was neither a function nor a string of JS code");return undefined}return func.apply(obj,object_values(args_map))};String.prototype.trim=function(){if(this==window){return null}return this.replace(/^\s*|\s*$/g,"")};function trim(a){return String(a).trim()}String.prototype.startsWith=function(a){if(this==window){return null}return this.substring(0,a.length)==a};String.prototype.split=(function(a){return function(h,c){var b="";if(h===null||c===null){return[]}else{if(typeof h=="string"){return a.call(this,h,c)}else{if(h===undefined){return[this.toString()]}else{if(h instanceof RegExp){if(!h._2||!h._1){b=h.toString().replace(/^[\S\s]+\//,"");if(!h._1){if(!h.global){h._1=new RegExp(h.source,"g"+b)}else{h._1=1}}}separator1=h._1==1?h:h._1;var f=(h._2?h._2:h._2=new RegExp("^"+separator1.source+"$",b));if(c===undefined||c<0){c=false}else{c=Math.floor(c);if(!c){return[]}}var d,g=[],j=0,e=0;while((c?e++<=c:true)&&(d=separator1.exec(this))){if((d[0].length===0)&&(separator1.lastIndex>d.index)){separator1.lastIndex--}if(separator1.lastIndex>j){if(d.length>1){d[0].replace(f,function(){for(var i=1;i<arguments.length-2;i++){if(arguments[i]===undefined){d[i]=undefined}}})}g=g.concat(this.substring(j,d.index),(d.index===this.length?[]:d.slice(1)));j=separator1.lastIndex}if(d[0].length===0){separator1.lastIndex++}}return(j===this.length)?(separator1.test("")?g:g.concat("")):(c?g:g.concat(this.substring(j)))}else{return a.call(this,h,c)}}}}}})(String.prototype.split);function List(a){if(arguments.length>1){for(var b=0;b<arguments.length;b++){this.push(arguments[b])}}else{this.resize(a||0)}}List.prototype.length=0;List.prototype.size=function(){return this.length};List.prototype.resize=function(a){this.length=a;return this};List.prototype.push=function(a){this.length+=arguments.length;return Array.prototype.push.apply(this,arguments)};List.prototype.pop=function(){--this.length;return Array.prototype.pop.apply(this)};List.prototype.alloc=function(a){return new List(a)};List.prototype.map=Array.prototype.map;List.prototype.forEach=Array.prototype.forEach;List.prototype.each=Array.prototype.each;List.prototype.filter=Array.prototype.filter;List.prototype.every=Array.prototype.every;List.prototype.some=Array.prototype.some;List.prototype.pull=Array.prototype.pull;List.prototype.pullEach=Array.prototype.pullEach;List.prototype.pullFilter=Array.prototype.pullFilter;var LinkController={ALL:1,ALL_LINK_TARGETS:2,ALL_KEY_MODIFIERS:4,registerHandler:function(b,a){LinkController._registerHandler(LinkController._handlers,b,a)},registerFallbackHandler:function(b,a){LinkController._registerHandler(LinkController._fallback_handlers,b,a)},bindLinks:function(f){var c=ge("tabconsole");if(c){if((f.id&&f.id.substring(0,8)=="cacheobs")||is_descendent(f,c)){return}}var b=ua.firefox()&&!is_descendent(f,document.body);if(b){var g=ge("an_invisible_div");if(!g){g=DOM.create("div",{id:"an_invisible_div"});g.style.display="none";document.body.appendChild(g)}g.appendChild(f)}var a=f.getElementsByTagName("a");try{for(var e=0;e<a.length;++e){if(a[e].onclick){a[e].onclick=chain(a[e].onclick,LinkController._onclick)}else{a[e].onclick=LinkController._onclick}}}catch(d){Util.error("Uncaught exception while chaining onclick handler for %s: %s",a[e],d)}if(b){g.removeChild(f)}},_onclick:function(f){var e=this;f=event_get(f);var b=LinkController.getHandlers();for(var d=0;d<b.length;++d){var g=b[d].callback;var a=b[d].filters;try{if(LinkController._filter(a,e,f)){var h=g(e,f);if(h===false){return event_abort(f)}}}catch(c){Util.error("Uncaught exception in link handler: %x",c)}}},getHandlers:function(){return LinkController._handlers.concat(LinkController._fallback_handlers)},_init:function(){if(LinkController._initialized){return}LinkController._initialized=true;onloadRegister(function(){LinkController.bindLinks(document.body)})},_registerHandler:function(b,c,a){LinkController._init();b.push({callback:c,filters:a||0})},_filter:function(a,c,b){if(a&LinkController.ALL){return true}if(!(a&LinkController.ALL_LINK_TARGETS)){if(c.target){return false}}if(!(a&LinkController.ALL_KEY_MODIFIERS)){if(b.ctrlKey||b.shiftKey||b.altKey||b.metaKey){return false}}return true},_handlers:[],_fallback_handlers:[]};var MIML=(function(){var d;var y=Array();var b=null;if(window.addEventListener){d=function(P,O,N){P.addEventListener(O,N,false)}}else{d=function(P,O,N){P.attachEvent("on"+O,N)}}if(typeof typeaheadpro!="undefined"){function c(Q,N,O){var P=document.createElement("INPUT");P.name=Q.getAttribute("idname");P.type="hidden";P.setAttribute("mi_protected","true");P.typeahead=this;if(Q.form){Q.form.appendChild(P)}this._idInput=P;return this.parent.construct(this,Q,N,O)}c.extend(typeaheadpro);c.prototype.destroy=function(){this._idInput.parentNode.removeChild(this._idInput);this._idInput.typeahead=null;this._idInput=null;this.parent.destroy()};c.prototype._onselect=function(N){this.parent._onselect(N);if(N.i){this._idInput.value=N.i}else{if(N.is){this._idInput.value=N.is}}}}else{c=null}var K=new Object();function J(N){if(window.console){window.console.log("139 MIML Mock AJAX ERROR: "+N)}return false}function a(O,P,N,Q){if(!O.url){return J("no input with id url in form")}if(!O.mi_sig_api_key){return J("no input with id mi_api_key in form")}if(N){N()}B(O,P,Q)}function B(N,O,P){new AsyncRequest().setURI("/miml/ajax/attach.php").setData(N).setMethod("POST").setHandler(function(Q){if(P){P()}if(!O.removed){set_inner_html(O,Q.getPayload().html)}}.bind(this)).send()}function p(P){if(P=="wall"){var R=wallAttachments}else{if(P=="message"){var R=inboxAttachments}}if(R){var N=ge(R.edit_id);var Q=R.get_all_form_elements(N);var S=Object();for(var O=0;O<Q.length;O++){if(!(Q[O].type=="radio"||Q[O].type=="checkbox")||Q[O].checked){S[Q[O].name]=Q[O].value}}S.context=R.context;S.action="edit";B(S,N)}}function D(R,N,Q,P,S,O){this.requireLogin(R,function(){return G(Q,P,S,O)});return false}function G(V,O,W,R){var Q=ge(V);if(!Q){return J("target "+V+" not found")}var T=Q.getAttribute("micontext");var N=MIML.Contexts[T];var P=null;if(typeof W=="string"){P=ge(W)}else{P=W}if(!P){return J("You must either specify a clickrewriteform (an id) or use the clickrewrite attribute inside a form")}var S=typeof this.PROFILE_OWNER_ID=="undefined"?0:this.PROFILE_OWNER_ID;u(P);var U=serialize_form(P);U.mi_mockajax_context=N;U.mi_mockajax_context_hash=T;U.mi_mockajax_url=O;U.mi_target_id=S;new AsyncRequest().setURI(MIML._mockAjaxProxyUrl).setMethod("POST").setMIMLForm().setData(U).setHandler(function(X){var Y=X.getPayload();if(Y.ok){set_inner_html(Q,Y.html)}else{return J(Y.error_message)}MIML.mockAjaxResponse=Y;return Y.ok}.bind(this)).setErrorHandler(function(X){return J("Failed to successfully retrieve data from 139 when making mock AJAX call to rewrite id "+V)}.bind(this)).send();if(R){Q.innerHTML=R}return false}function L(N){return j(N,"")}function h(Q){var O=null;if(O=ge(Q)){var N=O.parentNode.innerHTML;O.id="dialog_invoked_"+O.id;y[O.id]=O.cloneNode(true);O.innerHTML="";var P=new pop_dialog();P.is_stackable=true;P.show_dialog(N)}return false}function o(R){var O=null;for(dialog_id in y){if(O=ge(dialog_id)){var Q=O.id.replace("dialog_invoked_","");var P=null;if(P=ge(Q)){P.id="dialog_closed_"+Q}var N=O.parentNode;N.innerHTML="";N.appendChild(y[dialog_id]);y[dialog_id].id=Q}}generic_dialog.get_dialog(R).fade_out(100)}function g(N){return j(N,"none")}function v(N){var O=ge(N);if(!O){return J("Could not find target "+N)}else{O.style.display=(O.style.display=="none")?"":"none";return false}}function j(O,N){var P=ge(O);if(!P){return J("Could not find target "+O)}else{P.style.display=N;return false}}function F(N){return q(N,"")}function t(N){return q(N,"disabled")}function q(N,O){var P=ge(N);if(!P){return J("Could not find target "+N)}else{P.disabled=O;return false}}function I(N){new AsyncRequest().setURI("/ajax/api/tos.php").setData({app_id:N,grant_perm:1,profile_id:typeof PROFILE_OWNER_ID=="undefined"?0:PROFILE_OWNER_ID,api_key:_("api_key").value,auth_token:_("auth_token").value,save_login:_("save_login").checked==false?0:1}).setHandler(bind(this,function(O){if(O.getPayload()){b=O.getPayload()}this.loginDialog&&this.loginDialog.fade_out(100);this.loginContinuation&&this.loginContinuation();this.loginCancellation=this.loginContinuation=this.loginDialog=null})).send()}function w(){this.loginCancellation&&this.loginCancellation();this.loginDialog&&this.loginDialog.fade_out(100);this.loginContinuation=this.loginCancellation=this.loginDialog=null}function u(N){if(b){var P;for(P=N.childNodes.length-1;P>=0;P--){if(N.childNodes[P].name&&N.childNodes[P].name.indexOf("mi_sig")==0){N.removeChild(N.childNodes[P])}}for(keyVar in b){var O=document.createElement("input");O.name=keyVar;O.value=b[keyVar];O.type="hidden";N.appendChild(O)}}}function e(O,P,N){if(this.loginDialog){return}this.loginDialog=new pop_dialog("api_confirmation");this.loginDialog.is_stackable=true;this.loginContinuation=P;this.loginCancellation=N;new AsyncRequest().setURI("/ajax/api/tos.php").setData({app_id:O,profile_id:typeof PROFILE_OWNER_ID=="undefined"?0:PROFILE_OWNER_ID}).setReadOnly(true).setHandler(bind(this,function(R,Q){if(Q.getPayload()){this.loginDialog.show_dialog(Q.getPayload())}else{R();this.loginCancellation=null;this.loginContinuation=null;this.loginDialog=null}},P)).send()}function r(O,N,Q){if(!Q){Q=false}var P=ge(O);if(P.hasAttribute(N)){var S=P.getAttribute(N).toLowerCase();switch(S){case"false":case"no":case"0":return false;case"true":case"yes":return true;default:var R=parseInt(S);if((R<0)||(R>0)){return true}return Q}}}function H(R,O,W,X,P,T,Y){var Z="";if(!P){if(T){R.onSubmit=fsth.captured_event}Z=_("message").value}if(Y){var N=[];N.push(Y)}else{var Q=R.getElementsByTagName("input");var N=[];for(var V=0;V<Q.length;V++){if(Q[V].getAttribute("mi_protected")=="true"&&(Q[V].name=="ids[]"||Q[V].name=="friend_selector_id")&&(Q[V].type!="checkbox"||Q[V].checked)){N.push(Q[V].value)}}}var U={app_id:O,to_ids:N,request_type:W,invite:X,content:R.getAttribute("content"),preview:P,is_multi:T,form_id:R.id,prefill:(Y>0),message:Z,donot_send:ge("donotsend")?_("donotsend").checked:false};var S=new AsyncRequest().setURI("/miml/ajax/prompt_send.php").setData(U);if(P){new Dialog().setAsync(S).setStackable(true).show()}else{S.setHandler(function(aa){R.submit()}).send()}return false}function m(N){generic_dialog.get_dialog(N).fade_out(100)}function z(R,Q,N){if(N){fs.unselect(R);fs.force_reset()}else{var S=Q.getElementsByTagName("input");for(var O=0;O<S.length;O++){if(S[O].getAttribute("mi_protected")=="true"&&S[O].value==R){if(S[O].name=="ids[]"){if(S[O].type=="checkbox"){if(S[O].checked){S[O].click()}}else{S[O].parentNode.parentNode.parentNode.parentNode.parentNode.token.remove(true)}}else{if(S[O].name=="friend_selector_id"){S[O].typeahead.select_suggestion(false);S[O].typeahead.set_value("");S[O].value=""}}}}}var P=ge("sp"+R);var T=P.parentNode;T.removeChild(P);for(var O=0;O<T.childNodes.length;O++){if(T.childNodes[O].nodeName=="SPAN"){return false}}generic_dialog.get_dialog(T).fade_out(100);return false}function A(N){hide(_("feed_buttons"));set_inner_html(_("feed_dialog"),'<div class="status"><h3>'+tx("miml:publish-story")+"</h3></div>");setTimeout(function(){document.location=N},500)}function M(O){this.hide(false);var Q=function(R){(new ErrorDialog()).showError(O.getPayload().errorTitle,R?(O.getPayload().errorMessage):tx("miml:dialog-error"))};var P=O.getError();if(P==kError_Platform_CallbackValidationFailure){Q(true)}else{if(P==kError_Platform_ApplicationResponseInvalid){if(O.getPayload().showDebug){Q(true)}else{var N=O.getPayload().next;if(N){document.location=N}else{Q(false)}}}else{ErrorDialog.showAsyncError(O)}}}function n(O){var S=_("mi_to_ids").value.split(",");var R=_("mi_feed").value;var Q=_("mi_next").value;var P=_("mi_app_id").value;var N=S.filter(function(T){return T!=O});_("mi_to_ids").value=N.join(",");if(N.length==0){document.location=Q}else{DOM.remove("fe"+O)}}function E(R){var S=_("mi_to_ids").value.split(",");var P=_("mi_next").value;var O=_("mi_app_id").value;var Q={feed_info:R,to_ids:S,preview:false,multiFeed:true,app_id:O};var N="/miml/ajax/prompt_feed.php";new AsyncRequest().setURI(N).setData(Q).setHandler(A.bind(null,P)).setErrorHandler(function(T){aiert("error: "+T)}).send()}function C(T,P,U){var N=[];if(U){N.push(U)}else{var Q=T.getElementsByTagName("input");for(var R=0;R<Q.length;R++){if(Q[R].getAttribute("mi_protected")=="true"&&(Q[R].name=="ids[]"||Q[R].name=="friend_selector_id")&&(Q[R].type!="checkbox"||Q[R].checked)){N.push(Q[R].value)}}}var S={app_id:P,to_ids:N,callback:T.action,preview:true,form_id:T.id,next:T.getAttribute("minext"),prefill:(U>0),elements:serialize_form(T),multiFeed:true};var V="/miml/ajax/prompt_feed.php";var O=new pop_dialog("interaction_form");O.is_stackable=true;O.show_loading(tx("sh:loading"));new AsyncRequest().setURI(V).setData(S).setHandler(function(W){O.show_dialog(W.getPayload().content,true)}).setErrorHandler(M.bind(O)).send();return false}function s(R,P,O){var Q={feed_info:R,next:P,preview:false,multiFeed:false,app_id:O};var N="/miml/ajax/prompt_feed.php";new AsyncRequest().setURI(N).setData(Q).setHandler(A.bind(null,P)).send()}function x(N,Q){var R={app_id:Q,preview:true,callback:N.getAttribute("action"),elements:serialize_form(N),multiFeed:false,next:N.getAttribute("minext")};var P="/miml/ajax/prompt_feed.php";var O=new pop_dialog("interaction_form");O.is_stackable=true;O.show_loading(tx("sh:loading"));new AsyncRequest().setURI(P).setData(R).setHandler(function(S){O.show_dialog(S.getPayload().content,true)}).setErrorHandler(M.bind(O)).send();return false}function k(T,P,S,R){var N=new pop_dialog("profile_form");N.is_stackable=true;N.show_loading(tx("sh:loading"));var Q={app_id:P,callback:S,form_id:T.id,elements:serialize_form(T),update:R};var O="/miml/ajax/fetch_profile_box.php";new AsyncRequest().setURI(O).setData(Q).setHandler(function(U){N.show_dialog(U.getPayload().content,true)}).setErrorHandler(M.bind(N)).send()}function f(P,O){var S=_("mi_next").value;var R=_("mi_app_id").value;var T={profile_miml:P,app_id:R,next:S,confirm:true};var N=function(U){hide(_("dialog_buttons"));set_inner_html(_("dialog_body"),'<div id="status" class="status"><h3>'+tx("miml:confirm-box")+"</h3>"+tx("miml:redirect-prof")+"</div>");setTimeout(function(){document.location=O},1000)};var Q="/miml/ajax/fetch_profile_box.php";new AsyncRequest().setURI(Q).setData(T).setHandler(N).send()}var l=function(Q){var O=Q.getElementsByTagName("a");for(var P=0;P<O.length;P++){if(!O[P].getAttribute("flash")){addEventBase(O[P],"click",event_kill)}}var N=Q.getElementsByTagName("form");for(var P=0;P<N.length;P++){N[P].onsubmit=function(){return false}}};return{friendSelector:c,Contexts:K,attachCurlFromObject:a,attachFromPreview:p,clickRewriteAjax:D,clickToShow:L,clickToShowDialog:h,clickToHide:g,clickToEnable:F,clickToDisable:t,clickToToggle:v,closeDialogInvoked:o,confirmFeed:s,sendFeed:x,sendRequest:H,removeReqRecipient:z,confirmMultiFeed:E,confirmProfileBox:f,cancelDialog:m,sendMultiFeed:C,removeFeedRecipient:n,addHiddenInputs:u,mimlLogin:I,cancelLogin:w,requireLogin:e,createProfileBox:k,stripLinks:l}})();function mijs_sandbox(a){if(mijs_sandbox.instances["a"+a]){return mijs_sandbox.instances["a"+a]}this.appid=a;this.pending_bootstraps=[];this.bootstrapped=false;mijs_sandbox.instances["a"+a]=this}mijs_sandbox.instances={};mijs_sandbox.prototype.bootstrap=function(){if(!this.bootstrapped){var appid=this.appid;var code=["a",appid,"_Math = new mijs_math();","a",appid,"_Date = mijs_date();","a",appid,"_String = new mijs_string();","a",appid,"_RegExp = new mijs_regexp();","a",appid,"_Ajax = mijs_ajax(",appid,");","a",appid,"_Dialog = mijs_dialog(",appid,");","a",appid,"_139 = new mijs_139(",appid,");","a",appid,"_Animation = new mijs_animation();","a",appid,"_document = new mijs_main(",appid,");","a",appid,"_undefined = undefined;","a",appid,"_console = new mijs_console();","a",appid,"_setTimeout = mijs_sandbox.set_timeout;","a",appid,"_setInterval = mijs_sandbox.set_interval;","a",appid,"_escape = escapeURI;","a",appid,"_unescape = unescape;"];for(var i in {clearTimeout:1,clearInterval:1,parseFloat:1,parseInt:1,isNaN:1,isFinite:1}){code=code.concat(["a",appid,"_",i,"=",i,";"])}eval(code.join(""))}for(var i=0,il=this.pending_bootstraps.length;i<il;i++){eval_global(this.pending_bootstraps[i])}this.pending_bootstraps=[];this.bootstrapped=true};function ref(a){if(a==window){return null}else{if(a.ownerDocument==document){mijs_console.error("ref called with a DOM object!");return mijs_dom.get_instance(a)}else{return a}}}function idx(a){return(a instanceof Object||mijs_blacklist_props[a])?"__unknown__":a}var mijs_blacklist_props={caller:true};function arg(a){var c=[];for(var b=0;b<a.length;b++){c.push(a[b])}return c}mijs_sandbox.safe_string=function(a){if(ua.safari()){delete String.prototype.replace;delete String.prototype.toLowerCase}return a+""};mijs_sandbox.set_timeout=function(b,a){if(typeof b!="function"){mijs_console.error("setTimeout may not be used with a string. Please enclose your event in an anonymous function.")}else{return setTimeout(b,a)}};mijs_sandbox.set_interval=function(b,a){if(typeof b!="function"){mijs_console.error("setInterval may not be used with a string. Please enclose your event in an anonymous function.")}else{return setInterval(b,a)}};function mijs_main(a){mijs_private.get(this).appid=a}mijs_main.allowed_elements={a:true,abbr:true,acronym:true,address:true,b:true,br:true,bdo:true,big:true,blockquote:true,caption:true,center:true,cite:true,code:true,del:true,dfn:true,div:true,dl:true,dd:true,dt:true,em:true,fieldset:true,font:true,form:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,hr:true,i:true,img:true,input:true,ins:true,iframe:true,kbd:true,label:true,legend:true,li:true,ol:true,option:true,optgroup:true,p:true,pre:true,q:true,s:true,samp:true,select:true,small:true,span:true,strike:true,strong:true,sub:true,sup:true,table:true,textarea:true,tbody:true,td:true,tfoot:true,th:true,thead:true,tr:true,tt:true,u:true,ul:true};mijs_main.allowed_editable={embed:true,object:true};mijs_main.allowed_events={focus:true,click:true,mousedown:true,mouseup:true,dblclick:true,change:true,reset:true,select:true,submit:true,keydown:true,keypress:true,keyup:true,blur:true,load:true,mouseover:true,mouseout:true,mousemove:true,selectstart:true};mijs_main.prototype.getElementById=function(b){var a=mijs_private.get(this).appid;return mijs_dom.get_instance(document.getElementById("app"+a+"_"+b),a)};mijs_main.prototype.getRootElement=function(){var a=mijs_private.get(this).appid;return mijs_dom.get_instance(document.getElementById("app_content_"+a).firstChild,a)};mijs_main.prototype.createElement=function(a){var b=mijs_sandbox.safe_string(a.toLowerCase());if(mijs_main.allowed_elements[b]){return mijs_dom.get_instance(document.createElement(b),mijs_private.get(this).appid)}else{switch(b){case"mi:swf":return new mijs_miml_dom("mi:swf",mijs_private.get(this).appid);break;default:mijs_console.error(b+" is not an allowed DOM element");break}}};mijs_main.prototype.setLocation=function(a){a=mijs_sandbox.safe_string(a);if(mijs_dom.href_regex.test(a)){document.location.href=a;return this}else{mijs_console.error(a+" is not a valid location")}};function mijs_139(b){var a=mijs_private.get(this);a.sandbox=mijs_sandbox.instances["a"+b]}mijs_139.prototype.getUser=function(){var a=mijs_private.get(this);if(a.sandbox.data.loggedin){return a.sandbox.data.user}else{return null}};mijs_139.prototype.isApplicationAdded=function(){return mijs_private.get(this).sandbox.data.installed};mijs_139.prototype.isLoggedIn=function(){return mijs_private.get(this).sandbox.data.loggedin};mijs_139.prototype.urchinTracker=function(a){if(urchinTracker){urchinTracker(a)}else{mijs_console.error("There is no mi:google-analytics tag on this page!")}};function mijs_dom(c,a){this.__instance=mijs_dom.len;try{c.mijs_instance=mijs_dom.len}catch(b){}mijs_dom[mijs_dom.len]={instance:this,obj:c,events:{},appid:a};mijs_dom.len++}mijs_dom.len=0;mijs_dom.attr_setters={href:"setHref",id:"setId",dir:"setDir",checked:"setChecked",action:"setAction",value:"setValue",target:"setTarget",src:"setSrc","class":"setClassName",dir:"setDir",title:"setTitle",tabIndex:"setTabIndex",name:"setName",cols:"setCols",rows:"setRows",accessKey:"setAccessKey",disabled:"setDisabled",readOnly:"setReadOnly",type:"setType",selectedIndex:"setSelectedIndex",selected:"setSelected"};mijs_dom.factory=function(b,a){if(!b.tagName||((!mijs_main.allowed_elements[b.tagName.toLowerCase()]&&!mijs_main.allowed_editable[b.tagName.toLowerCase()])||has_css_class_name(b,"__miml_tag")||(b.tagName=="INPUT"&&(b.name.substring(0,2)=="mi"||b.name=="post_form_id"))||b.getAttribute("mi_protected")=="true")){return null}else{return new this(b,a)}};mijs_dom.get_data=function(a){if(a.__instance instanceof Object){return null}else{var b=mijs_dom[a.__instance];return b.instance==a?b:null}};mijs_dom.get_obj=function(a){if(a instanceof mijs_miml_dom){return mijs_miml_dom.get_obj(a)}else{if(typeof a.__instance=="number"){var b=mijs_dom[a.__instance];if(b&&b.instance==a){return b.obj}else{throw ("This DOM node is no longer valid.")}}else{throw ("This DOM node is no longer valid.")}}};mijs_dom.render=function(a){if(a instanceof mijs_miml_dom){mijs_miml_dom.render(a)}};mijs_dom.get_instance=function(b,a){if(!b){return null}if(typeof b.mijs_instance=="undefined"){return mijs_dom.factory(b,a)}else{return mijs_dom[b.mijs_instance].instance}};mijs_dom.get_instance_list=function(c,b){var e=[];for(var a=0;a<c.length;a++){var d=mijs_dom.get_instance(c[a],b);if(d){e.push(d)}}return e};mijs_dom.get_first_valid_instance=function(d,b,c){var a=null;if(d&&((d.id&&d.id.indexOf("app_content")!=-1)||(d.tagName&&d.tagName.toLowerCase()=="body"))){return null}while(d&&(!(a=mijs_dom.factory(d,c)))){if((d.id&&d.id.indexOf("app_content")!=-1)||(d.tagName&&d.tagName.toLowerCase()=="body")){return null}d=d[b]}return a};mijs_dom.clear_instances=function(c,a){if(a&&c.mijs_instance){delete mijs_dom[c.mijs_instance].obj;delete mijs_dom[c.mijs_instance].events;delete mijs_dom[c.mijs_instance].instance;delete mijs_dom[c.mijs_instance];c.mijs_instance=undefined}var d=c.childNodes;for(var b=0;b<d.length;b++){mijs_dom.clear_instances(d[b],true)}};mijs_dom.prototype.appendChild=function(a){mijs_dom.get_obj(this).appendChild(mijs_dom.get_obj(a));mijs_dom.render(a);return a};mijs_dom.prototype.insertBefore=function(b,a){if(a){mijs_dom.get_obj(this).insertBefore(mijs_dom.get_obj(b),mijs_dom.get_obj(a))}else{mijs_dom.get_obj(this).appendChild(mijs_dom.get_obj(b))}mijs_dom.render(b);return b};mijs_dom.prototype.removeChild=function(a){var a=mijs_dom.get_obj(a);mijs_dom.clear_instances(a,true);mijs_dom.get_obj(this).removeChild(a);return this};mijs_dom.prototype.replaceChild=function(b,a){mijs_dom.clear_instances(a,true);mijs_dom.get_obj(this).replaceChild(mijs_dom.get_obj(b),mijs_dom.get_obj(a));return this};mijs_dom.prototype.cloneNode=function(a){var b=mijs_dom.get_data(this);return mijs_dom.get_instance(b.obj.cloneNode(a),b.appid)};mijs_dom.prototype.getParentNode=function(){var a=mijs_dom.get_data(this);return mijs_dom.get_first_valid_instance(a.obj.parentNode,"parentNode",a.appid)};mijs_dom.prototype.getNextSibling=function(){var a=mijs_dom.get_data(this);return mijs_dom.get_first_valid_instance(a.obj.nextSibling,"nextSibling",a.appid)};mijs_dom.prototype.getPreviousSibling=function(){var a=mijs_dom.get_data(this);return mijs_dom.get_first_valid_instance(a.obj.previousSibling,"previousSibling",a.appid)};mijs_dom.prototype.getFirstChild=function(){var a=mijs_dom.get_data(this);return mijs_dom.get_first_valid_instance(a.obj.firstChild,"nextSibling",a.appid)};mijs_dom.prototype.getLastChild=function(){var a=mijs_dom.get_data(this);return mijs_dom.get_first_valid_instance(a.obj.lastChild,"previousSibling",a.appid)};mijs_dom.prototype.getChildNodes=function(){var a=mijs_dom.get_data(this);return mijs_dom.get_instance_list(a.obj.childNodes,a.appid)};mijs_dom.prototype.getElementsByTagName=function(a){var b=mijs_dom.get_data(this);return mijs_dom.get_instance_list(b.obj.getElementsByTagName(a),b.appid)};mijs_dom.prototype.getOptions=function(){var a=mijs_dom.get_data(this);return mijs_dom.get_instance_list(a.obj.options,a.appid)};mijs_dom.prototype.getForm=function(){var a=mijs_dom.get_data(this);return mijs_dom.get_instance(a.obj.form,a.appid)};mijs_dom.prototype.serialize=function(){var a=mijs_dom.get_data(this).obj.elements;var f={};for(var e=a.length-1;e>=0;e--){if(a[e].name&&a[e].name.substring(0,2)!="mi"&&a[e].name!="post_form_id"&&!a[e].disabled){if(a[e].tagName=="SELECT"){var c=a[e].multiple?a[e].name+"[]":a[e].name;for(var b=0,d=a[e].options.length;b<d;b++){if(a[e].options[b].selected){serialize_form_helper(f,c,(a[e].options[b].getAttribute("value")==null)?undefined:a[e].options[b].value)}}}else{if(!(a[e].type=="radio"||a[e].type=="checkbox")||a[e].checked||(!a[e].type||a[e].type=="text"||a[e].type=="password"||a[e].type=="hidden"||a[e].tagName=="TEXTAREA")){serialize_form_helper(f,a[e].name,a[e].value)}}}}return f};mijs_dom.prototype.setInnerXHTML=function(b){var d=mijs_dom.get_data(this);var c=new mijs_miml_sanitize(d.appid);var a=c.parseMIML(b);if(!a){return this}var e=mijs_dom.get_obj(this);switch(e.tagName){case"TEXTAREA":mijs_console.error("setInnerXHTML is not supported on textareas. Please use .value instead.");break;case"COL":case"COLGROUP":case"TABLE":case"TBODY":case"TFOOT":case"THEAD":case"TR":mijs_console.error("setInnerXHTML is not supported on this node.");break;default:mijs_dom.clear_instances(e,false);e.innerHTML="";this.appendChild(a);break}return this};mijs_dom.prototype.setInnerMIML=function(b){var a=mijs_private.get(b).htmlstring;var c=mijs_dom.get_obj(this);switch(c.tagName){case"TEXTAREA":mijs_console.error("setInnerMIML is not supported on textareas. Please use .value instead.");break;case"COL":case"COLGROUP":case"TABLE":case"TBODY":case"TFOOT":case"THEAD":case"TR":mijs_console.error("setInnerMIML is not supported on this node.");break;default:set_inner_html(c,a);break}return this};mijs_dom.prototype.setTextValue=function(b){var a=mijs_dom.get_obj(this);mijs_dom.clear_instances(a,false);a.innerHTML=htmlspecialchars(mijs_sandbox.safe_string(b));return this};mijs_dom.prototype.setValue=function(a){mijs_dom.get_obj(this).value=a;return this};mijs_dom.prototype.getValue=function(){var b=mijs_dom.get_obj(this);if(b.tagName=="SELECT"){var a=b.selectedIndex;if(a==-1){return null}else{if(b.options[a].getAttribute("value")==null){return undefined}else{return b.value}}}else{return mijs_dom.get_obj(this).value}};mijs_dom.prototype.getSelectedIndex=function(){return mijs_dom.get_obj(this).selectedIndex};mijs_dom.prototype.setSelectedIndex=function(a){mijs_dom.get_obj(this).selectedIndex=a;return this};mijs_dom.prototype.getChecked=function(){return mijs_dom.get_obj(this).checked};mijs_dom.prototype.setChecked=function(a){mijs_dom.get_obj(this).checked=a;return this};mijs_dom.prototype.getSelected=function(){return mijs_dom.get_obj(this).selected};mijs_dom.prototype.setSelected=function(a){mijs_dom.get_obj(this).selected=a;return this};mijs_dom.set_style=function(d,b,c){if(typeof b=="string"){if(b=="opacity"){set_opacity(d,parseFloat(c,10))}else{c=mijs_sandbox.safe_string(c);if(mijs_dom.css_regex.test(c)){d.style[b]=c}else{mijs_console.error(b+": "+c+" is not a valid CSS style")}}}else{for(var a in b){mijs_dom.set_style(d,a,b[a])}}};mijs_dom.css_regex=/^(?:[\w\-#%+]+|rgb\(\d+ *, *\d+, *\d+\)|url\('?http[^ ]+?'?\)| +)*$/i;mijs_dom.prototype.setStyle=function(a,b){mijs_dom.set_style(mijs_dom.get_obj(this),a,b);return this};mijs_dom.prototype.getStyle=function(a){return mijs_dom.get_obj(this).style[idx(a)]};mijs_dom.prototype.setHref=function(a){a=mijs_sandbox.safe_string(a);if(mijs_dom.href_regex.test(a)){mijs_dom.get_obj(this).href=a;return this}else{mijs_console.error(a+" is not a valid hyperlink")}};mijs_dom.href_regex=/^(?:https?|mailto|ftp|aim|irc|itms|gopher|\/|#)/;mijs_dom.prototype.getHref=function(){return mijs_dom.get_obj(this).href};mijs_dom.prototype.setAction=function(b){b=mijs_sandbox.safe_string(b);if(mijs_dom.href_regex.test(b)){mijs_dom.get_obj(this).action=b;return this}else{mijs_console.error(b+" is not a valid hyperlink")}};mijs_dom.prototype.getAction=function(){return mijs_dom.get_obj(this).action};mijs_dom.prototype.setMethod=function(a){a=mijs_sandbox.safe_string(a);mijs_dom.get_obj(this).method=a.toLowerCase()=="get"?"get":"post";return this};mijs_dom.prototype.getMethod=function(){return mijs_dom.get_obj(this).method};mijs_dom.prototype.setSrc=function(a){a=mijs_sandbox.safe_string(a);if(mijs_dom.href_regex.test(a)){mijs_dom.get_obj(this).src=a;return this}else{mijs_console.error(a+" is not a valid hyperlink")}};mijs_dom.prototype.getSrc=function(){return mijs_dom.get_obj(this).src};mijs_dom.prototype.setTarget=function(a){mijs_dom.get_obj(this).target=a;return this};mijs_dom.prototype.getTarget=function(){return mijs_dom.get_obj(this).target};mijs_dom.prototype.setClassName=function(a){mijs_dom.get_obj(this).className=a;return this};mijs_dom.prototype.getClassName=function(){return mijs_dom.get_obj(this).className};mijs_dom.prototype.hasClassName=function(a){return has_css_class_name(mijs_dom.get_obj(this),a)};mijs_dom.prototype.addClassName=function(a){add_css_class_name(mijs_dom.get_obj(this),a);return this};mijs_dom.prototype.removeClassName=function(a){remove_css_class_name(mijs_dom.get_obj(this),a);return this};mijs_dom.prototype.toggleClassName=function(a){this.hasClassName(a)?this.removeClassName(a):this.addClassName(a);return this};mijs_dom.prototype.getTagName=function(){return mijs_dom.get_obj(this).tagName};mijs_dom.prototype.getNodeType=function(){return mijs_dom.get_obj(this).nodeType};mijs_dom.prototype.getId=function(){var a=mijs_dom.get_obj(this).id;if(a){return a.replace(/^app\d+_/,"")}else{return a}};mijs_dom.prototype.setId=function(b){var a=mijs_dom.get_data(this);a.obj.id=["app",a.appid,"_",b].join("");return this};mijs_dom.prototype.setDir=function(a){mijs_dom.get_obj(this).dir=a;return this};mijs_dom.prototype.getdir=function(a){return mijs_dom.get_obj(this).dir};mijs_dom.prototype.getClientWidth=function(){return mijs_dom.get_obj(this).clientWidth};mijs_dom.prototype.getClientHeight=function(){return mijs_dom.get_obj(this).clientHeight};mijs_dom.prototype.getOffsetWidth=function(){return mijs_dom.get_obj(this).offsetWidth};mijs_dom.prototype.getOffsetHeight=function(){return mijs_dom.get_obj(this).offsetHeight};mijs_dom.prototype.getAbsoluteLeft=function(){return elementX(mijs_dom.get_obj(this))};mijs_dom.prototype.getAbsoluteTop=function(){return elementY(mijs_dom.get_obj(this))};mijs_dom.prototype.getScrollHeight=function(){return mijs_dom.get_obj(this).scrollHeight};mijs_dom.prototype.getScrollWidth=function(a){return mijs_dom.get_obj(this).scrollWidth};mijs_dom.prototype.getScrollTop=function(){return mijs_dom.get_obj(this).scrollTop};mijs_dom.prototype.setScrollTop=function(a){mijs_dom.get_obj(this).scrollTop=a;return this};mijs_dom.prototype.getScrollLeft=function(){return mijs_dom.get_obj(this).scrollLeft};mijs_dom.prototype.setScrollLeft=function(a){mijs_dom.get_obj(this).scrollLeft=a;return this};mijs_dom.prototype.getTabIndex=function(){return mijs_dom.get_obj(this).tabIndex};mijs_dom.prototype.setTabIndex=function(a){mijs_dom.get_obj(this).tabIndex=a;return this};mijs_dom.prototype.getTitle=function(){return mijs_dom.get_obj(this).title};mijs_dom.prototype.setTitle=function(a){mijs_dom.get_obj(this).title=a;return this};mijs_dom.prototype.getRowSpan=function(){return mijs_dom.get_obj(this).rowSpan};mijs_dom.prototype.setRowSpan=function(a){mijs_dom.get_obj(this).rowSpan=a;return this};mijs_dom.prototype.getColSpan=function(){return mijs_dom.get_obj(this).colSpan};mijs_dom.prototype.setColSpan=function(a){mijs_dom.get_obj(this).colSpan=a;return this};mijs_dom.prototype.getName=function(){return mijs_dom.get_obj(this).name};mijs_dom.prototype.setName=function(a){mijs_dom.get_obj(this).name=a;return this};mijs_dom.prototype.getCols=function(){return mijs_dom.get_obj(this).cols};mijs_dom.prototype.setCols=function(a){mijs_dom.get_obj(this).cols=a;return this};mijs_dom.prototype.getRows=function(){return mijs_dom.get_obj(this).rows};mijs_dom.prototype.setRows=function(a){mijs_dom.get_obj(this).rows=a;return this};mijs_dom.prototype.getAccessKey=function(){return mijs_dom.get_obj(this).accessKey};mijs_dom.prototype.setAccessKey=function(a){mijs_dom.get_obj(this).accessKey=a;return this};mijs_dom.prototype.setDisabled=function(a){mijs_dom.get_obj(this).disabled=a;return this};mijs_dom.prototype.getDisabled=function(){return mijs_dom.get_obj(this).disabled};mijs_dom.prototype.setMaxLength=function(a){mijs_dom.get_obj(this).maxLength=a;return this};mijs_dom.prototype.getMaxLength=function(){return mijs_dom.get_obj(this).maxLength};mijs_dom.prototype.setReadOnly=function(a){mijs_dom.get_obj(this).readOnly=a;return this};mijs_dom.prototype.getReadOnly=function(){return mijs_dom.get_obj(this).readOnly};mijs_dom.prototype.setType=function(a){a=mijs_sandbox.safe_string(a);mijs_dom.get_obj(this).type=a;return this};mijs_dom.prototype.getType=function(){return mijs_dom.get_obj(this).type};mijs_dom.prototype.getSelection=function(){var a=mijs_dom.get_obj(this);return get_caret_position(a)};mijs_dom.prototype.setSelection=function(c,a){var b=mijs_dom.get_obj(this);set_caret_position(b,c,a);return this};mijs_dom.prototype.submit=function(){mijs_dom.get_obj(this).submit();return this};mijs_dom.prototype.focus=function(){mijs_dom.get_obj(this).focus();return this};mijs_dom.prototype.select=function(){mijs_dom.get_obj(this).select();return this};mijs_dom.eventHandler=function(b){var c=(b instanceof mijs_event)?b:new mijs_event(b?b:window.event,this[2]);if(c.ignore){return}var a=this[1].call(this[0],c);if(a===false){c.preventDefault()}return mijs_event.destroy(c)};mijs_dom.prototype.addEventListener=function(b,c){b=mijs_sandbox.safe_string(b.toLowerCase());if(!mijs_main.allowed_events[b]){mijs_console.error(b+" is not an allowed event");return false}var d=mijs_dom.get_data(this);var e=d.obj;if(!d.events[b]){d.events[b]=[]}var a=null;if(e.addEventListener){e.addEventListener(b,a=mijs_dom.eventHandler.bind([this,c,d.appid]),false)}else{if(e.attachEvent){e.attachEvent("on"+b,a=mijs_dom.eventHandler.bind([this,c,d.appid]))}}d.events[b].push({func:c,handler:a});return this};mijs_dom.prototype.removeEventListener=function(c,d){c=c.toLowerCase();var e=mijs_dom.get_data(this);var f=e.obj;if(e.events[c]){for(var b=0,a=e.events[c].length;b<a;b++){if(e.events[c][b].func==d){if(f.removeEventListener){f.removeEventListener(c,e.events[c][b].handler,false)}else{if(f.detachEvent){f.detachEvent("on"+c,e.events[c][b].handler)}}e.events[c].splice(b,1)}}}if(f["on"+c]==d){f["on"+c]=null}return this};mijs_dom.prototype.listEventListeners=function(d){d=d.toLowerCase();var e=mijs_dom.get_data(this);var b=[];if(e.events[d]){for(var c=0,a=e.events[d].length;c<a;c++){b.push(e.events[d].func)}}if(e.obj["on"+d]){b.push(e.obj["on"+d])}return b};mijs_dom.prototype.purgeEventListeners=function(c){c=c.toLowerCase();var d=mijs_dom.get_data(this);var e=d.obj;if(d.events[c]){for(var b=0,a=d.events[c].length;b<a;b++){if(e.removeEventListener){e.removeEventListener(c,d.events[c][b].handler,false)}else{if(e.detachEvent){e.detachEvent("on"+c,d.events[c][b].handler)}}}}if(e["on"+c]){e["on"+c]=null}return this};mijs_dom.prototype.callSWF=function(e){var d=mijs_dom.get_data(this).obj;var b=new Array(arguments.length-1);for(var c=1;c<arguments.length;c++){b[c-1]=arguments[c]}if(ua.ie()){var f=0;for(var c=0;c<d.childNodes.length;c++){if(d.childNodes[c].name=="mijs"){f=d.childNodes[c].getAttribute("value")}}var a=window.so_swf_mijs}else{var f=d.getAttribute("mijs");var a=document.so_swf_mijs}return a.callFlash(f,e,b)};function mijs_miml_dom(a,b){var c=mijs_private.get(this);c.type=a;c.appid=b}mijs_miml_dom.get_obj=function(a){var b=mijs_private.get(a);if(!b.obj){b.obj=document.createElement("div");b.obj.className="__miml_tag"}return b.obj};mijs_miml_dom.render=function(h){var e=mijs_private.get(h);if(e.rendered){return}if(!e.id){e.id="swf"+parseInt(Math.random()*999999)}switch(e.type){case"mi:swf":var f=new SWFObject(e.swf_src,e.id,e.width,e.height,"5.0.0",e.bg_color?e.bg_color:"000000");var g={loop:true,quality:true,scale:true,align:true,salign:true};for(d in g){if(e[d]){f.addParam(d,e[d])}}f.addParam("wmode","transparent");f.addParam("allowScriptAccess","never");if(e.flash_vars){for(var d in e.flash_vars){f.addVariable(d,e.flash_vars[d])}}var j=mijs_sandbox.instances["a"+e.appid];if(j.validation_vars){for(var d in j.validation_vars){f.addVariable(d,j.validation_vars[d])}}if(ge("mijs_bridge_id")){var b=_("mijs_bridge_id").value;f.addVariable("mi_local_connection","_"+b);var k="_swf"+parseInt(Math.random()*999999);f.addVariable("mi_mijs_connection",k);f.addParam("mijs",k)}if(e.wait_for_click){var c=document.createElement("img");c.src=e.img_src;if(e.width){c.width=e.width}if(e.height){c.height=e.height}if(e.img_style){mijs_dom.set_style(c,e.img_style)}if(e.img_class){c.className=e.img_class}var a=document.createElement("a");a.href="#";a.onclick=function(){f.write(e.obj);return false};a.appendChild(c);e.obj.appendChild(a)}else{f.write(e.obj)}break}};mijs_miml_dom.prototype.setId=function(b){var a=mijs_private.get(this);a.id=["app",a.appid,"_",b].join("");return this};mijs_miml_dom.prototype.setSWFSrc=function(a){var b=mijs_private.get(this);a=mijs_sandbox.safe_string(a);if(mijs_dom.href_regex.test(a)){b.swf_src=a}else{mijs_console.error(a+" is not a valid swf")}};mijs_miml_dom.prototype.setImgSrc=function(a){var b=mijs_private.get(this);a=mijs_sandbox.safe_string(a);if(mijs_dom.href_regex.test(a)){b.img_src=a}else{mijs_console.error(a+" is not a valid src")}return this};mijs_miml_dom.prototype.setWidth=function(a){var b=mijs_private.get(this);b.width=(/\d+%?/.exec(a)||[]).pop();return this};mijs_miml_dom.prototype.setHeight=function(b){var a=mijs_private.get(this);a.height=(/\d+%?/.exec(b)||[]).pop();return this};mijs_miml_dom.prototype.setImgStyle=function(c,e){var d=mijs_private.get(this);var a=d.img_style?d.img_style:d.img_style={};if(typeof c=="string"){a[c]=e}else{for(var b in c){this.setImgStyle(b,c[b])}}return this};mijs_miml_dom.prototype.setImgClass=function(a){var b=mijs_private.get(this);b.img_class=a;return this};mijs_miml_dom.prototype.setFlashVar=function(b,d){var c=mijs_private.get(this);var a=c.flash_vars?c.flash_vars:c.flash_vars={};a[b]=d;return this};mijs_miml_dom.prototype.setSWFBGColor=function(a){var b=mijs_private.get(this);if(mijs_dom.css_regex.text(a)){b.bg_color=a}else{mijs_console.error(a+" is not a valid background color.")}return this};mijs_miml_dom.prototype.setWaitForClick=function(b){var a=mijs_private.get(this);a.wait_for_click=b;return this};mijs_miml_dom.prototype.setLoop=function(b){var a=mijs_private.get(this);a.loop=b;return this};mijs_miml_dom.prototype.setQuality=function(b){var a=mijs_private.get(this);a.quality=b;return this};mijs_miml_dom.prototype.setScale=function(b){var a=mijs_private.get(this);a.scale=b;return this};mijs_miml_dom.prototype.setAlign=function(b){var a=mijs_private.get(this);a.align=b;return this};mijs_miml_dom.prototype.setSAlign=function(b){var a=mijs_private.get(this);a.salign=b;return this};function mijs_event(d,c){if(!mijs_event.hacks){mijs_event.hacks=true;mijs_event.should_check_double_arrows=ua.safari()&&(ua.safari()<500);mijs_event.arrow_toggle={}}for(var b in mijs_event.allowed_properties){this[b]=d[b]}var f=null;if(d.target){f=d.target}else{if(d.srcElement){f=d.srcElement}}if(f&&f.nodeType==3){f=f.parentNode}this.target=mijs_dom.get_instance(f,c);var a=0;var e=0;if(d.pageX||d.pageY){a=d.pageX;e=d.pageY}else{if(d.clientX||d.clientY){a=d.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;e=d.clientY+document.body.scrollTop+document.documentElement.scrollTop}}this.pageX=a;this.pageY=e;if(mijs_event.should_check_double_arrows&&this.keyCode>=37&&this.keyCode<=40){mijs_event.arrow_toggle[this.type]=!mijs_event.arrow_toggle[this.type];if(mijs_event.arrow_toggle[this.type]){this.ignore=true}}mijs_private.get(this).event=d}mijs_event.allowed_properties={type:true,ctrlKey:true,keyCode:true,metaKey:true,shiftKey:true};mijs_event.prototype.preventDefault=function(){var a=mijs_private.get(this);if(!a.prevented&&a.event.preventDefault){a.event.preventDefault();a.prevented=true}a.return_value=false};mijs_event.prototype.stopPropagation=function(){var a=mijs_private.get(this).event;if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}};mijs_event.destroy=function(b){var a=mijs_private.get(b).return_value;mijs_private.remove(b);delete b.target;return a==undefined?true:a};function mijs_math(){}mijs_math.prototype.abs=Math.abs;mijs_math.prototype.acos=Math.acos;mijs_math.prototype.asin=Math.asin;mijs_math.prototype.atan=Math.atan;mijs_math.prototype.atan2=Math.atan2;mijs_math.prototype.ceil=Math.ceil;mijs_math.prototype.cos=Math.cos;mijs_math.prototype.exp=Math.exp;mijs_math.prototype.floor=Math.floor;mijs_math.prototype.log=Math.log;mijs_math.prototype.max=Math.max;mijs_math.prototype.min=Math.min;mijs_math.prototype.pow=Math.pow;mijs_math.prototype.random=Math.random;mijs_math.prototype.round=Math.round;mijs_math.prototype.sin=Math.sin;mijs_math.prototype.sqrt=Math.sqrt;mijs_math.prototype.tan=Math.tan;mijs_math.prototype.valueOf=Math.valueOf;mijs_math.prototype.E=Math.E;mijs_math.prototype.LN2=Math.LN2;mijs_math.prototype.LN10=Math.LN10;mijs_math.prototype.LOG2E=Math.LOG2E;mijs_math.prototype.PI=Math.PI;mijs_math.prototype.SQRT1_2=Math.SQRT1_2;mijs_math.prototype.SQRT2=Math.SQRT2;function mijs_string(){}mijs_string.prototype.fromCharCode=String.fromCharCode;function mijs_date(){var a=function(){var b=new Date();if(arguments.length){b.setFullYear.apply(b,arguments)}return b};a.parse=Date.parse;return a}function mijs_regexp(){var a=function(){var b=arguments.length?new RegExp(arguments[0],arguments[1]):new RegExp();return b};return a}function mijs_console(){}mijs_console.error=function(a){if(typeof console!="undefined"&&console.error){console.error(a)}};mijs_console.render=function(c){if(c&&typeof c.__priv!="undefined"){var e={};for(var b in c){e[b]=c[b]}delete e.__priv;delete e.__private;for(var b in e){e[b]=mijs_console.render(e[b])}var a=mijs_private.get(c);for(var b in a){e["PRIV_"+b]=a[b]}if(c.__private){var a=mijs_private.get(c.__private);for(var b in a){e["PRIV_"+b]=a[b]}}return e}else{if(c&&typeof c.__instance!="undefined"&&c.setInnerMIML){var e={};for(var b in c){e[b]=c[b]}delete e.__instance;e.PRIV_obj=mijs_dom.get_obj(c);return e}else{if(c&&typeof c=="object"&&c.ownerDocument!=document){var e=c instanceof Array?[]:{};var d=false;for(var b in c){c instanceof Array?e.push(mijs_console.render(c[b])):e[b]=mijs_console.render(c[b]);if(e[b]!=c[b]){d=true}}return d?e:c}else{return c}}}};mijs_console.render_args=function(a){var c=[];for(var b=0;b<a.length;b++){c[b]=mijs_console.render(a[b])}return c};if(typeof console!="undefined"){for(var i in console){mijs_console.prototype[i]=console[i]}}mijs_console.prototype.debug=function(){if(typeof console!="undefined"&&console.debug){console.debug.apply(console,mijs_console.render_args(arguments))}};mijs_console.prototype.log=function(){if(typeof console!="undefined"&&console.log){console.log.apply(console,mijs_console.render_args(arguments))}};mijs_console.prototype.warn=function(){if(typeof console!="undefined"&&console.warn){console.warn.apply(console,mijs_console.render_args(arguments))}};mijs_console.prototype.error=function(){if(typeof console!="undefined"&&console.error){console.error.apply(console,mijs_console.render_args(arguments))}};mijs_console.prototype.assert=function(){if(typeof console!="undefined"&&console.assert){console.assert.apply(console,mijs_console.render_args(arguments))}};mijs_console.prototype.dir=function(){if(typeof console!="undefined"&&console.dir){console.dir.apply(console,mijs_console.render_args(arguments))}};mijs_console.prototype.group=function(){if(typeof console!="undefined"&&console.group){console.group.apply(console,mijs_console.render_args(arguments))}};mijs_console.prototype.dirxml=function(a){if(typeof console!="undefined"&&console.dirxml){if(a.get_obj){console.dirxml(a.get_obj(a))}else{console.dirxml(a)}}};function mijs_ajax(d){var c=function(){};for(var b in mijs_ajax.prototype){c.prototype[b]=mijs_ajax.prototype[b]}var a=mijs_private.get(c.prototype.__private={});a.appid=d;a.sandbox=mijs_sandbox.instances["a"+d];c.JSON=mijs_ajax.JSON;c.MIML=mijs_ajax.MIML;c.RAW=mijs_ajax.RAW;return c}mijs_ajax.proxy_url="/miml/mijs_ajax_proxy.php";mijs_ajax.RAW=0;mijs_ajax.JSON=1;mijs_ajax.MIML=2;mijs_ajax.STATUS_WAITING_FOR_USER=1;mijs_ajax.STATUS_WAITING_FOR_SERVER=2;mijs_ajax.STATUS_IDLE=0;mijs_ajax.prototype.responseType=0;mijs_ajax.prototype.useLocalProxy=false;mijs_ajax.prototype.requireLogin=false;mijs_ajax.prototype.status=mijs_ajax.STATUS_IDLE;mijs_ajax.tokencount=0;mijs_ajax.tokens=new Object();mijs_ajax.new_xml_http=function(){try{return new XMLHttpRequest()}catch(a){try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){return null}}}};mijs_ajax.get_transport=function(a,c){var b=mijs_private.get(a);if(b.xml&&!c){return b.xml}else{b.xml=mijs_ajax.new_xml_http();b.xml.onreadystatechange=mijs_ajax.onreadystatechange.bind([a,b.xml]);return b.xml}};mijs_ajax.prototype.abort=function(){var a=mijs_ajax.get_transport(this,true);if(a.abort){a.abort()}mijs_private.get(this).inflight=false};mijs_ajax.flash_success=function(b,a){mijs_ajax.tokens[a].success(b)};mijs_ajax.flash_fail=function(a){mijs_ajax.tokens[a].fail()};mijs_ajax.prototype.post=function(d,g){var c=mijs_private.get(this.__private);var f=c.appid;var h=ge("post_form_id");if(!c.sandbox.data.loggedin&&this.requireLogin){this.status=mijs_ajax.STATUS_WAITING_FOR_USER;MIML.requireLogin(f,function(){this.status=mijs_ajax.STATUS_READY;c.sandbox.data.loggedin=true;this.post(d,g)}.bind(this),function(){if(this.onerror){this.onerror()}}.bind(this));return}if(this.useLocalProxy&&window.localProxy.callUrl&&this.responseType!=mijs_ajax.MIML){this.status=mijs_ajax.STATUS_WAITING_FOR_SERVER;mijs_ajax.tokencount++;mijs_ajax.tokens[mijs_ajax.tokencount]={success:function(j){this.status=mijs_ajax.STATUS_READY;this.ondone(j)}.bind(this),fail:function(j){this.status=mijs_ajax.STATUS_READY;if(this.onerror()){this.onerror()}}.bind(this)};var e=(this.responseType==mijs_ajax.JSON);var a=localProxy.callUrl(d+"?query="+g,e,"mijs_ajax.flash_success","mijs_ajax.flash_fail",mijs_ajax.tokencount);if(!a&&this.onerror){this.onerror()}return}else{var b=mijs_ajax.get_transport(this,true);if(b){this.status=mijs_ajax.STATUS_WAITING_FOR_SERVER;b.open("POST",mijs_ajax.proxy_url,true);b.setRequestHeader("Content-Type","application/x-www-form-urlencoded");b.send(URI.implodeQuery({url:d,query:g,type:this.responseType,require_login:this.requireLogin,mi_mockajax_context:mijs_sandbox.instances["a"+f].contextd,mi_mockajax_context_hash:mijs_sandbox.instances["a"+f].context,appid:f}));mijs_private.get(this).inflight=true}else{if(this.onerror){this.onerror()}else{mijs_console.error("There was an uncaught Ajax error. Please attach on onerror handler to properly handle failures.")}}}};mijs_ajax.make_mijs_recursive=function(b){for(var a in b){if(a.substring(0,5)=="miml_"){b[a]=new mijs_miml_string(b[a])}else{if(typeof b[a]=="object"){mijs_ajax.make_mijs_recursive(b[a])}}}};mijs_ajax.onreadystatechange=function(){var xml=this[1];try{if(xml.readyState==4){var text=xml.responseText;this[0].status=mijs_ajax.STATUS_READY;if(xml.status>=200&&xml.status<300&&text.length){var priv_data=mijs_private.get(this[0]);if(priv_data.inflight){priv_data.inflight=false}else{return}try{eval("var response = "+(text.substring(0,8)=="for(;;);"?text.substring(8):text))}catch(e){Util.error("MIJS AJAX eval failed! Response: "+text);var response={error:true}}if(response.error!==undefined){throw"foo"}else{if(this[0].ondone){try{if(response.type==mijs_ajax.RAW){this[0].ondone(response.data)}else{if(response.type==mijs_ajax.JSON){mijs_ajax.make_mijs_recursive(response.data);this[0].ondone(response.data)}else{if(response.type==mijs_ajax.MIML){this[0].ondone(new mijs_miml_string(response.data))}}}}catch(ignored){}}}}else{throw"foo"}}}catch(ignored){if(this[0].onerror){this[0].onerror()}else{mijs_console.error("There was an uncaught Ajax error. Please attach on onerror handler to properly handle failures.")}}};function mijs_dialog(c){var b=function(e){var d=mijs_private.get(this);switch(e){case mijs_dialog.DIALOG_CONTEXTUAL:d.dialog=new contextual_dialog("app_content_"+c);d.dialog.is_stackable=true;break;case mijs_dialog.DIALOG_POP:default:d.dialog=new pop_dialog("app_content_"+c);d.dialog.is_stackable=true;break}d.type=e;d.ready=false};for(var a in mijs_dialog.prototype){b.prototype[a]=mijs_dialog.prototype[a]}b.DIALOG_POP=mijs_dialog.DIALOG_POP;b.DIALOG_CONTEXTUAL=mijs_dialog.DIALOG_CONTEXTUAL;return b}mijs_dialog.DIALOG_POP=1;mijs_dialog.DIALOG_CONTEXTUAL=2;mijs_dialog.onconfirm=function(){var a=true;if(this.onconfirm){if(this.onconfirm()===false){a=false}}if(a){this.hide()}};mijs_dialog.oncancel=function(){var a=true;if(this.oncancel){if(this.oncancel()===false){a=false}}if(a){this.hide()}};mijs_dialog.build_dialog=function(){var a=mijs_private.get(this);if(!a.ready){a.dialog.build_dialog();a.ready=true}};mijs_dialog.prototype.setStyle=function(b,c){var a=mijs_private.get(this);mijs_dialog.build_dialog.call(this);var d=null;if(b=="width"||b=="height"){d=a.type==mijs_dialog.DIALOG_CONTEXTUAL?a.dialog.frame:a.dialog.frame.parentNode}else{d=a.dialog.content}mijs_dom.set_style(d,b,c);return ref(this)};mijs_dialog.prototype.showMessage=function(c,b,a){this.showChoice(c,b,a,false);return ref(this)};mijs_dialog.prototype.showChoice=function(e,d,c,b){var a=mijs_private.get(this).dialog;mijs_dialog.build_dialog.call(this);a.show_choice(mijs_miml_string.get(e),mijs_miml_string.get(d),!c?"Okay":mijs_miml_string.get(c),bind(this,mijs_dialog.onconfirm),b===undefined?"Cancel":(b?mijs_miml_string.get(b):false),bind(this,mijs_dialog.oncancel));a.content.id="app_content_"+gen_unique();return ref(this)};mijs_dialog.prototype.setContext=function(b){var a=mijs_private.get(this).dialog;var c=mijs_dom.get_obj(b);a.set_context(c);return ref(this)};mijs_dialog.prototype.hide=function(){var a=mijs_private.get(this).dialog;if(generic_dialog.dialog_stack&&generic_dialog.dialog_stack.length>1){a.hide()}else{a.fade_out(200)}return ref(this)};function mijs_animation(){var b=function(c){if(this==window){return new arguments.callee(mijs_dom.get_obj(c))}else{mijs_private.get(this).animation=new animation(c)}};for(var a in mijs_animation.prototype){b.prototype[a]=mijs_animation.prototype[a]}b.ease={begin:animation.ease.begin,end:animation.ease.end,both:animation.ease.both};return b}mijs_animation.prototype.stop=function(){mijs_private.get(this).animation.stop();return this};mijs_animation.prototype.to=function(a,b){mijs_private.get(this).animation.to(a,b);return this};mijs_animation.prototype.by=function(a,b){mijs_private.get(this).animation.by(a,b);return this};mijs_animation.prototype.from=function(a,b){mijs_private.get(this).animation.from(a,b);return this};mijs_animation.prototype.duration=function(a){mijs_private.get(this).animation.duration(a);return this};mijs_animation.prototype.checkpoint=function(a,b){mijs_private.get(this).animation.checkpoint(a,typeof b=="function"?bind(this,b):null);return this};mijs_animation.prototype.ondone=function(a){if(typeof a=="function"){mijs_private.get(this).animation.checkpoint(bind(this,a));return this}};mijs_animation.prototype.blind=function(){mijs_private.get(this).animation.blind();return this};mijs_animation.prototype.show=function(){mijs_private.get(this).animation.show();return this};mijs_animation.prototype.hide=function(){mijs_private.get(this).animation.hide();return this};mijs_animation.prototype.ease=function(a){mijs_private.get(this).animation.ease(a);return this};mijs_animation.prototype.go=function(){mijs_private.get(this).animation.go();return this};function mijs_miml_string(a){mijs_private.get(this).htmlstring=a}mijs_miml_string.get=function(a){if(a instanceof mijs_miml_string){return mijs_private.get(a).htmlstring}else{return htmlspecialchars(mijs_sandbox.safe_string(a))}};mijs_private=new Object();mijs_private.len=0;mijs_private.get=function(a){if(typeof a!="object"){return null}if(a.__priv==undefined){var b={data:{},instance:a};a.__priv=mijs_private.len;mijs_private.len++;b.instance=a;mijs_private[a.__priv]=b;return b.data}else{if(typeof a.__priv=="number"){var b=mijs_private[a.__priv];if(b.instance==a){return b.data}else{throw ("Invalid object supplied to mijs_private.get")}}else{throw ("Invalid object supplied to mijs_private.get")}}};mijs_private.remove=function(a){if(a.__priv!=undefined){if(mijs_private[a.__priv].instance==a){delete mijs_private[a.__priv];delete a.__priv}}};function mijs_miml_sanitize(appid){this.appid=appid;this.main=eval("a"+appid+"_document");return this}mijs_miml_sanitize.prototype.parseMIML=function(d){if(window.ActiveXObject){var c=new ActiveXObject("Microsoft.XMLDOM");c.async="false";c.loadXML(d);if(c.parseError.reason){mijs_console.error(c.parseError.reason);return null}}else{var b=new DOMParser();var c=b.parseFromString(d,"text/xml");if(c.documentElement.nodeName=="parsererror"){mijs_console.error(c.documentElement.textContent);return null}}var a=c.documentElement;return this.processElement(a)};mijs_miml_sanitize.prototype.processElement=function(d){if(d.nodeType==3){return new mijs_dom(document.createTextNode(d.nodeValue),this.appid)}else{if(d.nodeType!=1){return null}}var e=this.main.createElement(d.nodeName);if(!e){return null}for(var k=0;k<d.attributes.length;k++){var g=d.attributes[k];var h=g.nodeName;if(h=="style"){var b=g.nodeValue.split(";");for(var f=0;f<b.length;f++){if(b[f]!=""){var j=b[f].split(":");e.setStyle(j[0],j[1].replace(/^\s+|\s+$/g,""))}}}else{setter=mijs_dom.attr_setters[h];if(e[setter]){e[setter](g.nodeValue)}}}for(var k=0;k<d.childNodes.length;k++){var c=d.childNodes[k];var a=this.processElement(c);if(a){e.appendChild(a)}}return e};if(window.Bootloader){Bootloader.done(2)};window.onloadRegister=window.onloadRegister||function(a){window.onloadhooks.push(a)};window.onloadhooks=window.onloadhooks||[];window.wait_for_load=window.wait_for_load||function(a,c,b){b=bind(a,b,c);if(window.loading_begun){return b()}switch((c||event).type){case"load":onloadRegister(b);return;case"click":if(a.original_cursor===undefined){a.original_cursor=a.style.cursor}if(document.body.original_cursor===undefined){document.body.original_cursor=document.body.style.cursor}a.style.cursor=document.body.style.cursor="progress";onloadRegister(function(){a.style.cursor=a.original_cursor;document.body.style.cursor=document.body.original_cursor;a.original_cursor=document.body.original_cursor=undefined;if(a.tagName.toLowerCase()=="a"){var e=window.event;window.event=c;var d=a.onclick.call(a,c);window.event=e;if(d!==false&&a.href){window.location.href=a.href}}else{if(a.click){a.click()}}});break}return false};window.bind=window.bind||function(d,c){var a=[];for(var b=2;b<arguments.length;b++){a.push(arguments[b])}return function(){var g=d||this;var e=a.slice();for(var f=0;f<arguments.length;f++){e.push(arguments[f])}if(typeof(c)=="string"){if(g[c]){return g[c].apply(g,e)}}else{return c.apply(g,e)}}};if(!window.Bootloader){window.copy_properties=function(c,b){for(var a in b){c[a]=b[a]}if(b.hasOwnProperty&&b.hasOwnProperty("toString")&&(b.toString!==undefined)&&(c.toString!==b.toString)){c.toString=b.toString}return c};window.Bootloader={loadResource:function(e){var a=window.Bootloader;if(e.name){if(a._loaded[e.name]){return}a.markResourcesAsLoaded([e.name])}var f=a._getHardpoint();switch(e.type){case"js":++a._pending;case"js-ext":var c=document.createElement("script");c.src=e.src;c.type="text/javascript";f.appendChild(c);break;case"css":var d=document.createElement("link");d.rel="stylesheet";d.type="text/css";d.media="all";d.href=e.src;f.appendChild(d);break}},wait:function(c){var a=window.Bootloader;if(a._pending>0){a._wait.push(c)}else{if(a._pending<0&&window.Util){Util.error("Bootloader- there are supposedly "+a._pending+" resources pending.")}c()}},done:function(c){c=c||1;var a=window.Bootloader;if(!a._ready){return}a._pending-=c;if(a._pending<=0){if(a._pending<0&&window.Util){Util.error("Bootloader- there are supposedly "+a._pending+" resources pending.")}var e=a._wait;a._wait=[];for(var d=0;d<e.length;d++){e[d]()}}},markResourcesAsLoaded:function(d){var a=window.Bootloader;for(var c=0;c<d.length;c++){a._loaded[d[c]]=true}a._ready=true},_getHardpoint:function(){var a=window.Bootloader;if(!a._hardpoint){var d,c=document.getElementsByTagName("head");if(c.length){d=c[0]}else{d=document.body}a._hardpoint=d}return a._hardpoint},_loaded:{},_pending:0,_hardpoint:null,_wait:[],_ready:false}};var ua={ie:function(){return this._ie},firefox:function(){return this._firefox},opera:function(){return this._opera},safari:function(){return this._safari},windows:function(){return this._windows},osx:function(){return this._osx},populate:function(){var a=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera.(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))/.exec(navigator.userAgent);var b=/(Mac OS X;)|(Windows;)/.exec(navigator.userAgent);if(a){ua._ie=a[1]?parseFloat(a[1]):NaN;ua._firefox=a[2]?parseFloat(a[2]):NaN;ua._opera=a[3]?parseFloat(a[3]):NaN;ua._safari=a[4]?parseFloat(a[4]):NaN}else{ua._ie=ua._firefox=ua._opera=ua._safari=NaN}if(b){ua._osx=!!b[1];ua._windows=!!b[2]}else{ua._osx=ua._windows=false}}};function chain(b,a){var c=[];for(var d=0;d<arguments.length;d++){c.push(arguments[d])}return function(){for(var e=0;e<c.length;e++){if(c[e]&&c[e].apply(this,arguments)===false){return false}}return true}}function addEventBase(e,d,c,b){if(e.addEventListener){e.addEventListener(d,c,false)}else{if(e.attachEvent){var a=d+c+b;e["e"+a]=c;e[a]=function(){e["e"+a](window.event)};e.attachEvent("on"+d,e[a])}}return c}function removeEventBase(e,d,c,b){if(e.removeEventListener){e.removeEventListener(d,c,false)}else{if(e.detachEvent){var a=d+c+b;if(e[a]){e.detachEvent("on"+d,e[a]);e[a]=null;e["e"+a]=null}}}}function event_get(a){return a||window.event}function event_get_target(a){return(a=event_get(a))&&(a.target||a.srcElement)}function event_abort(a){(a=event_get(a))&&(a.cancelBubble=true)&&a.stopPropagation&&a.stopPropagation();return false}function event_prevent(a){(a=event_get(a))&&!(a.returnValue=false)&&a.preventDefault&&a.preventDefault();return false}function event_kill(a){return event_abort(a)||event_prevent(a)}function event_get_keypress_keycode(a){a=event_get(a);if(!a){return false}switch(a.keyCode){case 63232:return 38;case 63233:return 40;case 63234:return 37;case 63235:return 39;case 63272:case 63273:case 63275:return null;case 63276:return 33;case 63277:return 34}if(a.shiftKey){switch(a.keyCode){case 33:case 34:case 37:case 38:case 39:case 40:return null}}else{return a.keyCode}}function stopPropagation(a){if(!a){var a=window.event}a.cancelBubble=true;if(a.stopPropagation){a.stopPropagation()}};window.onloadRegister=function(a){window.loaded?_runHook(a):_addHook("onloadhooks",a)};function onafterloadRegister(a){window.loaded?_runHook(a):_addHook("onafterloadhooks",a)}function _include_quickling_events_default(){return window.loading_initial_content_div||window.loaded}function onbeforeunloadRegister(b,a){if(a===undefined){a=_include_quickling_events_default()}if(a){_addHook("onbeforeleavehooks",b)}else{_addHook("onbeforeunloadhooks",b)}}function onunloadRegister(b,a){if(a===undefined){a=_include_quickling_events_default()}if(a){_addHook("onleavehooks",b)}else{_addHook("onunloadhooks",b)}}function _onloadHook(){window.loading_begun=true;!window.loaded&&window.Env&&(Env.t_willonloadhooks=(new Date()).getTime());_runHooks("onloadhooks");!window.loaded&&window.Env&&(Env.t_doneonloadhooks=(new Date()).getTime());window.loaded=true}function _runHook(b){try{b()}catch(a){Util.error("Uncaught exception in hook (run after page load): %x",a)}}function _runHooks(a){var b=a=="onbeforeleavehooks"||a=="onbeforeunloadhooks";var f=null;do{var e=window[a];if(!b){window[a]=null}if(!e){break}for(var d=0;d<e.length;d++){try{if(b){f=f||e[d]()}else{e[d]()}}catch(c){Util.error("Uncaught exception in hook (%q) #%d: %x",a,d,c)}}if(b){break}}while(window[a]);if(b&&f){return f}}function _addHook(a,b){(window[a]?window[a]:(window[a]=[])).push(b)}function _bootstrapEventHandlers(){if(document.addEventListener){if(ua.safari()){var a=setInterval(function(){if(/loaded|complete/.test(document.readyState)){(window.Env&&(Env.t_domcontent=(new Date()).getTime()));_onloadHook();clearTimeout(a)}},3)}else{document.addEventListener("DOMContentLoaded",function(){(window.Env&&(Env.t_domcontent=(new Date()).getTime()));_onloadHook()},true)}}else{var b="javascript:void(0)";if(window.location.protocol=="https:"){b="//:"}document.write('<script onreadystatechange="if (this.readyState==\'complete\') {(window.Env&&(Env.t_domcontent=(new Date()).getTime()));this.parentNode.removeChild(this);_onloadHook();}" defer="defer" src="'+b+'"><\/script>')}window.onload=chain(window.onload,function(){(window.Env&&(Env.t_layout=(new Date()).getTime()));var c=document&&document.body&&document.body.offsetWidth;(window.Env&&(Env.t_onload=(new Date()).getTime()));_onloadHook();_runHooks("onafterloadhooks")});window.onbeforeunload=function(){var c=_runHooks("onbeforeleavehooks")||_runHooks("onbeforeunloadhooks");if(!c){window.loaded=false}return c};window.onunload=chain(window.onunload,function(){_runHooks("onleavehooks");_runHooks("onunloadhooks")})}function keep_window_set_as_loaded(){if(window.loaded==false){window.loaded=true;_runHooks("onloadhooks");_runHooks("onafterloadhooks")}};function EventController(a){copy_properties(this,{queue:[],ready:false,responder:a})}copy_properties(EventController.prototype,{startQueue:function(){this.ready=true;this.dispatchEvents();return this},pauseQueue:function(){this.ready=false;return this},addEvent:function(c){if(c.toLowerCase()!==c){Util.warn("Event name %q contains uppercase letters; events should be lowercase.",c)}var a=[];for(var b=1;b<arguments.length;b++){a.push(arguments[b])}this.queue.push({type:c,args:a});if(this.ready){this.dispatchEvents()}return false},dispatchEvents:function(){if(!this.responder){Util.error("Event controller attempting to dispatch events with no responder! Provide a responder when constructing the controller.")}for(var a=0;a<this.queue.length;a++){var b="on"+this.queue[a].type;if(typeof(this.responder[b])!="function"&&typeof(this.responder[b])!="null"){Util.warn("Event responder is unable to respond to %q event! Implement a %q method. Note that method names are case sensitive; use lower case when defining events and event handlers.",this.queue[a].type,b)}else{if(this.responder[b]){this.responder[b].apply(this.responder,this.queue[a].args)}}}this.queue=[]}});function adjustUABehaviors(){onloadRegister(addSafariLabelSupport);if(ua.ie()<7){try{document.execCommand("BackgroundImageCache",false,true)}catch(a){}}}function addSafariLabelSupport(a){if(ua.safari()<500){var b=(a||document.body).getElementsByTagName("label");for(i=0;i<b.length;i++){b[i].addEventListener("click",addLabelAction,true)}}}function addLabelAction(b){var d=this.getAttribute("for");var a=null;if(d){a=document.getElementById(d)}else{a=this.getElementsByTagName("input")[0]}if(!a||b.srcElement==a){return}if(a.type=="checkbox"){a.checked=!a.checked}else{if(a.type=="radio"){var c=document.getElementsByTagName("input");for(i=0;i<c.length;i++){if(c[i].name==a.name&&c[i].form==a.form){c.checked=false}}a.checked=true}else{a.focus()}}if(a.onclick){a.onclick(b)}};function escapeURI(a){if(encodeURIComponent){return encodeURIComponent(a)}if(escape){return escape(a)}}function htmlspecialchars(a){if(typeof(a)=="undefined"||!a.toString){return""}if(a===false){return"0"}else{if(a===true){return"1"}}return a.toString().replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function htmlize(a){return htmlspecialchars(a).replace(/\n/g,"<br />")}function escape_js_quotes(a){if(typeof(a)=="undefined"||!a.toString){return""}return a.toString().replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/"/g,"\\x22").replace(/'/g,"\\'").replace(/</g,"\\x3c").replace(/>/g,"\\x3e").replace(/&/g,"\\x26")};function html_wordwrap(j,h,e){if(typeof h=="undefined"){h=60}if(typeof e!="function"){e=htmlize}var m=new RegExp("\\S{"+(h+1)+"}","g");var a=0;var g=j;var c=[];var f=j.match(m);if(f){for(var b=0;b<f.length;b++){var d=f[b];var k=a+g.indexOf(d);var l=j.substring(a,k);if(l){c.push(e(l))}c.push(e(d)+"<wbr/>");a=k+d.length;g=j.substring(a)}}if(g){c.push(e(g))}return c.join("")}function text_get_hyperlinks(a){if(typeof(a)!="string"){return[]}return a.match(/(?:(?:ht|f)tps?):\/\/[^\s<]*[^\s<\.)]/ig)}function html_hyperlink(q,j,m){var c={"<":">","*":"*","{":"}","[":"]","'":"'",'"':'"',"#":"#","+":"+","-":"-","(":")"};if(typeof(q)=="undefined"||!q.toString){return""}if(typeof j!="function"){j=htmlize}if(typeof m!="function"){m=htmlize}var q=q.toString();var n=text_get_hyperlinks(q);var a=0;var o=q;var h=[];var o=q;if(n){for(var g=0;g<n.length;g++){var f=n[g];var l=a+o.indexOf(f);var r=f.length;var d=q.substring(a,l);if(d){h.push(j(d))}var k="";if(l>0){var b=q[l-1];if(typeof c[b]!="undefined"){var e=c[b];var p=f.indexOf(e);if(p!=-1){k=j(f.substring(p));f=f.substring(0,p)}}}http_str=m(f);http_url_quote_escape=f.replace(/"/g,"%22");h.push('<a href="'+http_url_quote_escape+'" target="_blank" rel="nofollow">'+http_str+"</a>"+k);a=l+r;o=q.substring(a)}}if(o){h.push(j(o))}return h.join("")}function nl2br(a){if(typeof(a)=="undefined"||!a.toString){return""}return a.toString().replace(/\n/g,"<br />")}function is_email(a){return/^([\w!.%+\-])+@([\w\-])+(?:\.[\w\-]+)+$/.test(a)};function sprintf(){if(arguments.length==0){Util.warn("sprintf() was called with no arguments; it should be called with at least one argument.");return""}var c=["This is an argument vector."];for(var l=arguments.length-1;l>0;l--){if(typeof(arguments[l])=="undefined"){Util.log("You passed an undefined argument (argument "+l+" to sprintf(). Pattern was: `"+(arguments[0])+"'.","error");c.push("")}else{if(arguments[l]===null){c.push("")}else{if(arguments[l]===true){c.push("true")}else{if(arguments[l]===false){c.push("false")}else{if(!arguments[l].toString){Util.log("Argument "+(l+1)+" to sprintf() does not have a toString() method. The pattern was: `"+(arguments[0])+"'.","error");return""}c.push(arguments[l])}}}}}var u=arguments[0];u=u.toString().split("%");var y=u.length;var a=u[0];for(var l=1;l<y;l++){if(c.length==0){Util.log("Not enough arguments were provide to sprintf(). The pattern was: `"+(arguments[0])+"'.","error");return""}if(!u[l].length){a+="%";continue}var q=0;var t=0;var o="";var b=" ";var i=null;var d=null;var v="";var f=0;if(t=u[l].match(/^('.)?(?:(-?\d+\.)?(-?\d+)?)/)){if(t[2]!==undefined&&t[2].length){i=parseInt(v=t[2])}if(t[3]!==undefined&&t[3].length){if(i!==null){d=parseInt(t[3])}else{i=parseInt(v=t[3])}}f=t[0].length;if(t[1]!==undefined&&t[1].length){b=t[1].charAt(1)}else{if(v.charAt(0)==0){b="0"}}}switch(u[l].charAt(f)){case"s":raw=htmlspecialchars(c.pop().toString());break;case"h":raw=c.pop().toString();break;case"d":raw=parseInt(c.pop()).toString();break;case"f":raw=parseFloat(c.pop()).toString();break;case"q":raw="`"+htmlspecialchars(c.pop().toString())+"'";break;case"e":raw="'"+escape_js_quotes(c.pop().toString())+"'";break;case"L":var w=c.pop();for(var l=0;l<w.length;l++){w[l]="`"+htmlspecialchars(c.pop().toString())+"'"}if(w.length>1){w[w.length-1]="and "+w[w.length-1]}raw=w.join(", ");break;case"x":x=c.pop();var k="?";var g="?";try{if(typeof(x.line)!="undefined"){k=x.line}else{if(typeof(x.lineNumber)!="undefined"){k=x.lineNumber}}if(typeof(x.sourceURL)!="undefined"){g=x.sourceURL}else{if(typeof(x.fileName)!="undefined"){g=x.fileName}}}catch(h){}var n="[An Exception]";try{n=x.message||x.toString()}catch(h){}raw=n+" [at line "+k+" in "+g+"]";break;default:raw="%"+u[l].charAt(f+1);break}if(i!==null){if(raw.length<Math.abs(i)){var z="";var e=(Math.abs(i)-raw.length);for(var j=0;j<e;j++){z+=b}if(i<0){raw+=z}else{raw=z+raw}}}if(d!==null){if(raw.length>d){raw=raw.substr(0,d)}}a+=raw+u[l].substring(f+1)}if(c.length>1){Util.log("Too many arguments ("+(c.length-1)+" extras) were passed to sprintf(). Pattern was: `"+(arguments[0])+"'.","error")}return a};function URI(a){if(a===window){Util.error("what the hell are you doing");return}if(this===window){return new URI(a||window.location.href)}this.parse(a||"")}copy_properties(URI,{getRequestURI:function(){return new URI(window.location.href)},expression:/(((\w+):\/\/)([^\/:]*)(:(\d+))?)?([^#?]*)(\?([^#]*))?(#(.*))?/,explodeQuery:function(d){if(!d){return{}}var b,a,c={};d=d.split("&");for(b=0,l=d.length;b<l;b++){a=d[b].split("=");c[decodeURIComponent(a[0])]=(typeof(a[1])=="undefined")?"":decodeURIComponent(a[1])}return c},implodeQuery:function(f,c){c=c||"";var e=[];if(f instanceof Array){for(var d=0;d<f.length;d++){try{e.push(URI.implodeQuery(f[d],c?c+"["+d+"]":d))}catch(b){}}}else{if(typeof(f)=="object"){if(is_node(f)){e.push("{node}")}else{for(var a in f){try{e.push(URI.implodeQuery(f[a],c?c+"["+a+"]":a))}catch(b){}}}}else{if(c&&c.length){e.push(encodeURIComponent(c)+"="+encodeURIComponent(f))}else{e.push(encodeURIComponent(f))}}}return e.join("&")}});copy_properties(URI.prototype,{parse:function(b){var a=b.toString().match(URI.expression);copy_properties(this,{protocol:a[3]||"",domain:a[4]||"",port:a[6]||"",path:a[7]||"",query:URI.explodeQuery(a[9]||""),fragment:a[11]||""});return this},setProtocol:function(a){this.protocol=a;return this},getProtocol:function(){return this.protocol},setQueryData:function(a){this.query=a;return this},addQueryData:function(a){return this.setQueryData(copy_properties(this.query,a))},getQueryData:function(){return this.query},setFragment:function(a){this.fragment=a;return this},getFragment:function(){return this.fragment},setDomain:function(a){this.domain=a;return this},getDomain:function(){return this.domain},setPort:function(a){this.port=a;return this},getPort:function(){return this.port},setPath:function(a){this.path=a;return this},getPath:function(){return this.path},toString:function(){var a="";var b=URI.implodeQuery(this.query);this.protocol&&(a+=this.protocol+"://");this.domain&&(a+=this.domain);this.port&&(a+=":"+this.port);if(this.domain&&!this.path){a+="/"}this.path&&(a+=this.path);b&&(a+="?"+b);this.fragment&&(a+="#"+this.fragment);return a},getUnqualifiedURI:function(){return new URI(this).setProtocol(null).setDomain(null).setPort(null)},getQualifiedURI:function(){var b=URI();var a=new URI(this);if(!a.getDomain()){a.setProtocol(b.getProtocol()).setDomain(b.getDomain()).setPort(b.getPort())}return a},isSameOrigin:function(a){var b=a||window.location.href;if(!(b instanceof URI)){b=new URI(b.toString())}if(this.getProtocol()&&this.getProtocol()!=b.getProtocol()){return false}if(this.getDomain()&&this.getDomain()!=b.getDomain()){return false}return true},coerceToSameOrigin:function(a){var b=a||window.location.href;if(!(b instanceof URI)){b=new URI(b.toString())}if(this.isSameOrigin(b)){return true}if(this.getProtocol()!=b.getProtocol()){return false}var d=b.getDomain().split(".");var c=this.getDomain().split(".");if(d.pop()=="com"&&c.pop()=="com"){if(d.pop()=="139"&&c.pop()=="139"){this.setDomain(b.getDomain());return true}}return false}});function env_get(a){return typeof(window.Env)!="undefined"&&Env[a]}var Util={fallbackErrorHandler:function(a){aiert(a)},isDevelopmentEnvironment:function(){return env_get("dev")},warn:function(){Util.log(sprintf.apply(null,arguments),"warn")},error:function(){Util.log(sprintf.apply(null,arguments),"error")},log:function(d,c){if(Util.isDevelopmentEnvironment()){var b=false;if(typeof(window.TabConsole)!="undefined"){var a=TabConsole.getInstance();if(a){a.log(d,c);b=true}}if(typeof(console)!="undefined"&&console.error){console.error(d);b=true}if(!b&&c!="deprecated"&&Util.fallbackErrorHandler){Util.fallbackErrorHandler(d)}}else{if(c=="error"){d+="\n\n"+Util.stack();(typeof(window.Env)!="undefined")&&(Env.rlog)&&(typeof(window.debug_rlog)=="function")&&debug_rlog(d)}}},deprecated:function(a){if(!Util._deprecatedThings[a]){Util._deprecatedThings[a]=true;var b=sprintf("Deprecated: %q is deprecated.\n\n%s",a,Util.whyIsThisDeprecated(a));Util.log(b,"deprecated")}},stack:function(){try{try{({}).llama()}catch(d){if(d.stack){var g=[];var c=[];var j=/^([^@]+)@(.+)$/mg;var l=j.exec(d.stack);do{g.push([l[1],l[2]])}while(l=j.exec());for(var b=0;b<g.length;b++){c.push("#"+b+" "+g[b][0]+" @ "+(g[b+1]?g[b+1][1]:"?"))}return c.join("\n")}else{var c=[];var h=arguments.callee;var k=[];while(h){for(var b=0;b<k.length;b++){if(k[b]==h){c.push("#"+c.length+" ** recursion ** @ ?");return c.join("\n")}}k.push(h);var f=[];for(var b=0;b<h.arguments.length;b++){if(h.arguments[b] instanceof Function){var a=/function ?([^(]*)/.exec(h.arguments[b].toString()).pop();f.push(a?a:"anonymous")}else{if(h.arguments[b] instanceof Array){f.push("Array")}else{if(h.arguments[b] instanceof Object){f.push("Object")}else{if(typeof h.arguments[b]=="string"){f.push('"'+h.arguments[b].replace(/("|\\)/g,"\\$1")+'"')}else{f.push(h.arguments[b])}}}}}c.push("#"+c.length+" "+/function ?([^(]*)/.exec(h).pop()+"("+f.join(", ")+") @ ?");if(c.length>100){break}h=h.caller}return c.join("\n")}}}catch(d){return"No stack trace available"}},whyIsThisDeprecated:function(a){return Util._deprecatedBecause[a.toLowerCase()]||"No additional information is available about this deprecation."},_deprecatedBecause:{},_deprecatedThings:{}};var Configurable={getOption:function(a){if(typeof(this.option[a])=="undefined"){Util.warn("Failed to get option %q; it does not exist.",a);return null}return this.option[a]},setOption:function(b,a){if(typeof(this.option[b])=="undefined"){Util.warn("Failed to set option %q; it does not exist.",b)}else{this.option[b]=a}return this},getOptions:function(){return this.option}};function Vector2(b,c,a){copy_properties(this,{x:parseFloat(b),y:parseFloat(c),domain:a||"pure"})}copy_properties(Vector2.prototype,{toString:function(){return"("+this.x+", "+this.y+")"},add:function(d,c){var a=this.x,e=this.y,b=arguments.length;if(b==1){if(d.domain!="pure"){d=d.convertTo(this.domain)}a+=d.x;e+=d.y}else{if(b==2){a+=parseFloat(d);e+=parseFloat(arguments[1])}else{Util.warn("Vector2.add called with %d arguments, should be one (a vector) or two (x and y coordinates).",b)}}return new Vector2(a,e,this.domain)},mul:function(b,a){if(typeof(a)=="undefined"){a=b}return new Vector2(this.x*b,this.y*a,this.domain)},sub:function(c){var a=this.x,d=this.y,b=arguments.length;if(b==1){if(c.domain!="pure"){c=c.convertTo(this.domain)}a-=c.x;d-=c.y}else{if(b==2){a-=parseFloat(c);d-=parseFloat(arguments[1])}else{Util.warn("Vector2.add called with %d arguments, should be one (a vector) or two (x and y coordinates).",b)}}return new Vector2(a,d,this.domain)},distanceTo:function(a){return this.sub(a).magnitude()},magnitude:function(){return Math.sqrt((this.x*this.x)+(this.y*this.y))},toViewportCoordinates:function(){return this.convertTo("viewport")},toDocumentCoordinates:function(){return this.convertTo("document")},convertTo:function(d){if(d!="pure"&&d!="viewport"&&d!="document"){Util.error("Domain %q is not valid; legitimate coordinate domains are %q, %q, %q.",d,"pure","viewport","document");return new Vector2(0,0)}if(d==this.domain){return new Vector2(this.x,this.y,this.domain)}if(d=="pure"){return new Vector2(this.x,this.y)}if(this.domain=="pure"){Util.error("Unable to covert a pure vector to %q coordinates; a pure vector is abstract and does not exist in any document coordinate system. If you need to hack around this, create the vector explicitly in some document coordinate domain, by passing a third argument to the constructor. But you probably don't, and are just using the class wrong. Stop doing that.",d);return new Vector2(0,0)}var b=Vector2.getScrollPosition("document");var a=this.x,c=this.y;if(this.domain=="document"){a-=b.x;c-=b.y}else{a+=b.x;c+=b.y}return new Vector2(a,c,d)},setElementPosition:function(a){var b=this.convertTo("document");a.style.left=parseInt(b.x)+"px";a.style.top=parseInt(b.y)+"px";return this},setElementDimensions:function(a){a.style.width=parseInt(this.x)+"px";a.style.height=parseInt(this.y)+"px";return this},setElementWidth:function(a){a.style.width=this.x+"px";return this}});copy_properties(Vector2,{compass:{east:"e",west:"w",north:"n",south:"s",center:"center",northeast:"ne",northwest:"nw",southeast:"se",southwest:"sw"},domainError:function(){Util.error("You MUST provide a coordinate system domain to Vector2.* functions. Available domains are %q and %q. See the documentation for more information.","document","viewport")},getEventPosition:function(c,b){b=b||"document";c=event_get(c);var a=c.pageX||(c.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));var d=c.pageY||(c.clientY+(document.documentElement.scrollTop||document.body.scrollTop));return(new Vector2(a,d,"document").convertTo(b))},getScrollPosition:function(b){b=b||"document";var a=document.body.scrollLeft||document.documentElement.scrollLeft;var c=document.body.scrollTop||document.documentElement.scrollTop;return(new Vector2(a,c,"document").convertTo(b))},getElementPosition:function(b,a){a=a||"document";return(new Vector2(elementX(b),elementY(b),"document").convertTo(a))},getElementDimensions:function(c){if(ua.safari()&&c.nodeName=="TR"){var b=c.getElementsByTagName("td");var d=Vector2.getElementCompassPoint(b[b.length-1],Vector2.compass.southeast).sub(Vector2.getElementPosition(b[0]));return d}var a=c.offsetWidth||0;var e=c.offsetHeight||0;return new Vector2(a,e)},getElementCompassPoint:function(a,f){f=f||Vector2.compass.southeast;var b=Vector2.getElementPosition(a);var e=Vector2.getElementDimensions(a);var g=Vector2.compass;switch(f){case g.east:return b.add(e.x,e.y*0.5);case g.west:return b.add(0,e.y*0.5);case g.north:return b.add(e.x*0.5,0);case g.south:return b.add(e.x*0.5,e.y);case g.center:return b.add(e.mul(0.5));case g.northwest:return b;case g.northeast:return b.add(e.x,0);case g.southwest:return b.add(0,e.y);case g.southeast:return b.add(e)}Util.error("Unknown compass point %s.",f);return b},getViewportDimensions:function(){var a=(window&&window.innerWidth)||(document&&document.documentElement&&document.documentElement.clientWidth)||(document&&document.body&&document.body.clientWidth)||0;var b=(window&&window.innerHeight)||(document&&document.documentElement&&document.documentElement.clientHeight)||(document&&document.body&&document.body.clientHeight)||0;return new Vector2(a,b)},getDocumentDimensions:function(){var a=(document&&document.body&&document.body.scrollWidth)||(document&&document.documentElement&&document.documentElement.scrollWidth)||0;var b=(document&&document.body&&document.body.scrollHeight)||(document&&document.documentElement&&document.documentElement.scrollHeight)||0;return new Vector2(a,b)},scrollTo:function(a){if(!(a instanceof Vector2)){a=new Vector2(Vector2.getScrollPosition().x,Vector2.getElementPosition(_(a)).y,"document")}a=a.toDocumentCoordinates();if(window.scrollTo){window.scrollTo(a.x,a.y)}}});var mouseX=function(a){return Vector2.getEventPosition(a).x};var mouseY=function(a){return Vector2.getEventPosition(a).y};var pageScrollX=function(){return Vector2.getScrollPosition().x};var pageScrollY=function(){return Vector2.getScrollPosition().y};var getViewportWidth=function(){return Vector2.getViewportDimensions().x};var getViewportHeight=function(){return Vector2.getViewportDimensions().y};var operaIgnoreScroll={table:true,"inline-table":true,inline:true};function elementX(b){if(ua.safari()<500&&b.tagName=="TR"){b=b.firstChild}var a=b.offsetLeft;var c=b.offsetParent;while(b.parentNode&&document.body!=b.parentNode){b=b.parentNode;if(!(ua.opera()<9.5)||!operaIgnoreScroll[window.getComputedStyle(b,"").getPropertyValue("display")]){a-=b.scrollLeft}if(c==b){if(ua.safari()<500&&b.tagName=="TR"){a+=b.firstChild.offsetLeft}else{a+=b.offsetLeft}c=b.offsetParent}}return a}function elementY(b){if(ua.safari()<500&&b.tagName=="TR"){b=b.firstChild}var a=b.offsetTop;var c=b.offsetParent;while(b.parentNode&&document.body!=b.parentNode){b=b.parentNode;if(!isNaN(b.scrollTop)){if(!(ua.opera()<9.5)||!operaIgnoreScroll[window.getComputedStyle(b,"").getPropertyValue("display")]){a-=b.scrollTop}}if(c==b){if(ua.safari()<500&&b.tagName=="TR"){a+=b.firstChild.offsetTop}else{a+=b.offsetTop}c=b.offsetParent}}return a};function Rect(e,f,c,d,a){copy_properties(this,{t:e,r:f,b:c,l:d,domain:a||"pure"})}copy_properties(Rect.prototype,{w:function(){return this.r-this.l},h:function(){return this.b-this.t},area:function(){return this.w()*this.h()},toString:function(){return"(("+this.l+", "+this.t+"), ("+this.r+", "+this.b+"))"},intersects:function(a){a=a.convertTo(this.domain);var b=this;if(b.l>a.r||a.l>b.r||b.t>a.b||a.t>b.b){return false}return true},intersectingArea:function(a){a=a.convertTo(this.domain);var b=this;if(!this.intersects(a)){return null}return new Rect(Math.max(b.t,a.t),Math.min(b.r,a.r),Math.min(b.b,a.b),Math.max(b.l,a.l)).area()},contains:function(a){a=a.convertTo(this.domain);var b=this;if(a instanceof Vector2){return(b.l<=a.x&&b.r>=a.x&&b.t<=a.y&&b.b>=a.y)}else{return(b.l<=a.l&&b.r>=b.r&&b.t<=a.t&&b.b>=a.b)}},canContain:function(a){a=a.convertTo(this.domain);return(a.h()<=this.h())&&(a.w()<=this.w())},forceBelow:function(a,b){b=b||0;a=a.convertTo(this.domain);if(a.b>this.t){return this.offset(0,(a.b-this.t)+b)}return this},offset:function(a,b){return new Rect(this.t+b,this.r+a,this.b+b,this.l+a,this.domain)},expand:function(a,b){return new Rect(this.t,this.r+a,this.b+b,this.l,this.domain)},scale:function(a,b){b=b||a;return new Rect(this.t,this.l+(this.w()*a),this.t+(this.h()*b),this.l,this.domain)},setDimensions:function(a,b){return new Rect(this.t,this.l+a,this.t+b,this.l,this.domain)},setPosition:function(a,b){return new Rect(a,this.w(),this.h(),b,this.domain)},boundWithin:function(b){if(b.contains(this)||!b.canContain(this)){return this}var a=0,c=0;if(this.l<b.l){a=b.l-this.l}else{if(this.r>b.r){a=b.r-this.r}}if(this.t<b.t){c=b.t-this.t}else{if(this.b>b.b){c=b.b-this.b}}return this.offset(a,c)},setElementBounds:function(a){this.getPositionVector().setElementPosition(a);this.getDimensionVector().setElementDimensions(a);return this},getPositionVector:function(){return new Vector2(this.l,this.t,this.domain)},getDimensionVector:function(){return new Vector2(this.w(),this.h(),"pure")},convertTo:function(b){if(this.domain==b){return this}if(b=="pure"){return new Rect(this.t,this.r,this.b,this.l,"pure")}if(this.domain=="pure"){Util.error("Unable to convert a pure rect to %q coordinates.",b);return new Rect(0,0,0,0)}var a=new Vector2(this.l,this.t,this.domain).convertTo(b);return new Rect(a.y,a.x+this.w(),a.y+this.h(),a.x,b)},constrict:function(a,b){if(typeof(b)=="undefined"){b=a}a=a||0;return new Rect(this.t+b,this.r-a,this.b-b,this.l+a,this.domain)},expandX:function(){return new Rect(this.t,Number.POSITIVE_INFINITY,this.b,Number.NEGATIVE_INFINITY)},expandY:function(){return new Rect(number.NEGATIVE_INFINITY,this.r,Number.POSITIVE_INFINITY,this.l)}});copy_properties(Rect,{newFromVectors:function(b,a){return new Rect(b.y,b.x+a.x,b.y+a.y,b.x,b.domain)},getElementBounds:function(a){return Rect.newFromVectors(Vector2.getElementPosition(a),Vector2.getElementDimensions(a))},getViewportBounds:function(){return Rect.newFromVectors(Vector2.getScrollPosition(),Vector2.getViewportDimensions())},getDocumentBounds:function(){return Rect.newFromVectors(new Vector2(0,0,"document"),Vector2.getDocumentDimensions())}});function rand32(){return Math.floor(Math.random()*4294967295)};try{if(window.miJavascriptLibrariesHaveLoaded){Util.error("You have double-included base.js and possibly other Javascript files; it may be in a package. This will cause you great unhappiness. Each file should be included at most once.")}window.miJavascriptLibrariesHaveLoaded=true}catch(ignored){}function gen_unique(){return ++gen_unique._counter}gen_unique._counter=0;function close_more_list(){var a=ge("expandable_more");if(a){a.style.display="none";removeEventBase(document,"click",a.offclick,a.id)}var b=ge("ssponsor");if(b){b.style.position=""}var c=ge("more_link");if(c){c.innerHTML=tx("base01");c.className="expand_link more_apps"}}function expand_more_list(){var b=ge("expandable_more");var a=ge("more_section");if(a){remove_css_class_name(a,"highlight_more_link")}if(b){b.style.display="block";b.offclick=function(f){if(!is_descendent(event_get_target(f),"sidebar_content")){close_more_list()}}.bind(b);addEventBase(document,"click",b.offclick,b.id)}var c=ge("ssponsor");if(c){c.style.position="static"}var d=ge("more_link");if(d){d.innerHTML=tx("base02");d.className="expand_link less_apps"}}function create_hidden_input(a,b){return $N("input",{name:a,id:a,value:b,type:"hidden"})}var KEYS={BACKSPACE:8,TAB:9,RETURN:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};var KeyCodes={Up:63232,Down:63233,Left:63234,Right:63235};function optional_drop_down_menu(m,k,b,a,l,j,c,g,f,i){if(b.style.display=="none"){b.style.display="block";if(f&&i){for(prop in i){switch(prop){case"top":b.style.top=(f.offsetTop+i[prop])+"px";break;case"left":b.style.left=(f.offsetLeft+i[prop])+"px";break;case"right":b.style.left=(f.offsetLeft+f.offsetWidth-i[prop]-b.offsetWidth)+"px";break;case"bottom":b.style.top=(f.offsetTop+f.offsetHeight-i[prop]-b.offsetHeight)+"px";break}}}if(m){var h=j?j:m.className}if(k){k.className="active"}if(m){m.className=l?l:"global_menu_arrow_active"}var e=true;var d=ge(b.id+"_iframe");if(d){d.style.top=b.style.top;d.style.right=b.style.right;d.style.display="block";d.style.width=(b.offsetWidth+2)+"px";d.style.height=(b.offsetHeight+2)+"px"}b.offclick=function(n){if(!e){hide(this);if(k){k.className=""}if(m){m.className=h}var o=ge(b.id+"_iframe");if(o){o.style.display="none";o.style.width=b.offsetWidth+"px";o.style.height=b.offsetHeight+"px"}if(g){g(n)}removeEventBase(document,"click",this.offclick,b.id)}else{e=false}}.bind(b);if(c){c()}addEventBase(document,"click",b.offclick,b.id);onunloadRegister(b.offclick,true)}return false}function position_app_switcher(){var a=ge("app_switcher");var b=ge("app_switcher_menu");b.style.top=(a.offsetHeight-1)+"px";b.style.right="0px"}function hover_tooltip(d,b,c,f,g){if(d.tooltip){var a=d.previousSibling;a.style.display="block";return}else{d.parentNode.style.position="relative";var a=document.createElement("div");a.className="tooltip_pro "+c;a.style.left=-9999+"px";a.style.display="block";a.innerHTML='<div class="tooltip_text"><span>'+b+'</span></div><div class="tooltip_pointer"></div>';d.parentNode.insertBefore(a,d);while(a.firstChild.firstChild.offsetWidth<=0){1}var h=16;var e=a.firstChild.firstChild.offsetWidth+h;a.style.width=e+"px";a.style.display="none";a.style.left=f+d.offsetLeft-((e-6-d.offsetWidth)/2)+"px";a.style.top=g+"px";a.style.display="block";d.tooltip=true;d.onmouseout=function(i){hover_clear_tooltip(d)}}}function hover_clear_tooltip(b){var a=b.previousSibling;a.style.display="none"}function goURI(a){window.location.href=a}function getTableRowShownDisplayProperty(){if(ua.ie()){return"inline"}else{return"table-row"}}function showTableRow(){for(var b=0;b<arguments.length;b++){var a=ge(arguments[b]);if(a&&a.style){a.style.display=getTableRowShownDisplayProperty()}}return false}function getParentRow(a){a=ge(a);while(a.tagName&&a.tagName!="TR"){a=a.parentNode}return a}function show_standard_status(a){s=ge("standard_status");if(s){var b=s.firstChild;b.innerHTML=a;show("standard_status")}}function hide_standard_status(){s=ge("standard_status");if(s){hide("standard_status")}}function adjustImage(f,h,a){var g=f.parentNode;while(get_style(g,"display")!="block"&&g.parentNode){g=g.parentNode}var c=g.offsetWidth;if(f.offsetWidth>c){try{if(ua.ie()){var b=document.createElement("div");b.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+f.src.replace('"',"%22")+'", sizingMethod="scale")';b.style.width=c+"px";b.style.height=Math.floor(((c/f.offsetWidth)*f.offsetHeight))+"px";if(f.parentNode.tagName=="A"){b.style.cursor="pointer"}f.parentNode.insertBefore(b,f);f.parentNode.removeChild(f)}else{throw 1}}catch(d){f.style.width=c+"px"}}remove_css_class_name(f,"img_loading")}function imageConstrainSize(e,d,b,a){var c=new Image();c.onload=function(){if(c.width>0&&c.height>0){var h=c.width;var i=c.height;if(h>d||i>b){var k=b/d;var f=i/h;if(f>k){h=h*(b/i);i=b}else{i=i*(d/h);h=d}}var j=ge(a);var g=document.createElement("img");g.src=e;g.width=h;g.height=i;j.parentNode.insertBefore(g,j);j.parentNode.removeChild(j)}};c.src=e}function login_form_change(){var a=ge("persistent");if(a){a.checked=false}}function require_password_confirmation(a,b){if((!getCookie("sid")||getCookie("sid")=="0")||getCookie("pk")){a();return}require_password_confirmation.onsuccess=a;require_password_confirmation.oncancel=b;(new pop_dialog()).show_ajax_dialog("/ajax/password_check_dialog.php")}function search_validate(a){var b=_(a);if(b.value!=""&&b.value!=b.getAttribute("placeholder")){return true}else{b.focus();return false}}function abTest(a,b){AsyncRequest.pingURI("/ajax/abtest.php",{data:a,post_form_id:null},true);if(!b){return true}}function ac(a){AsyncRequest.pingURI("/ajax/ac.php",{meta:a},true);return true}function alc(a){AsyncRequest.pingURI("/ajax/alc.php",{meta:a},true);return true}function scribe_log(b,a){AsyncRequest.pingURI("/ajax/scribe_log.php",{category:b,message:a,post_form_id:null},true)}function play_sound(c,a){a=a||false;var b=ge("sound");if(!b){b=document.createElement("span");b.setAttribute("id","sound");document.body.appendChild(b)}b.innerHTML='<embed src="'+c+'" autostart="true" hidden="true" loop="'+(a?"true":"false")+'" />'}function image_has_loaded(c){try{if((c.mimeType!=null&&c.complete&&c.mimeType!="")||(c.naturalHeight!=null&&c.complete&&c.naturalHeight!=0)){return true}else{if(ua.safari()<3){var a=new Image();a.src=c.src;if(a.complete==true){return true}delete a}}}catch(b){return true}}function image_has_failed(a){if((a.complete==null&&a.width==20&&a.height==20)||(a.mimeType!=null&&a.complete&&a.mimeType=="")||(a.naturalHeight!=null&&a.complete&&a.naturalHeight==0)){return true}}function cavalry_log(c,a){if(!window.Env){return}window.scrollBy(0,1);var b=[a,___tcss,___tjs+___tcss,___thtml+___tcss+___tjs,parseInt(Env.t_domcontent-Env.start,10),parseInt(Env.t_onload-Env.start,10),parseInt(Env.t_layout-Env.start,10),parseInt(((new Date()).getTime())-Env.start,10),parseInt(Env.t_doneonloadhooks-Env.t_willonloadhooks,10)];(new Image()).src="/common/instrument_endpoint.php?g="+c+"&uri="+encodeURIComponent(window.location)+"&t="+b.join(",")+"&"+parseInt(Math.random()*10000,10)}function show_search_profile(b){var a=new AsyncRequest().setURI("/ajax/search_profile.php").setData({id:b}).setMethod("GET").setReadOnly(true);new Dialog().setAsync(a).setButtons(Dialog.CLOSE).setContentWidth(490).show()}function _search_profile_link_handler(b){var a=new URI(b.href);if(a.getPath()=="/s.php"){var c=a.getQueryData();if(c.k==100000080){show_search_profile(c.id);return false}}}onloadRegister(function(){LinkController.registerHandler(_search_profile_link_handler)});function warn_if_unsaved(b){var a=ge(b);if(!a){Util.error("warn_if_unsaved couldn't find form in order to save its original state.  This is probably because you called render_start_form_with_unsaved_warning to render a form, but then didn't echo it into page.  To get around this, you can call render_start_form, and then call warn_if_unsaved yourself once you've caused the form to appear.");return}if(!_unsaved_forms_to_check_for){_unsaved_forms_to_check_for={};LinkController.registerHandler(_check_for_unsaved_forms)}a.original_state=serialize_form(a);_unsaved_forms_to_check_for[b]=true}function _check_for_unsaved_forms(f){for(var e in _unsaved_forms_to_check_for){var d=ge(e);if(d&&d.original_state&&!are_equal(d.original_state,serialize_form(d))){var b=f.href;var a=_find_first_submit_button(d);var c=[];if(a){c.push({name:"save",label:tx("sh:save-button"),handler:bind(a,"click")})}c.push({name:"dont_save",label:tx("uw:dont-save"),handler:function(){window.location.href=b}});c.push(Dialog.CANCEL);new Dialog().setTitle(tx("uw:title")).setBody(tx("uw:body")).setButtons(c).setModal().show();return false}}}function _find_first_submit_button(b){var c=b.getElementsByTagName("input");for(var a=0;a<c.length;++a){if(c[a].type.toUpperCase()=="SUBMIT"){return c[a]}}return null}_unsaved_forms_to_check_for=undefined;ua.populate();_bootstrapEventHandlers();adjustUABehaviors();if(navigator&&navigator.userAgent&&!(parseInt((/Gecko\/([0-9]+)/.exec(navigator.userAgent)||[]).pop())<=20060508)){};var DOM={tryElement:function(g){if(typeof(g)=="undefined"){Util.error('Tried to get "undefined" element!');return null}var e;if(typeof(g)=="string"){e=document.getElementById(g);if(!(ua.ie()>=7)){return e}if(!e){return null}else{if(typeof(e.id)=="string"&&e.id==g){return e}else{var a=document.getElementsByName(g);if(!a||!a.length){return null}var d=[];for(var b=0;b<a.length;b++){var f=a[b];if(!f.id&&g){continue}if(typeof(f.id)=="string"&&f.id!=g){continue}d.push(a[b])}if(!d.length){return null}return d[0]}}}return g},getElement:function(b){var a=DOM.tryElement.apply(null,arguments);if(!a){Util.warn("Tried to get element %q, but it is not present in the page. (Use ge() to test for the presence of an element.)",arguments[0])}return a},setText:function(a,b){if(ua.firefox()){a.textContent=b}else{a.innerText=b}},getText:function(a){if(ua.firefox()){return a.textContent}else{return a.innerText}},setContent:function(b,d){if(ua.ie()){for(var a=b.childNodes.length-1;a>=0;--a){DOM.remove(b.childNodes[a])}}else{b.innerHTML=""}if(d instanceof HTML){set_inner_html(b,d.toString())}else{if(is_scalar(d)){d=document.createTextNode(d);b.appendChild(d)}else{if(is_node(d)){b.appendChild(d)}else{if(d instanceof Array){for(var a=0;a<d.length;a++){var c=d[a];if(!is_node(c)){c=document.createTextNode(c)}b.appendChild(c)}}else{Util.error("No way to set content %q.",d)}}}}},remove:function(a){a=_(a);if(a.removeNode){a.removeNode(true)}else{for(var b=a.childNodes.length-1;b>=0;--b){DOM.remove(a.childNodes[b])}a.parentNode.removeChild(a)}},create:function(b,a,c){b=document.createElement(b);if(a){a=copy_properties({},a);if(a.style){copy_properties(b.style,a.style);delete a.style}copy_properties(b,a)}if(c!=undefined){DOM.setContent(b,c)}return b},scry:function(f,c){c=c.split(".");var b=c[0]||null;if(!b){return[]}var e=c[1]||null;var a=f.getElementsByTagName(b);if(e!==null){var d=[];for(var g=0;g<a.length;g++){if(CSS.hasClass(a[g],e)){d.push(a[g])}}a=d}return a},prependChild:function(a,b){a=_(a);if(a.firstChild){a.insertBefore(b,a.firstChild)}else{a.appendChild(b)}},getCaretPosition:function(c){c=_(c);if(!is_node(c,["input","textarea"])){return{start:undefined,end:undefined}}if(!document.selection){return{start:c.selectionStart,end:c.selectionEnd}}if(is_node(c,"input")){var b=document.selection.createRange();return{start:-b.moveStart("character",-c.value.length),end:-b.moveEnd("character",-c.value.length)}}else{var b=document.selection.createRange();var d=b.duplicate();d.moveToElementText(c);d.setEndPoint("StartToEnd",b);var a=c.value.length-d.text.length;d.setEndPoint("StartToStart",b);return{start:c.value.length-d.text.length,end:a}}},addEvent:function(a,c,d,b){return addEventBase(a,c,d,b)}};var $N=DOM.create;var ge=DOM.tryElement;var $_=function _$_(b){var a=[document].concat(Array.prototype.slice.apply(arguments));return DOM.scry.apply(null,a)};var _=DOM.getElement;var remove_node=DOM.remove;var prependChild=DOM.prependChild;var get_caret_position=DOM.getCaretPosition;function is_node(d,e){if(typeof(Node)=="undefined"){Node=null}try{if(!d||!((Node!=undefined&&d instanceof Node)||d.nodeName)){return false}}catch(a){return false}if(typeof(e)!=="undefined"){if(!(e instanceof Array)){e=[e]}var b;try{b=new String(d.nodeName).toUpperCase()}catch(a){return false}for(var c=0;c<e.length;c++){try{if(b==e[c].toUpperCase()){return true}}catch(a){}}return false}return true}function is_descendent(c,b){var a=ge(b);if(c==null){return}while(c!=a){if(c.parentNode){c=c.parentNode}else{return false}}return true}function iterTraverseDom(b,a){var g=b,f=null;var e=0;do{f=g.firstChild;if(!f){if(a(g)==false){return}f=g.nextSibling}if(!f){var d=g;do{f=d.parentNode;if(f==b){break}if(a(f)==false){return}d=f;f=f.nextSibling}while(!f)}g=f}while(g!=b)}function insertAfter(a,d,c){if(a!=d.parentNode){Util.error("child is not really a child of parent - wtf, seriously.")}if(d.nextSibling){var b=a.insertBefore(c,d.nextSibling)}else{var b=a.appendChild(c)}if(!b){return null}return c}function set_caret_position(e,f,a){if(document.selection){if(e.tagName=="TEXTAREA"){var c=e.value.indexOf("\r",0);while(c!=-1&&c<a){a--;if(c<f){f--}c=e.value.indexOf("\r",c+1)}}var b=e.createTextRange();b.collapse(true);b.moveStart("character",f);if(a!=undefined){b.moveEnd("character",a-f)}b.select()}else{e.selectionStart=f;var d=a==undefined?f:a;e.selectionEnd=Math.min(d,e.value.length);e.focus()}};var CSS={hasClass:function(b,a){if(b&&a&&b.className){return new RegExp("\\b"+trim(a)+"\\b").test(b.className)}return false},addClass:function(b,a){if(b&&a){if(!CSS.hasClass(b,a)){if(b.className){b.className+=" "+trim(a)}else{b.className=trim(a)}}}return this},removeClass:function(c,b){if(c&&b&&c.className){b=trim(b);var a=new RegExp("\\b"+b+"\\b","g");c.className=c.className.replace(a,"")}return this},conditionClass:function(b,a,c){if(c){CSS.addClass(b,a)}else{CSS.removeClass(b,a)}},setClass:function(b,a){b.className=a;return this},toggleClass:function(b,a){if(CSS.hasClass(b,a)){return CSS.removeClass(b,a)}else{return CSS.addClass(b,a)}},getStyle:function(c,a){c=_(c);function d(e){return e.replace(/[A-Z]/g,function(f){return"-"+f.toLowerCase()})}if(window.getComputedStyle){return window.getComputedStyle(c,null).getPropertyValue(d(a))}if(document.defaultView&&document.defaultView.getComputedStyle){var b=document.defaultView.getComputedStyle(c,null);if(b){return b.getPropertyValue(d(a))}if(a=="display"){return"none"}Util.error("Can't retrieve requested style %q due to a bug in Safari",a)}if(c.currentStyle){return c.currentStyle[a]}return c.style[a]},setOpacity:function(c,d){var a=(d==1);try{c.style.opacity=(a?"":""+d)}catch(b){}try{c.style.filter=(a?"":"alpha(opacity="+(d*100)+")")}catch(b){}},getOpacity:function(a){var b=get_style(a,"filter");var c=null;if(b&&(c=/(\d+(?:\.\d+)?)/.exec(b))){return parseFloat(c.pop())/100}else{if(b=get_style(a,"opacity")){return parseFloat(b)}else{return 1}}},Cursor:{kGrabbable:"grabbable",kGrabbing:"grabbing",kEditable:"editable",set:function(b,a){b=b||document.body;switch(a){case CSS.Cursor.kEditable:a="text";break;case CSS.Cursor.kGrabbable:if(ua.firefox()){a="-moz-grab"}else{a="move"}break;case CSS.Cursor.kGrabbing:if(ua.firefox()){a="-moz-grabbing"}else{a="move"}break}b.style.cursor=a}}};var has_css_class_name=CSS.hasClass;var add_css_class_name=CSS.addClass;var remove_css_class_name=CSS.removeClass;var toggle_css_class_name=CSS.toggleClass;var get_style=CSS.getStyle;var set_opacity=CSS.setOpacity;var get_opacity=CSS.getOpacity;function getRadioFormValue(a){for(i=0;i<a.length;i++){if(a[i].checked){return a[i].value}}return null}function getElementsByTagNames(g,h){if(!h){var h=document}var f=g.split(",");var a=new Array();for(var e=0;e<f.length;e++){var c=h.getElementsByTagName(f[e]);for(var b=0;b<c.length;b++){a.push(c[b])}}var d=a[0];if(!d){return[]}if(d.sourceIndex){a.sort(function(k,j){return k.sourceIndex-j.sourceIndex})}else{if(d.compareDocumentPosition){a.sort(function(k,j){return 3-(k.compareDocumentPosition(j)&6)})}}return a}function get_all_form_inputs(a){if(!a){a=document}return getElementsByTagNames("input,select,textarea,button",a)}function get_form_select_value(a){return a.options[a.selectedIndex].value}function set_form_select_value(c,b){for(var a=0;a<c.options.length;++a){if(c.options[a].value==b){c.selectedIndex=a;break}}}function get_form_attr(e,a){var f=e[a];if(typeof f=="object"&&f.tagName=="INPUT"){var b=f.parentNode,c=f.nextSibling,d=f;b.removeChild(d);f=e[a];c?b.insertBefore(d,c):b.appendChild(d)}return f}function serialize_form_helper(e,b,d){var a=/([^\]]+)\[([^\]]*)\](.*)/.exec(b);if(a){e[a[1]]=e[a[1]]||{};if(a[2]==""){var c=0;while(e[a[1]][c]!=undefined){c++}}else{c=a[2]}if(a[3]==""){e[a[1]][c]=d}else{serialize_form_helper(e[a[1]],c.concat(a[3]),d)}}else{e[b]=d}}function serialize_form_fix(f){var e=[];for(var c in f){if(f instanceof Object){f[c]=serialize_form_fix(f[c])}e.push(c)}var b=0,d=true;e.sort().each(function(g){if(g!=b++){d=false}});if(d){var a={};e.each(function(g){a[g]=f[g]});return a}else{return f}}function serialize_form(d){var c={};var a=d.tagName=="FORM"?d.elements:get_all_form_inputs(d);for(var b=a.length-1;b>=0;b--){if(a[b].name&&!a[b].disabled){if(!a[b].type||((a[b].type=="radio"||a[b].type=="checkbox")&&a[b].checked)||a[b].type=="text"||a[b].type=="password"||a[b].type=="hidden"||a[b].tagName=="TEXTAREA"||a[b].tagName=="SELECT"){serialize_form_helper(c,a[b].name,a[b].value)}}}return serialize_form_fix(c)}function is_button(b){var a=b.tagName.toUpperCase();if(a=="BUTTON"){return true}if(a=="INPUT"&&b.type){var c=b.type.toUpperCase();return c=="BUTTON"||c=="SUBMIT"}return false}function do_post(d){var b=/(^([^?])+)\??(.*)$/.exec(d);var e=document.createElement("form");e.action=b[1];e.method="post";e.style.display="none";var a=/([\w]+)(?:=([^&]+)|&|$)/g;var f=null;if(ge("post_form_id")){b[3]+="&post_form_id="+_("post_form_id").value}while(f=a.exec(b[3])){var c=document.createElement("input");c.type="hidden";c.name=decodeURIComponent(f[1]);c.value=decodeURIComponent(f[2]);e.appendChild(c)}document.body.appendChild(e);e.submit();return false}function dynamic_post(b,e){var c=document.createElement("form");c.action=b;c.method="POST";c.style.display="none";if(ge("post_form_id")){e.post_form_id=_("post_form_id").value}for(var d in e){var a=document.createElement("input");a.type="hidden";a.name=d;a.value=e[d];c.appendChild(a)}document.body.appendChild(c);c.submit();return false};function HTML(a){if(this===window){return new HTML(a)}this.content=a;return this}copy_properties(HTML.prototype,{toString:function(){return this.content}});function show(){for(var b=0;b<arguments.length;b++){var a=ge(arguments[b]);if(a&&a.style){a.style.display=""}}return false}function hide(){for(var b=0;b<arguments.length;b++){var a=ge(arguments[b]);if(a&&a.style){a.style.display="none"}}return false}function shown(a){a=ge(a);return(a.style.display!="none"&&!(a.style.display==""&&a.offsetWidth==0))}function toggle(){for(var b=0;b<arguments.length;b++){var a=_(arguments[b]);a.style.display=get_style(a,"display")=="block"?"none":"block"}return false}function set_inner_html(d,a,b){var c='<span style="display:none">&nbsp</span>';a=a.replace("<style",c+"<style");a=a.replace("<STYLE",c+"<STYLE");a=a.replace("<script",c+"<script");a=a.replace("<SCRIPT",c+"<SCRIPT");d.innerHTML=a;if(b){eval_inner_js.bind(null,d).defer()}else{eval_inner_js(d)}addSafariLabelSupport(d);(function(){LinkController.bindLinks(d)}).defer()}function eval_inner_js(f){var a=f.getElementsByTagName("script");for(var b=0;b<a.length;b++){if(a[b].src){var c=document.createElement("script");c.type="text/javascript";c.src=a[b].src;document.body.appendChild(c)}else{try{eval_global(a[b].innerHTML)}catch(d){if(typeof console!="undefined"){console.error(d)}}}}}function eval_global(c){var b=document.createElement("script");b.type="text/javascript";try{b.innerHTML=c}catch(a){b.text=c}document.body.appendChild(b)};function DOMControl(a){copy_properties(this,{root:a&&_(a),updating:false});if(a){a.getControl=identity.bind(null,this)}}copy_properties(DOMControl.prototype,{getRoot:function(){return this.root},beginUpdate:function(){if(this.updating){return false}this.updating=true;return true},endUpdate:function(){this.updating=false},update:function(){if(!this.beginUpdate()){return this}this.onupdate();this.endUpdate()}});function TextInputControl(c){this.parent.construct(this,c);copy_properties(this,{placeholderText:null,maxLength:this.getRoot().maxLength||null,radio:null,focused:false,nativePlaceholder:false});var b=this.getRoot();if((String(b.type).toLowerCase()=="search")&&ua.safari()){this.nativePlaceholder=true;this.setPlaceholderText(b.getAttribute("placeholder"))}DOM.addEvent(b,"focus",this.setFocused.bind(this,true));DOM.addEvent(b,"blur",this.setFocused.bind(this,false));var a=this.update.bind(this);DOM.addEvent(b,"keydown",a);DOM.addEvent(b,"keyup",a);DOM.addEvent(b,"keypress",a);setInterval(a,150);this.setFocused(false)}TextInputControl.extend(DOMControl);copy_properties(TextInputControl.prototype,{associateWithRadioButton:function(a){this.radio=a&&_(a);return this},setMaxLength:function(a){this.maxLength=a;this.getRoot().maxLength=this.maxLength||null;return this},getValue:function(){if(this.getRoot().value==this.placeholderText){return null}return this.getRoot().value},isEmpty:function(){var a=this.getValue();return(a===null||a=="")},setValue:function(a){this.getRoot().value=a;this.update();return this},clear:function(){return this.setValue("")},isFocused:function(){return this.focused},setFocused:function(c){this.focused=c;if(this.placeholderText&&!this.nativePlaceholder){var b=this.getRoot();var a=b.value;if(this.focused){CSS.removeClass(b,"DOMControl_placeholder");if(this.isEmpty()){this.clear()}}else{if(this.isEmpty()){CSS.addClass(b,"DOMControl_placeholder");this.setValue(this.placeholderText)}}}this.update();return this},setPlaceholderText:function(a){this.placeholderText=a;if(this.nativePlaceholder){this.getRoot().setAttribute("placeholder",a)}return this.setFocused(this.isFocused())},onupdate:function(){if(this.radio){if(this.focused){this.radio.checked=true}}var a=this.getRoot();if(this.maxLength>0){if(a.value.length>this.maxLength){a.value=a.value.substring(0,this.maxLength)}}}});function placeholderSetup(a){if(!ge(a)){Util.warn("Setting up a placeholder for an element which does not exist: %q.",a);return}if(!_(a).getAttribute("placeholder")){Util.warn("Setting up a placeholder for an element with no placeholder text: %q.",a);return}return new TextInputControl(_(a)).setPlaceholderText(_(a).getAttribute("placeholder"))};function TextAreaControl(a){copy_properties(this,{autogrow:false,shadow:null,originalHeight:null,metricsValue:null});this.parent.construct(this,a)}TextAreaControl.extend(TextInputControl);copy_properties(TextAreaControl.prototype,{setAutogrow:function(a){this.autogrow=a;this.refreshShadow();return this},onupdate:function(){this.parent.onupdate();var a=this.getRoot();if(this.autogrow&&a.value!=this.metricsValue){this.metricsValue=a.value;copy_properties(this.shadow.style,{fontSize:parseInt(CSS.getStyle(a,"fontSize"),10)+"px",fontFamily:CSS.getStyle(a,"fontFamily")+"px",width:(Vector2.getElementDimensions(a).x-8)+"px"});DOM.setContent(this.shadow,HTML(htmlize(a.value)));a.style.height=Math.max(this.originalHeight,Vector2.getElementDimensions(this.shadow).y+15)+"px"}},refreshShadow:function(){if(this.autogrow){this.shadow=$N("div",{className:"DOMControl_shadow"});document.body.appendChild(this.shadow);var a=this.getRoot();this.originalHeight=parseInt(CSS.getStyle(a,"height"))||Vector2.getElementDimensions(this.getRoot()).y}else{if(this.shadow){DOM.remove(this.shadow)}this.shadow=null}}});function autogrow_textarea(a){a=_(a);if(!a._hascontrol){a._hascontrol=true;new TextAreaControl(a).setAutogrow(true)}}function textarea_maxlength(b,a){b=_(b);if(!b._hascontrol){b._hascontrol=true;new TextAreaControl(b).setMaxLength(a)}};function KeyEventController(){copy_properties(this,{handlers:{}});document.onkeyup=this.onkeyevent.bind(this,"onkeyup");document.onkeydown=this.onkeyevent.bind(this,"onkeydown");document.onkeypress=this.onkeyevent.bind(this,"onkeypress")}copy_properties(KeyEventController,{instance:null,getInstance:function(){return KeyEventController.instance||(KeyEventController.instance=new KeyEventController())},defaultFilter:function(b,a){b=event_get(b);return KeyEventController.filterEventTypes(b,a)&&KeyEventController.filterEventTargets(b,a)&&KeyEventController.filterEventModifiers(b,a)},filterEventTypes:function(b,a){if(a==="onkeydown"){return true}return false},filterEventTargets:function(b,a){var c=event_get_target(b);if(c!==document.body&&c!==document.documentElement){if(!ua.ie()){return false}if(is_node(c,["input","select","textarea","object","embed"])){return false}}return true},filterEventModifiers:function(b,a){if(b.ctrlKey||b.altKey||b.metaKey||b.repeat){return false}return true},registerKey:function(c,e,f){if(f===undefined){f=KeyEventController.defaultFilter}var b=KeyEventController.getInstance();var a=b.mapKey(c);for(var d=0;d<a.length;d++){c=a[d];if(!b.handlers[c]){b.handlers[c]=[]}b.handlers[c].push({callback:e,filter:f})}},bindToAccessKeys:function(){var d,c;var b=document.getElementsByTagName("a");for(d=0;d<b.length;d++){if(b[d].accessKey){if(c){KeyEventController.registerKey(c,bind(KeyEventController,"accessLink",b[d]))}}}var e=document.getElementsByTagName("input");for(d=0;d<e.length;d++){if(e[d].accessKey){if(c){KeyEventController.registerKey(c,bind(KeyEventController,"accessInput",e[d]))}}}var a=document.getElementsByTagName("textarea");for(d=0;d<a.length;d++){if(a[d].accessKey){if(c){KeyEventController.registerKey(c,bind(KeyEventController,"accessInput",a[d]))}}}},accessLink:function(a,b){if(a.onclick){return a.onclick(b)}if(a.href){window.location.href=a.href}},accessInput:function(a,b){Vector2.scrollTo(a);a.focus(b);if(a.type=="submit"){a.form.submit()}},keyCodeMap:{"[":[219],"]":[221],"`":[192],LEFT:[KEYS.LEFT,KeyCodes.Left],RIGHT:[KEYS.RIGHT,KeyCodes.Right],RETURN:[KEYS.RETURN],TAB:[KEYS.TAB],DOWN:[KEYS.DOWN,KeyCodes.Down],UP:[KEYS.UP,KeyCodes.Up],ESCAPE:[KEYS.ESC]}});copy_properties(KeyEventController.prototype,{mapKey:function(b){if(typeof(b)=="number"){return[b]}if(KeyEventController.keyCodeMap[b.toUpperCase()]){return KeyEventController.keyCodeMap[b.toUpperCase()]}var a=b.charCodeAt(0);var c=b.toUpperCase().charCodeAt(0);if(a!=c){return[a,c]}return[a]},onkeyevent:function(g,f){f=event_get(f);var i=null;var b=this.handlers[f.keyCode];var h,d,c;if(b){for(var j=0;j<b.length;j++){h=b[j].callback;d=b[j].filter;try{if(!d||d(f,g)){c=h(f,g);if(c===false){return event_abort(f)||event_prevent(f)}}}catch(a){Util.error("Uncaught exception in key handler: %x",a)}}}return true}});function editor_two_level_change(a,d,b){a=ge(a);if(a.getAttribute("typefor")){subselector=ge(a.getAttribute("typefor"))}if(a&&subselector){subselector.options.length=1;type_value=a.options[a.selectedIndex].value;if(type_value==""){type_value=-1}index=1;suboptions=d[type_value];if(typeof(suboptions)!="undefined"){for(var c=0;c<suboptions.length;c++){if(typeof(suboptions[c])!="undefined"){subselector.options[index++]=new Option(suboptions[c],c)}}}if(b){if(b[type_value]){subselector.options[0]=new Option(b[type_value],"");subselector.options[0].selected=true}else{subselector.options[0]=new Option("---","");subselector.options[0].selected=true}}subselector.disabled=subselector.options.length<=1}}function editor_two_level_set_subselector(a,c){a=ge(a);if(a){opts=a.options;for(var b=0;b<opts.length;b++){if((opts[b].value==c)||(c===null&&opts[b].value=="")){a.selectedIndex=b}}}}function editor_network_change(b,a,c){b=ge(b);if(b&&b.value>0){show("display_network_message")}else{hide("display_network_message")}}function editor_rel_change(c,b,d){c=ge(c);for(var a=2;a<=6;a++){if(a==c.value){show(b+"_new_partner_"+a)}else{hide(b+"_new_partner_"+a)}}if(c&&ge(b+"_new_partner")){if(c.value>1){show(b+"_new_partner")}else{hide(b+"_new_partner")}}if(c&&ge(b+"_rel_uncancel")){if(c.value>1){editor_rel_uncancel(c,b,c.value)}else{editor_rel_cancel(c,b)}}editor_rel_toggle_awaiting(c,b,d)}function rel_typeahead_onsubmit(){return false}function rel_typeahead_onselect(a){if(!a){return}_("new_partner").value=a.i}function editor_rel_toggle_awaiting(b,a,c){b=ge(b);if(b&&ge(a+"_rel_required")){if(b.value==c){hide(a+"_rel_required");show(a+"_rel_awaiting")}else{show(a+"_rel_required");hide(a+"_rel_awaiting")}}}function editor_rel_cancel(b,a){if(ge(a+"_rel_uncancel")){show(a+"_rel_uncancel")}if(ge(a+"_rel_cancel")){hide(a+"_rel_cancel")}b=ge(b);if(ge(b)&&_(b).selectedIndex>1){editor_rel_set_value(b,1)}}function editor_rel_uncancel(b,a,c){if(ge(a+"_rel_uncancel")){hide(a+"_rel_uncancel")}if(ge(a+"_rel_cancel")){show(a+"_rel_cancel")}if(c==4||c==5){hide(a+"_rel_with");show(a+"_rel_to")}else{if(c>1){show(a+"_rel_with");hide(a+"_rel_to")}}if(ge(b)&&_(b).selectedIndex<=1){editor_rel_set_value(b,c)}editor_rel_toggle_awaiting(b,a,c)}function editor_autocomplete_onselect(b){var a=ge(/(.*)_/.exec(this.obj.name)[1]+"_id");if(b){a.value=b.i==null?b.t:b.i}else{a.value=-1}}function editor_rel_set_value(a,c){a=ge(a);if(a){opts=a.options;opts_length=opts.length;for(var b=0;b<opts_length;b++){if((opts[b].value==c)||(c===null&&opts[b].value=="")){a.selectedIndex=b}}}}function enableDisable(a,b){b=ge(b);if(b){if(b.value){b.value=""}if(b.selectedIndex){b.selectedIndex=0}}}function show_editor_error(a,b){_("editor_error_text").innerHTML=a;_("editor_error_explanation").innerHTML=b;show("error")}function make_explanation_list(c,a,b){var d="";if(b=="missing"){if(a==1){d=tx("el01",{"thing-1":c[0]})}else{if(a==2){d=tx("el02",{"thing-1":c[0],"thing-2":c[1]})}else{if(a==3){d=tx("el03",{"thing-1":c[0],"thing-2":c[1],"thing-3":c[2]})}else{if(a==4){d=tx("el04",{"thing-1":c[0],"thing-2":c[1],"thing-3":c[2],"thing-4":c[3]})}else{if(a>4){d=tx("el05",{"thing-1":c[0],"thing-2":c[1],"thing-3":c[2],num:a-3})}}}}}}else{if(b=="bad"){if(a==1){d=tx("el06",{"thing-1":c[0]})}else{if(a==2){d=tx("el07",{"thing-1":c[0],"thing-2":c[1]})}else{if(a==3){d=tx("el08",{"thing-1":c[0],"thing-2":c[1],"thing-3":c[2]})}else{if(a==4){d=tx("el09",{"thing-1":c[0],"thing-2":c[1],"thing-3":c[2],"thing-4":c[3]})}else{if(a>4){d=tx("el10",{"thing-1":c[0],"thing-2":c[1],"thing-3":c[2],num:a-3})}}}}}}}return d}function TimeSpan(b,e,o,f){this.get_start_ts=function(){return t(j,g,s,c,d,q)};this.get_end_ts=function(){var z=t(j,g,s,c,d,q);var A=t(i,a,r,m,x,v);if(z>A&&!(s&&r)){var y=new Date();y.setTime(A);y.setFullYear(y.getFullYear()+1);return y.getTime()}else{return A}};var j=ge(b+"_month");var g=ge(b+"_day");var c=ge(b+"_hour");var s=ge(b+"_year");var d=ge(b+"_min");var q=ge(b+"_ampm");var i=ge(e+"_month");var a=ge(e+"_day");var r=ge(e+"_year");var m=ge(e+"_hour");var x=ge(e+"_min");var v=ge(e+"_ampm");var w;if(f){w=false}else{w=true}var h=function(){if(!w){u(j,g,s,c,d,q)}};var p=function(){w=true};var u=function(){var y=t(j,g,s,c,d,q);var z=y+o*60000;l(z,i,a,r,m,x,v)};var t=function(C,M,P,H,F,O){var z=new Date();var A=z.getDate();var K=z.getMonth();var G=z.getFullYear();var J=C.value-1;var B=M.value;var E;var D=F.value;var N;E=parseInt(H.value);if(O.value!=""){if(E==12){E=0}if(O.value=="pm"){E=E+12}}if(!P){if(J<K){N=G+1}else{if(J==K&&B<A){N=G+1}else{N=G}}}else{N=P.value}var I=new Date(N,J,B,E,D,0,0);var L=I.getTime();return L};var l=function(I,B,J,L,D,C,K){var F=new Date();F.setTime(I);var E=B.value;var z=F.getMonth()+1;var A=F.getDate();var H=F.getHours();var G=F.getMinutes();var N=F.getFullYear();var M;if(K.value!=""){if(H>11){M="pm";if(H>12){H=H-12}}else{if(H==0){H=12}M="am"}}else{M=""}if(G<10){G="0"+G}B.value=z;J.value=A;if(L){L.value=N}D.value=H;C.value=G;K.value=M;if(E!=z){editor_date_month_change(B,J,L?L:false)}};var n=function(){h();editor_date_month_change(j,g,s?s:false)};var k=function(){p();editor_date_month_change(i,a,r?r:false)};j.onchange=n;g.onchange=h;if(s){s.onchange=h}c.onchange=h;d.onchange=h;q.onchange=h;i.onchange=k;a.onchange=p;if(r){r.onchange=p}m.onchange=p;x.onchange=p;v.onchange=p}function editor_date_month_change(g,e,f){var g=ge(g);var e=ge(e);var f=f?ge(f):false;var c=month_get_num_days(g.value,f.value&&f.value!=-1?f.value:false);var a=e.options[0].value==-1?1:0;for(var d=e.options.length;d>c+a;d--){remove_node(e.options[d-1])}for(var d=e.options.length;d<c+a;d++){e.options[d]=new Option(d+(a?0:1))}}function editor_date_year_change(c,a,b){editor_date_month_change(c,a,b)}function month_get_num_days(c,b){var a;if(c==-1){return 31}a=new Date(b?b:1912,c,0);return a.getDate()}function toggleEndWorkSpan(a){if(shown(a+"_endspan")){hide(a+"_endspan");show(a+"_present")}else{show(a+"_endspan");hide(a+"_present")}}function regionCountryChange(a,d,c,b){switch(d){case"326":show(c);_(a).innerHTML=b+tx("el13");break;case"398":show(c);_(a).innerHTML=b+tx("el12");break;default:_(a).innerHTML=b+tx("el11");hide(c);break}}function regionCountryChange_twoLabels(b,a,e,d,c){show(b);_(b).innerHTML=c+tx("el11");switch(e){case"326":show(d);show(a);_(a).innerHTML=c+tx("el13");break;case"":case"398":show(d);show(a);_(a).innerHTML=c+tx("el12");break;default:_(a).innerHTML=c+tx("el12");_(d).disabled=true;break}}function regionCountyChange_setUSifStateChosen(b,a){region_select=ge(a);country_select=ge(b);if(region_select.value!=""&&country_select.value==""){country_select.value=398}}function regionCountryChange_restrictions(b,a){country_select=ge(b);if(country_select.value==398){country_select.value=""}else{if(country_select.value==326){region_select=ge(a);if(region_select.value){country_select.value=""}}}}function textLimit(a,b){var c=ge(a);if(c.value.length>b){c.value=c.value.substring(0,b);if(arguments.length>2){_(arguments[2]).style.display="block"}}}function textLimitStrict(e,b,h,c,d){var g=ge(e);var a=g.value.length;var f=a-b;if(f>0){if(f>25000){g.value=g.value.substring(0,b+25000);f=25000}_(h).style.display="block";_(c).innerHTML=f;_(d).disabled=true}else{if(a==0){_(h).style.display="none";_(d).disabled=true;_(c).innerHTML=1}else{if(_(c).innerHTML!=0){_(c).innerHTML=0;_(h).style.display="none";_(d).disabled=false}}}}function calcAge(c,a,b){bYear=parseInt(_(b).value);bMonth=parseInt(_(c).value);bDay=parseInt(_(a).value);theDate=new Date();year=theDate.getFullYear();month=theDate.getMonth()+1;day=theDate.getDate();age=year-bYear;if((bMonth>month)||(bMonth==month&&day<bDay)){age--}return age}function mobile_phone_nag(d,c,a){var e=false;var b=function(){if(e){return}for(var f=0;f<d.length;f++){if((new RegExp("\\b"+d[f]+"\\b","i")).test(c.value)){e=true;(new AsyncRequest()).setURI("/ajax/mobile_phone_nag.php").setHandler(function(h){var g=h.getPayload();if(g){var i=document.createElement("div");i.innerHTML=g;i.className="mobile_nag";i.style.display="none";a.parentNode.insertBefore(i,a);animation(i).blind().show().from("height",0).to("height","auto").go()}}).setReadOnly(true).setOption("suppressErrorHandlerWarning",true).send();break}}};addEventBase(c,"keyup",b);addEventBase(c,"change",b)}function mobile_phone_nag_hide(a){while(a.parentNode&&a.className!="mobile_nag"){a=a.parentNode}a.parentNode.removeChild(a)};function tz_calculate(e){var g=new Date();var b=g.getTimezoneOffset()/30;var c=g.getTime()/1000;var f=Math.round((e-c)/1800);var a=Math.round(b+f)%48;if(a==0){return 0}else{if(a>24){a-=Math.ceil(a/48)*48}else{if(a<-28){a+=Math.ceil(a/-48)*48}}}return a*30}function ajax_tz_set(c){var e=c.time.value;var a=-tz_calculate(e);var d=c.tz_gmt_off.value;if(a!=d){var b="/ajax/autoset_timezone_ajax.php";new AsyncSignal(b,{user:c.user.value,post_form_id:c.post_form_id.value,gmt_off:a}).send()}}function tz_autoset(){var a=ge("tz_autoset_form");if(a){ajax_tz_set(a)}};function typeaheadpro(e,a,c){if(!typeaheadpro.hacks){typeaheadpro.should_check_missing_events=ua.safari()<500;typeaheadpro.should_use_iframe=typeaheadpro.should_simulate_keypress=ua.ie()||(ua.safari()>500&&ua.safari()<523||ua.safari()>=525);typeaheadpro.should_use_overflow=ua.opera()<9.5||ua.safari()<500;if(ua.firefox()){this.poll_handle=setInterval(this.check_value.bind(this),100);this.deactivate_poll_on_blur=false}typeaheadpro.hacks=true}typeaheadpro.instances=(typeaheadpro.instances||[]);typeaheadpro.instances.push(this);this.instance=typeaheadpro.instances.length-1;copy_properties(this,c||{});this.obj=e;this.obj.typeahead=this;this.obj.onfocus=this._onfocus.bind(this);this.obj.onblur=chain(this.obj.onblur,this._onblur.bind(this));this.obj.onchange=this._onchange.bind(this);this.obj.onkeyup=function(f){return this._onkeyup(f||window.event)}.bind(this);this.obj.onkeydown=function(f){return this._onkeydown(f||window.event)}.bind(this);this.obj.onkeypress=function(f){return this._onkeypress(f||window.event)}.bind(this);this.want_icon_list=false;this.showing_icon_list=false;this.stop_suggestion_select=false;if(this.typeahead_icon_class&&this.typeahead_icon_get_return){this.typeahead_icon=document.createElement("div");this.typeahead_icon.className="typeahead_list_icon "+this.typeahead_icon_class;this.typeahead_icon.innerHTML="&nbsp;";this.setup_typeahead_icon();setTimeout(function(){this.focus()}.bind(this),50);this.typeahead_icon.onmousedown=function(f){return this.typeahead_icon_onclick(f||window.event)}.bind(this)}this.focused=this.obj.offsetWidth?true:false;this.anchor=this.setup_anchor();this.dropdown=document.createElement("div");this.dropdown.className="typeahead_list";if(!this.focused){this.dropdown.style.display="none"}this.anchor_block=this.anchor_block||this.anchor.tagName.toLowerCase()=="div";if(this.should_use_absolute){document.body.appendChild(this.dropdown);this.dropdown.className+=" typeahead_list_absolute"}else{var d=this.anchor;var b=d.parentNode;if(b.id=="qsearch_wrapper"){d=b;b=b.parentNode}if(d.nextSibling){b.insertBefore(this.dropdown,d.nextSibling)}else{b.appendChild(this.dropdown)}if(!this.anchor_block){b.insertBefore(document.createElement("br"),this.dropdown)}}this.dropdown.appendChild(this.list=document.createElement("div"));this.dropdown.onmousedown=function(f){return this.dropdown_onmousedown(f||window.event)}.bind(this);if(typeaheadpro.should_use_iframe&&!typeaheadpro.iframe){typeaheadpro.iframe=document.createElement("iframe");typeaheadpro.iframe.src="/common/blank.html";typeaheadpro.iframe.className="typeahead_iframe";typeaheadpro.iframe.style.display="none";typeaheadpro.iframe.frameBorder=0;document.body.appendChild(typeaheadpro.iframe)}if(typeaheadpro.should_use_iframe&&typeaheadpro.iframe){typeaheadpro.iframe.style.zIndex=parseInt(get_style(this.dropdown,"zIndex"))-1}this.results_text="";this.last_key_suggestion=0;this.status=typeaheadpro.STATUS_BLOCK_ON_SOURCE_BOOTSTRAP;this.clear_placeholder();if(a){this.set_source(a)}if(this.source){this.selectedindex=-1;if(this.focused){this.show();this._onkeyup();this.set_class("");this.capture_submit()}}else{this.hide()}}typeaheadpro.prototype.enumerate=false;typeaheadpro.prototype.interactive=false;typeaheadpro.prototype.changed=false;typeaheadpro.prototype.render_block_size=50;typeaheadpro.prototype.typeahead_icon_class=false;typeaheadpro.prototype.typeahead_icon_get_return=false;typeaheadpro.prototype.old_value="";typeaheadpro.prototype.poll_handle=null;typeaheadpro.prototype.deactivate_poll_on_blur=true;typeaheadpro.prototype.suggestion_count=0;typeaheadpro.STATUS_IDLE=0;typeaheadpro.STATUS_WAITING_ON_SOURCE=1;typeaheadpro.STATUS_BLOCK_ON_SOURCE_BOOTSTRAP=2;typeaheadpro.prototype.should_use_absolute=false;typeaheadpro.prototype.max_results=0;typeaheadpro.prototype.max_display=10;typeaheadpro.prototype.allow_placeholders=true;typeaheadpro.prototype.auto_select=true;typeaheadpro.prototype.set_source=function(a){this.source=a;this.source.set_owner(this);this.status=typeaheadpro.STATUS_IDLE;this.cache={};this.last_search=0;this.suggestions=[]};typeaheadpro.prototype.setup_anchor=function(){return this.obj};typeaheadpro.prototype.destroy=function(){if(this.typeahead_icon){this.typeahead_icon.parentNode.removeChild(this.typeahead_icon);this.toggle_icon_list=function(){}}this.clear_render_timeouts();if(!this.anchor_block&&this.anchor.nextSibling.tagName.toLowerCase()=="br"){this.anchor.parentNode.removeChild(this.anchor.nextSibling)}if(this.dropdown){this.dropdown.parentNode.removeChild(this.dropdown)}this.obj.onfocus=this.obj.onblur=this.obj.onkeyup=this.obj.onkeydown=this.obj.onkeypress=null;this.obj.parentNode.removeChild(this.obj);this.anchor=this.obj=this.obj.typeahead=this.dropdown=null;delete typeaheadpro.instances[this.instance]};typeaheadpro.prototype.check_value=function(){if(this.obj){var a=this.obj.value;if(a!=this.old_value){this.dirty_results();this.old_value=a}}};typeaheadpro.prototype._onkeyup=function(a){this.last_key=a?a.keyCode:-1;if(this.key_down==this.last_key){this.key_down=0}switch(this.last_key){case 27:this.selectedindex=-1;this._onselect(false);this.hide();break}};typeaheadpro.prototype._onkeydown=function(a){this.key_down=this.last_key=a?a.keyCode:-1;this.interactive=true;switch(this.last_key){case 33:case 34:case 38:case 40:if(typeaheadpro.should_simulate_keypress){this._onkeypress({keyCode:this.last_key})}return false;case 9:this.select_suggestion(this.selectedindex);this.advance_focus();break;case 13:if(this.select_suggestion(this.selectedindex)){this.hide()}if(typeof(this.submit_keydown_return)!="undefined"){this.submit_keydown_return=this._onsubmit(this.get_current_selection())}return this.submit_keydown_return;case 229:if(!this.poll_handle){this.poll_handle=setInterval(this.check_value.bind(this),100)}break;default:setTimeout(bind(this,"check_value"),10)}};typeaheadpro.prototype._onkeypress=function(b){var c=1;this.last_key=b?event_get_keypress_keycode(b):-1;this.interactive=true;switch(this.last_key){case 33:c=this.max_display;case 38:this.set_suggestion(c>1&&this.selectedindex>0&&this.selectedindex<c?0:this.selectedindex-c);this.last_key_suggestion=(new Date()).getTime();return false;case 34:c=this.max_display;case 40:if(trim(this.get_value())==""&&!this.enumerate){this.enumerate=true;this.results_text=null;this.dirty_results()}else{this.set_suggestion(this.suggestions.length<=this.selectedindex+c?this.suggestions.length-1:this.selectedindex+c);this.last_key_suggestion=(new Date()).getTime()}return false;case 13:var a=null;if(typeof(this.submit_keydown_return)=="undefined"){a=this.submit_keydown_return=this._onsubmit(this.get_current_selection())}else{a=this.submit_keydown_return;delete this.submit_keydown_return}return a;default:setTimeout(bind(this,"check_value"),10);break}return true};typeaheadpro.prototype._onchange=function(){this.changed=true};typeaheadpro.prototype._onfound=function(a){return this.onfound?this.onfound.call(this,a):true};typeaheadpro.prototype._onsubmit=function(b){if(this.onsubmit){var a=this.onsubmit.call(this,b);if(a&&this.obj.form){if(!this.obj.form.onsubmit||this.obj.form.onsubmit()){this.obj.form.submit()}return false}return a}else{this.advance_focus();return false}};typeaheadpro.prototype._onselect=function(a){if(this.onselect){this.onselect.call(this,a)}};typeaheadpro.prototype._onfocus=function(){if(this.last_dropdown_mouse>(new Date()).getTime()-10||this.focused){return}this.focused=true;this.changed=false;this.clear_placeholder();this.results_text="";this.set_class("");this.dirty_results();this.show();this.capture_submit();if(this.typeahead_icon){show(this.typeahead_icon)}};typeaheadpro.prototype._onblur=function(b){if(!this.stop_hiding){if(this.showing_icon_list){this.toggle_icon_list(true)}}else{this.focus();return false}if(this.last_dropdown_mouse&&this.last_dropdown_mouse>(new Date()).getTime()-10){event_prevent(b);setTimeout(function(){this.focus()}.bind(this.obj),0);return false}this.focused=false;if(this.changed&&!this.interactive){this.dirty_results();this.changed=false;return}if(!this.suggestions){this._onselect(false)}else{if(this.selectedindex>=0){this.select_suggestion(this.selectedindex)}}this.hide();this.update_class();if(!this.get_value()){var a=this.allow_placeholders?"":this.source.gen_noinput();this.set_value(a?a:"");this.set_class("typeahead_placeholder")}if(this.poll_handle&&this.deactivate_poll_on_blur){clearInterval(this.poll_handle);this.poll_handle=null}};typeaheadpro.prototype.typeahead_icon_onclick=function(a){this.stop_hiding=true;this.focus();setTimeout(function(){this.toggle_icon_list()}.bind(this),50);event_abort(a);return false};typeaheadpro.prototype.dropdown_onmousedown=function(a){this.last_dropdown_mouse=(new Date()).getTime()};typeaheadpro.prototype.setup_typeahead_icon=function(){this.typeahead_parent=document.createElement("div");this.typeahead_parent.className="typeahead_parent";this.typeahead_parent.appendChild(this.typeahead_icon);this.obj.parentNode.insertBefore(this.typeahead_parent,this.obj)};typeaheadpro.prototype.mouse_set_suggestion=function(a){if(!this.visible){return}if((new Date()).getTime()-this.last_key_suggestion>50){this.set_suggestion(a)}};typeaheadpro.prototype.capture_submit=function(){if(!typeaheadpro.should_check_missing_events){return}if((!this.captured_form||this.captured_substitute!=this.captured_form.onsubmit)&&this.obj.form){this.captured_form=this.obj.form;this.captured_event=this.obj.form.onsubmit;this.captured_substitute=this.obj.form.onsubmit=function(){return((this.key_down&&this.key_down!=13&&this.key_down!=9)?this.submit_keydown_return:(this.captured_event?this.captured_event.apply(arguments,this.captured_form):true))?true:false}.bind(this)}};typeaheadpro.prototype.set_suggestion=function(a){this.stop_suggestion_select=false;if(!this.suggestions||this.suggestions.length<=a){return}var b=this.get_suggestion_node(this.selectedindex);this.selectedindex=(a<=-1)?-1:a;var c=this.get_suggestion_node(this.selectedindex);if(b){b.className=b.className.replace(/\btypeahead_selected\b/,"typeahead_not_selected")}if(c){c.className=c.className.replace(/\btypeahead_not_selected\b/,"typeahead_selected")}this.recalc_scroll();this._onfound(this.get_current_selection())};typeaheadpro.prototype.get_suggestion_node=function(b){var a=this.list.childNodes;return b==-1?null:a[Math.floor(b/this.render_block_size)].childNodes[b%this.render_block_size]};typeaheadpro.prototype.get_current_selection=function(){return this.selectedindex==-1?false:this.suggestions[this.selectedindex]};typeaheadpro.prototype.update_class=function(){if(this.suggestions&&this.selectedindex!=-1&&typeahead_source.flatten_string(this.get_current_selection().t)==typeahead_source.flatten_string(this.get_value())){this.set_class("typeahead_found")}else{this.set_class("")}};typeaheadpro.prototype.select_suggestion=function(a){if(!this.stop_suggestion_select&&this.current_selecting!=a){this.current_selecting=a}if(!this.suggestions||a==undefined||a===false||this.suggestions.length<=a||a<0){this._onfound(false);this._onselect(false);this.selectedindex=-1;this.set_class("")}else{this.selectedindex=a;this.set_value(this.suggestions[a].t);this.set_class("typeahead_found");this._onfound(this.suggestions[this.selectedindex]);this._onselect(this.suggestions[this.selectedindex])}if(!this.interactive){this.hide();this.blur()}this.current_selecting=null;return true};typeaheadpro.prototype.set_value=function(a){this.obj.value=a};typeaheadpro.prototype.get_value=function(){if(this.showing_icon_list&&this.old_typeahead_value!=this.obj.value){this.toggle_icon_list()}if(this.want_icon_list){return this.typeahead_icon_get_return}else{if(this.showing_icon_list){this.toggle_icon_list()}}return this.obj.value};typeaheadpro.prototype.found_suggestions=function(b,p,o){if(!b){b=[]}this.suggestion_count=b.length;if(!o){this.status=typeaheadpro.STATUS_IDLE;this.add_cache(p,b)}this.clear_render_timeouts();if(this.get_value()==this.results_text){return}else{if(!o){this.results_text=typeahead_source.flatten_string(p);if(this.enumerate&&trim(this.results_text)!=""){this.enumerate=false}}}var j=-1;if(this.selectedindex!=-1){var f=this.suggestions[this.selectedindex].i;for(var g=0,e=b.length;g<e;g++){if(b[g].i==f){j=g;break}}}if(j==-1&&this.auto_select&&b.length){j=0;this._onfound(b[0])}this.selectedindex=j;this.suggestions=b;if(!o){this.real_suggestions=b}if(b.length){var h=[],m=Math.ceil(b.length/this.render_block_size),c={},k,a=null;this.list.innerHTML="";for(var g=0;g<m;g++){this.list.appendChild(document.createElement("div"))}if(j>-1){k=Math.floor(j/this.render_block_size);c[k]=true;if(j%this.render_block_size>this.render_block_size/2){c[k+1]=true}else{if(k!=0){c[k-1]=true}}}else{c[0]=true}for(var d in c){this.render_block(d);sample=this.list.childNodes[d].firstChild}this.show();if(m){var n=sample.offsetHeight;this.render_timeouts=[];for(var g=1;g<m;g++){if(!c[g]){this.list.childNodes[g].style.height=n*Math.min(this.render_block_size,b.length-g*this.render_block_size)+"px";this.list.childNodes[g].style.width="1px";this.render_timeouts.push(setTimeout(this.render_block.bind(this,g),700+g*50))}}}}else{this.selectedindex=-1;this.set_message(this.status==typeaheadpro.STATUS_IDLE?this.source.gen_nomatch():this.source.gen_loading());this._onfound(false)}this.recalc_scroll();if(!o&&this.results_text!=typeahead_source.flatten_string(this.get_value())){this.dirty_results()}};typeaheadpro.prototype.render_block=function(d,h){var a=this.suggestions,g=this.selectedindex,k=this.get_value(),j=this.instance,f=[],b=this.list.childNodes[d];for(var e=d*this.render_block_size,c=Math.min(a.length,(d+1)*this.render_block_size);e<c;e++){f.push('<div class="');if(g==e){f.push("typeahead_suggestion typeahead_selected")}else{f.push("typeahead_suggestion typeahead_not_selected")}f.push('" onmouseover="typeaheadpro.instances[',j,"].mouse_set_suggestion(",e,')" ','onmousedown="typeaheadpro.instances[',j,"].select_suggestion(",e,'); event_abort(event);">',this.source.gen_html(a[e],k),"</div>")}b.innerHTML=f.join("");b.style.height="auto";b.style.width="auto"};typeaheadpro.prototype.clear_render_timeouts=function(){if(this.render_timeouts){for(var a=0;a<this.render_timeouts.length;a++){clearTimeout(this.render_timeouts[a])}this.render_timeouts=null}};typeaheadpro.prototype.recalc_scroll=function(){var e=this.list.firstChild;if(!e){return}if(e.childNodes.length>this.max_display){var a=e.childNodes[this.max_display-1];var c=a.offsetTop+a.offsetHeight;this.dropdown.style.height=c+"px";var b=this.get_suggestion_node(this.selectedindex);if(b){var d=this.dropdown.scrollTop;if(b.offsetTop<d){this.dropdown.scrollTop=b.offsetTop}else{if(b.offsetTop+b.offsetHeight>c+d){this.dropdown.scrollTop=b.offsetTop+b.offsetHeight-c}}}if(!typeaheadpro.should_use_overflow){this.dropdown.style.overflowY="scroll";this.dropdown.style.overflowX="hidden"}}else{this.dropdown.style.height="auto";if(!typeaheadpro.should_use_overflow){this.dropdown.style.overflowY="hidden"}}};typeaheadpro.prototype.search_cache=function(a){return this.cache[typeahead_source.flatten_string(a)]};typeaheadpro.prototype.add_cache=function(b,a){if(this.source.cache_results){this.cache[typeahead_source.flatten_string(b)]=a}};typeaheadpro.prototype.update_status=function(a){this.status=a;this.dirty_results()};typeaheadpro.prototype.set_class=function(a){this.obj.className=(this.obj.className.replace(/typeahead_[^\s]+/g,"")+" "+a).replace(/ {2,}/g," ")};typeaheadpro.prototype.dirty_results=function(){if(!this.enumerate&&trim(this.get_value())==""){this.results_text="";this.set_message(this.source.gen_placeholder());this.suggestions=[];this.selectedindex=-1;return}else{if(this.results_text==typeahead_source.flatten_string(this.get_value())){return}else{if(this.status==typeaheadpro.STATUS_BLOCK_ON_SOURCE_BOOTSTRAP){this.set_message(this.source.gen_loading());return}}}var e=(new Date).getTime();var d=false;if(this.last_search<=(e-this.source.search_limit)&&this.status==typeaheadpro.STATUS_IDLE){d=this.perform_search()}else{if(this.status==typeaheadpro.STATUS_IDLE){if(!this.search_timeout){this.search_timeout=setTimeout(function(){this.search_timeout=false;if(this.status==typeaheadpro.STATUS_IDLE){this.dirty_results()}}.bind(this),this.source.search_limit-(e-this.last_search))}}}if(this.source.allow_fake_results&&this.real_suggestions&&!d){var a=typeahead_source.tokenize(this.get_value()).sort(typeahead_source._sort);var c=[];for(var b=0;b<this.real_suggestions.length;b++){if(typeahead_source.check_match(a,this.real_suggestions[b].t+" "+this.real_suggestions[b].n)){c.push(this.real_suggestions[b])}}if(c.length){this.found_suggestions(c,this.get_value(),true)}else{this.selectedindex=-1;this.set_message(this.source.gen_loading())}}};typeaheadpro.prototype.perform_search=function(){if(this.get_value()==this.results_text){return true}var a;if((a=this.search_cache(this.get_value()))===undefined&&!(a=this.source.search_value(this.get_value()))){this.status=typeaheadpro.STATUS_WAITING_ON_SOURCE;this.last_search=(new Date).getTime();return false}this.found_suggestions(a,this.get_value(),false);return true};typeaheadpro.prototype.set_message=function(a){this.clear_render_timeouts();if(a){this.list.innerHTML='<div class="typeahead_message">'+a+"</div>";this.reset_iframe()}else{this.hide()}this.recalc_scroll()};typeaheadpro.prototype.reset_iframe=function(){if(!typeaheadpro.should_use_iframe){return}if(this.should_use_absolute){typeaheadpro.iframe.style.top=this.dropdown.style.top;typeaheadpro.iframe.style.left=this.dropdown.style.left}else{typeaheadpro.iframe.style.top=elementY(this.dropdown)+"px";typeaheadpro.iframe.style.left=elementX(this.dropdown)+"px"}typeaheadpro.iframe.style.width=this.dropdown.offsetWidth+"px";typeaheadpro.iframe.style.height=this.dropdown.offsetHeight+"px";typeaheadpro.iframe.style.display=""};typeaheadpro.prototype.advance_focus=function(){var b=this.obj.form?get_all_form_inputs(this.obj.form):get_all_form_inputs();var c=false;for(var a=0;a<b.length;a++){if(c){if(b[a].type!="hidden"&&b[a].tabIndex!=-1&&b[a].offsetParent){c.push(b[a])}}else{if(b[a]==this.obj){c=[]}}}setTimeout(function(){for(var d=0;d<this.length;d++){try{if(this[d].offsetParent){this[d].focus();setTimeout(function(){try{this.focus()}catch(g){}}.bind(this[d]),0);return}}catch(f){}}}.bind(c?c:[]),0)};typeaheadpro.prototype.clear_placeholder=function(){if(this.obj.className.indexOf("typeahead_placeholder")!=-1){this.set_value("");this.set_class("")}};typeaheadpro.prototype.clear=function(){this.set_value("");this.set_class("");this.selectedindex=-1;this.enumerate=false;this.dirty_results()};typeaheadpro.prototype.hide=function(){if(this.stop_hiding){return}this.visible=false;if(this.should_use_absolute){this.dropdown.style.display="none"}else{this.dropdown.style.visibility="hidden"}this.clear_render_timeouts();if(typeaheadpro.should_use_iframe){typeaheadpro.iframe.style.display="none"}};typeaheadpro.prototype.show=function(){this.visible=true;if(this.focused){if(this.should_use_absolute){this.dropdown.style.top=elementY(this.anchor)+this.anchor.offsetHeight+"px";this.dropdown.style.left=elementX(this.anchor)+"px"}this.dropdown.style.width=(this.anchor.offsetWidth-2)+"px";this.dropdown.style[this.should_use_absolute?"display":"visibility"]="";if(typeaheadpro.should_use_iframe){typeaheadpro.iframe.style.display="";this.reset_iframe()}}};typeaheadpro.prototype.toggle_icon_list=function(a){if(this.showing_icon_list){this.showing_icon_list=false;this.source.showing_icon_list=false;if(!a){this.focus()}remove_css_class_name(this.typeahead_icon,"on_selected");this.want_icon_list=false;this.showing_icon_list=false;this.stop_suggestion_select=true;if(this.obj){this.dirty_results()}}else{this.source.showing_icon_list=true;this.old_typeahead_value=this.obj.value;this.stop_suggestion_select=true;this.want_icon_list=true;this.dirty_results();this.focus();add_css_class_name(this.typeahead_icon,"on_selected");this.show();this.set_suggestion(-1);this.showing_icon_list=true}setTimeout(function(){this.stop_hiding=false}.bind(this),100)};typeaheadpro.prototype.focus=function(){this.obj.focus()};typeaheadpro.prototype.blur=function(){this.obj.blur()};typeaheadpro.kill_typeahead=function(a){if(a.typeahead){if(!this.should_use_absolute&&!this.anchor_block){a.parentNode.removeChild(a.nextSibling)}a.parentNode.removeChild(a.nextSibling);if(a.typeahead.source){a.typeahead.source=a.typeahead.source.owner=null}a.onfocus=a.onblur=a.onkeypress=a.onkeyup=a.onkeydown=a.typeahead=null}};function tokenizer(c,e,b,d,a){if(ua.safari()<500){tokenizer.valid_arrow_count=0;tokenizer.valid_arrow_event=function(){return tokenizer.valid_arrow_count++%2==0}}else{tokenizer.valid_arrow_event=function(){return true}}this.obj=c;this.obj.tokenizer=this;this.typeahead_source=e;while(!/\btokenizer\b/.test(this.obj.className)){this.obj=this.obj.parentNode}this.tab_stop=this.obj.getElementsByTagName("input")[0];this.inputs=[];this.obj.onmousedown=function(f){return this._onmousedown(f?f:window.event)}.bind(this);this.tab_stop.onfocus=function(f){return this._onfocus(f?f:window.event)}.bind(this);this.tab_stop.onblur=function(f){return this.tab_stop_onblur(f?f:window.event)}.bind(this);this.tab_stop.onkeydown=function(f){return this.tab_stop_onkeydown(f?f:window.event)}.bind(this);if(!b&&elementY(this.obj)>0&&this.obj.offsetWidth){this._onfocus()}this.max_selections=d;copy_properties(this,a||{});this.properties=a}tokenizer.is_empty=function(a){if(has_css_class_name(a,"tokenizer_locked")){return a.getElementsByTagName("input").length==0}else{return(!a.tokenizer||a.tokenizer.count_names()==0)}};tokenizer.prototype.get_token_values=function(){var c=[];var b=this.obj.getElementsByTagName("input");for(var a=0;a<b.length;++a){if(b[a].name&&b[a].value){c.push(b[a].value)}}return c};tokenizer.prototype.get_token_strings=function(){var b=[];var c=this.obj.getElementsByTagName("a");for(var a=0;a<c.length;++a){if(typeof c[a].token!="undefined"){b.push(c[a].token.text)}}return b};tokenizer.prototype.clear=function(){var b=this.obj.getElementsByTagName("a");for(var a=b.length-1;a>=0;--a){if(typeof b[a].token!="undefined"){b[a].token.remove()}}};tokenizer.prototype._onmousedown=function(a){if(this.onfocus){this.onfocus()}setTimeout(function(){if(!this.inputs.length){if(this.max_selections>this.count_names()){new tokenizer_input(this)}else{var c=this.obj.getElementsByTagName("a");for(var b=c.length-1;b>=0;b--){if(typeof c[b].token!="undefined"){c[b].token.select();break}}}}else{this.inputs[0].focus()}}.bind(this),0);a?a.cancelBubble=true:false;return false};tokenizer.prototype._onfocus=function(a){if(this.tab_stop_ignore_focus){this.tab_stop_ignore_focus=false;return}this._onmousedown()};tokenizer.prototype.tab_stop_onblur=function(a){this.selected_token?this.selected_token.deselect():false};tokenizer.prototype.tab_stop_onkeydown=function(d){if(!d.keyCode||!this.selected_token){return}switch(d.keyCode){case 8:case 46:var a=this.selected_token;var c=a.element.previousSibling;if(c&&c.input){c.input.element.focus()}else{new tokenizer_input(this,a.element)}a.remove();return false;case 37:if(!tokenizer.valid_arrow_event()){break}var a=this.selected_token;var c=a.element.previousSibling;if(c&&c.input){c.input.element.focus()}else{if(this.max_selections>this.count_names()){new tokenizer_input(this,a.element)}else{return false}}a.deselect();return false;case 39:if(!tokenizer.valid_arrow_event()){break}var a=this.selected_token;var b=a.element.nextSibling;if(b&&b.input){b.input.focus()}else{if(this.max_selections>this.count_names()){new tokenizer_input(this,a.element.nextSibling)}else{return false}}a.deselect();return false}};tokenizer.prototype.count_names=function(f){var d=this.obj.getElementsByTagName("input");var e={};var c=0;for(var b=0;b<d.length;b++){if(d[b].type=="hidden"&&!e[d[b].value]){e[d[b].value]=true;++c}}if(f){for(var a=0;a<f.length;a++){if(!e[f[a]]){e[f[a]]=true;++c}}}return c};tokenizer.prototype.disable=function(){this.tab_stop.parentNode.removeChild(this.tab_stop);this.obj.className+=" tokenizer_locked"};function tokenizer_input(a,b){if(!tokenizer_input.hacks){tokenizer_input.should_use_borderless_hack=ua.safari();tokenizer_input.should_use_shadow_hack=ua.ie()||ua.opera();tokenizer_input.hacks=true}this.tokenizer=a;this.obj=document.createElement("input");this.obj.input=this;this.obj.tabIndex=-1;this.obj.size=1;this.obj.onmousedown=function(c){(c?c:window.event).cancelBubble=true}.bind(this);this.shadow=document.createElement("span");this.shadow.className="tokenizer_input_shadow";this.element=document.createElement("div");this.element.className="tokenizer_input"+(tokenizer_input.should_use_borderless_hack?" tokenizer_input_borderless":"");this.element.appendChild(document.createElement("div"));this.element.firstChild.appendChild(this.obj);(tokenizer_input.should_use_shadow_hack?document.body:this.element.firstChild).appendChild(this.shadow);b?a.obj.insertBefore(this.element,b):a.obj.appendChild(this.element);this.tokenizer.tab_stop.disabled=true;this.update_shadow();this.update_shadow=this.update_shadow.bind(this);this.tokenizer.inputs.push(this);this.parent.construct(this,this.obj,this.tokenizer.typeahead_source);if(this.focused){this.focus();this.obj.select()}copy_properties(this,a.properties||{});setInterval(this.update_shadow.bind(this),100)}tokenizer_input.extend(typeaheadpro);tokenizer_input.prototype.gen_nomatch=tokenizer_input.prototype.gen_loading=tokenizer_input.prototype.gen_placeholder=tokenizer_input.prototype.gen_noinput="";tokenizer_input.prototype.max_display=8;tokenizer_input.prototype.setup_anchor=function(){return this.tokenizer.obj};tokenizer_input.prototype.update_shadow=function(){try{var b=this.obj.value}catch(a){return}if(this.shadow_input!=b){this.shadow.innerHTML=htmlspecialchars((this.shadow_input=b)+"^_^");if(tokenizer_input.should_use_shadow_hack){this.obj.style.width=this.shadow.offsetWidth+"px";this.obj.value=b}}};tokenizer_input.prototype._onblur=function(){if(this.parent._onblur()===false){return false}if(this.changed&&!this.interactive){this.dirty_results();this.changed=false;return}if(this.changed||this.interactive){this.select_suggestion(this.selectedindex)}setTimeout(function(){this.disabled=false}.bind(this.tokenizer.tab_stop),1000);tokenizerToDestroy=this;setTimeout(function(){tokenizerToDestroy.destroy()},0)};tokenizer_input.prototype._onfocus=function(){this.tokenizer.tab_stop.disabled=true;this.parent._onfocus();return true};tokenizer_input.prototype._onkeydown=function(c){switch(c.keyCode){case 13:break;case 37:case 8:if(this.get_selection_start()!=0||this.obj.value!=""){break}var b=this.element.previousSibling;if(b&&b.token){setTimeout(b.token.select.bind(b.token),0)}break;case 39:case 46:if(this.get_selection_start()!=this.obj.value.length){break}var a=this.element.nextSibling;if(a&&a.token){setTimeout(a.token.select.bind(a.token),0)}break;case 188:this._onkeydown({keyCode:13});return false;case 9:if(this.obj.value){this.advance_focus();this._onkeydown({keyCode:13});return false}else{if(!c.shiftKey){this.advance_focus();this.parent._onkeydown(c);return false}}break}return this.parent._onkeydown(c)};tokenizer_input.prototype._onkeypress=function(a){switch(a.keyCode){case 9:return false}setTimeout(this.update_shadow,0);return this.parent._onkeypress(a)};tokenizer_input.prototype.select_suggestion=function(a){if(this.suggestions&&a>=0&&this.suggestions.length>a){var b=this.tokenizer.obj.getElementsByTagName("input");var c=this.suggestions[a].i;for(i=0;i<b.length;i++){if(b[i].name=="ids[]"&&b[i].value==c){return false}}}return this.parent.select_suggestion(a)};tokenizer_input.prototype.get_selection_start=function(){if(this.obj.selectionStart!=undefined){return this.obj.selectionStart}else{return Math.abs(document.selection.createRange().moveStart("character",-1024))}};tokenizer_input.prototype.onselect=function(b){if(b){var a=this.tokenizer.obj.getElementsByTagName("input");for(i=0;i<a.length;i++){if(a[i].name=="ids[]"&&a[i].value==b.i){return false}}new token(b,this.tokenizer,this.element);if(this.tokenizer.max_selections>this.tokenizer.count_names()){this.clear()}else{this.destroy();this.hide=function(){};return false}}if(b){this.tokenizer._ontokenadded(b)}this.tokenizer.typeahead_source.onselect_not_found.call(this);return false};tokenizer.prototype._ontokenadded=function(a){if(this.ontokenadded){this.ontokenadded.call(this,a)}};tokenizer.prototype._ontokenremoved=function(a){if(this.ontokenremoved){this.ontokenremoved.call(this,a)}};tokenizer.prototype._ontokennotfound=function(a){if(this.ontokennotfound){this.ontokennotfound.call(this,a)}};tokenizer_input.prototype._onsubmit=function(){return false};tokenizer_input.prototype.capture_submit=function(){return false};tokenizer_input.prototype.clear=function(){this.parent.clear();this.update_shadow()};tokenizer_input.prototype.destroy=function(){if(tokenizer_input.should_use_shadow_hack){this.shadow.parentNode.removeChild(this.shadow)}this.element.parentNode.removeChild(this.element);this.element=null;var a=this.tokenizer.inputs.indexOf(this);if(a!=-1){this.tokenizer.inputs.splice(a,1)}this.tokenizer=this.element=this.shadow=null;this.parent.destroy();return null};function token(b,a,c){if(b.is&&(a.count_names(b.is)>a.max_selections)){(new contextual_dialog).set_context(a.obj).show_prompt(tx("ta12"),tx("ta13")).fade_out(500,1500);return null}this.tokenizer=a;this.element=document.createElement("a");this.element.className="token";this.element.href="#";this.element.tabIndex=-1;this.element.onclick=function(d){return this._onclick(d?d:window.event)}.bind(this);this.element.onmousedown=function(d){(d?d:window.event).cancelBubble=true;return false};this.render_obj(b);this.obj=b;this.element.token=this;c?this.tokenizer.obj.insertBefore(this.element,c):this.tokenizer.obj.appendChild(this.element)}token.prototype.render_obj=function(e){var c="";if(e.np){var d=""}else{var d='mi_protected="true" '}if(e.e){c=['<input type="hidden" ',d,'name="emails[]" value="',e.e,'" />'].join("")}else{if(e.i){c=['<input type="hidden" ',d,'name="',this.tokenizer.obj.id,'[]" value="',e.i,'" />'].join("")}else{if(e.is){for(var b=0,a=e.is.length;b<a;b++){c+=['<input type="hidden" ',d,'name="',this.tokenizer.obj.id,'[]" value="',e.is[b],'" />'].join("")}this.explodable=true;this.n=e.n}}}this.text=e.t;this.element.innerHTML=["<span><span><span><span>",c,htmlspecialchars(e.t),'<span onclick="this.parentNode.parentNode.parentNode.parentNode.parentNode.token.remove(true); event.cancelBubble=true; return false;" ','onmouseover="this.className=\'x_hover\'" onmouseout="this.className=\'x\'" class="x">&nbsp;</span>',"</span></span></span></span>"].join("")};token.prototype._onclick=function(e){var d=(new Date()).getTime();if(this.explodable&&this.tokenizer.last_select_time&&(d-this.tokenizer.last_select_time<1400)){var f=this.n;this.remove();var c=this.tokenizer.obj.getElementsByTagName("input");var b={};for(var a=0;a<c.length;++a){if(c[a].name=="ids[]"){b[c[a].value]=true}}for(var g in f){if(!b[g]){new token({t:f[g],i:g},this.tokenizer)}}}else{this.select()}this.tokenizer.last_select_time=d;e.cancelBubble=true;return false};token.prototype.select=function(a){if(this.tokenizer.selected_token&&!a){this.tokenizer.selected_token.deselect()}this.element.className=trim(this.element.className.replace("token_selected",""))+" token_selected";this.tokenizer.tab_stop_ignore_focus=true;if(this.tokenizer.tab_stop.disabled){this.tokenizer.tab_stop.disabled=false}this.tokenizer.tab_stop.focus();this.tokenizer.selected_token=this;if(a!==true){setTimeout(function(){this.select(true)}.bind(this),0)}else{setTimeout(function(){this.tab_stop_ignore_focus=false}.bind(this.tokenizer),0)}};token.prototype.remove=function(a){this.element.parentNode.removeChild(this.element);this.element.token=null;this.tokenizer.selected_token=null;if(a){this.tokenizer._onmousedown()}if(this.obj){this.tokenizer._ontokenremoved(this.obj)}};token.prototype.deselect=function(){this.element.className=trim(this.element.className.replace("token_selected",""));this.tokenizer.selected_token=null};function typeahead_source(){}typeahead_source.prototype.cache_results=false;typeahead_source.prototype.enumerable=false;typeahead_source.prototype.allow_fake_results=false;typeahead_source.prototype.search_limit=10;typeahead_source.check_match=function(c,g){g=typeahead_source.tokenize(g);for(var e=0,a=c.length;e<a;e++){if(c[e].length){var f=false;for(var b=0,d=g.length;b<d;b++){if(g[b].length>=c[e].length&&g[b].substring(0,c[e].length)==c[e]){f=true;g[b]="";break}}if(!f){return false}}}return true};typeahead_source.tokenize=function(c,a,b){return(b?c:typeahead_source.flatten_string(c)).split(a?typeahead_source.normalizer_regex_capture:typeahead_source.normalizer_regex)};typeahead_source.normalizer_regex_str="(?:(?:^| +)[\"'.\\-]+ *)|(?: *['\".\\-]+(?: +|$)|@| +)";typeahead_source.normalizer_regex=new RegExp(typeahead_source.normalizer_regex_str,"g");typeahead_source.normalizer_regex_capture=new RegExp("("+typeahead_source.normalizer_regex_str+")","g");typeahead_source.flatten_string=function(b){if(!typeahead_source.accents){typeahead_source.accents={a:/à|á|â|ã|ä|å/g,c:/ç/g,d:/ð/g,e:/è|é|ê|ë/g,i:/ì|í|î|ï/g,n:/ñ/g,o:/ø|ö|õ|ô|ó|ò/g,u:/ü|û|ú|ù/g,y:/ÿ|ý/g,ae:/æ/g,oe:/œ/g}}b=b.toLowerCase();for(var a in typeahead_source.accents){b=b.replace(typeahead_source.accents[a],a)}return b};typeahead_source.prototype.set_owner=function(a){this.owner=a;if(this.is_ready){this.owner.update_status(typeaheadpro.STATUS_IDLE)}};typeahead_source.prototype.ready=function(){if(this.owner&&!this.is_ready){this.is_ready=true;this.owner.update_status(typeaheadpro.STATUS_IDLE)}else{this.is_ready=true}};typeahead_source.highlight_found=function(h,c){var f=[];resultv=typeahead_source.tokenize(h,true,true);h=typeahead_source.tokenize(h,true);c=typeahead_source.tokenize(c);c.sort(typeahead_source._sort);for(var e=0,a=resultv.length;e<a;e++){var g=false;for(var b=0,d=c.length;b<d;b++){if(c[b]&&h[e].lastIndexOf(c[b],0)!=-1){f.push("<em>",htmlspecialchars(resultv[e].substring(0,c[b].length)),"</em>",htmlspecialchars(resultv[e].substring(c[b].length,resultv[e].length)));g=true;break}}if(!g){f.push(htmlspecialchars(resultv[e]))}}return f.join("")};typeahead_source._sort=function(d,c){return c.length-d.length};typeahead_source.prototype.gen_nomatch=function(){return this.text_nomatch!=null?this.text_nomatch:tx("ta01")};typeahead_source.prototype.gen_loading=function(){return this.text_loading!=null?this.text_loading:tx("ta02")};typeahead_source.prototype.gen_placeholder=function(){return this.text_placeholder!=null?this.text_placeholder:tx("ta03")};typeahead_source.prototype.gen_noinput=function(){return this.text_noinput!=null?this.text_noinput:tx("ta03")};typeahead_source.prototype.onselect_not_found=function(){if(typeof this.tokenizer._ontokennotfound!="undefined"){this.tokenizer._ontokennotfound(this.obj.value)}if(typeof this.tokenizer.onselect!="undefined"){return this.tokenizer.onselect()}};function static_source(){this.values=null;this.index=null;this.index_includes_hints=false;this.exclude_ids={};this.parent.construct(this)}static_source.extend(typeahead_source);static_source.prototype.enumerable=true;static_source.prototype.build_index=function(g){var f=[];var l=this.values;var k=l.length&&typeof l[0].i=="undefined";for(var d=0,h=l.length;d<h;d++){var a=typeahead_source.tokenize(l[d].t);for(var b=0,c=a.length;b<c;b++){f.push({t:a[b],o:l[d]})}if(this.index_includes_hints&&l[d].s){var a=typeahead_source.tokenize(l[d].s);for(var b=0,c=a.length;b<c;b++){f.push({t:a[b],o:l[d]})}}if(k){l[d].i=d}}var e=function(){f.sort(function(m,j){return(m.t==j.t)?0:(m.t<j.t?-1:1)});this.index=f;this.ready()}.bind(this);if(g){e()}else{e.defer()}};static_source.prototype._sort_text_obj=function(d,c){if(d.e&&!c.e){return 1}if(!d.e&&c.e){return -1}if(d.t==c.t){return 0}return d.t<c.t?-1:1};static_source.prototype.search_value=function(l){if(!this.is_ready){return}var g;if(l==""){g=this.values}else{var k=typeahead_source.tokenize(l).sort(typeahead_source._sort);var h=this.index;var j=0;var e=this.index.length-1;var b=Math.floor(e/2);while(j<=e){if(h[b].t>=k[0]){e=b-1}else{j=b+1}b=Math.floor(j+((e-j)/2))}var g=[];var d={};var a=typeof _ignoreList!="undefined";for(var f=j;f<h.length&&h[f].t.lastIndexOf(k[0],0)!=-1;f++){var c=h[f].o.flid?h[f].o.flid:h[f].o.i;if(typeof d[c]!="undefined"){continue}else{d[c]=true}if((!a||!_ignoreList[c])&&!this.exclude_ids[c]&&(k.length==1||typeahead_source.check_match(k,h[f].o.t))){g.push(h[f].o)}}}g.sort(this._sort_text_obj);if(this.owner.max_results){g=g.slice(0,this.owner.max_results)}return g};static_source.prototype.set_exclude_ids=function(a){this.exclude_ids=a};function friend_source(a){this.parent.construct(this);if(friend_source.friends[a]){this.values=friend_source.friends[a];this.index=friend_source.friends_index[a];this.ready()}else{new AsyncRequest().setMethod("GET").setReadOnly(true).setURI("/ajax/typeahead_friends.php?"+a).setHandler(function(b){friend_source.friends[a]=this.values=b.getPayload().friends;this.build_index();friend_source.friends_index[a]=this.index}.bind(this)).send()}}friend_source.extend(static_source);friend_source.prototype.text_noinput=friend_source.prototype.text_placeholder=tx("ta04");friend_source.friends={};friend_source.friends_index={};friend_source.prototype.cache_results=true;friend_source.prototype.gen_html=function(a,c){var e=a.n;if(a.n===false){e=tx("ta16")}else{if(typeof(a.n)=="object"){var d=[];for(var b in a.n){d.push(a.n[b])}if(d.length>3){e=tx("ta15",{name1:d[0],name2:d[1],count:d.length-2})}else{if(d.length){e=d.join(", ")}else{e=tx("ta16")}}}}return["<div>",typeahead_source.highlight_found(a.t,c),"</div><div><small>",e,"</small></div>"].join("")};friend_source.prototype.search_value=function(a){if(a=="\x5e\x5f\x5e"){return[{t:a,n:"\x6b\x65\x6b\x65",i:10,it:"http://static.ak.facebook.com/pics/t_default.jpg"}]}return this.parent.search_value(a)};function friendlist_source(a){this.parent.construct(this,a)}friendlist_source.extend(friend_source);friendlist_source.prototype.friend_lists=false;friendlist_source.prototype.text_placeholder=tx("ta18");friendlist_source.prototype.return_friend_lists=function(){if(!this.friend_lists||(this.friend_lists&&this.friend_lists.length==0)){this.friend_lists=[];var a=this.index;var c=[];var e=[];if(!a.length||!(a.length>=1)){return}for(var b=0;b<a.length;b++){if(a[b].o.flid&&!e[a[b].o.flid]){e[a[b].o.flid]=true;c.push(a[b].o)}}var d=c.sort(function(g,f){if(g.t>f.t){return 1}else{if(g.t<f.t){return -1}else{return 0}}});this.friend_lists=d}return this.friend_lists};friendlist_source.prototype.search_value=function(a){if(a=="**FRIENDLISTS**"){return this.return_friend_lists()}return this.parent.search_value(a)};friendlist_source.prototype.gen_nomatch=function(){if(this.showing_icon_list){return tx("ta17")}else{return this.parent.gen_nomatch()}};function friend_and_email_source(a){a=a?a+"&include_emails=1":"";this.parent.construct(this,a)}friend_and_email_source.extend(friend_source);friend_and_email_source.prototype.text_noinput=friend_and_email_source.prototype.text_placeholder=tx("ta05");friend_and_email_source.prototype.text_nomatch=tx("ta06");friend_and_email_source.prototype.onselect_not_found=function(){emails=this.results_text.split(/[,; ]/);for(var a=0;a<emails.length;a++){var f=emails[a].replace(/^\s+|\s+$/g,"");var e=/.*\@.*\.[a-z]+$/;if(!e.test(f)){continue}var d={t:f,e:f};var c=new token(d,this.tokenizer,this.element);var b={email:f};new AsyncRequest().setMethod("GET").setReadOnly(true).setURI("/ajax/typeahead_email.php").setData(b).setHandler(function(g){if(g.getPayload()){this.render_obj(g.getPayload().token)}}.bind(c)).send()}this.clear()};function network_source(a){this.get_selected_type=a;this.parent.construct(this);this.ready()}network_source.extend(typeahead_source);network_source.prototype.cache_results=true;network_source.prototype.search_limit=200;network_source.prototype.text_placeholder=network_source.prototype.text_noinput=tx("ta07");network_source.prototype.base_uri="";network_source.prototype.allow_fake_results=true;network_source.prototype.search_value=function(b){this.search_text=b;var a={q:b};if((type=typeof(this.get_selected_type))!="undefined"){a.t=(type!="string")?JSON.encode(this.get_selected_type):this.get_selected_type}if((type=typeof(this.t))!="undefined"){a.t=(type!="string")?JSON.encode(this.t):this.t}if(this.show_email){a.show_email=1}if(this.show_network_type){a.show_network_type=1}if(this.disable_school_status){a.disable_school_status=1}new AsyncRequest().setReadOnly(true).setMethod("GET").setURI("/ajax/typeahead_networks.php").setData(a).setHandler(function(c){this.owner.found_suggestions(c.getPayload(),this.search_text)}.bind(this)).setErrorHandler(function(c){this.owner.found_suggestions(false,this.search_text)}.bind(this)).send()};network_source.prototype.gen_html=function(b,a){return["<div>",typeahead_source.highlight_found(b.t,a),"</div><div><small>",typeahead_source.highlight_found(b.l,a),"</small></div>"].join("")};function custom_source(a){this.parent.construct(this);if(a.length&&typeof(a[0])=="string"){for(var b=0;b<a.length;b++){a[b]={t:a[b],i:a[b]}}}this.values=a;this.build_index()}custom_source.extend(static_source);custom_source.prototype.text_placeholder=custom_source.prototype.text_noinput=false;custom_source.prototype.gen_html=function(c,b){var a=["<div>",typeahead_source.highlight_found(c.t,b),"</div>"];if(c.s){a.push("<div><small>",htmlspecialchars(c.s),"</small></div>")}return a.join("")};function concentration_source(c){this.parent.construct(this,[]);this.network=c;if(!concentration_source.networks){concentration_source.networks=[]}else{for(var b=0,a=concentration_source.networks.length;b<a;b++){if(concentration_source.networks[b].n==this.network){this.values=concentration_source.networks[b].v;this.index=concentration_source.networks[b].i;this.ready();return}}}new AsyncRequest().setURI("/ajax/typeahead_concentrations.php?n="+this.network).setHandler(function(d){this.values=d.getPayload();this.build_index();concentration_source.networks.push({n:this.network,v:this.values,i:this.index});this.ready()}.bind(this)).send()}concentration_source.extend(custom_source);concentration_source.prototype.noinput=false;concentration_source.prototype.text_placeholder=tx("ta08");concentration_source.prototype.allow_fake_results=true;function language_source(){this.parent.construct(this,[]);if(!language_source.languages){language_source.languages=[]}else{for(var b=0,a=language_source.languages.length;b<a;b++){this.values=language_source.languages[b].v;this.index=language_source.languages[b].i;this.ready();return}}new AsyncRequest().setURI("/ajax/typeahead_languages.php").setHandler(function(c){this.values=c.getPayload();this.build_index();language_source.languages.push({v:this.values,i:this.index});this.ready()}.bind(this)).send()}language_source.extend(custom_source);language_source.prototype.noinput=false;language_source.prototype.text_placeholder=tx("ta14");language_source.prototype.allow_fake_results=false;function keyword_source(b){this.parent.construct(this,[]);this.category=b;if(!keyword_source.categories){keyword_source.categories=[]}else{for(var c=0,a=keyword_source.categories.length;c<a;c++){if(keyword_source.categories[c].c==this.category){this.values=keyword_source.categories[c].v;this.index=keyword_source.categories[c].i;this.ready();return}}}new AsyncRequest().setURI("/ajax/typeahead_keywords.php").setData({c:this.category}).setMethod("GET").setReadOnly(true).setHandler(function(d){this.values=d.getPayload();this.build_index();keyword_source.categories.push({c:this.category,v:this.values,i:this.index});this.ready()}.bind(this)).send()}keyword_source.extend(custom_source);keyword_source.prototype.noinput=false;keyword_source.prototype.text_placeholder=tx("ta09");function regions_source(a){this.parent.construct(this,[]);this.country=a;this.reload()}regions_source.extend(custom_source);regions_source.prototype.noinput=false;regions_source.prototype.text_placeholder=tx("ta10");regions_source.prototype.reload=function(){new AsyncRequest().setMethod("GET").setReadOnly(true).setURI("/ajax/typeahead_regions.php").setData({c:this.country}).setHandler(function(a){this.values=a.getPayload();this.build_index();this.ready()}.bind(this)).send()};function time_source(){this.status=0;this.parent.construct(this)}time_source.extend(typeahead_source);time_source.prototype.cache_results=true;time_source.prototype.text_placeholder=time_source.prototype.text_noinput=tx("ta11");time_source.prototype.base_uri="";time_source.prototype.search_value=function(b){this.search_text=b;var a={q:b};new AsyncRequest().setURI("/ajax/typeahead_time.php").setMethod("GET").setReadOnly(true).setData(a).setHandler(function(c){this.owner.found_suggestions(c.getPayload(),this.search_text)}.bind(this)).setErrorHandler(function(c){this.owner.found_suggestions(false,this.search_text)}.bind(this)).send()};time_source.prototype.gen_html=function(b,a){return["<div>",typeahead_source.highlight_found(b.t,a),"</div>"].join("")};function dynamic_custom_source(a){this.async_url=a;this.parent.construct(this)}dynamic_custom_source.extend(typeahead_source);dynamic_custom_source.cache_results=true;dynamic_custom_source.prototype.search_value=function(c){this.search_text=c;var a={q:c};var b=new AsyncRequest().setURI(this.async_url).setData(a).setHandler(bind(this,function(d){this.owner.found_suggestions(d.getPayload(),this.search_text,false)})).setErrorHandler(bind(this,function(d){this.owner.found_suggestions(false,this.search_text,false)})).setReadOnly(true).send()};dynamic_custom_source.prototype.gen_html=function(c,b){var a=["<div>",this.highlight_found(c.t,b),"</div>"];if(c.s){a.push('<div class="sub_result"><small>',c.s,"</small></div>")}return a.join("")};dynamic_custom_source.prototype.highlight_found=function(b,a){return typeahead_source.highlight_found(b,a)};function ad_targeting_cluster_source(a){this.parent.construct(this,[]);if(!ad_targeting_cluster_source.clusters){ad_targeting_cluster_source.clusters=[]}else{for(var c=0,b=ad_targeting_cluster_source.clusters.length;c<b;c++){this.values=ad_targeting_cluster_source.clusters[c].v;this.index=ad_targeting_cluster_source.clusters[c].i;this.ready();return}}new AsyncRequest().setURI("/ads/ajax/typeahead_clusters.php").setData({act:a}).setHandler(function(d){this.values=d.getPayload();this.build_index();ad_targeting_cluster_source.clusters.push({v:this.values,i:this.index});this.ready()}.bind(this)).send()}ad_targeting_cluster_source.extend(custom_source);function generic_dialog(a,b){this.className=a;this.content=null;this.obj=null;this.popup=null;this.overlay=null;this.modal=null;this.iframe=null;this.hidden_objects=[];if(b==true){this.modal=true}}generic_dialog.dialog_stack=null;generic_dialog.prototype.setClassName=function(a){this.className=a};generic_dialog.hide_all=function(){if(generic_dialog.dialog_stack!==null){var a=generic_dialog.dialog_stack.clone();generic_dialog.dialog_stack=null;for(var b=a.length-1;b>=0;b--){a[b].hide()}}};generic_dialog.prototype.should_hide_objects=!ua.windows();generic_dialog.prototype.should_use_iframe=ua.ie()<7||(ua.osx()&&ua.firefox());generic_dialog.prototype.show_dialog=function(b){if(generic_dialog.dialog_stack===null){onunloadRegister(generic_dialog.hide_all,true)}if(!this.obj){this.build_dialog()}set_inner_html(this.content,b);var c=this.content.getElementsByTagName("img");for(var a=0;a<c.length;a++){c[a].onload=chain(c[a].onload,this.hide_objects.bind(this))}this.show();this.focus_first_textbox_or_button();this.on_show_callback&&this.on_show_callback();return this};generic_dialog.prototype.set_callback=function(a){this.on_show_callback=a;return this};generic_dialog.prototype.focus_first_textbox_or_button=function(){var a={text:1,button:1,submit:1};function b(c){var d=(c.tagName=="INPUT"&&a[c.type.toLowerCase()])||(c.tagName=="TEXTAREA");if(d){try{if(elementY(c)>0&&elementX(c)>0){c.focus();return false}}catch(f){}}return true}iterTraverseDom(this.content,b)};generic_dialog.prototype.set_top=function(a){return this};generic_dialog.prototype.make_modal=function(){if(this.modal){return}this.modal=true;if(ua.ie()==7){this.build_iframe()}this.build_overlay();this.reset_iframe()};generic_dialog.prototype.show_loading=function(a){if(!a){a=tx("sh:loading")}return this.show_dialog('<div class="dialog_loading">'+a+"</div>")};generic_dialog.prototype.show_ajax_dialog_custom_loader=function(b,e,f){if(b){this.show_loading(b)}var d=function(g){this.show_dialog(g.getPayload().responseText)}.bind(this);var a=function(g){ErrorDialog.showAsyncError(g);this.hide(false)}.bind(this);var c=new AsyncRequest().setOption("suppressEvaluation",true).setURI(e).setData(f||{}).setHandler(d).setErrorHandler(a).setTransportErrorHandler(a);if(!f){c.setMethod("GET").setReadOnly(true)}c.send();return this};generic_dialog.prototype.show_ajax_dialog=function(b,c){c=c||false;var a=tx("sh:loading");return this.show_ajax_dialog_custom_loader(a,b,c)};generic_dialog.prototype.show_prompt=function(b,a){return this.show_dialog("<h2><span>"+b+'</span></h2><div class="dialog_content">'+a+"</div>")};generic_dialog.prototype.show_message=function(c,b,a){if(a==null){a=tx("sh:ok-button")}return this.show_choice(c,b,a,function(){generic_dialog.get_dialog(this).fade_out(100)})};generic_dialog.prototype.show_choice=function(title,content,button1,button1js,button2,button2js,buttons_msg,button3,button3js){var buttons='<div class="dialog_buttons" id="dialog_buttons">';if(typeof(buttons_msg)!="undefined"){buttons+='<div class="dialog_buttons_msg">';buttons+=buttons_msg;buttons+="</div>"}buttons+='<input class="inputsubmit" type="button" value="'+button1+'" id="dialog_button1" />';if(button2){var button2_class="inputsubmit";if(button2==tx("sh:cancel-button")){button2_class+=" inputaux"}buttons+='<input class="'+button2_class+'" type="button" value="'+button2+'" id="dialog_button2" />'}if(button3){var button3_class="inputsubmit";if(button3==tx("sh:cancel-button")){button3_class+=" inputaux"}buttons+='<input class="'+button3_class+'" type="button" value="'+button3+'" id="dialog_button3" />'}this.show_prompt(title,this.content_to_markup(content)+buttons);var inputs=this.obj.getElementsByTagName("input");if(button3){button1obj=inputs[inputs.length-3];button2obj=inputs[inputs.length-2];button3obj=inputs[inputs.length-1]}else{if(button2){button1obj=inputs[inputs.length-2];button2obj=inputs[inputs.length-1]}else{button1obj=inputs[inputs.length-1]}}if(button1js&&button1){if(typeof button1js=="string"){eval("button1js = function() {"+button1js+"}")}button1obj.onclick=button1js}if(button2js&&button2){if(typeof button2js=="string"){eval("button2js = function() {"+button2js+"}")}button2obj.onclick=button2js}if(button3js&&button3){if(typeof button3js=="string"){eval("button3js = function() {"+button3js+"}")}button3obj.onclick=button3js}if(!this.modal){document.onkeyup=function(e){var keycode=(e&&e.which)?e.which:event.keyCode;var btn2_exists=(typeof button2obj!="undefined");var btn3_exists=(typeof button3obj!="undefined");var is_webkit=ua.safari();if(is_webkit&&keycode==13){button1obj.click()}if(keycode==27){if(btn3_exists){button3obj.click()}else{if(btn2_exists){button2obj.click()}else{button1obj.click()}}}document.onkeyup=function(){}};this.button_to_focus=button1obj;button1obj.offsetWidth&&button1obj.focus()}return this};generic_dialog.prototype.show_choice_ajax=function(k,h,g,e,f,i,c,d,l,a){this.show_loading(tx("sh:loading"));var m=function(n){this.show_choice(k,n.getPayload(),g,e,f,i,c,d,l)}.bind(this);var b=function(n){ErrorDialog.showAsyncError(n);this.hide(false)}.bind(this);var j=new AsyncRequest().setURI(h).setHandler(m).setErrorHandler(b).setTransportErrorHandler(b);if(a==true){j.setReadOnly(true)}j.send();return this};generic_dialog.prototype.show_form_ajax=function(g,b,d,e){this.show_loading(tx("sh:loading"));var j="dialog_ajax_form__"+gen_unique();var a=function(k,l){if(l.getError()!=true){k.hide();ErrorDialog.showAsyncError(l)}else{k.show_choice(g,l.getPayload(),"Okay",function(){k.fade_out(200)})}}.bind(null,this);var i=function(l,m){var k='<form id="'+j+'" onsubmit="return false;">'+m.getPayload()+"</form>";l.show_choice(g,k,d,h,tx("sh:cancel-button"),function(){l.fade_out(200)})}.bind(null,this);var h=function(){new AsyncRequest().setURI(b).setData(serialize_form(ge(j))).setHandler(f).setErrorHandler(c).send()};var f=function(k,l){k.show_choice(g,l.getPayload(),"Okay",function(){k.fade_out(200)});if(e){window.location.reload()}else{setTimeout(function(){k.fade_out(500)},750)}}.bind(null,this);var c=function(k,l){if(l.getError()==1346001){i(l)}else{if(l.getError()!=true){ErrorDialog.showAsyncError(l)}else{a(l)}}}.bind(null,this);new AsyncRequest().setURI(b).setReadOnly(true).setHandler(i).setErrorHandler(a).send();return this};generic_dialog.prototype.show_form=function(f,d,b,g,a){d='<form action="'+g+'" method="post">'+this.content_to_markup(d);var e=ge("post_form_id");if(e){d+='<input type="hidden" name="post_form_id" value="'+e.value+'" />'}d+='<div class="dialog_buttons" id="dialog_buttons"><input class="inputsubmit" id="dialog_confirm" name="dialog_confirm" type="submit" value="'+b+'" />';d+='<input type="hidden" name="next" value="'+htmlspecialchars(document.location.href)+'"/>';d+='<input class="inputsubmit inputaux" type="button" value="'+tx("sh:cancel-button")+'" onclick="generic_dialog.get_dialog(this).fade_out(100)" /></form>';this.show_prompt(f,d);var c=ge("dialog_confirm");c.onclick=function(){window[a]&&window[a]()};return this};generic_dialog.prototype.content_to_markup=function(a){return(typeof a=="string")?'<div class="dialog_body">'+a+"</div>":'<div class="dialog_summary">'+a.summary+'</div><div class="dialog_body">'+a.body+"</div>"};generic_dialog.prototype.hide=function(b){if(this.obj){this.obj.style.display="none"}if(this.iframe){this.iframe.style.display="none"}if(this.overlay){this.overlay.style.display="none"}if(this.timeout){clearTimeout(this.timeout);this.timeout=null;return}if(this.hidden_objects.length){for(var d=0,c=this.hidden_objects.length;d<c;d++){this.hidden_objects[d].style.visibility=""}this.hidden_objects=[]}clearInterval(this.active_hiding);if(!b){if(generic_dialog.dialog_stack){var a=generic_dialog.dialog_stack;for(var d=a.length-1;d>=0;d--){if(a[d]==this){a.splice(d,1)}}if(a.length){a[a.length-1].show()}}if(this.obj){this.obj.parentNode.removeChild(this.obj);this.obj=null}if(this.close_handler){this.close_handler()}}return this};generic_dialog.prototype.fade_out=function(b,a,c){if(!this.popup){return this}animation(this.obj).duration(a?a:0).checkpoint().to("opacity",0).hide().duration(b?b:350).ondone(function(){c&&c();this.hide()}.bind(this,{callback:c})).go();return this};generic_dialog.prototype.show=function(){if(this.obj&&this.obj.style.display){this.obj.style.visibility="hidden";this.obj.style.display="";this.reset_dialog();this.obj.style.visibility="";this.obj.dialog=this}else{this.reset_dialog()}this.hide_objects();clearInterval(this.active_hiding);this.active_hiding=setInterval(this.active_resize.bind(this),500);var a=generic_dialog.dialog_stack?generic_dialog.dialog_stack:generic_dialog.dialog_stack=[];if(a.length){var c=a[a.length-1];if(c!=this&&!c.is_stackable){c.hide()}}for(var b=a.length-1;b>=0;b--){if(a[b]==this){a.splice(b,1)}else{a[b].hide(true)}}a.push(this);return this};generic_dialog.prototype.enable_buttons=function(b){var c=this.obj.getElementsByTagName("input");for(var a=0;a<c.length;a++){if(c[a].type=="button"||c[a].type=="submit"){c[a].disabled=!b}}};generic_dialog.prototype.active_resize=function(){if(this.last_offset_height!=this.content.offsetHeight){this.hide_objects();this.last_offset_height=this.content.offsetHeight}};generic_dialog.prototype.hide_objects=function(){var f=[],j=[];var a=["",0,1,2,4,5,9,3];for(var e=0;e<a.length;e++){var c=ge("ad_"+a[e]);if(c!=null){f.push(c)}}var h={x:elementX(this.content),y:elementY(this.content),w:this.content.offsetWidth,h:this.content.offsetHeight};if(this.should_hide_objects){var g=document.getElementsByTagName("iframe");for(var e=0;e<g.length;e++){if(g[e].className.indexOf("share_hide_on_dialog")!=-1){j.push(g[e])}}}var d=getElementsByTagNames("embed,object");for(var e=0;e<d.length;e++){if((d[e].getAttribute("wmode")||"").toLowerCase()!="transparent"||this.should_hide_objects){j.push(d[e])}}for(var e=0;e<j.length;e++){var b=j[e].offsetHeight?j[e]:j[e].parentNode;swf_rect={x:elementX(b),y:elementY(b),w:b.offsetWidth,h:b.offsetHeight};if(!is_descendent(j[e],this.content)&&h.y+h.h>swf_rect.y&&swf_rect.y+swf_rect.h>h.y&&h.x+h.w>swf_rect.x&&swf_rect.x+swf_rect.w>h.w&&this.hidden_objects.indexOf(b)==-1){f.push(b)}}for(var e=0;e<f.length;e++){this.hidden_objects.push(f[e]);f[e].style.visibility="hidden"}};generic_dialog.prototype.build_dialog=function(){if(!this.obj){this.obj=document.createElement("div")}this.obj.className="generic_dialog"+(this.className?" "+this.className:"");this.obj.style.display="none";onloadRegister(function(){document.body.appendChild(this.obj)}.bind(this));if(this.should_use_iframe||(this.modal&&ua.ie()==7)){this.build_iframe()}if(!this.popup){this.popup=document.createElement("div");this.popup.className="generic_dialog_popup"}this.popup.style.left=this.popup.style.top="";this.obj.appendChild(this.popup);if(this.modal){this.build_overlay()}};generic_dialog.prototype.build_iframe=function(){if(!this.iframe&&!(this.iframe=ge("generic_dialog_iframe"))){this.iframe=document.createElement("iframe");this.iframe.id="generic_dialog_iframe";this.iframe.src="/common/blank.html"}this.iframe.frameBorder="0";onloadRegister(function(){document.body.appendChild(this.iframe)}.bind(this))};generic_dialog.prototype.build_overlay=function(){this.overlay=document.createElement("div");this.overlay.id="generic_dialog_overlay";if(document.body.clientHeight>document.documentElement.clientHeight){this.overlay.style.height=document.body.clientHeight+"px"}else{this.overlay.style.height=document.documentElement.clientHeight+"px"}onloadRegister(function(){document.body.appendChild(this.overlay)}.bind(this))};generic_dialog.prototype.reset_dialog=function(){if(!this.popup){return}onloadRegister(function(){this.reset_dialog_obj();this.reset_iframe()}.bind(this))};generic_dialog.prototype.reset_iframe=function(){if(!this.should_use_iframe&&!(this.modal&&ua.ie()==7)){return}if(this.modal){this.iframe.style.left="0px";this.iframe.style.top="0px";this.iframe.style.width="100%";if((document.body.clientHeight>document.documentElement.clientHeight)&&(document.body.clientHeight<10000)){this.iframe.style.height=document.body.clientHeight+"px"}else{if((document.body.clientHeight<document.documentElement.clientHeight)&&(document.documentElement.clientHeight<10000)){this.iframe.style.height=document.documentElement.clientHeight+"px"}else{this.iframe.style.height="10000px"}}}else{this.iframe.style.left=elementX(this.frame)+"px";this.iframe.style.top=elementY(this.frame)+"px";this.iframe.style.width=this.frame.offsetWidth+"px";this.iframe.style.height=this.frame.offsetHeight+"px"}this.iframe.style.display=""};generic_dialog.prototype.reset_dialog_obj=function(){};generic_dialog.get_dialog=function(a){while(!a.dialog&&a.parentNode){a=a.parentNode}return a.dialog?a.dialog:false};function pop_dialog(a,c,b){this.top=125;this.parent.construct(this,a,b);this.on_show_callback=c}pop_dialog.extend(generic_dialog);pop_dialog.prototype.do_expand_animation=false;pop_dialog.prototype.kill_expand_animation=true;pop_dialog.prototype.show_ajax_dialog=function(c,d,b){d=d||false;if(this.do_expand_animation&&!this.kill_expand_animation){var a=null;this.show_loading_title(b)}else{var a=tx("sh:loading")}return this.show_ajax_dialog_custom_loader(a,c,d)};pop_dialog.prototype.show_message=function(c,b,a){if(this.do_expand_animation&&!this.kill_expand_animation){this.show_loading_title(c)}else{this.show_loading()}return this.parent.show_message(c,b,a)};pop_dialog.prototype.show_dialog=function(c,h){var f=this.parent.show_dialog(c);if(this.do_expand_animation&&!h&&!this.kill_expand_animation){function b(k,j){var j=(j?j:0);if(this.done_loading_title!=true&&j<10){j++;setTimeout(b.bind(this,k,j),50)}else{k&&k()}}function e(o,q,k){var m=0;var p=o.getElementsByTagName("img");var j=ua.safari()<3;for(var l=0;l<p.length;l++){var n=p[l];if(image_has_loaded(n)){m++}}if(m!=p.length){if(k<20){k++;setTimeout(function(){e(o,q,k)},100)}else{q()}}else{q()}}var d=this.content.getElementsByTagName("div");for(var a=0;a<d.length;a++){if(d[a].className=="dialog_content"){expand_animation_div=d[a];break}}var g=document.createElement("div");g.style.padding="0px";g.style.margin="0px";g.style.overflow="visible";expand_animation_div.parentNode.insertBefore(g,expand_animation_div);g.appendChild(expand_animation_div);expand_animation_div.style.overflow="hidden";e(expand_animation_div,function(){b.bind(this,function(){this.content.getElementsByTagName("h2")[0].className="";animation(expand_animation_div).to("height","auto").from(0).from("opacity",0).to(1).ease(animation.ease.both).show().duration(200).ondone(function(){g.parentNode.insertBefore(expand_animation_div,g);g.parentNode.removeChild(g);if(!this.button_to_focus){var k=this.obj.getElementsByTagName("input");for(var j=0;j<k.length;j++){if(k[j].type=="button"&&k[j].id=="dialog_button1"){this.button_to_focus=k[j];break}}}if(this.button_to_focus){setTimeout(function(){this.button_to_focus.focus()}.bind(this),50)}expand_animation_div.style.overflow="visible";this.do_expand_animation=false;this.show()}.bind(this,{expand_animation_div:expand_animation_div,container_div:g})).go()}.bind(this))()}.bind(this,{expand_animation_div:expand_animation_div}),0)}return f};pop_dialog.prototype.build_dialog=function(){this.parent.build_dialog();this.obj.className+=" pop_dialog";this.popup.innerHTML='<table id="pop_dialog_table" class="pop_dialog_table"><tr><td class="pop_topleft"></td><td class="pop_border"></td><td class="pop_topright"></td></tr><tr><td class="pop_border"></td><td class="pop_content" id="pop_content"></td><td class="pop_border"></td></tr><tr><td class="pop_bottomleft"></td><td class="pop_border"></td><td class="pop_bottomright"></td></tr></table>';this.frame=this.popup.getElementsByTagName("tbody")[0];this.content=this.popup.getElementsByTagName("td")[4]};pop_dialog.prototype.reset_dialog_obj=function(){this.popup.style.top=(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)+this.top+"px"};pop_dialog.prototype.set_top=function(a){this.top=a};pop_dialog.prototype.show_prompt=function(b,a){if(!this.do_expand_animation||this.kill_expand_animation){return this.show_dialog("<h2><span>"+b+'</span></h2><div class="dialog_content">'+a+"</div>")}return this.show_dialog('<h2 class="dialog_loading"><span>'+b+'</span></h2><div class="dialog_content" style="display:none;">'+a+"</div>")};pop_dialog.prototype.show_loading_title=function(a){if(!this.kill_expand_animation){this.do_expand_animation=true;this.show_dialog('<h2 class="dialog_loading"><span>'+a+"</span></h2>",true);setTimeout(function(){this.done_loading_title=true}.bind(this),200)}else{this.show_loading()}};function contextual_dialog(a){this.parent.construct(this,a)}contextual_dialog.extend(generic_dialog);contextual_dialog.prototype.set_context=function(a){this.context=a;return this};contextual_dialog.prototype.build_dialog=function(){this.parent.build_dialog();this.obj.className+=" contextual_dialog";this.popup.innerHTML='<div class="contextual_arrow"><span>^_^keke1</span></div><div class="contextual_dialog_content"></div>';this.arrow=this.popup.getElementsByTagName("div")[0];this.content=this.frame=this.popup.getElementsByTagName("div")[1]};contextual_dialog.prototype.reset_dialog_obj=function(){var a=elementX(this.context);var c=(document.body.offsetWidth-this.popup.offsetWidth)/2;if(a<document.body.offsetWidth/2){this.arrow.className="contextual_arrow_rev";var d=Math.min(c,a+this.context.offsetWidth-this.arrow_padding_x);var b=a-d+this.context.offsetWidth+this.arrow_padding_x}else{this.arrow.className="contextual_arrow";var d=Math.max(c,a-this.popup.offsetWidth+this.arrow_padding_x);var b=a-d-this.arrow_padding_x-this.arrow_width}if(isNaN(d)){d=0}if(isNaN(b)){b=0}this.popup.style.top=(elementY(this.context)+this.context.offsetHeight-this.arrow.offsetHeight+this.arrow_padding_y)+"px";this.popup.style.left=d+"px";this.arrow.style.backgroundPosition=b+"px"};contextual_dialog.prototype._remove_resize_events=function(){if(this._scroll_events){for(var a=0;a<this._scroll_events.length;a++){removeEventBase(this._scroll_events[a].obj,this._scroll_events[a].event,this._scroll_events[a].func)}}this._scroll_events=[]};contextual_dialog.prototype.show=function(){this._remove_resize_events();var b=this.context;while(b){if(b.id!="content"&&(b.scrollHeight&&b.offsetHeight&&b.scrollHeight!=b.offsetHeight)||(b.scrollWidth&&b.offsetWidth&&b.scrollWidth!=b.offsetWidth)){var a={obj:b,event:"scroll",func:this.reset_dialog_obj.bind(this)};addEventBase(a.obj,a.event,a.func)}b=b.parentNode}var a={obj:window,event:"resize",func:this.reset_dialog_obj.bind(this)};addEventBase(a.obj,a.event,a.func);this.parent.show()};contextual_dialog.prototype.hide=function(a){this._remove_resize_events();this.parent.hide(a)};contextual_dialog.prototype.arrow_padding_x=5;contextual_dialog.prototype.arrow_padding_y=10;contextual_dialog.prototype.arrow_width=13;contextual_dialog.hide_all=function(b){if(generic_dialog.dialog_stack){for(var a=0;a<generic_dialog.dialog_stack.length;a++){if(generic_dialog.dialog_stack[a].context&&generic_dialog.dialog_stack[a].arrow){generic_dialog.dialog_stack[a].hide()}}}b&&b()};function ErrorDialog(){this.parent.construct(this,"errorDialog",null,true);return this}ErrorDialog.extend(pop_dialog);copy_properties(ErrorDialog.prototype,{showError:function(b,a){return this.show_message(b,a)}});copy_properties(ErrorDialog,{showAsyncError:function(b){try{return(new ErrorDialog()).showError(b.getErrorSummary(),b.getErrorDescription())}catch(a){aiert(b)}}});var Registry=[];var _registryIndex=0;var _lastKeyCode=-1;var _names;var _ids;var _images;var _networks;var TypeAhead=function(p,n,a,i,c,e,m,b,l,d,h,k,o,j,f){this.resize=!f;this.getMatchSingleTerm=function(r,w){var x="";var u=r.length;if(!w){return""}var y=w;var v=0;v=y.toUpperCase().indexOf(r.toUpperCase());if(v==-1){return x}var s=y.substring(0,u);x+='<span class="suggest">'+s+"</span>";var t=0;y=y.substring(v+u);while((v=y.toUpperCase().indexOf(r.toUpperCase()))!=-1){var q=y.substring(0,v);if(q){x+=q}var s=y.substring(v,v+u);if(s){x+='<span class="suggest">'+s+"</span>"}y=y.substring(v+u);t=1}if(t){x+=y}};this.getMatchMultipleTerms=function(u,x){if(!x){return""}var z=u.split(/\s+/);var C=x.split(/\s+/);var y="";for(var w=0;w<C.length;w++){var q=0;var A=C[w];for(var r=0;r<z.length;r++){var t=z[r];if(A.toUpperCase().indexOf(t.toUpperCase())==0){q=1;break}}if(w>0){y+=" "}if(q){var v=t.length;var s=A.substring(0,v);var B=A.substring(v);y+='<span class="suggest">'+s+"</span>"+B}else{y+=A}}return y};this.onListChange=function(){this.selectedIndex=-1;if(!this.pEvent){this.idEl.value=0}var q=this.dropDownEl;if(q&&q.childNodes){this.dropDownCount=q.childNodes.length}this.lastTypedValue=this.currentInputValue;if(this.currentInputValue==""||this.dropDownCount==0||this.pEvent){this.dropDownEl.hide()}else{this.dropDownEl.show();this.defaultDropDownEl.show()}var s=false;if(this.currentInputValue.length>0){for(var r=0;r<this.dropDownCount;r++){if(!s){s=true;this.selectedIndex=r;this.selectedEl=this.dropDownEl.childNodes[r]}var v=this.getMatchSingleTerm(this.currentInputValue,this.dropDownEl.childNodes[r]._value);if(!v){v=this.getMatchMultipleTerms(this.currentInputValue,this.dropDownEl.childNodes[r]._value)}this.dropDownEl.childNodes[r].setName(v);v=this.getMatchSingleTerm(this.currentInputValue,this.dropDownEl.childNodes[r]._loc);if(!v){v=this.getMatchMultipleTerms(this.currentInputValue,this.dropDownEl.childNodes[r]._loc)}this.dropDownEl.childNodes[r].setLoc(v)}if(!s){for(var r=0;r<this.defaultDropDownCount;r++){if(this.defaultDropDownEl.childNodes[r]._value.toUpperCase().indexOf(this.currentInputValue.toUpperCase())==0){s=true;this.selectedIndex=r;this.selectedEl=this.defaultDropDownEl.childNodes[r];break}}}}var u=this.currentInputValue;var t=false;switch(this.lastKeyCode){case 8:case 33:case 34:case 35:case 35:case 36:case 37:case 39:case 45:case 46:t=true;break;case 27:t=true;break;default:break}if(!t&&s&&!this.pEvent){this.selectedEl.select()}else{}this._noMatches=false;if(this.dropDownCount==0){if(this.textBoxEl.value!=""&&this.textBoxEl.value!=this.textBoxEl.ph){this._noMatches=true;if(this.showNoMatches){this.defaultTextEl.setText(tx("typeahead_ns:no-matches"))}}else{this.defaultTextEl.setDefault()}this.defaultDropDownEl.show();if(this.showNoMatches){this.defaultTextEl.show()}}else{this.defaultTextEl.hide()}if(this.dropDownCount>=1&&this.selectedEl&&this.getUnselectedLength()==this.selectedEl._value.length){this.idEl.value=this.selectedEl._id;if(this.dropDownCount==1){this.onTypeAheadSuccess()}else{this.textBoxEl.style.background="#e1e9f6"}}else{this.onTypeAheadFailure()}if(this.lastKeyCode==27){this.textBoxEl.blur()}this.setFrame();this.pEvent=0};this.setFrame=function(){if(this.goodFrame){this.goodFrame.style.height=(this.containerEl.offsetHeight)+"px";this.goodFrame.style.width=(this.textBoxEl.offsetWidth)+"px"}};this.onTypeAheadSuccess=function(){this.dropDownEl.hide();this.textBoxEl.style.background="#e1e9f6";if(this.onSuccess&&!this.pEvent){this.onSuccess(this)}};this.onTypeAheadFailure=function(){this.textBoxEl.style.background="#FFFFFF"};this.refocus=function(){this.reFocused=true;this.textBoxEl.blur();setTimeout("Registry["+this.registryIndex+"].focus();",10)};this.focus=function(){this.textBoxEl.focus()};this.handleKeyUp=function(r){if(!r&&window.event){r=window.event}if(r.keyCode==40||r.keyCode==38){if(this.isSafari&&(this.fireCount++%2==1)){}}var t=this.textBoxEl.value;var q=this.getSelectedLength();var u=this.getUnselectedLength();if(q>0&&u!=-1){t=t.substring(0,u)}this.currentInputValue=t;var s=false;switch(this.lastKeyCode){case 13:case 9:s=true;break;case 38:s=true;if(this.onUp){this.onUp(this)}break;case 40:s=true;if(this.onDown){this.onDown(this)}break}this.pEvent=0;if(r.pEvent){this.pEvent=r.pEvent}if(!s&&this.onInputChange){this.onInputChange(this)}if(this.lastKeyCode==13){this.lastKeyCode=-1;_lastKeyCode=-1}this.lastInputValue=this.currentInputValue};this.getSelectedLength=function(){var s=this.textBoxEl;var q=-1;if(s.createTextRange){var r=document.selection.createRange().duplicate();q=r.text.length}else{if(s.setSelectionRange){q=s.selectionEnd-s.selectionStart}}return q};this.getUnselectedLength=function(){var s=this.textBoxEl;var q=0;if(s.createTextRange){var r=document.selection.createRange().duplicate();r.moveEnd("textedit",1);q=s.value.length-r.text.length}else{if(s.setSelectionRange){q=s.selectionStart}else{q=-1}}return q};this.handleKeyDown=function(q){if(!q&&window.event){q=window.event}if(q){this.lastKeyCode=q.keyCode;_lastKeyCode=q.keyCode}switch(this.lastKeyCode){case 38:break;case 40:break;case 27:this.textBoxEl.value="";break;case 13:case 9:if(this.selectedIndex!=-1){this.textBoxEl.value=this.selectedEl._value;this.defaultTextEl.hide();this.onTypeAheadSuccess()}this.dropDownEl.hide();this.defaultDropDownEl.hide();this.setFrame();break;case 3:this.dropDownEl.hide();this.defaultDropDownEl.hide();this.setFrame();break}switch(this.lastKeyCode){case 38:this.selectPrevDropDown();if(this.onUp){this.onUp(this)}break;case 40:this.selectNextDropDown();if(this.onDown){this.onDown(this)}break}if(q&&(q.keyCode==13||q.keyCode==38||q.keyCode==40)){q.cancelBubble=true;q.returnValue=false}};this.selectPrevDropDown=function(){this.selectDropDown(this.selectedIndex-1)};this.selectNextDropDown=function(){this.selectDropDown(this.selectedIndex+1)};this.selectDropDown=function(q){this.textBoxEl.value=this.lastTypedValue;if((this.dropDownCount+this.defaultDropDownCount)<=0){return}if(this.dropDownCount>0){this.dropDownEl.show();this.defaultDropDownEl.show()}else{this.dropDownEl.hide()}this.setFrame();var r=false;if(q>=this.dropDownCount&&this.defaultDropDownCount>0){r=true}if(q>=this.dropDownCount+this.defaultDropDownCount){q=this.dropDownCount+this.defaultDropDownCount-1}if(this.selectedIndex!=-1&&q!=this.selectedIndex){this.selectedIndex=-1;this.selectedEl.unselect()}if(q<0){this.selectedIndex=-1;return}this.selectedIndex=q;if(r){this.selectedEl=this.defaultDropDownEl.childNodes[q-this.dropDownCount]}else{this.selectedEl=this.dropDownEl.childNodes[q]}this.selectedEl.select();this.textBoxEl.value=this.selectedEl._value};this.displaySuggestList=function(A,q,x){if(A.length!=q.length){return false}var z=this.dropDownEl;while(z.childNodes.length>0){z.removeChild(z.childNodes[0])}if(this.selectedEl){this.selectedEl.unselect()}var D=0;var B;var v;var t;var r;var C;var y=this.currentInputValue.toUpperCase();y=y.replace(/^\s+|\s+$/,"");for(var w=0;w<A.length&&D<10;w++){r=A[w];if(this.useFilter){if(!y){continue}C=q[w];if(window._ignoreList&&_ignoreList[C]&&_ignoreList[C]==1){continue}t=0;if(r.toUpperCase().indexOf(y)==0){t=1}if(!t){B=r.split(/\s+/);for(var u=0;u<B.length;u++){v=B[u];if(v.toUpperCase().indexOf(y)==0){t=1;break}}}if(!t){continue}D++}var s=this.createListElement(r,q[w],x[w],w);z.appendChild(s)}for(var w=0;w<this.defaultDropDownEl.childNodes.length;w++){var s=this.defaultDropDownEl.childNodes[w];s._index=w+this.dropDownEl.childNodes.length}return true};this.createListElement=function(t,x,v,s){var w=document.createElement("div");w._value=t;w._loc=v;w._id=x;w._index=s;w.setName=function(y){this.nameEl.innerHTML=y};w.setLoc=function(y){if(this.locEl){this.locEl.innerHTML=y}};w.select=function(){this.className="list_element_container_selected";this.nameEl.className="list_element_name_selected";if(this.locEl){this.locEl.className="list_element_loc_selected"}if(g.idEl){g.idEl.value=this._id}};w.unselect=function(){this.className="list_element_container";this.nameEl.className="list_element_name";if(this.locEl){this.locEl.className="list_element_loc"}if(g.idEl){}g.selectedIndex=-1};w.onmousedown=function(){g.textBoxEl.value=this._value;if(g.idEl){g.idEl.value=this._id}g.onTypeAheadSuccess();if(g.formEl){}if(g.onListElMouseDown){g.onListElMouseDown(g,this)}g.setFrame()};w.onmouseover=function(){if(g.selectedEl){g.selectedEl.unselect()}g.selectedEl=this;g.selectedIndex=this._index;this.select()};w.onmouseout=function(){this.unselect()};w.style.zIndex="101";var r;if(s==-1){r=this.createDivider();w.appendChild(r)}var u=document.createElement("div");u.className="list_element_name";u.innerHTML=t;w.appendChild(u);w.nameEl=u;w.locEl=q;if(v){var q=document.createElement("div");q.className="list_element_loc";q.innerHTML=v;w.appendChild(q);w.locEl=q}r=this.createDivider();w.appendChild(r);w.unselect();return w};this.createDivider=function(){var q=document.createElement("div");q.className="list_element_divider";return q};this.createDropDownContainer=function(){var q=document.createElement("div");q.className="dropdown-container";this.containerEl=q;this.positionDropDown()};this.createDropDown=function(){var q=document.createElement("div");q.className="dropdown";q.style.display="none";q.style.zIndex="101";q.hide=function(){this.style.display="none"};q.show=function(){this.style.display="";g.positionDropDown()};this.containerEl.appendChild(q);this.dropDownEl=q};this.createDefaultDropDown=function(){var s=document.createElement("div");s.className="typeahead_header";s.style.display="none";s.innerHTML=tx("typeahead_ns:search-elsewhere");this.containerEl.appendChild(s);this.defaultDropDownHeaderEl=s;var t=document.createElement("div");t.style.display="none";t.show=function(){if(g.defaultDropDownCount>0){this.style.display="";g.defaultDropDownHeaderEl.style.display=""}else{g.dropDownEl.style.borderBottom="1px solid #777"}};t.hide=function(){this.style.display="none";g.defaultDropDownHeaderEl.style.display="none"};var r=0;for(var q in this.defaultOptions){var u=this.createListElement(q,this.defaultOptions[q],"",r);r++;t.appendChild(u)}t.className="default-dropdown";t.hide();this.containerEl.appendChild(t);this.defaultDropDownEl=t;this.defaultDropDownCount=t.childNodes.length};this.createDefaultText=function(){var q=document.createElement("div");q.className="default-text";q.style.display="none";q.hide=function(){this.style.display="none"};q.show=function(){this.style.display="";if(g.defaultDropDownCount==0){this.style.borderBottom="1px solid #777"}};q.setDefault=function(){this.innerHTML=e};q.setText=function(r){this.innerHTML=r};q.setDefault();if(!this.defaultOptions){q.style.borderBottom="0px solid"}this.containerEl.appendChild(q);this.defaultTextEl=q};this.positionDropDown=function(){var q=this.containerEl;if(q){if(this.customOffsetElement){q.style.left=elementX(this.textBoxEl)-elementX(this.customOffsetElement)+"px";q.style.top=elementY(this.textBoxEl)-elementY(this.customOffsetElement)+this.textBoxEl.offsetHeight+"px"}else{if(this.resize){q.style.left=elementX(this.textBoxEl)+"px";q.style.top=elementY(this.textBoxEl)+this.textBoxEl.offsetHeight+"px"}}if(!this.isIE){q.style.width=this.textBoxEl.offsetWidth+"px"}else{q.style.width=this.textBoxEl.offsetWidth+"px"}}};this.getText=function(){return this.textBoxEl.value};this.getSelectedText=function(){return this.selectedEl?this.selectedEl._value:""};this.noMatches=function(){return this._noMatches};this.getID=function(){return this.selectedEl?this.selectedEl._id:0};this.setText=function(s,r){this.textBoxEl.setText(s,r)};this.init=function(){this._noMatches=false;this.registryIndex=_registryIndex;Registry[_registryIndex++]=this;this.lastKeyCode=-1;this.currentInputValue=a.value;this.lastTypedValue="";this.lastInputValue="";this.dropDownCount=0;this.defaultDropDownCount=0;this.customOffsetElement=null;this.selectedIndex=-1;this.selectedEl=null;this.reFocused=false;a.setAttribute("placeholder",o);a.style.color="#777";a.ph=o;a.oThis=this;a.onblur=function(){if(!g.reFocused){g.dropDownEl.hide();g.defaultTextEl.hide();g.defaultDropDownEl.hide()}if(g.selectedIndex==-1){g.idEl.value=0}g.reFocused=false;var t=this.getAttribute("placeholder");if(this.isFocused&&t&&(this.value==""||this.value==t)){this.isFocused=0;this.value=t;this.style.color="#777"}g.setFrame()};a.onfocus=function(){var v=this.oThis;if(!this.isFocused){this.isFocused=1;if(v.selectedIndex==-1&&this.value==this.getAttribute("placeholder")){this.value=""}}if(v.dropDownCount>0||v.defaultTextEl.innerHTML!=""){if(v.dropDownCount==0){v.defaultTextEl.show()}if(this.createTextRange){var u=this.createTextRange();u.moveStart("character",0);u.select()}else{if(this.setSelectionRange){this.setSelectionRange(0,this.value.length)}}v.dropDownEl.show();v.defaultDropDownEl.show();v.positionDropDown();v.setFrame()}this.style.color="#000"};a.onkeyup=function(t){g.handleKeyUp(t)};a.setText=function(v,u){var w=this.getAttribute("placeholder");this.isFocused=0;if(v){this.style.color="#000";this.value=v;var t=new Object();t.keyCode=0;t.pEvent=1;g.handleKeyUp(t)}else{if(w&&w!=""){if(u){this.value="";this.style.color="#000"}else{this.value=w;this.style.color="#777"}this.isFocused=0;g.textBoxEl.style.background="#FFFFFF"}else{this.value="";g.textBoxEl.style.background="#FFFFFF"}}};if(!n){n=a.form}if(n){n.onsubmit=function(){g.setFrame();if(_lastKeyCode==13){_lastKeyCode=-1;return false}if(g.selectedIndex!=-1&&g.selectedEl){g.idEl.value=g.selectedEl._id}return true}}this.formEl=n;this.textBoxEl=a;this.idEl=i;this.onInputChange=l;this.onSuccess=b;this.defaultOptions=c;this.useFilter=m;this.onUp=d;this.onDown=h;this.onListElMouseDown=k;this.showNoMatches=j;this.fireCount=0;this.isIE=0;this.isSafari=0;if(navigator){this.browser=navigator.userAgent.toLowerCase();if(this.browser.indexOf("safari")!=-1){this.isSafari=1}if(this.browser.indexOf("msie")!=-1){this.isIE=1}}var q=p;this.createDropDownContainer();this.createDropDown();this.createDefaultText();this.createDefaultDropDown();this.positionDropDown();var r=document.createElement("div");r.id="savior";this.containerEl.id="dropdown";this.goodFrame=null;if(p){if(q&&this.isIE){p.appendChild(r)}p.appendChild(this.containerEl)}if(q==p&&this.isIE){var s=document.createElement("iframe");s.id="goodFrame";s.src="/common/blank.html";s.style.width="0px";s.style.height="0px";s.style.zIndex="98";q.insertBefore(s,q.firstChild);q.style.zIndex="99";this.goodFrame=s}};this.setCustomOffsetElement=function(q){this.customOffsetElement=q};var g=this;this.init();if(!window.onresize){window.onresize=function(r){for(var q=0;q<Registry.length;q++){Registry[q].positionDropDown()}}}a.onkeydown=function(q){g.handleKeyDown(q)}};function debug(a){document.getElementById("debug").innerHTML+=a+"<BR>"}function city_selector_onfound(a,b){a.value=b?b.i:-1}function city_selector_onselect(a){if(window[a]){window[a]()}};var Suggest=function(o,a,m,e,k,c,d,j,g,b,n,f,l,h){this.onInputChange=function(){var r=i.typeAheadObj.currentInputValue;var q=i.getCache(r);if(q){i.onSuggestRequestDone(r,q[0],q[1],q[2])}else{var t="";var s={};s[i.suggestParam]=r;if(i.networkType){s.t=i.networkType}var p=new AsyncRequest().setURI(i.suggestURI).setData(s).setHandler(function(u){var v=u.payload;i.onSuggestRequestDone(r,v.suggestNames,v.suggestIDs,v.suggestLocs,i.typeAheadObj.pEvent)}).setErrorHandler(function(u){new Dialog().setTitle(tx("sh:error-occurred")).setBody(tx("su01")).setButtons(Dialog.OK).show()}).setMethod("GET").setReadOnly(true).send()}};this.onSuggestRequestDone=function(p,t,q,s,r){this.setCache(p,t,q,s);if(this.typeAheadObj.displaySuggestList(t,q,s)){this.typeAheadObj.pEvent=r;this.typeAheadObj.onListChange()}};this.getCache=function(p){return this.suggestCache[p.toUpperCase()]};this.setCache=function(p,s,q,r){this.suggestCache[p.toUpperCase()]=new Array(s,q,r)};this.init=function(){this.suggestURI=c;this.suggestParam=d;this.suggestCache=[];this.networkType=b;if(!g){g=tx("su02")}e.value=a;this.typeAheadObj=new TypeAhead(o,m,e,k,f,g,0,j,this.onInputChange,null,null,null,n,l,h)};var i=this;this.init()};function debug(a){document.getElementById("debug").innerHTML+=a+"<BR>"};var noErr=0,kError_ErrorTool_BadErrorName=1337001,kError_ErrorTool_DuplicateErrorName=1337002,kError_ErrorTool_BadNamespaceName=1337003,kError_ErrorTool_BadErrorID=1337004,kError_ErrorTool_DuplicateNamespaceName=1337005,kError_ErrorTool_BadNamespaceID=1337006,kError_ErrorTool_WriteFailed=1337007,kError_ErrorTool_BadServiceName=1337008,kError_ErrorTool_RequestFailed=1337009,kError_ErrorTool_TempWriteFailed=1337010,kError_ErrorTool_LintFailed=1337011,kError_Account_IncorrectPassword=1340001,kError_Account_NotAuthenticated=1340002,kError_Account_MissingPassword=1340003,kError_Profile_InvalidAttribute=1341001,kError_Database_WriteFailed=1342001,kError_Account_NotLoggedIn=1340004,kError_Global_ValidationError=1346001,kError_Mobile_Error=1347001,kError_Login_DownError=1348001,kError_Login_ExternalLoginError=1348002,kError_Login_NoCookies=1348003,kError_Login_DeveloperLoginError=1348004,kError_Login_ZiddioContestMessage=1348005,kError_Login_OneTimeCodeMessage=1348006,kError_Login_MustLogInToSeeMessage=1348007,kError_Platform_NotLoggedIn=1349001,kError_Platform_NoAppInfoForAppID=1349002,kError_Platform_LoginError=1349003,kError_Login_ReactivateAccountMessage=1348008,kError_Login_GenericError=1348009,kError_Login_CreatorAccountError=1348010,kError_Login_NotComfirmedError=1348012,kError_Login_AccountDeactivatedError=1348013,kError_Login_AccountMergedError=1348014,kError_Login_AccountMergingError=1348015,kError_TPS_NoTicketId=1350001,kError_TPS_InvalidTicketStatus=1350002,kError_TPS_FailedUpdateTicketStatus=1350003,kError_TPS_FailedUpdateTicketSubject=1350004,kError_TPS_FailedUpdateTicketOwner=1350005,kError_TPS_FailedUpdateTicketQueue=1350006,kError_Login_IncorrectEmailOrPasswordError=1348016,kError_Login_PasswordsCaseSensitiveSubError=1348017,kError_TPS_FailedCorrespondOut=1350007,kError_TPS_EmptyCorrespondence=1350008,kError_TPS_FailedTicketRefresh=1350009,kError_Registration_LoginViaReg=1351001,kError_TPS_WarnUserFailedBadParams=1350010,kError_TPS_WarnUserFailedBadCall=1350011,kError_debategroups_alreadyVoted=1352001,kError_Payment_CardAlreadyDisabled=1353001,kError_Payment_PaymentException=1353002,kError_Payment_InvalidRequest=1353003,kError_TPS_UserHasTicket=1350013,kError_TPS_TicketAssociateBadParams=1350014,kError_TPS_TicketAssociateFailed=1350015,kError_TPS_EmailHasTicket=1350016,kError_Level1_NotEnabled=1354001,kError_Level1_CouldNotConnectToQueueDB=1354002,kError_Level1_QueueCommitFailed=1354003,kError_Level1_TransactionBeginFailed=1354004,kError_Level1_DirtyQueueSelectFailed=1354005,kError_Level1_NoDirtyKeys=1354006,kError_Level1_DispatchCreationFailed=1354007,kError_Level1_DirtyQueueUpdateFailed=1354008,kError_Level1_TransactionCommitFailed=1354009,kError_Level1_DispatchQueueSelectFailed=1354010,kError_Level1_NothingToDispatch=1354011,kError_TPS_FailedConfirmUser=1350017,kError_TPS_FailedResetPassword=1350018,kError_TPS_UnknownSimpleCommand=1350019,kError_TPS_NameChangeFailed=1350020,kError_TPS_InvalidBdayDate=1350021,kError_TPS_InvalidBdayUserTooYoung=1350022,kError_TPS_InvalidBdayUserTooOld=1350023,kError_TPS_BdayChangeGeneralFailure=1350024,kError_TPS_TicketAssociateMergeFailed=1350025,kError_TPS_TicketAssociateSimpleFailed=1350026,kError_TPS_TicketAssociateUnspecifiedError=1350027,kError_TPS_TicketAssociateRemoveUIDFailed=1350028,kError_TPS_VerificationScoreUpdateFailed=1350029,kError_TPS_AffilAddUseReAdd=1350030,kError_TPS_AffilAddEmailRequired=1350031,kError_TPS_AffilAddFailed=1350032,kError_TPS_AffilConfirmFailed=1350033,kError_TPS_AffilRemoveFailed=1350034,kError_TPS_AffilPendingFailed=1350035,kError_TPS_AffilReaddFailure=1350036,kError_TPS_AffilsUpdateError=1350037,kError_TPS_AffilWidgetUnknownAction=1350038,kError_TPS_AccountChangeFailedDark=1350039,kError_Chat_SendPermissions=1356001,kError_Chat_NotAvailable=1356002,kError_Chat_SendOtherNotAvailable=1356003,kError_Chat_Unknown=1356004,kError_Async_NotLoggedIn=1357001,kError_Async_NotInternUser=1357002,kError_TPS_TicketAttachBadParams=1350040,kError_TPS_TicketAttachGetPendingFailed=1350041,kError_Chat_MessageTooLong=1356005,kError_Payment_RefundExceedsAmount=1353004,kError_Payment_RefundAmountNotSupported=1353005,kError_Database_DatabaseDown=1342002,kError_TPS_AffilAddHSUserTooOld=1350042,kError_Admanager_ActionFailed=1359001,kError_Admanager_UpdateFailed=1359002,kError_Calendar_LackEditPermission=1360001,kError_Calendar_GenericError=1360002,kError_CSDC_Disabled=1361001,kError_Calendar_CannotJoinPrivate=1360003,kError_Reviews_WriteFailed=1362001,kError_Global_FailedCaptcha=1346002,kError_Payment_RefundMerchantCheck=1353006,kError_Video_TagExists=1363001,kError_Video_TagFailed=1363002,kError_Video_TagLimitReached=1363003,kError_Calendar_CannotSeeItem=1360004,kError_Calendar_PrivateCalendar=1360005,kError_Async_LoginChanged=1357003,kError_Calendar_CannotInviteOthers=1360006,kError_Mobile_CarrierInputDuplicate=1347002,kError_Mobile_NoData=1347003,kError_Ratings_MissingRequiredParams=1365001,kError_Ratings_InvalidContest=1365002,kError_Ratings_InvalidTarget=1365003,kError_Ratings_ContestNotRunning=1365004,kError_Ratings_NoTargetsFound=1365005,kError_Ratings_TargetTrojan=1365006,kError_Ratings_InvalidScore=1365007,kError_TPS_TicketAddCCFailed=1350043,kError_TPS_TicketRemoveCCFailed=1350044,kError_TPS_QueueAddCCFailed=1350045,kError_TPS_QueueRemoveCCFailed=1350046,kError_TPS_NoQueueId=1350047,kError_TPS_CCEditNoActionSpecified=1350048,kError_Global_ContentError=1346003,kError_Mobile_StatusUpdatesPrivacy=1347004,kError_Chat_MessageBlocked=1356006,kError_TPS_FailedChangeLanguage=1350049,kError_TPS_QueuePrefChangeFailed=1350050,kError_TPS_FailedChangePriority=1350051,kError_Chat_DownForMaintenance=1356007,kError_Async_CSRFCheckFailed=1357004,kError_Async_ParameterFailure=1357005,kError_Calendar_Blocked=1360007,kError_Video_AcceptedUploadAgreement=1363004,kError_Database_CannotConnect=1342003,kError_Photos_CommentFailed=1366001,kError_Async_BadPermissions=1357006,kError_Wall_PostFailure=1367001,kError_Example_DivisionByZero=1370001,kError_Typeahead_StaticSourceListEmpty=1371001,kError_Global_CantSee=1346004,kError_Chat_TooManyMessages=1356008,kError_Account_KarmaBlocked=1340005,kError_Platform_InvalidRequest=1349004,kError_Platform_AppNotOwnedByUser=1349005,kError_Platform_NoFriendsSelected=1349006,kError_Platform_CallbackValidationFailure=1349007,kError_Platform_ApplicationResponseInvalid=1349008,kError_Platform_TestConsoleKarmaWarned=1349009,kError_MIPages_TooManyAdded=1373001,kError_MIPages_AddFanStatusFailed=1373002,kError_MIPages_RemoveFanStatusFailed=1373003,kError_MIPages_EditSettingsFailed=1373004,kError_Minifeed_HideClickFail=1375001,kError_Group_NotGroupMember=1376001,kError_Group_UnableToJoin=1376002,kError_Group_NoPermission=1376003,kError_Group_EmptyOfficerTitle=1376004,kError_Group_UnableEditOfficer=1376005,kError_Notes_InvalidDeleteRequest=1377001,kError_Notes_DeleteFailed=1377002,kError_Notes_NoAccessRight=1377003,kError_Notes_FailToAddTag=1377004,kError_Notes_NoSuchNote=1377005,kError_Notes_UnknownAction=1377006,kError_Notes_NotebookUpdateFailed=1377007,kError_TPS_CRBadParams=1350052,kError_TPS_CRUnspecifiedAction=1350053,kError_TPS_CRUnspecifiedError=1350054,kError_TPS_CRInsuffPrivs=1350055,kError_TPS_CRDataFetchFailed=1350056,kError_TPS_CRCreateFailed=1350057,kError_TPS_CRCollectionCreateFailed=1350058,kError_TPS_CRUpdateFailed=1350059,kError_TPS_CRCollectionUpdateFailed=1350060,kError_TPS_CRBodyUpdateFailed=1350061,kError_TPS_CRRemoveBodyFailed=1350062,kError_Marketplace_MessageSendFailed=1378001,kError_TPS_CRFetchBodyFailed=1350063,kError_TPS_CRFetchBodyTypesFailed=1350064,kError_TPS_CRFetchFailed=1350065,kError_Notes_UnknownUploadCommand=1377008,kError_RichMediaContent_NoMoreMIML=1380001,kError_RichMediaContent_AddMIMLFailure=1380002,kError_RichMediaContent_GenericError=1380003,kError_TPS_TraccampBugCreationFailed=1350066,kError_TPS_NoTraccampProjectId=1350067,kError_PlatformRequests_NoSelection=1381001,kError_PlatformRequests_OutOfRequests=1381002,kError_RichMediaContent_NoMoreFlash=1380004,kError_RichMediaContent_AddFlashFailure=1380005,kError_Queues_UnknownCommand=1382001,kError_TPS_CRUpdateFrequentCollFailed=1350068,kError_TPS_CRDeleteFrequentCollFailed=1350069,kError_TPS_CRUpdateInitialCRFailed=1350070,kError_TPS_CRDeleteInitialCRFailed=1350071,kError_MIPages_BlockUserFailed=1373005,kError_Reviews_TooLong=1362003,kError_Reviews_MissingRequiredFields=1362004,kError_Reviews_DeleteFailed=1362005,kError_MIPayments_InvalidParamters=1383001,kError_MIPayments_UnableToCreateOrder=1383002,kError_TPS_CROrderUpdateFailed=1350072,kError_Maps_DeskDeleteFailure=1384001,kError_Maps_DeskAssignFailure=1384002,kError_Maps_DeskRotateFailure=1384003,kError_Maps_DeskCreateFailure=1384004,kError_Maps_DeskMoveFailure=1384005,kError_Mobile_InvalidIP=1347005,kError_Bookmarks_AddBookmarkFailed=1385001,kError_Bookmarks_RemoveBookmarkFailed=1385002,kError_TPS_CRDeleteFailed=1350073,kError_TPS_CRDeleteFailedSpecial=1350074,kError_TPS_CRDeleteCollectionFailed=1350075,kError_TPS_CRDeleteCollectionFailedSpecial=1350076;function animation(a){if(a==undefined){Util.error("Creating animation on non-existant object");return}if(this==window){return new animation(a)}else{this.obj=a;this._reset_state();this.queue=[];this.last_attr=null}}animation.resolution=20;animation.offset=0;animation.prototype._reset_state=function(){this.state={attrs:{},duration:500}};animation.prototype.stop=function(){this._reset_state();this.queue=[];return this};animation.prototype._build_container=function(){if(this.container_div){this._refresh_container();return}if(this.obj.firstChild&&this.obj.firstChild.__animation_refs){this.container_div=this.obj.firstChild;this.container_div.__animation_refs++;this._refresh_container();return}var b=document.createElement("div");b.style.padding="0px";b.style.margin="0px";b.style.border="0px";b.__animation_refs=1;var a=this.obj.childNodes;while(a.length){b.appendChild(a[0])}this.obj.appendChild(b);this.obj.style.overflow="hidden";this.container_div=b;this._refresh_container()};animation.prototype._refresh_container=function(){this.container_div.style.height="auto";this.container_div.style.width="auto";this.container_div.style.height=this.container_div.offsetHeight+"px";this.container_div.style.width=this.container_div.offsetWidth+"px"};animation.prototype._destroy_container=function(){if(!this.container_div){return}if(!--this.container_div.__animation_refs){var a=this.container_div.childNodes;while(a.length){this.obj.appendChild(a[0])}this.obj.removeChild(this.container_div)}this.container_div=null};animation.ATTR_TO=1;animation.ATTR_BY=2;animation.ATTR_FROM=3;animation.prototype._attr=function(a,b,c){a=a.replace(/-[a-z]/gi,function(e){return e.substring(1).toUpperCase()});var d=false;switch(a){case"background":this._attr("backgroundColor",b,c);return this;case"margin":b=animation.parse_group(b);this._attr("marginBottom",b[0],c);this._attr("marginLeft",b[1],c);this._attr("marginRight",b[2],c);this._attr("marginTop",b[3],c);return this;case"padding":b=animation.parse_group(b);this._attr("paddingBottom",b[0],c);this._attr("paddingLeft",b[1],c);this._attr("paddingRight",b[2],c);this._attr("paddingTop",b[3],c);return this;case"backgroundColor":case"borderColor":case"color":b=animation.parse_color(b);break;case"opacity":b=parseFloat(b,10);break;case"height":case"width":if(b=="auto"){d=true}else{b=parseInt(b,10)}break;case"borderWidth":case"lineHeight":case"fontSize":case"marginBottom":case"marginLeft":case"marginRight":case"marginTop":case"paddingBottom":case"paddingLeft":case"paddingRight":case"paddingTop":case"bottom":case"left":case"right":case"top":case"scrollTop":case"scrollLeft":b=parseInt(b,10);break;default:throw new Error(a+" is not a supported attribute!")}if(this.state.attrs[a]===undefined){this.state.attrs[a]={}}if(d){this.state.attrs[a].auto=true}switch(c){case animation.ATTR_FROM:this.state.attrs[a].start=b;break;case animation.ATTR_BY:this.state.attrs[a].by=true;case animation.ATTR_TO:this.state.attrs[a].value=b;break}};animation.prototype.to=function(a,b){if(b===undefined){this._attr(this.last_attr,a,animation.ATTR_TO)}else{this._attr(a,b,animation.ATTR_TO);this.last_attr=a}return this};animation.prototype.by=function(a,b){if(b===undefined){this._attr(this.last_attr,a,animation.ATTR_BY)}else{this._attr(a,b,animation.ATTR_BY);this.last_attr=a}return this};animation.prototype.from=function(a,b){if(b===undefined){this._attr(this.last_attr,a,animation.ATTR_FROM)}else{this._attr(a,b,animation.ATTR_FROM);this.last_attr=a}return this};animation.prototype.duration=function(a){this.state.duration=a?a:0;return this};animation.prototype.checkpoint=function(b,a){if(b===undefined){b=1}this.state.checkpoint=b;this.queue.push(this.state);this._reset_state();this.state.checkpointcb=a;return this};animation.prototype.blind=function(){this.state.blind=true;return this};animation.prototype.hide=function(){this.state.hide=true;return this};animation.prototype.show=function(){this.state.show=true;return this};animation.prototype.ease=function(a){this.state.ease=a;return this};animation.prototype.go=function(){var b=(new Date()).getTime();this.queue.push(this.state);for(var a=0;a<this.queue.length;a++){this.queue[a].start=b-animation.offset;if(this.queue[a].checkpoint){b+=this.queue[a].checkpoint*this.queue[a].duration}}animation.push(this);return this};animation.prototype._frame=function(g){var j=true;var h=false;var d=false;for(var k=0;k<this.queue.length;k++){var o=this.queue[k];if(o.start>g){j=false;continue}if(o.checkpointcb){this._callback(o.checkpointcb,g-o.start);o.checkpointcb=null}if(o.started===undefined){if(o.show){this.obj.style.display="block"}for(var m in o.attrs){if(o.attrs[m].start!==undefined){continue}switch(m){case"backgroundColor":case"borderColor":case"color":var e=animation.parse_color(get_style(this.obj,m=="borderColor"?"borderLeftColor":m));if(o.attrs[m].by){o.attrs[m].value[0]=Math.min(255,Math.max(0,o.attrs[m].value[0]+e[0]));o.attrs[m].value[1]=Math.min(255,Math.max(0,o.attrs[m].value[1]+e[1]));o.attrs[m].value[2]=Math.min(255,Math.max(0,o.attrs[m].value[2]+e[2]))}break;case"opacity":var e=get_opacity(this.obj);if(o.attrs[m].by){o.attrs[m].value=Math.min(1,Math.max(0,o.attrs[m].value+e))}break;case"height":case"width":var e=animation["get_"+m](this.obj);if(o.attrs[m].by){o.attrs[m].value+=e}break;case"scrollLeft":case"scrollTop":var e=(this.obj==document.body)?(document.documentElement[m]||document.body[m]):this.obj[m];if(o.attrs[m].by){o.attrs[m].value+=e}o["last"+m]=e;break;default:var e=parseInt(get_style(this.obj,m),10);if(o.attrs[m].by){o.attrs[m].value+=e}break}o.attrs[m].start=e}if((o.attrs.height&&o.attrs.height.auto)||(o.attrs.width&&o.attrs.width.auto)){if(ua.firefox()<3){d=true}this._destroy_container();for(var m in {height:1,width:1,fontSize:1,borderLeftWidth:1,borderRightWidth:1,borderTopWidth:1,borderBottomWidth:1,paddingLeft:1,paddingRight:1,paddingTop:1,paddingBottom:1}){if(o.attrs[m]){this.obj.style[m]=o.attrs[m].value+(typeof o.attrs[m].value=="number"?"px":"")}}if(o.attrs.height&&o.attrs.height.auto){o.attrs.height.value=animation.get_height(this.obj)}if(o.attrs.width&&o.attrs.width.auto){o.attrs.width.value=animation.get_width(this.obj)}}o.started=true;if(o.blind){this._build_container()}}var c=(g-o.start)/o.duration;if(c>=1){c=1;if(o.hide){this.obj.style.display="none"}}else{j=false}var l=o.ease?o.ease(c):c;if(!h&&c!=1&&o.blind){h=true}if(d&&this.obj.parentNode){var f=this.obj.parentNode;var b=this.obj.nextSibling;f.removeChild(this.obj)}for(var m in o.attrs){switch(m){case"backgroundColor":case"borderColor":case"color":this.obj.style[m]="rgb("+animation.calc_tween(l,o.attrs[m].start[0],o.attrs[m].value[0],true)+","+animation.calc_tween(l,o.attrs[m].start[1],o.attrs[m].value[1],true)+","+animation.calc_tween(l,o.attrs[m].start[2],o.attrs[m].value[2],true)+")";break;case"opacity":set_opacity(this.obj,animation.calc_tween(l,o.attrs[m].start,o.attrs[m].value));break;case"height":case"width":this.obj.style[m]=l==1&&o.attrs[m].auto?"auto":animation.calc_tween(l,o.attrs[m].start,o.attrs[m].value,true)+"px";break;case"scrollLeft":case"scrollTop":var e=(this.obj==document.body)?(document.documentElement[m]||document.body[m]):this.obj[m];if(o["last"+m]!=e){delete o.attrs[m]}else{var n=animation.calc_tween(l,o.attrs[m].start,o.attrs[m].value,true)-e;if(m=="scrollLeft"){window.scrollBy(n,0)}else{window.scrollBy(0,n)}o["last"+m]=n+e}break;default:this.obj.style[m]=animation.calc_tween(l,o.attrs[m].start,o.attrs[m].value,true)+"px";break}}if(c==1){this.queue.splice(k--,1);this._callback(o.ondone,g-o.start-o.duration)}}if(d){f[b?"insertBefore":"appendChild"](this.obj,b)}if(!h&&this.container_div){this._destroy_container()}return !j};animation.prototype.ondone=function(a){this.state.ondone=a;return this};animation.prototype._callback=function(a,b){if(a){animation.offset=b;a.call(this);animation.offset=0}};animation.calc_tween=function(b,d,c,a){return(a?parseInt:parseFloat)((c-d)*b+d,10)};animation.parse_color=function(a){var c=/^#([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{1,2})$/i.exec(a);if(c){return[parseInt(c[1].length==1?c[1]+c[1]:c[1],16),parseInt(c[2].length==1?c[2]+c[2]:c[2],16),parseInt(c[3].length==1?c[3]+c[3]:c[3],16)]}else{var b=/^rgba? *\(([0-9]+), *([0-9]+), *([0-9]+)(?:, *([0-9]+))?\)$/.exec(a);if(b){if(b[4]==="0"){return[255,255,255]}else{return[parseInt(b[1],10),parseInt(b[2],10),parseInt(b[3],10)]}}else{if(a=="transparent"){return[255,255,255]}else{throw"Named color attributes are not supported."}}}};animation.parse_group=function(a){var a=trim(a).split(/ +/);if(a.length==4){return a}else{if(a.length==3){return[a[0],a[1],a[2],a[1]]}else{if(a.length==2){return[a[0],a[1],a[0],a[1]]}else{return[a[0],a[0],a[0],a[0]]}}}};animation.get_height=function(d){var c=parseInt(get_style(d,"paddingTop"),10),b=parseInt(get_style(d,"paddingBottom"),10),a=parseInt(get_style(d,"borderTopWidth"),10),e=parseInt(get_style(d,"borderBottomWidth"),10);return d.offsetHeight-(c?c:0)-(b?b:0)-(a?a:0)-(e?e:0)};animation.get_width=function(c){var b=parseInt(get_style(c,"paddingLeft"),10),e=parseInt(get_style(c,"paddingRight"),10),d=parseInt(get_style(c,"borderLeftWidth"),10),a=parseInt(get_style(c,"borderRightWidth"),10);return c.offsetWidth-(b?b:0)-(e?e:0)-(d?d:0)-(a?a:0)};animation.push=function(a){if(!animation.active){animation.active=[]}animation.active.push(a);if(!animation.timeout){animation.timeout=setInterval(animation.animate.bind(animation),animation.resolution)}animation.animate(true)};animation.animate=function(c){var a=true;var d=(new Date()).getTime();for(var b=c===true?animation.active.length-1:0;b<animation.active.length;b++){if(animation.active[b]._frame(d)){a=false}else{animation.active.splice(b--,1)}}if(a){clearInterval(animation.timeout);animation.timeout=null}};animation.ease={};animation.ease.begin=function(a){return a*a};animation.ease.end=function(a){a-=1;return -(a*a)+1};animation.ease.both=function(a){if(a<=0.5){return(a*a)*2}else{a-=1;return(a*a)*-2+1}};function Dialog(){Dialog._setup();this._pd=new pop_dialog();this._pd._dialog_object=this}Dialog.OK={name:"ok",label:tx("sh:ok-button")};Dialog.CANCEL={name:"cancel",label:tx("sh:cancel-button"),className:"inputaux"};Dialog.CLOSE={name:"close",label:tx("sh:close-button")};Dialog.SAVE={name:"save",label:tx("sh:save-button")};Dialog.OK_AND_CANCEL=[Dialog.OK,Dialog.CANCEL];Dialog._STANDARD_BUTTONS=[Dialog.OK,Dialog.CANCEL,Dialog.CLOSE,Dialog.SAVE];Dialog.getCurrent=function(){var a=generic_dialog.dialog_stack;if(a.length==0){return null}return a[a.length-1]._dialog_object||null};Dialog._basicMutator=function(a){return function(b){this[a]=b;this._dirty();return this}};copy_properties(Dialog.prototype,{show:function(){this._showing=true;this._dirty();return this},hide:function(){this._showing=false;if(this._autohide_timeout){clearTimeout(this._autohide_timeout);this._autohide_timeout=null}this._pd.fade_out(250);return this},setTitle:Dialog._basicMutator("_title"),setBody:Dialog._basicMutator("_body"),setAutohide:function(a){if(a){if(this._showing){this._autohide_timeout=setTimeout(bind(this,"hide"),a)}else{this._autohide=a}}else{this._autohide=null;if(this._autohide_timeout){clearTimeout(this._autohide_timeout);this._autohide_timeout=null}}return this},setSummary:Dialog._basicMutator("_summary"),setButtons:function(c){if(!(c instanceof Array)){c=[c]}for(var b=0;b<c.length;++b){if(typeof(c[b])=="string"){var a=Dialog._findButton(Dialog._STANDARD_BUTTONS,c[b]);if(!a){Util.error("Unknown button: "+c[b])}c[b]=a}}this._buttons=c;this._dirty();return this},setButtonsMessage:Dialog._basicMutator("_buttons_message"),setStackable:Dialog._basicMutator("_is_stackable"),setHandler:function(a){this._handler=a;return this},setPostURI:function(a){this.setHandler(this._submitForm.bind(this,"POST",a));return this},setGetURI:function(a){this.setHandler(this._submitForm.bind(this,"GET",a));return this},setModal:function(a){if(a===undefined){a=true}if(this._showing&&this._modal&&!a){Util.error("At the moment we don't support un-modal-ing a modal dialog")}this._modal=a;return this},setContentWidth:function(a){this._content_width=a;this._dirty();return this},setClassName:Dialog._basicMutator("_class_name"),setCloseHandler:function(a){this._close_handler=call_or_eval.bind(null,null,a);return this},setAsync:function(a){var c=function(e){if(this._async_request!=a){return}this._async_request=null;var g=e.getPayload();if(typeof(g)=="string"){this.setBody(g)}else{for(var d in g){var f=this["set"+d.substr(0,1).toUpperCase()+d.substr(1)];if(!f){Util.error("Unknown Dialog property: "+d)}f.call(this,g[d])}}this._dirty()}.bind(this);var b=bind(this,"hide");a.setHandler(chain(a.getHandler(),c)).setErrorHandler(chain(b,a.getErrorHandler())).setTransportErrorHandler(chain(b,a.getTransportErrorHandler())).send();this._async_request=a;this._dirty();return this},_dirty:function(){if(!this._is_dirty){this._is_dirty=true;bind(this,"_update").defer()}},_update:function(){this._is_dirty=false;if(!this._showing){return}if(this._autohide&&!this._async_request&&!this._autohide_timeout){this._autohide_timeout=setTimeout(bind(this,"hide"),this._autohide)}if(this._class_name){this._pd.setClassName(this._class_name)}if(!this._async_request){var a=[];if(this._title){a.push("<h2><span>"+this._title+"</span></h2>")}a.push('<div class="dialog_content">');if(this._summary){a.push('<div class="dialog_summary">');a.push(this._summary);a.push("</div>")}a.push('<div class="dialog_body">');a.push(this._body);a.push("</div>");if(this._buttons||this._buttons_message){a.push('<div class="dialog_buttons">');if(this._buttons_message){a.push('<div class="dialog_buttons_msg">');a.push(this._buttons_message);a.push("</div>")}if(this._buttons){this._buttons.forEach(function(c){a.push('<input class="inputsubmit '+(c.className||"")+'" type="button"'+(c.name?(' name="'+c.name+'"'):"")+' value="'+htmlspecialchars(c.label)+'" onclick="Dialog.getCurrent().handleButton(this.name);" />')},this)}a.push("</div>")}a.push("</div>");this._pd.show_dialog(a.join(""))}else{var b=this._title||tx("sh:loading");this._pd.show_loading_title(b)}if(this._modal){this._pd.make_modal()}if(this._content_width){this._pd.popup.childNodes[0].style.width=(this._content_width+42)+"px"}this._pd.is_stackable=this._is_stackable;this._pd.close_handler=this._close_handler},handleButton:function(a){if(typeof(a)=="string"){a=Dialog._findButton(this._buttons,a)}if(!a){Util.error("Huh?  How did this button get here?");return}if(call_or_eval(a,a.handler)===false){return}if(a!=Dialog.CANCEL){if(call_or_eval(this,this._handler,{button:a})===false){return}}this.hide()},_submitForm:function(e,c,b){var d=this._getFormData();d[b.name]=b.label;var a=new AsyncRequest().setURI(c).setData(d).setMethod(e).setReadOnly(e=="GET");this.setAsync(a);return false},_getFormData:function(){var a=DOM.scry(this._pd.content,"div.dialog_content");if(a.length!=1){Util.error(a.length+" dialog_content divs in this dialog?  Weird.")}return serialize_form(a[0])}});Dialog._findButton=function(c,a){for(var b=0;b<c.length;++b){if(c[b].name==a){return c[b]}}return null};Dialog._setup=function(){if(Dialog._is_set_up){return}Dialog._is_set_up=true;var a=function(c,b){return KeyEventController.filterEventTypes(c,b)&&KeyEventController.filterEventModifiers(c,b)};KeyEventController.registerKey("ESCAPE",Dialog._handleEscapeKey,a)};Dialog._handleEscapeKey=function(f,d){var b=Dialog.getCurrent();if(!b){return true}var e=b._buttons;if(!e){return true}var a=Dialog._findButton(e,"cancel");if(a){var c=a}else{if(e.length==1){var c=e[0]}else{return true}}b.handleButton(c);return false};