var _string_table={"sh:loading":"載入中...","sh:cancel-button":"取消","sh:save-button":"儲存","sh:submit-button":"送出","sh:ok-button":"確認","sh:confirm-button":"確定","sh:close-button":"關閉","sh:download-button":"下載"};function tx(d,a){if(typeof _string_table=="undefined"){return d}d=_string_table[d];if(a){if(typeof a!="object"){Util.error("moved.js: args should be a keyed array (not a string) for tx("+d+", ...)")}else{for(var b in a){var c="/{"+b+"}/g";d=d.replace(c,a[b])}}}return d}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}}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 m=j.exec(d.stack);do{g.push([m[1],m[2]])}while(m=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}};Array.prototype.alloc=function(a){return a?new Array(a):[]};Array.prototype.forEach=function(b,a){this.map(b,a);return this};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.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);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){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 k=1;k<arguments.length-2;k++){if(arguments[k]===undefined){d[k]=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 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 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 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 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 n=new RegExp("\\S{"+(h+1)+"}","g");var a=0;var g=j;var c=[];var f=j.match(n);if(f){for(var b=0;b<f.length;b++){var d=f[b];var k=a+g.indexOf(d);var m=j.substring(a,k);if(m){c.push(e(m))}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(r,j,n){var c={"<":">","*":"*","{":"}","[":"]","'":"'",'"':'"',"#":"#","+":"+","-":"-","(":")"};if(typeof(r)=="undefined"||!r.toString){return""}if(typeof j!="function"){j=htmlize}if(typeof n!="function"){n=htmlize}var r=r.toString();var o=text_get_hyperlinks(r);var a=0;var p=r;var h=[];var p=r;if(o){for(var g=0;g<o.length;g++){var f=o[g];var m=a+p.indexOf(f);var t=f.length;var d=r.substring(a,m);if(d){h.push(j(d))}var k="";if(m>0){var b=r[m-1];if(typeof c[b]!="undefined"){var e=c[b];var q=f.indexOf(e);if(q!=-1){k=j(f.substring(q));f=f.substring(0,q)}}}http_str=n(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=m+t;p=r.substring(a)}}if(p){h.push(j(p))}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 o=arguments.length-1;o>0;o--){if(typeof(arguments[o])=="undefined"){Util.log("You passed an undefined argument (argument "+o+" to sprintf(). Pattern was: `"+(arguments[0])+"'.","error");c.push("")}else{if(arguments[o]===null){c.push("")}else{if(arguments[o]===true){c.push("true")}else{if(arguments[o]===false){c.push("false")}else{if(!arguments[o].toString){Util.log("Argument "+(o+1)+" to sprintf() does not have a toString() method. The pattern was: `"+(arguments[0])+"'.","error");return""}c.push(arguments[o])}}}}}var w=arguments[0];w=w.toString().split("%");var A=w.length;var a=w[0];for(var o=1;o<A;o++){if(c.length==0){Util.log("Not enough arguments were provide to sprintf(). The pattern was: `"+(arguments[0])+"'.","error");return""}if(!w[o].length){a+="%";continue}var u=0;var v=0;var t="";var b=" ";var j=null;var d=null;var y="";var f=0;if(v=w[o].match(/^('.)?(?:(-?\d+\.)?(-?\d+)?)/)){if(v[2]!==undefined&&v[2].length){j=parseInt(y=v[2])}if(v[3]!==undefined&&v[3].length){if(j!==null){d=parseInt(v[3])}else{j=parseInt(y=v[3])}}f=v[0].length;if(v[1]!==undefined&&v[1].length){b=v[1].charAt(1)}else{if(y.charAt(0)==0){b="0"}}}switch(w[o].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 z=c.pop();for(var o=0;o<z.length;o++){z[o]="`"+htmlspecialchars(c.pop().toString())+"'"}if(z.length>1){z[z.length-1]="and "+z[z.length-1]}raw=z.join(", ");break;case"x":x=c.pop();var n="?";var g="?";try{if(typeof(x.line)!="undefined"){n=x.line}else{if(typeof(x.lineNumber)!="undefined"){n=x.lineNumber}}if(typeof(x.sourceURL)!="undefined"){g=x.sourceURL}else{if(typeof(x.fileName)!="undefined"){g=x.fileName}}}catch(h){}var q="[An Exception]";try{q=x.message||x.toString()}catch(h){}raw=q+" [at line "+n+" in "+g+"]";break;default:raw="%"+w[o].charAt(f+1);break}if(j!==null){if(raw.length<Math.abs(j)){var B="";var e=(Math.abs(j)-raw.length);for(var k=0;k<e;k++){B+=b}if(j<0){raw+=B}else{raw=B+raw}}}if(d!==null){if(raw.length>d){raw=raw.substr(0,d)}}a+=raw+w[o].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()=="facebook"&&c.pop()=="facebook"){this.setDomain(b.getDomain());return true}}return false}});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.fbJavascriptLibrariesHaveLoaded){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.fbJavascriptLibrariesHaveLoaded=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(o,m,b,a,n,k,c,g,f,j){if(b.style.display=="none"){b.style.display="block";if(f&&j){for(prop in j){switch(prop){case"top":b.style.top=(f.offsetTop+j[prop])+"px";break;case"left":b.style.left=(f.offsetLeft+j[prop])+"px";break;case"right":b.style.left=(f.offsetLeft+f.offsetWidth-j[prop]-b.offsetWidth)+"px";break;case"bottom":b.style.top=(f.offsetTop+f.offsetHeight-j[prop]-b.offsetHeight)+"px";break}}}if(o){var h=k?k:o.className}if(m){m.className="active"}if(o){o.className=n?n:"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(p){if(!e){hide(this);if(m){m.className=""}if(o){o.className=h}var q=ge(b.id+"_iframe");if(q){q.style.display="none";q.style.width=b.offsetWidth+"px";q.style.height=b.offsetHeight+"px"}if(g){g(p)}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(j){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 j=c.height;if(h>d||j>b){var m=b/d;var f=j/h;if(f>m){h=h*(b/j);j=b}else{j=j*(d/h);h=d}}var k=ge(a);var g=document.createElement("img");g.src=e;g.width=h;g.height=j;k.parentNode.insertBefore(g,k);k.parentNode.removeChild(k)}};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}}}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 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;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 j=null;var b=this.handlers[f.keyCode];var h,d,c;if(b){for(var k=0;k<b.length;k++){h=b[k].callback;d=b[k].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,q,f){this.get_start_ts=function(){return w(k,g,v,c,d,t)};this.get_end_ts=function(){var D=w(k,g,v,c,d,t);var E=w(j,a,u,o,B,z);if(D>E&&!(v&&u)){var C=new Date();C.setTime(E);C.setFullYear(C.getFullYear()+1);return C.getTime()}else{return E}};var k=ge(b+"_month");var g=ge(b+"_day");var c=ge(b+"_hour");var v=ge(b+"_year");var d=ge(b+"_min");var t=ge(b+"_ampm");var j=ge(e+"_month");var a=ge(e+"_day");var u=ge(e+"_year");var o=ge(e+"_hour");var B=ge(e+"_min");var z=ge(e+"_ampm");var A;if(f){A=false}else{A=true}var h=function(){if(!A){y(k,g,v,c,d,t)}};var r=function(){A=true};var y=function(){var C=w(k,g,v,c,d,t);var D=C+q*60000;n(D,j,a,u,o,B,z)};var w=function(F,P,S,K,I,R){var C=new Date();var D=C.getDate();var N=C.getMonth();var J=C.getFullYear();var M=F.value-1;var E=P.value;var H;var G=I.value;var Q;H=parseInt(K.value);if(R.value!=""){if(H==12){H=0}if(R.value=="pm"){H=H+12}}if(!S){if(M<N){Q=J+1}else{if(M==N&&E<D){Q=J+1}else{Q=J}}}else{Q=S.value}var L=new Date(Q,M,E,H,G,0,0);var O=L.getTime();return O};var n=function(L,E,M,O,G,F,N){var I=new Date();I.setTime(L);var H=E.value;var C=I.getMonth()+1;var D=I.getDate();var K=I.getHours();var J=I.getMinutes();var Q=I.getFullYear();var P;if(N.value!=""){if(K>11){P="pm";if(K>12){K=K-12}}else{if(K==0){K=12}P="am"}}else{P=""}if(J<10){J="0"+J}E.value=C;M.value=D;if(O){O.value=Q}G.value=K;F.value=J;N.value=P;if(H!=C){editor_date_month_change(E,M,O?O:false)}};var p=function(){h();editor_date_month_change(k,g,v?v:false)};var m=function(){r();editor_date_month_change(j,a,u?u:false)};k.onchange=p;g.onchange=h;if(v){v.onchange=h}c.onchange=h;d.onchange=h;t.onchange=h;j.onchange=m;a.onchange=r;if(u){u.onchange=r}o.onchange=r;B.onchange=r;z.onchange=r}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 j=document.createElement("div");j.innerHTML=g;j.className="mobile_nag";j.style.display="none";a.parentNode.insertBefore(j,a);animation(j).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 generic_dialog(a,b){this.className=a;this.content=null;this.obj=null;this.popup=null;this.overlay=null;this.modal=true;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(m,h,g,e,f,j,c,d,n,a){this.show_loading(tx("sh:loading"));var o=function(p){this.show_choice(m,p.getPayload(),g,e,f,j,c,d,n)}.bind(this);var b=function(p){ErrorDialog.showAsyncError(p);this.hide(false)}.bind(this);var k=new AsyncRequest().setURI(h).setHandler(o).setErrorHandler(b).setTransportErrorHandler(b);if(a==true){k.setReadOnly(true)}k.send();return this};generic_dialog.prototype.show_form_ajax=function(g,b,d,e){this.show_loading(tx("sh:loading"));var k="dialog_ajax_form__"+gen_unique();var a=function(m,n){if(n.getError()!=true){m.hide();ErrorDialog.showAsyncError(n)}else{m.show_choice(g,n.getPayload(),"Okay",function(){m.fade_out(200)})}}.bind(null,this);var j=function(n,o){var m='<form id="'+k+'" onsubmit="return false;">'+o.getPayload()+"</form>";n.show_choice(g,m,d,h,tx("sh:cancel-button"),function(){n.fade_out(200)})}.bind(null,this);var h=function(){new AsyncRequest().setURI(b).setData(serialize_form(ge(k))).setHandler(f).setErrorHandler(c).send()};var f=function(m,n){m.show_choice(g,n.getPayload(),"Okay",function(){m.fade_out(200)});if(e){window.location.reload()}else{setTimeout(function(){m.fade_out(500)},750)}}.bind(null,this);var c=function(m,n){if(n.getError()==1346001){j(n)}else{if(n.getError()!=true){ErrorDialog.showAsyncError(n)}else{a(n)}}}.bind(null,this);new AsyncRequest().setURI(b).setReadOnly(true).setHandler(j).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=PEOPLE_P+"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(p,r,k){var n=0;var q=p.getElementsByTagName("img");var j=ua.safari()<3;for(var m=0;m<q.length;m++){var o=q[m];if(image_has_loaded(o)){n++}}if(n!=q.length){if(k<20){k++;setTimeout(function(){e(p,r,k)},100)}else{r()}}else{r()}}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 class="pop_dialog_top"><td class="pop_topleft"></td><td class="pop_border"></td><td class="pop_topright"></td></tr><tr><td class="pop_content" id="pop_content" colspan="3"></td></tr><tr class="pop_dialog_bottom"><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")[3]};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(r,p,a,j,c,e,o,b,n,d,h,m,q,k,f){this.resize=!f;this.getMatchSingleTerm=function(u,A){var B="";var y=u.length;if(!A){return""}var C=A;var z=0;z=C.toUpperCase().indexOf(u.toUpperCase());if(z==-1){return B}var v=C.substring(0,y);B+='<span class="suggest">'+v+"</span>";var w=0;C=C.substring(z+y);while((z=C.toUpperCase().indexOf(u.toUpperCase()))!=-1){var t=C.substring(0,z);if(t){B+=t}var v=C.substring(z,z+y);if(v){B+='<span class="suggest">'+v+"</span>"}C=C.substring(z+y);w=1}if(w){B+=C}};this.getMatchMultipleTerms=function(y,B){if(!B){return""}var D=y.split(/\s+/);var G=B.split(/\s+/);var C="";for(var A=0;A<G.length;A++){var t=0;var E=G[A];for(var u=0;u<D.length;u++){var w=D[u];if(E.toUpperCase().indexOf(w.toUpperCase())==0){t=1;break}}if(A>0){C+=" "}if(t){var z=w.length;var v=E.substring(0,z);var F=E.substring(z);C+='<span class="suggest">'+v+"</span>"+F}else{C+=E}}return C};this.onListChange=function(){this.selectedIndex=-1;if(!this.pEvent){this.idEl.value=0}var t=this.dropDownEl;if(t&&t.childNodes){this.dropDownCount=t.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 v=false;if(this.currentInputValue.length>0){for(var u=0;u<this.dropDownCount;u++){if(!v){v=true;this.selectedIndex=u;this.selectedEl=this.dropDownEl.childNodes[u]}var z=this.getMatchSingleTerm(this.currentInputValue,this.dropDownEl.childNodes[u]._value);if(!z){z=this.getMatchMultipleTerms(this.currentInputValue,this.dropDownEl.childNodes[u]._value)}this.dropDownEl.childNodes[u].setName(z);z=this.getMatchSingleTerm(this.currentInputValue,this.dropDownEl.childNodes[u]._loc);if(!z){z=this.getMatchMultipleTerms(this.currentInputValue,this.dropDownEl.childNodes[u]._loc)}this.dropDownEl.childNodes[u].setLoc(z)}if(!v){for(var u=0;u<this.defaultDropDownCount;u++){if(this.defaultDropDownEl.childNodes[u]._value.toUpperCase().indexOf(this.currentInputValue.toUpperCase())==0){v=true;this.selectedIndex=u;this.selectedEl=this.defaultDropDownEl.childNodes[u];break}}}}var y=this.currentInputValue;var w=false;switch(this.lastKeyCode){case 8:case 33:case 34:case 35:case 35:case 36:case 37:case 39:case 45:case 46:w=true;break;case 27:w=true;break;default:break}if(!w&&v&&!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(u){if(!u&&window.event){u=window.event}if(u.keyCode==40||u.keyCode==38){if(this.isSafari&&(this.fireCount++%2==1)){}}var w=this.textBoxEl.value;var t=this.getSelectedLength();var y=this.getUnselectedLength();if(t>0&&y!=-1){w=w.substring(0,y)}this.currentInputValue=w;var v=false;switch(this.lastKeyCode){case 13:case 9:v=true;break;case 38:v=true;if(this.onUp){this.onUp(this)}break;case 40:v=true;if(this.onDown){this.onDown(this)}break}this.pEvent=0;if(u.pEvent){this.pEvent=u.pEvent}if(!v&&this.onInputChange){this.onInputChange(this)}if(this.lastKeyCode==13){this.lastKeyCode=-1;_lastKeyCode=-1}this.lastInputValue=this.currentInputValue};this.getSelectedLength=function(){var v=this.textBoxEl;var t=-1;if(v.createTextRange){var u=document.selection.createRange().duplicate();t=u.text.length}else{if(v.setSelectionRange){t=v.selectionEnd-v.selectionStart}}return t};this.getUnselectedLength=function(){var v=this.textBoxEl;var t=0;if(v.createTextRange){var u=document.selection.createRange().duplicate();u.moveEnd("textedit",1);t=v.value.length-u.text.length}else{if(v.setSelectionRange){t=v.selectionStart}else{t=-1}}return t};this.handleKeyDown=function(t){if(!t&&window.event){t=window.event}if(t){this.lastKeyCode=t.keyCode;_lastKeyCode=t.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(t&&(t.keyCode==13||t.keyCode==38||t.keyCode==40)){t.cancelBubble=true;t.returnValue=false}};this.selectPrevDropDown=function(){this.selectDropDown(this.selectedIndex-1)};this.selectNextDropDown=function(){this.selectDropDown(this.selectedIndex+1)};this.selectDropDown=function(t){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 u=false;if(t>=this.dropDownCount&&this.defaultDropDownCount>0){u=true}if(t>=this.dropDownCount+this.defaultDropDownCount){t=this.dropDownCount+this.defaultDropDownCount-1}if(this.selectedIndex!=-1&&t!=this.selectedIndex){this.selectedIndex=-1;this.selectedEl.unselect()}if(t<0){this.selectedIndex=-1;return}this.selectedIndex=t;if(u){this.selectedEl=this.defaultDropDownEl.childNodes[t-this.dropDownCount]}else{this.selectedEl=this.dropDownEl.childNodes[t]}this.selectedEl.select();this.textBoxEl.value=this.selectedEl._value};this.displaySuggestList=function(E,t,B){if(E.length!=t.length){return false}var D=this.dropDownEl;while(D.childNodes.length>0){D.removeChild(D.childNodes[0])}if(this.selectedEl){this.selectedEl.unselect()}var H=0;var F;var z;var w;var u;var G;var C=this.currentInputValue.toUpperCase();C=C.replace(/^\s+|\s+$/,"");for(var A=0;A<E.length&&H<10;A++){u=E[A];if(this.useFilter){if(!C){continue}G=t[A];if(window._ignoreList&&_ignoreList[G]&&_ignoreList[G]==1){continue}w=0;if(u.toUpperCase().indexOf(C)==0){w=1}if(!w){F=u.split(/\s+/);for(var y=0;y<F.length;y++){z=F[y];if(z.toUpperCase().indexOf(C)==0){w=1;break}}}if(!w){continue}H++}var v=this.createListElement(u,t[A],B[A],A);D.appendChild(v)}for(var A=0;A<this.defaultDropDownEl.childNodes.length;A++){var v=this.defaultDropDownEl.childNodes[A];v._index=A+this.dropDownEl.childNodes.length}return true};this.createListElement=function(w,B,z,v){var A=document.createElement("div");A._value=w;A._loc=z;A._id=B;A._index=v;A.setName=function(C){this.nameEl.innerHTML=C};A.setLoc=function(C){if(this.locEl){this.locEl.innerHTML=C}};A.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}};A.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};A.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()};A.onmouseover=function(){if(g.selectedEl){g.selectedEl.unselect()}g.selectedEl=this;g.selectedIndex=this._index;this.select()};A.onmouseout=function(){this.unselect()};A.style.zIndex="101";var u;if(v==-1){u=this.createDivider();A.appendChild(u)}var y=document.createElement("div");y.className="list_element_name";y.innerHTML=w;A.appendChild(y);A.nameEl=y;A.locEl=t;if(z){var t=document.createElement("div");t.className="list_element_loc";t.innerHTML=z;A.appendChild(t);A.locEl=t}u=this.createDivider();A.appendChild(u);A.unselect();return A};this.createDivider=function(){var t=document.createElement("div");t.className="list_element_divider";return t};this.createDropDownContainer=function(){var t=document.createElement("div");t.className="dropdown-container";this.containerEl=t;this.positionDropDown()};this.createDropDown=function(){var t=document.createElement("div");t.className="dropdown";t.style.display="none";t.style.zIndex="101";t.hide=function(){this.style.display="none"};t.show=function(){this.style.display="";g.positionDropDown()};this.containerEl.appendChild(t);this.dropDownEl=t};this.createDefaultDropDown=function(){var v=document.createElement("div");v.className="typeahead_header";v.style.display="none";v.innerHTML=tx("typeahead_ns:search-elsewhere");this.containerEl.appendChild(v);this.defaultDropDownHeaderEl=v;var w=document.createElement("div");w.style.display="none";w.show=function(){if(g.defaultDropDownCount>0){this.style.display="";g.defaultDropDownHeaderEl.style.display=""}else{g.dropDownEl.style.borderBottom="1px solid #777"}};w.hide=function(){this.style.display="none";g.defaultDropDownHeaderEl.style.display="none"};var u=0;for(var t in this.defaultOptions){var y=this.createListElement(t,this.defaultOptions[t],"",u);u++;w.appendChild(y)}w.className="default-dropdown";w.hide();this.containerEl.appendChild(w);this.defaultDropDownEl=w;this.defaultDropDownCount=w.childNodes.length};this.createDefaultText=function(){var t=document.createElement("div");t.className="default-text";t.style.display="none";t.hide=function(){this.style.display="none"};t.show=function(){this.style.display="";if(g.defaultDropDownCount==0){this.style.borderBottom="1px solid #777"}};t.setDefault=function(){this.innerHTML=e};t.setText=function(u){this.innerHTML=u};t.setDefault();if(!this.defaultOptions){t.style.borderBottom="0px solid"}this.containerEl.appendChild(t);this.defaultTextEl=t};this.positionDropDown=function(){var t=this.containerEl;if(t){if(this.customOffsetElement){t.style.left=elementX(this.textBoxEl)-elementX(this.customOffsetElement)+"px";t.style.top=elementY(this.textBoxEl)-elementY(this.customOffsetElement)+this.textBoxEl.offsetHeight+"px"}else{if(this.resize){t.style.left=elementX(this.textBoxEl)+"px";t.style.top=elementY(this.textBoxEl)+this.textBoxEl.offsetHeight+"px"}}if(!this.isIE){t.style.width=this.textBoxEl.offsetWidth+"px"}else{t.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(u,t){this.textBoxEl.setText(u,t)};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",q);a.style.color="#777";a.ph=q;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 w=this.getAttribute("placeholder");if(this.isFocused&&w&&(this.value==""||this.value==w)){this.isFocused=0;this.value=w;this.style.color="#777"}g.setFrame()};a.onfocus=function(){var y=this.oThis;if(!this.isFocused){this.isFocused=1;if(y.selectedIndex==-1&&this.value==this.getAttribute("placeholder")){this.value=""}}if(y.dropDownCount>0||y.defaultTextEl.innerHTML!=""){if(y.dropDownCount==0){y.defaultTextEl.show()}if(this.createTextRange){var w=this.createTextRange();w.moveStart("character",0);w.select()}else{if(this.setSelectionRange){this.setSelectionRange(0,this.value.length)}}y.dropDownEl.show();y.defaultDropDownEl.show();y.positionDropDown();y.setFrame()}this.style.color="#000"};a.onkeyup=function(w){g.handleKeyUp(w)};a.setText=function(z,y){var A=this.getAttribute("placeholder");this.isFocused=0;if(z){this.style.color="#000";this.value=z;var w=new Object();w.keyCode=0;w.pEvent=1;g.handleKeyUp(w)}else{if(A&&A!=""){if(y){this.value="";this.style.color="#000"}else{this.value=A;this.style.color="#777"}this.isFocused=0;g.textBoxEl.style.background="#FFFFFF"}else{this.value="";g.textBoxEl.style.background="#FFFFFF"}}};if(!p){p=a.form}if(p){p.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=p;this.textBoxEl=a;this.idEl=j;this.onInputChange=n;this.onSuccess=b;this.defaultOptions=c;this.useFilter=o;this.onUp=d;this.onDown=h;this.onListElMouseDown=m;this.showNoMatches=k;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 t=r;this.createDropDownContainer();this.createDropDown();this.createDefaultText();this.createDefaultDropDown();this.positionDropDown();var u=document.createElement("div");u.id="savior";this.containerEl.id="dropdown";this.goodFrame=null;if(r){if(t&&this.isIE){r.appendChild(u)}r.appendChild(this.containerEl)}if(t==r&&this.isIE){var v=document.createElement("iframe");v.id="goodFrame";v.src="/common/blank.html";v.style.width="0px";v.style.height="0px";v.style.zIndex="98";t.insertBefore(v,t.firstChild);t.style.zIndex="99";this.goodFrame=v}};this.setCustomOffsetElement=function(t){this.customOffsetElement=t};var g=this;this.init();if(!window.onresize){window.onresize=function(u){for(var t=0;t<Registry.length;t++){Registry[t].positionDropDown()}}}a.onkeydown=function(t){g.handleKeyDown(t)}};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(r,a,o,e,m,c,d,k,g,b,p,f,n,h){this.onInputChange=function(){var u=j.typeAheadObj.currentInputValue;var t=j.getCache(u);if(t){j.onSuggestRequestDone(u,t[0],t[1],t[2])}else{var w="";var v={};v[j.suggestParam]=u;if(j.networkType){v.t=j.networkType}var q=new AsyncRequest().setURI(j.suggestURI).setData(v).setHandler(function(y){var z=y.payload;j.onSuggestRequestDone(u,z.suggestNames,z.suggestIDs,z.suggestLocs,j.typeAheadObj.pEvent)}).setErrorHandler(function(y){new Dialog().setTitle(tx("sh:error-occurred")).setBody(tx("su01")).setButtons(Dialog.OK).show()}).setMethod("GET").setReadOnly(true).send()}};this.onSuggestRequestDone=function(q,w,t,v,u){this.setCache(q,w,t,v);if(this.typeAheadObj.displaySuggestList(w,t,v)){this.typeAheadObj.pEvent=u;this.typeAheadObj.onListChange()}};this.getCache=function(q){return this.suggestCache[q.toUpperCase()]};this.setCache=function(q,v,t,u){this.suggestCache[q.toUpperCase()]=new Array(v,t,u)};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(r,o,e,m,f,g,0,k,this.onInputChange,null,null,null,p,n,h)};var j=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_FBPages_TooManyAdded=1373001,kError_FBPages_AddFanStatusFailed=1373002,kError_FBPages_RemoveFanStatusFailed=1373003,kError_FBPages_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_NoMoreFBML=1380001,kError_RichMediaContent_AddFBMLFailure=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_FBPages_BlockUserFailed=1373005,kError_Reviews_TooLong=1362003,kError_Reviews_MissingRequiredFields=1362004,kError_Reviews_DeleteFailed=1362005,kError_FBPayments_InvalidParamters=1383001,kError_FBPayments_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 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 d="";if(e.np){var b=""}else{var b='fb_protected="true" '}if(e.e){d=['<input type="hidden" ',b,'name="emails[]" value="',e.e,'" />'].join("")}else{if(e.i){d=['<input type="hidden" ',b,'name="',this.tokenizer.obj.id,'[]" value="',e.i,'" />'].join("")}else{if(e.is){for(var c=0,a=e.is.length;c<a;c++){d+=['<input type="hidden" ',b,'name="',this.tokenizer.obj.id,'[]" value="',e.is[c],'" />'].join("")}this.explodable=true;this.n=e.n}}}this.text=e.t;this.element.innerHTML=["<span><span><span><span>",d,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 m=this.values;var k=m.length&&typeof m[0].i=="undefined";for(var d=0,h=m.length;d<h;d++){var a=typeahead_source.tokenize(m[d].t);for(var b=0,c=a.length;b<c;b++){f.push({t:a[b],o:m[d]})}if(this.index_includes_hints&&m[d].s){var a=typeahead_source.tokenize(m[d].s);for(var b=0,c=a.length;b<c;b++){f.push({t:a[b],o:m[d]})}}if(k){m[d].i=d}}var e=function(){f.sort(function(n,j){return(n.t==j.t)?0:(n.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(m){if(!this.is_ready){return}var g;if(m==""){g=this.values}else{var k=typeahead_source.tokenize(m).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 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 q=this.queue[k];if(q.start>g){j=false;continue}if(q.checkpointcb){this._callback(q.checkpointcb,g-q.start);q.checkpointcb=null}if(q.started===undefined){if(q.show){this.obj.style.display="block"}for(var n in q.attrs){if(q.attrs[n].start!==undefined){continue}switch(n){case"backgroundColor":case"borderColor":case"color":var e=animation.parse_color(get_style(this.obj,n=="borderColor"?"borderLeftColor":n));if(q.attrs[n].by){q.attrs[n].value[0]=Math.min(255,Math.max(0,q.attrs[n].value[0]+e[0]));q.attrs[n].value[1]=Math.min(255,Math.max(0,q.attrs[n].value[1]+e[1]));q.attrs[n].value[2]=Math.min(255,Math.max(0,q.attrs[n].value[2]+e[2]))}break;case"opacity":var e=get_opacity(this.obj);if(q.attrs[n].by){q.attrs[n].value=Math.min(1,Math.max(0,q.attrs[n].value+e))}break;case"height":case"width":var e=animation["get_"+n](this.obj);if(q.attrs[n].by){q.attrs[n].value+=e}break;case"scrollLeft":case"scrollTop":var e=(this.obj==document.body)?(document.documentElement[n]||document.body[n]):this.obj[n];if(q.attrs[n].by){q.attrs[n].value+=e}q["last"+n]=e;break;default:var e=parseInt(get_style(this.obj,n),10);if(q.attrs[n].by){q.attrs[n].value+=e}break}q.attrs[n].start=e}if((q.attrs.height&&q.attrs.height.auto)||(q.attrs.width&&q.attrs.width.auto)){if(ua.firefox()<3){d=true}this._destroy_container();for(var n in {height:1,width:1,fontSize:1,borderLeftWidth:1,borderRightWidth:1,borderTopWidth:1,borderBottomWidth:1,paddingLeft:1,paddingRight:1,paddingTop:1,paddingBottom:1}){if(q.attrs[n]){this.obj.style[n]=q.attrs[n].value+(typeof q.attrs[n].value=="number"?"px":"")}}if(q.attrs.height&&q.attrs.height.auto){q.attrs.height.value=animation.get_height(this.obj)}if(q.attrs.width&&q.attrs.width.auto){q.attrs.width.value=animation.get_width(this.obj)}}q.started=true;if(q.blind){this._build_container()}}var c=(g-q.start)/q.duration;if(c>=1){c=1;if(q.hide){this.obj.style.display="none"}}else{j=false}var m=q.ease?q.ease(c):c;if(!h&&c!=1&&q.blind){h=true}if(d&&this.obj.parentNode){var f=this.obj.parentNode;var b=this.obj.nextSibling;f.removeChild(this.obj)}for(var n in q.attrs){switch(n){case"backgroundColor":case"borderColor":case"color":this.obj.style[n]="rgb("+animation.calc_tween(m,q.attrs[n].start[0],q.attrs[n].value[0],true)+","+animation.calc_tween(m,q.attrs[n].start[1],q.attrs[n].value[1],true)+","+animation.calc_tween(m,q.attrs[n].start[2],q.attrs[n].value[2],true)+")";break;case"opacity":set_opacity(this.obj,animation.calc_tween(m,q.attrs[n].start,q.attrs[n].value));break;case"height":case"width":this.obj.style[n]=m==1&&q.attrs[n].auto?"auto":animation.calc_tween(m,q.attrs[n].start,q.attrs[n].value,true)+"px";break;case"scrollLeft":case"scrollTop":var e=(this.obj==document.body)?(document.documentElement[n]||document.body[n]):this.obj[n];if(q["last"+n]!=e){delete q.attrs[n]}else{var o=animation.calc_tween(m,q.attrs[n].start,q.attrs[n].value,true)-e;if(n=="scrollLeft"){window.scrollBy(o,0)}else{window.scrollBy(0,o)}q["last"+n]=o+e}break;default:this.obj.style[n]=animation.calc_tween(m,q.attrs[n].start,q.attrs[n].value,true)+"px";break}}if(c==1){this.queue.splice(k--,1);this._callback(q.ondone,g-q.start-q.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};function AsyncRequest(){copy_properties(this,{transport:null,method:"POST",uri:"",handler:null,errorHandler:null,data:{},readonly:false,writeRequiredParams:new Array()});if(typeof ErrorDialog!="undefined"){this.errorHandler=ErrorDialog.showAsyncError}return this}copy_properties(AsyncRequest.prototype,{FailHandler:function(a){try{rsobj=ej(a.reponseText);this.errorHandler.bind(rsobj)}catch(b){}},SuccHandler:function(c){try{rsobj=ej(c.responseText);if(rsobj.bootload){for(var b=0;b<rsobj.bootload.length;b++){Bootloader.loadResource(boot[ii])}}var a=new AsyncResponse();copy_properties(a,rsobj);if(a.error){Bootloader.wait(this.errorHandler.bind(null,a))}else{Bootloader.wait.bind(null,(this.handler.bind(null,a))).defer()}}catch(d){}},setMethod:function(a){this.method=a.toString().toUpperCase();return this},getMethod:function(){return this.method},setData:function(a){this.data=a;return this},getData:function(){return this.data},setURI:function(a){this.uri=a;return this},getURI:function(){return this.uri},setHandler:function(a){this.handler=a;return this},getHandler:function(){return this.handler},setErrorHandler:function(a){this.errorHandler=a;return this},getErrorHandler:function(){return this.errorHandler},setTransportErrorHandler:function(a){return this},getTransportErrorHandler:function(){return null},setFBMLForm:function(){this.writeRequiredParams=["fb_sig"];return this},setReadOnly:function(a){this.readonly=a;return this},getReadOnly:function(){return this.readonly},specifiesWriteRequiredParams:function(){var b=true;for(var a=0;a<this.writeRequiredParams.length;a++){var d=this.writeRequiredParams[a];if(typeof(this.data[d])=="undefined"){var c=$(d);if(c&&typeof(c.value)!="undefined"){this.data[d]=c.value}else{b=false;break}}}return b},send:function(){if(!this.getReadOnly()){if(!this.specifiesWriteRequiredParams()){alert("requiredparam");return false}if(this.method!="POST"){alert("method");return false}}new Ajax.Request(this.uri,{method:this.method,parameters:this.data,onSuccess:this.SuccHandler.bind(this),onFailure:this.errorHandler})}});function AsyncResponse(){copy_properties(this,{error:0,errorSummary:null,errorDescription:null,payload:null});return this}copy_properties(AsyncResponse.prototype,{getPayload:function(){return this.payload},getError:function(){return this.error},getErrorSummary:function(){return this.errorSummary},getErrorDescription:function(){return this.errorDescription}});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 FBML=(function(){var d;var C=Array();var b=null;if(window.addEventListener){d=function(S,R,Q){S.addEventListener(R,Q,false)}}else{d=function(S,R,Q){S.attachEvent("on"+R,Q)}}if(typeof typeaheadpro!="undefined"){function c(T,Q,R){var S=document.createElement("INPUT");S.name=T.getAttribute("idname");S.type="hidden";S.setAttribute("fb_protected","true");S.typeahead=this;if(T.form){T.form.appendChild(S)}this._idInput=S;return this.parent.construct(this,T,Q,R)}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(Q){this.parent._onselect(Q);if(Q.i){this._idInput.value=Q.i}else{if(Q.is){this._idInput.value=Q.is}}}}else{c=null}var N=new Object();function M(Q){if(window.console){window.console.log("Facebook FBML Mock AJAX ERROR: "+Q)}return false}function a(R,S,Q,T){if(!R.url){return M("no input with id url in form")}if(!R.fb_sig_api_key){return M("no input with id fb_api_key in form")}if(Q){Q()}F(R,S,T)}function F(Q,R,S){new AsyncRequest().setURI("/fbml/ajax/attach.php").setData(Q).setMethod("POST").setHandler(function(T){if(S){S()}if(!R.removed){set_inner_html(R,T.getPayload().html)}}.bind(this)).send()}function q(S){if(S=="wall"){var U=wallAttachments}else{if(S=="message"){var U=inboxAttachments}}if(U){var Q=ge(U.edit_id);var T=U.get_all_form_elements(Q);var V=Object();for(var R=0;R<T.length;R++){if(!(T[R].type=="radio"||T[R].type=="checkbox")||T[R].checked){V[T[R].name]=T[R].value}}V.context=U.context;V.action="edit";F(V,Q)}}function H(U,Q,T,S,V,R){K(T,S,V,R);return false}function K(Y,R,Z,U){var T=ge(Y);if(!T){return M("target "+Y+" not found")}var W=T.getAttribute("fbcontext");var Q=FBML.Contexts[W];var S=null;if(typeof Z=="string"){S=ge(Z)}else{S=Z}if(!S){return M("You must either specify a clickrewriteform (an id) or use the clickrewrite attribute inside a form")}var V=typeof this.PROFILE_OWNER_ID=="undefined"?0:this.PROFILE_OWNER_ID;w(S);var X=serialize_form(S);X.fb_mockajax_context=Q;X.fb_mockajax_context_hash=W;X.fb_mockajax_url=R;X.fb_target_id=V;new AsyncRequest().setURI(FBML._mockAjaxProxyUrl).setMethod("POST").setFBMLForm().setData(X).setHandler(function(aa){var ab=aa.getPayload();if(ab.ok){set_inner_html(T,ab.html)}else{return M(ab.error_message)}FBML.mockAjaxResponse=ab;return ab.ok}.bind(this)).setErrorHandler(function(aa){return M("Failed to successfully retrieve data from Facebook when making mock AJAX call to rewrite id "+Y)}.bind(this)).send();if(U){T.innerHTML=U}return false}function O(Q){return j(Q,"")}function h(T){var R=null;if(R=ge(T)){var Q=R.parentNode.innerHTML;R.id="dialog_invoked_"+R.id;C[R.id]=R.cloneNode(true);R.innerHTML="";var S=new pop_dialog();S.is_stackable=true;S.show_dialog(Q)}return false}function p(U){var R=null;for(dialog_id in C){if(R=ge(dialog_id)){var T=R.id.replace("dialog_invoked_","");var S=null;if(S=ge(T)){S.id="dialog_closed_"+T}var Q=R.parentNode;Q.innerHTML="";Q.appendChild(C[dialog_id]);C[dialog_id].id=T}}generic_dialog.get_dialog(U).fade_out(100)}function g(Q){return j(Q,"none")}function y(Q){var R=ge(Q);if(!R){return M("Could not find target "+Q)}else{R.style.display=(R.style.display=="none")?"":"none";return false}}function j(R,Q){var S=ge(R);if(!S){return M("Could not find target "+R)}else{S.style.display=Q;return false}}function J(Q){return r(Q,"")}function v(Q){return r(Q,"disabled")}function r(Q,R){var S=ge(Q);if(!S){return M("Could not find target "+Q)}else{S.disabled=R;return false}}function A(Q){new AsyncRequest().setURI("/ajax/api/tos.php").setData({app_id:Q,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(R){if(R.getPayload()){b=R.getPayload()}this.loginDialog&&this.loginDialog.fade_out(100);this.loginContinuation&&this.loginContinuation();this.loginCancellation=this.loginContinuation=this.loginDialog=null})).send()}function z(){this.loginCancellation&&this.loginCancellation();this.loginDialog&&this.loginDialog.fade_out(100);this.loginContinuation=this.loginCancellation=this.loginDialog=null}function w(Q){if(b){var S;for(S=Q.childNodes.length-1;S>=0;S--){if(Q.childNodes[S].name&&Q.childNodes[S].name.indexOf("fb_sig")==0){Q.removeChild(Q.childNodes[S])}}for(keyVar in b){var R=document.createElement("input");R.name=keyVar;R.value=b[keyVar];R.type="hidden";Q.appendChild(R)}}}function e(R,S,Q){if(this.loginDialog){return}this.loginDialog=new pop_dialog("api_confirmation");this.loginDialog.is_stackable=true;this.loginContinuation=S;this.loginCancellation=Q;new AsyncRequest().setURI("/people/tos.php").setData({app_id:R,profile_id:typeof PROFILE_OWNER_ID=="undefined"?0:PROFILE_OWNER_ID}).setReadOnly(true).setHandler(bind(this,function(U,T){if(T.getPayload()){this.loginDialog.show_dialog(T.getPayload())}else{U();this.loginCancellation=null;this.loginContinuation=null;this.loginDialog=null}},S)).send()}function t(R,Q,T){if(!T){T=false}var S=ge(R);if(S.hasAttribute(Q)){var V=S.getAttribute(Q).toLowerCase();switch(V){case"false":case"no":case"0":return false;case"true":case"yes":return true;default:var U=parseInt(V);if((U<0)||(U>0)){return true}return T}}}function L(U,R,Z,aa,S,W,ab){var ad="";if(!S){ad=$("pre_req_msg_textarea").value}if(ab){var Q=[];Q.push(ab)}else{var T=U.getElementsByTagName("input");var Q=[];for(var Y=0;Y<T.length;Y++){if(T[Y].getAttribute("fb_protected")=="true"&&(T[Y].name=="ids[]"||T[Y].name=="friend_selector_id")&&(T[Y].type!="checkbox"||T[Y].checked)){Q.push(T[Y].value)}}}var X={act:S?"pre":"do_req",app_id:R,to_ids:Q.join(","),request_type:Z,invite:aa,content:U.getAttribute("content"),preview:S,is_multi:W,form_id:U.id,prefill:(ab>0),message:ad,donot_send:ge("donotsend")?$("donotsend").checked:false};var V=new AsyncRequest().setURI(PEOPLE_P+"reqs.ajax.php").setData(X);if(S){new Dialog().setAsync(V).setStackable(true).show()}else{V.setHandler(function(ae){U.submit()}).send()}return false}function n(Q){generic_dialog.get_dialog(Q).fade_out(100)}function D(U,T,Q){if(Q){fs.unselect(U);fs.force_reset()}else{var V=T.getElementsByTagName("input");for(var R=0;R<V.length;R++){if(V[R].getAttribute("fb_protected")=="true"&&V[R].value==U){if(V[R].name=="ids[]"){if(V[R].type=="checkbox"){if(V[R].checked){V[R].click()}}else{V[R].parentNode.parentNode.parentNode.parentNode.parentNode.token.remove(true)}}else{if(V[R].name=="friend_selector_id"){V[R].typeahead.select_suggestion(false);V[R].typeahead.set_value("");V[R].value=""}}}}}var S=ge("sp"+U);var W=S.parentNode;W.removeChild(S);for(var R=0;R<W.childNodes.length;R++){if(W.childNodes[R].nodeName=="SPAN"){return false}}generic_dialog.get_dialog(W).fade_out(100);return false}function E(Q){hide($("feed_buttons"));set_inner_html($("feed_dialog"),'<div class="status"><h3>'+tx("fbml:publish-story")+"</h3></div>");setTimeout(function(){document.location=Q},500)}function P(R){this.hide(false);var T=function(U){(new ErrorDialog()).showError(R.getPayload().errorTitle,U?(R.getPayload().errorMessage):tx("fbml:dialog-error"))};var S=R.getError();if(S==kError_Platform_CallbackValidationFailure){T(true)}else{if(S==kError_Platform_ApplicationResponseInvalid){if(R.getPayload().showDebug){T(true)}else{var Q=R.getPayload().next;if(Q){document.location=Q}else{T(false)}}}else{ErrorDialog.showAsyncError(R)}}}function o(R){var V=$("fb_to_ids").value.split(",");var U=$("fb_feed").value;var T=$("fb_next").value;var S=$("fb_app_id").value;var Q=V.filter(function(W){return W!=R});$("fb_to_ids").value=Q.join(",");if(Q.length==0){document.location=T}else{DOM.remove("fe"+R)}}function I(U){var V=$("fb_to_ids").value.split(",");var S=$("fb_next").value;var R=$("fb_app_id").value;var T={feed_info:U,to_ids:V,preview:false,multiFeed:true,app_id:R};var Q="/fbml/ajax/prompt_feed.php";new AsyncRequest().setURI(Q).setData(T).setHandler(E.bind(null,S)).setErrorHandler(function(W){aiert("error: "+W)}).send()}function G(W,S,X){var Q=[];if(X){Q.push(X)}else{var T=W.getElementsByTagName("input");for(var U=0;U<T.length;U++){if(T[U].getAttribute("fb_protected")=="true"&&(T[U].name=="ids[]"||T[U].name=="friend_selector_id")&&(T[U].type!="checkbox"||T[U].checked)){Q.push(T[U].value)}}}var V={app_id:S,to_ids:Q,callback:W.action,preview:true,form_id:W.id,next:W.getAttribute("fbnext"),prefill:(X>0),elements:serialize_form(W),multiFeed:true};var Y="/fbml/ajax/prompt_feed.php";var R=new pop_dialog("interaction_form");R.is_stackable=true;R.show_loading(tx("sh:loading"));new AsyncRequest().setURI(Y).setData(V).setHandler(function(Z){R.show_dialog(Z.getPayload().content,true)}).setErrorHandler(P.bind(R)).send();return false}function u(U,S,R){var T={feed_info:U,next:S,preview:false,multiFeed:false,app_id:R};var Q="/fbml/ajax/prompt_feed.php";new AsyncRequest().setURI(Q).setData(T).setHandler(E.bind(null,S)).send()}function B(Q,T){var U={app_id:T,preview:true,callback:Q.getAttribute("action"),elements:serialize_form(Q),multiFeed:false,next:Q.getAttribute("fbnext")};var S="/fbml/ajax/prompt_feed.php";var R=new pop_dialog("interaction_form");R.is_stackable=true;R.show_loading(tx("sh:loading"));new AsyncRequest().setURI(S).setData(U).setHandler(function(V){R.show_dialog(V.getPayload().content,true)}).setErrorHandler(P.bind(R)).send();return false}function k(W,S,V,U){var Q=new pop_dialog("profile_form");Q.is_stackable=true;Q.show_loading(tx("sh:loading"));var T={app_id:S,callback:V,form_id:W.id,elements:serialize_form(W),update:U};var R="/fbml/ajax/fetch_profile_box.php";new AsyncRequest().setURI(R).setData(T).setHandler(function(X){Q.show_dialog(X.getPayload().content,true)}).setErrorHandler(P.bind(Q)).send()}function f(W,R){var U=$("fb_next").value;var T=$("fb_app_id").value;var V={profile_fbml:W,app_id:T,next:U,confirm:true};var Q=function(X){hide($("dialog_buttons"));set_inner_html($("dialog_body"),'<div id="status" class="status"><h3>'+tx("fbml:confirm-box")+"</h3>"+tx("fbml:redirect-prof")+"</div>");setTimeout(function(){document.location=R},1000)};var S="/fbml/ajax/fetch_profile_box.php";new AsyncRequest().setURI(S).setData(V).setHandler(Q).send()}var m=function(T){var R=T.getElementsByTagName("a");for(var S=0;S<R.length;S++){if(!R[S].getAttribute("flash")){addEventBase(R[S],"click",event_kill)}}var Q=T.getElementsByTagName("form");for(var S=0;S<Q.length;S++){Q[S].onsubmit=function(){return false}}};return{friendSelector:c,Contexts:N,attachCurlFromObject:a,attachFromPreview:q,clickRewriteAjax:H,clickToShow:O,clickToShowDialog:h,clickToHide:g,clickToEnable:J,clickToDisable:v,clickToToggle:y,closeDialogInvoked:p,confirmFeed:u,sendFeed:B,sendRequest:L,removeReqRecipient:D,confirmMultiFeed:I,confirmProfileBox:f,cancelDialog:n,sendMultiFeed:G,removeFeedRecipient:o,addHiddenInputs:w,fbmlLogin:A,cancelLogin:z,requireLogin:e,createProfileBox:k,stripLinks:m}})();function fbjs_sandbox(a){if(fbjs_sandbox.instances["a"+a]){return fbjs_sandbox.instances["a"+a]}this.appid=a;this.pending_bootstraps=[];this.bootstrapped=false;fbjs_sandbox.instances["a"+a]=this}fbjs_sandbox.instances={};fbjs_sandbox.prototype.bootstrap=function(){if(!this.bootstrapped){var appid=this.appid;var code=["a",appid,"_Math = new fbjs_math();","a",appid,"_Date = fbjs_date();","a",appid,"_String = new fbjs_string();","a",appid,"_RegExp = new fbjs_regexp();","a",appid,"_Ajax = fbjs_ajax(",appid,");","a",appid,"_Dialog = fbjs_dialog(",appid,");","a",appid,"_Facebook = new fbjs_facebook(",appid,");","a",appid,"_Animation = new fbjs_animation();","a",appid,"_document = new fbjs_main(",appid,");","a",appid,"_undefined = undefined;","a",appid,"_console = new fbjs_console();","a",appid,"_setTimeout = fbjs_sandbox.set_timeout;","a",appid,"_setInterval = fbjs_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){fbjs_console.error("ref called with a DOM object!");return fbjs_dom.get_instance(a)}else{return a}}}function idx(a){return(a instanceof Object||fbjs_blacklist_props[a])?"__unknown__":a}var fbjs_blacklist_props={caller:true};function arg(a){var c=[];for(var b=0;b<a.length;b++){c.push(a[b])}return c}fbjs_sandbox.safe_string=function(a){if(ua.safari()<3){delete String.prototype.replace;delete String.prototype.toLowerCase}return a+""};fbjs_sandbox.set_timeout=function(b,a){if(typeof b!="function"){fbjs_console.error("setTimeout may not be used with a string. Please enclose your event in an anonymous function.")}else{return setTimeout(b,a)}};fbjs_sandbox.set_interval=function(b,a){if(typeof b!="function"){fbjs_console.error("setInterval may not be used with a string. Please enclose your event in an anonymous function.")}else{return setInterval(b,a)}};function fbjs_main(a){fbjs_private.get(this).appid=a}fbjs_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};fbjs_main.allowed_editable={embed:true,object:true};fbjs_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};fbjs_main.prototype.getElementById=function(b){var a=fbjs_private.get(this).appid;return fbjs_dom.get_instance(document.getElementById("app"+a+"_"+b),a)};fbjs_main.prototype.getRootElement=function(){var a=fbjs_private.get(this).appid;return fbjs_dom.get_instance(document.getElementById("app_content_"+a).firstChild,a)};fbjs_main.prototype.createElement=function(a){var b=fbjs_sandbox.safe_string(a.toLowerCase());if(fbjs_main.allowed_elements[b]){return fbjs_dom.get_instance(document.createElement(b),fbjs_private.get(this).appid)}else{switch(b){case"fb:swf":return new fbjs_fbml_dom("fb:swf",fbjs_private.get(this).appid);break;default:fbjs_console.error(b+" is not an allowed DOM element");break}}};fbjs_main.prototype.setLocation=function(a){a=fbjs_sandbox.safe_string(a);if(fbjs_dom.href_regex.test(a)){document.location.href=a;return this}else{fbjs_console.error(a+" is not a valid location")}};function fbjs_facebook(b){var a=fbjs_private.get(this);a.sandbox=fbjs_sandbox.instances["a"+b]}fbjs_facebook.prototype.getUser=function(){var a=fbjs_private.get(this);if(a.sandbox.data.loggedin){return a.sandbox.data.user}else{return null}};fbjs_facebook.prototype.isApplicationAdded=function(){return fbjs_private.get(this).sandbox.data.installed};fbjs_facebook.prototype.isLoggedIn=function(){return fbjs_private.get(this).sandbox.data.loggedin};fbjs_facebook.prototype.urchinTracker=function(a){if(urchinTracker){urchinTracker(a)}else{fbjs_console.error("There is no fb:google-analytics tag on this page!")}};function fbjs_dom(c,a){this.__instance=fbjs_dom.len;try{c.fbjs_instance=fbjs_dom.len}catch(b){}fbjs_dom[fbjs_dom.len]={instance:this,obj:c,events:{},appid:a};fbjs_dom.len++}fbjs_dom.len=0;fbjs_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"};fbjs_dom.factory=function(b,a){if(!b.tagName||((!fbjs_main.allowed_elements[b.tagName.toLowerCase()]&&!fbjs_main.allowed_editable[b.tagName.toLowerCase()])||has_css_class_name(b,"__fbml_tag")||(b.tagName=="INPUT"&&(b.name.substring(0,2)=="fb"||b.name=="post_form_id"))||b.getAttribute("fb_protected")=="true")){return null}else{return new this(b,a)}};fbjs_dom.get_data=function(a){if(a.__instance instanceof Object){return null}else{var b=fbjs_dom[a.__instance];return b.instance==a?b:null}};fbjs_dom.get_obj=function(a){if(a instanceof fbjs_fbml_dom){return fbjs_fbml_dom.get_obj(a)}else{if(typeof a.__instance=="number"){var b=fbjs_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.")}}};fbjs_dom.render=function(a){if(a instanceof fbjs_fbml_dom){fbjs_fbml_dom.render(a)}};fbjs_dom.get_instance=function(b,a){if(!b){return null}if(typeof b.fbjs_instance=="undefined"||(typeof b.beCloned!="undefined"&&b.beCloned)){return fbjs_dom.factory(b,a)}else{return fbjs_dom[b.fbjs_instance].instance}};fbjs_dom.get_instance_list=function(c,b){var e=[];for(var a=0;a<c.length;a++){var d=fbjs_dom.get_instance(c[a],b);if(d){e.push(d)}}return e};fbjs_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=fbjs_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};fbjs_dom.clear_instances=function(c,a){if(a&&c.fbjs_instance){delete fbjs_dom[c.fbjs_instance].obj;delete fbjs_dom[c.fbjs_instance].events;delete fbjs_dom[c.fbjs_instance].instance;delete fbjs_dom[c.fbjs_instance];c.fbjs_instance=undefined}var d=c.childNodes;for(var b=0;b<d.length;b++){fbjs_dom.clear_instances(d[b],true)}};fbjs_dom.prototype.appendChild=function(a){fbjs_dom.get_obj(this).appendChild(fbjs_dom.get_obj(a));fbjs_dom.render(a);return a};fbjs_dom.prototype.insertBefore=function(b,a){if(a){fbjs_dom.get_obj(this).insertBefore(fbjs_dom.get_obj(b),fbjs_dom.get_obj(a))}else{fbjs_dom.get_obj(this).appendChild(fbjs_dom.get_obj(b))}fbjs_dom.render(b);return b};fbjs_dom.prototype.removeChild=function(a){var a=fbjs_dom.get_obj(a);fbjs_dom.clear_instances(a,true);fbjs_dom.get_obj(this).removeChild(a);return this};fbjs_dom.prototype.replaceChild=function(b,a){fbjs_dom.clear_instances(a,true);fbjs_dom.get_obj(this).replaceChild(fbjs_dom.get_obj(b),fbjs_dom.get_obj(a));return this};fbjs_dom.prototype.cloneNode=function(a){var b=fbjs_dom.get_data(this);var d=b.obj.cloneNode(a);d.beCloned=true;return fbjs_dom.get_instance(d,b.appid)};fbjs_dom.prototype.getParentNode=function(){var a=fbjs_dom.get_data(this);return fbjs_dom.get_first_valid_instance(a.obj.parentNode,"parentNode",a.appid)};fbjs_dom.prototype.getNextSibling=function(){var a=fbjs_dom.get_data(this);return fbjs_dom.get_first_valid_instance(a.obj.nextSibling,"nextSibling",a.appid)};fbjs_dom.prototype.getPreviousSibling=function(){var a=fbjs_dom.get_data(this);return fbjs_dom.get_first_valid_instance(a.obj.previousSibling,"previousSibling",a.appid)};fbjs_dom.prototype.getFirstChild=function(){var a=fbjs_dom.get_data(this);return fbjs_dom.get_first_valid_instance(a.obj.firstChild,"nextSibling",a.appid)};fbjs_dom.prototype.getLastChild=function(){var a=fbjs_dom.get_data(this);return fbjs_dom.get_first_valid_instance(a.obj.lastChild,"previousSibling",a.appid)};fbjs_dom.prototype.getChildNodes=function(){var a=fbjs_dom.get_data(this);return fbjs_dom.get_instance_list(a.obj.childNodes,a.appid)};fbjs_dom.prototype.getElementsByTagName=function(a){var b=fbjs_dom.get_data(this);return fbjs_dom.get_instance_list(b.obj.getElementsByTagName(a),b.appid)};fbjs_dom.prototype.getOptions=function(){var a=fbjs_dom.get_data(this);return fbjs_dom.get_instance_list(a.obj.options,a.appid)};fbjs_dom.prototype.getForm=function(){var a=fbjs_dom.get_data(this);return fbjs_dom.get_instance(a.obj.form,a.appid)};fbjs_dom.prototype.serialize=function(){var a=fbjs_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)!="fb"&&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};fbjs_dom.prototype.setInnerXHTML=function(b){var d=fbjs_dom.get_data(this);var c=new fbjs_fbml_sanitize(d.appid);var a=c.parseFBML(b);if(!a){return this}var e=fbjs_dom.get_obj(this);switch(e.tagName){case"TEXTAREA":fbjs_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":fbjs_console.error("setInnerXHTML is not supported on this node.");break;default:fbjs_dom.clear_instances(e,false);e.innerHTML="";this.appendChild(a);break}return this};fbjs_dom.prototype.setInnerFBML=function(b){var a=fbjs_private.get(b).htmlstring;var c=fbjs_dom.get_obj(this);switch(c.tagName){case"TEXTAREA":fbjs_console.error("setInnerFBML is not supported on textareas. Please use .value instead.");break;case"COL":case"COLGROUP":case"TABLE":case"TBODY":case"TFOOT":case"THEAD":case"TR":fbjs_console.error("setInnerFBML is not supported on this node.");break;default:set_inner_html(c,a);break}return this};fbjs_dom.prototype.setTextValue=function(b){var a=fbjs_dom.get_obj(this);fbjs_dom.clear_instances(a,false);a.innerHTML=htmlspecialchars(fbjs_sandbox.safe_string(b));return this};fbjs_dom.prototype.setValue=function(a){fbjs_dom.get_obj(this).value=a;return this};fbjs_dom.prototype.getValue=function(){var b=fbjs_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 fbjs_dom.get_obj(this).value}};fbjs_dom.prototype.getSelectedIndex=function(){return fbjs_dom.get_obj(this).selectedIndex};fbjs_dom.prototype.setSelectedIndex=function(a){fbjs_dom.get_obj(this).selectedIndex=a;return this};fbjs_dom.prototype.getChecked=function(){return fbjs_dom.get_obj(this).checked};fbjs_dom.prototype.setChecked=function(a){fbjs_dom.get_obj(this).checked=a;return this};fbjs_dom.prototype.getSelected=function(){return fbjs_dom.get_obj(this).selected};fbjs_dom.prototype.setSelected=function(a){fbjs_dom.get_obj(this).selected=a;return this};fbjs_dom.set_style=function(d,b,c){if(typeof b=="string"){if(b=="opacity"){set_opacity(d,parseFloat(c,10))}else{c=fbjs_sandbox.safe_string(c);if(fbjs_dom.css_regex.test(c)){d.style[b]=c}else{fbjs_console.error(b+": "+c+" is not a valid CSS style")}}}else{for(var a in b){fbjs_dom.set_style(d,a,b[a])}}};fbjs_dom.css_regex=/^(?:[\w\-#%+]+|rgb\(\d+ *, *\d+, *\d+\)|url\('?http[^ ]+?'?\)| +)*$/i;fbjs_dom.prototype.setStyle=function(a,b){fbjs_dom.set_style(fbjs_dom.get_obj(this),a,b);return this};fbjs_dom.prototype.getStyle=function(a){return fbjs_dom.get_obj(this).style[idx(a)]};fbjs_dom.prototype.setHref=function(a){a=fbjs_sandbox.safe_string(a);if(fbjs_dom.href_regex.test(a)){fbjs_dom.get_obj(this).href=a;return this}else{fbjs_console.error(a+" is not a valid hyperlink")}};fbjs_dom.href_regex=/^(?:https?|mailto|ftp|aim|irc|itms|gopher|\/|#)/;fbjs_dom.prototype.getHref=function(){return fbjs_dom.get_obj(this).href};fbjs_dom.prototype.setAction=function(b){b=fbjs_sandbox.safe_string(b);if(fbjs_dom.href_regex.test(b)){fbjs_dom.get_obj(this).action=b;return this}else{fbjs_console.error(b+" is not a valid hyperlink")}};fbjs_dom.prototype.getAction=function(){return fbjs_dom.get_obj(this).action};fbjs_dom.prototype.setMethod=function(a){a=fbjs_sandbox.safe_string(a);fbjs_dom.get_obj(this).method=a.toLowerCase()=="get"?"get":"post";return this};fbjs_dom.prototype.getMethod=function(){return fbjs_dom.get_obj(this).method};fbjs_dom.prototype.setSrc=function(a){a=fbjs_sandbox.safe_string(a);if(fbjs_dom.href_regex.test(a)){fbjs_dom.get_obj(this).src=a;return this}else{fbjs_console.error(a+" is not a valid hyperlink")}};fbjs_dom.prototype.getSrc=function(){return fbjs_dom.get_obj(this).src};fbjs_dom.prototype.setTarget=function(a){fbjs_dom.get_obj(this).target=a;return this};fbjs_dom.prototype.getTarget=function(){return fbjs_dom.get_obj(this).target};fbjs_dom.prototype.setClassName=function(a){fbjs_dom.get_obj(this).className=a;return this};fbjs_dom.prototype.getClassName=function(){return fbjs_dom.get_obj(this).className};fbjs_dom.prototype.hasClassName=function(a){return has_css_class_name(fbjs_dom.get_obj(this),a)};fbjs_dom.prototype.addClassName=function(a){add_css_class_name(fbjs_dom.get_obj(this),a);return this};fbjs_dom.prototype.removeClassName=function(a){remove_css_class_name(fbjs_dom.get_obj(this),a);return this};fbjs_dom.prototype.toggleClassName=function(a){this.hasClassName(a)?this.removeClassName(a):this.addClassName(a);return this};fbjs_dom.prototype.getTagName=function(){return fbjs_dom.get_obj(this).tagName};fbjs_dom.prototype.getNodeType=function(){return fbjs_dom.get_obj(this).nodeType};fbjs_dom.prototype.getId=function(){var a=fbjs_dom.get_obj(this).id;if(a){return a.replace(/^app\d+_/,"")}else{return a}};fbjs_dom.prototype.setId=function(b){var a=fbjs_dom.get_data(this);a.obj.id=["app",a.appid,"_",b].join("");return this};fbjs_dom.prototype.setDir=function(a){fbjs_dom.get_obj(this).dir=a;return this};fbjs_dom.prototype.getdir=function(a){return fbjs_dom.get_obj(this).dir};fbjs_dom.prototype.getClientWidth=function(){return fbjs_dom.get_obj(this).clientWidth};fbjs_dom.prototype.getClientHeight=function(){return fbjs_dom.get_obj(this).clientHeight};fbjs_dom.prototype.getOffsetWidth=function(){return fbjs_dom.get_obj(this).offsetWidth};fbjs_dom.prototype.getOffsetHeight=function(){return fbjs_dom.get_obj(this).offsetHeight};fbjs_dom.prototype.getAbsoluteLeft=function(){return elementX(fbjs_dom.get_obj(this))};fbjs_dom.prototype.getAbsoluteTop=function(){return elementY(fbjs_dom.get_obj(this))};fbjs_dom.prototype.getScrollHeight=function(){return fbjs_dom.get_obj(this).scrollHeight};fbjs_dom.prototype.getScrollWidth=function(a){return fbjs_dom.get_obj(this).scrollWidth};fbjs_dom.prototype.getScrollTop=function(){return fbjs_dom.get_obj(this).scrollTop};fbjs_dom.prototype.setScrollTop=function(a){fbjs_dom.get_obj(this).scrollTop=a;return this};fbjs_dom.prototype.getScrollLeft=function(){return fbjs_dom.get_obj(this).scrollLeft};fbjs_dom.prototype.setScrollLeft=function(a){fbjs_dom.get_obj(this).scrollLeft=a;return this};fbjs_dom.prototype.getTabIndex=function(){return fbjs_dom.get_obj(this).tabIndex};fbjs_dom.prototype.setTabIndex=function(a){fbjs_dom.get_obj(this).tabIndex=a;return this};fbjs_dom.prototype.getTitle=function(){return fbjs_dom.get_obj(this).title};fbjs_dom.prototype.setTitle=function(a){fbjs_dom.get_obj(this).title=a;return this};fbjs_dom.prototype.getRowSpan=function(){return fbjs_dom.get_obj(this).rowSpan};fbjs_dom.prototype.setRowSpan=function(a){fbjs_dom.get_obj(this).rowSpan=a;return this};fbjs_dom.prototype.getColSpan=function(){return fbjs_dom.get_obj(this).colSpan};fbjs_dom.prototype.setColSpan=function(a){fbjs_dom.get_obj(this).colSpan=a;return this};fbjs_dom.prototype.getName=function(){return fbjs_dom.get_obj(this).name};fbjs_dom.prototype.setName=function(a){fbjs_dom.get_obj(this).name=a;return this};fbjs_dom.prototype.getCols=function(){return fbjs_dom.get_obj(this).cols};fbjs_dom.prototype.setCols=function(a){fbjs_dom.get_obj(this).cols=a;return this};fbjs_dom.prototype.getRows=function(){return fbjs_dom.get_obj(this).rows};fbjs_dom.prototype.setRows=function(a){fbjs_dom.get_obj(this).rows=a;return this};fbjs_dom.prototype.getAccessKey=function(){return fbjs_dom.get_obj(this).accessKey};fbjs_dom.prototype.setAccessKey=function(a){fbjs_dom.get_obj(this).accessKey=a;return this};fbjs_dom.prototype.setDisabled=function(a){fbjs_dom.get_obj(this).disabled=a;return this};fbjs_dom.prototype.getDisabled=function(){return fbjs_dom.get_obj(this).disabled};fbjs_dom.prototype.setMaxLength=function(a){fbjs_dom.get_obj(this).maxLength=a;return this};fbjs_dom.prototype.getMaxLength=function(){return fbjs_dom.get_obj(this).maxLength};fbjs_dom.prototype.setReadOnly=function(a){fbjs_dom.get_obj(this).readOnly=a;return this};fbjs_dom.prototype.getReadOnly=function(){return fbjs_dom.get_obj(this).readOnly};fbjs_dom.prototype.setType=function(a){a=fbjs_sandbox.safe_string(a);fbjs_dom.get_obj(this).type=a;return this};fbjs_dom.prototype.getType=function(){return fbjs_dom.get_obj(this).type};fbjs_dom.prototype.getSelection=function(){var a=fbjs_dom.get_obj(this);return get_caret_position(a)};fbjs_dom.prototype.setSelection=function(c,a){var b=fbjs_dom.get_obj(this);set_caret_position(b,c,a);return this};fbjs_dom.prototype.submit=function(){fbjs_dom.get_obj(this).submit();return this};fbjs_dom.prototype.focus=function(){fbjs_dom.get_obj(this).focus();return this};fbjs_dom.prototype.select=function(){fbjs_dom.get_obj(this).select();return this};fbjs_dom.eventHandler=function(b){var c=(b instanceof fbjs_event)?b:new fbjs_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 fbjs_event.destroy(c)};fbjs_dom.prototype.addEventListener=function(b,c){b=fbjs_sandbox.safe_string(b.toLowerCase());if(!fbjs_main.allowed_events[b]){fbjs_console.error(b+" is not an allowed event");return false}var d=fbjs_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=fbjs_dom.eventHandler.bind([this,c,d.appid]),false)}else{if(e.attachEvent){e.attachEvent("on"+b,a=fbjs_dom.eventHandler.bind([this,c,d.appid]))}}d.events[b].push({func:c,handler:a});return this};fbjs_dom.prototype.removeEventListener=function(c,d){c=c.toLowerCase();var e=fbjs_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};fbjs_dom.prototype.listEventListeners=function(d){d=d.toLowerCase();var e=fbjs_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};fbjs_dom.prototype.purgeEventListeners=function(c){c=c.toLowerCase();var d=fbjs_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};fbjs_dom.prototype.callSWF=function(e){var d=fbjs_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=="fbjs"){f=d.childNodes[c].getAttribute("value")}}var a=window.so_swf_fbjs}else{var f=d.getAttribute("fbjs");var a=document.so_swf_fbjs}return a.callFlash(f,e,b)};function fbjs_fbml_dom(a,b){var c=fbjs_private.get(this);c.type=a;c.appid=b}fbjs_fbml_dom.get_obj=function(a){var b=fbjs_private.get(a);if(!b.obj){b.obj=document.createElement("div");b.obj.className="__fbml_tag"}return b.obj};fbjs_fbml_dom.render=function(j){var f=fbjs_private.get(j);if(f.rendered){return}if(!f.id){f.id="swf"+parseInt(Math.random()*999999)}switch(f.type){case"fb:swf":var g=new SWFObject(f.swf_src,f.id,f.width,f.height,"5.0.0",f.bg_color?f.bg_color:"000000");var h={loop:true,quality:true,scale:true,align:true,salign:true};for(e in h){if(f[e]){g.addParam(e,f[e])}}g.addParam("wmode","transparent");g.addParam("allowScriptAccess","never");if(f.flash_vars){for(var e in f.flash_vars){g.addVariable(e,f.flash_vars[e])}}var k=fbjs_sandbox.instances["a"+f.appid];if(k.validation_vars){for(var e in k.validation_vars){g.addVariable(e,k.validation_vars[e])}}if(ge("fbjs_bridge_id")){var b=$("fbjs_bridge_id").value;g.addVariable("fb_local_connection","_"+b);var c="_swf"+parseInt(Math.random()*999999);g.addVariable("fb_fbjs_connection",c);g.addParam("fbjs",c)}if(f.wait_for_click){var d=document.createElement("img");d.src=f.img_src;if(f.width){d.width=f.width}if(f.height){d.height=f.height}if(f.img_style){fbjs_dom.set_style(d,f.img_style)}if(f.img_class){d.className=f.img_class}var a=document.createElement("a");a.href="#";a.onclick=function(){g.write(f.obj);return false};a.appendChild(d);f.obj.appendChild(a)}else{g.write(f.obj)}break}};fbjs_fbml_dom.prototype.setId=function(b){var a=fbjs_private.get(this);a.id=["app",a.appid,"_",b].join("");return this};fbjs_fbml_dom.prototype.setSWFSrc=function(a){var b=fbjs_private.get(this);a=fbjs_sandbox.safe_string(a);if(fbjs_dom.href_regex.test(a)){b.swf_src=a}else{fbjs_console.error(a+" is not a valid swf")}};fbjs_fbml_dom.prototype.setImgSrc=function(a){var b=fbjs_private.get(this);a=fbjs_sandbox.safe_string(a);if(fbjs_dom.href_regex.test(a)){b.img_src=a}else{fbjs_console.error(a+" is not a valid src")}return this};fbjs_fbml_dom.prototype.setWidth=function(a){var b=fbjs_private.get(this);b.width=(/\d+%?/.exec(a)||[]).pop();return this};fbjs_fbml_dom.prototype.setHeight=function(b){var a=fbjs_private.get(this);a.height=(/\d+%?/.exec(b)||[]).pop();return this};fbjs_fbml_dom.prototype.setImgStyle=function(c,e){var d=fbjs_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};fbjs_fbml_dom.prototype.setImgClass=function(a){var b=fbjs_private.get(this);b.img_class=a;return this};fbjs_fbml_dom.prototype.setFlashVar=function(b,d){var c=fbjs_private.get(this);var a=c.flash_vars?c.flash_vars:c.flash_vars={};a[b]=d;return this};fbjs_fbml_dom.prototype.setSWFBGColor=function(a){var b=fbjs_private.get(this);if(fbjs_dom.css_regex.text(a)){b.bg_color=a}else{fbjs_console.error(a+" is not a valid background color.")}return this};fbjs_fbml_dom.prototype.setWaitForClick=function(b){var a=fbjs_private.get(this);a.wait_for_click=b;return this};fbjs_fbml_dom.prototype.setLoop=function(b){var a=fbjs_private.get(this);a.loop=b;return this};fbjs_fbml_dom.prototype.setQuality=function(b){var a=fbjs_private.get(this);a.quality=b;return this};fbjs_fbml_dom.prototype.setScale=function(b){var a=fbjs_private.get(this);a.scale=b;return this};fbjs_fbml_dom.prototype.setAlign=function(b){var a=fbjs_private.get(this);a.align=b;return this};fbjs_fbml_dom.prototype.setSAlign=function(b){var a=fbjs_private.get(this);a.salign=b;return this};function fbjs_event(d,c){if(!fbjs_event.hacks){fbjs_event.hacks=true;fbjs_event.should_check_double_arrows=ua.safari()&&(ua.safari()<500);fbjs_event.arrow_toggle={}}for(var b in fbjs_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=fbjs_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(fbjs_event.should_check_double_arrows&&this.keyCode>=37&&this.keyCode<=40){fbjs_event.arrow_toggle[this.type]=!fbjs_event.arrow_toggle[this.type];if(fbjs_event.arrow_toggle[this.type]){this.ignore=true}}fbjs_private.get(this).event=d}fbjs_event.allowed_properties={type:true,ctrlKey:true,keyCode:true,metaKey:true,shiftKey:true};fbjs_event.prototype.preventDefault=function(){var a=fbjs_private.get(this);if(!a.prevented&&a.event.preventDefault){a.event.preventDefault();a.prevented=true}a.return_value=false};fbjs_event.prototype.stopPropagation=function(){var a=fbjs_private.get(this).event;if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}};fbjs_event.destroy=function(b){var a=fbjs_private.get(b).return_value;fbjs_private.remove(b);delete b.target;return a==undefined?true:a};function fbjs_math(){}fbjs_math.prototype.abs=Math.abs;fbjs_math.prototype.acos=Math.acos;fbjs_math.prototype.asin=Math.asin;fbjs_math.prototype.atan=Math.atan;fbjs_math.prototype.atan2=Math.atan2;fbjs_math.prototype.ceil=Math.ceil;fbjs_math.prototype.cos=Math.cos;fbjs_math.prototype.exp=Math.exp;fbjs_math.prototype.floor=Math.floor;fbjs_math.prototype.log=Math.log;fbjs_math.prototype.max=Math.max;fbjs_math.prototype.min=Math.min;fbjs_math.prototype.pow=Math.pow;fbjs_math.prototype.random=Math.random;fbjs_math.prototype.round=Math.round;fbjs_math.prototype.sin=Math.sin;fbjs_math.prototype.sqrt=Math.sqrt;fbjs_math.prototype.tan=Math.tan;fbjs_math.prototype.valueOf=Math.valueOf;fbjs_math.prototype.E=Math.E;fbjs_math.prototype.LN2=Math.LN2;fbjs_math.prototype.LN10=Math.LN10;fbjs_math.prototype.LOG2E=Math.LOG2E;fbjs_math.prototype.PI=Math.PI;fbjs_math.prototype.SQRT1_2=Math.SQRT1_2;fbjs_math.prototype.SQRT2=Math.SQRT2;function fbjs_string(){}fbjs_string.prototype.fromCharCode=String.fromCharCode;function fbjs_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 fbjs_regexp(){var a=function(){var b=arguments.length?new RegExp(arguments[0],arguments[1]):new RegExp();return b};return a}function fbjs_console(){}fbjs_console.error=function(a){if(typeof console!="undefined"&&console.error){console.error(a)}};fbjs_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]=fbjs_console.render(e[b])}var a=fbjs_private.get(c);for(var b in a){e["PRIV_"+b]=a[b]}if(c.__private){var a=fbjs_private.get(c.__private);for(var b in a){e["PRIV_"+b]=a[b]}}return e}else{if(c&&typeof c.__instance!="undefined"&&c.setInnerFBML){var e={};for(var b in c){e[b]=c[b]}delete e.__instance;e.PRIV_obj=fbjs_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(fbjs_console.render(c[b])):e[b]=fbjs_console.render(c[b]);if(e[b]!=c[b]){d=true}}return d?e:c}else{return c}}}};fbjs_console.render_args=function(a){var c=[];for(var b=0;b<a.length;b++){c[b]=fbjs_console.render(a[b])}return c};if(typeof console!="undefined"){for(var i in console){fbjs_console.prototype[i]=console[i]}}fbjs_console.prototype.debug=function(){if(typeof console!="undefined"&&console.debug){console.debug.apply(console,fbjs_console.render_args(arguments))}};fbjs_console.prototype.log=function(){if(typeof console!="undefined"&&console.log){console.log.apply(console,fbjs_console.render_args(arguments))}};fbjs_console.prototype.warn=function(){if(typeof console!="undefined"&&console.warn){console.warn.apply(console,fbjs_console.render_args(arguments))}};fbjs_console.prototype.error=function(){if(typeof console!="undefined"&&console.error){console.error.apply(console,fbjs_console.render_args(arguments))}};fbjs_console.prototype.assert=function(){if(typeof console!="undefined"&&console.assert){console.assert.apply(console,fbjs_console.render_args(arguments))}};fbjs_console.prototype.dir=function(){if(typeof console!="undefined"&&console.dir){console.dir.apply(console,fbjs_console.render_args(arguments))}};fbjs_console.prototype.group=function(){if(typeof console!="undefined"&&console.group){console.group.apply(console,fbjs_console.render_args(arguments))}};fbjs_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 fbjs_ajax(d){var c=function(){};for(var b in fbjs_ajax.prototype){c.prototype[b]=fbjs_ajax.prototype[b]}var a=fbjs_private.get(c.prototype.__private={});a.appid=d;a.sandbox=fbjs_sandbox.instances["a"+d];c.JSON=fbjs_ajax.JSON;c.FBML=fbjs_ajax.FBML;c.RAW=fbjs_ajax.RAW;return c}fbjs_ajax.proxy_url="/people/fbjs_ajax_proxy.php";fbjs_ajax.RAW=0;fbjs_ajax.JSON=1;fbjs_ajax.FBML=2;fbjs_ajax.STATUS_WAITING_FOR_USER=1;fbjs_ajax.STATUS_WAITING_FOR_SERVER=2;fbjs_ajax.STATUS_IDLE=0;fbjs_ajax.prototype.responseType=0;fbjs_ajax.prototype.useLocalProxy=false;fbjs_ajax.prototype.requireLogin=false;fbjs_ajax.prototype.status=fbjs_ajax.STATUS_IDLE;fbjs_ajax.tokencount=0;fbjs_ajax.tokens=new Object();fbjs_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}}}};fbjs_ajax.get_transport=function(a,c){var b=fbjs_private.get(a);if(b.xml&&!c){return b.xml}else{b.xml=fbjs_ajax.new_xml_http();b.xml.onreadystatechange=fbjs_ajax.onreadystatechange.bind([a,b.xml]);return b.xml}};fbjs_ajax.prototype.abort=function(){var a=fbjs_ajax.get_transport(this,true);if(a.abort){a.abort()}fbjs_private.get(this).inflight=false};fbjs_ajax.flash_success=function(b,a){fbjs_ajax.tokens[a].success(b)};fbjs_ajax.flash_fail=function(a){fbjs_ajax.tokens[a].fail()};fbjs_ajax.prototype.post=function(d,g){var c=fbjs_private.get(this.__private);var f=c.appid;var h=ge("post_form_id");if(!c.sandbox.data.loggedin&&this.requireLogin){checkLoginAndReturn_callback((function(j){return function(){j.status=fbjs_ajax.STATUS_READY;c.sandbox.data.loggedin=true;j.post(d,g)}})(this));return;this.status=fbjs_ajax.STATUS_WAITING_FOR_USER;FBML.requireLogin(f,function(){this.status=fbjs_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!=fbjs_ajax.FBML){this.status=fbjs_ajax.STATUS_WAITING_FOR_SERVER;fbjs_ajax.tokencount++;fbjs_ajax.tokens[fbjs_ajax.tokencount]={success:function(j){this.status=fbjs_ajax.STATUS_READY;this.ondone(j)}.bind(this),fail:function(j){this.status=fbjs_ajax.STATUS_READY;if(this.onerror()){this.onerror()}}.bind(this)};var e=(this.responseType==fbjs_ajax.JSON);var a=localProxy.callUrl(d+"?query="+g,e,"fbjs_ajax.flash_success","fbjs_ajax.flash_fail",fbjs_ajax.tokencount);if(!a&&this.onerror){this.onerror()}return}else{var b=fbjs_ajax.get_transport(this,true);if(b){this.status=fbjs_ajax.STATUS_WAITING_FOR_SERVER;b.open("POST",fbjs_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,fb_mockajax_context:fbjs_sandbox.instances["a"+f].contextd,fb_mockajax_context_hash:fbjs_sandbox.instances["a"+f].context,appid:f}));fbjs_private.get(this).inflight=true}else{if(this.onerror){this.onerror()}else{fbjs_console.error("There was an uncaught Ajax error. Please attach on onerror handler to properly handle failures.")}}}};fbjs_ajax.make_fbjs_recursive=function(b){for(var a in b){if(a.substring(0,5)=="fbml_"){b[a]=new fbjs_fbml_string(b[a])}else{if(typeof b[a]=="object"){fbjs_ajax.make_fbjs_recursive(b[a])}}}};fbjs_ajax.onreadystatechange=function(){var xml=this[1];try{if(xml.readyState==4){var text=xml.responseText;this[0].status=fbjs_ajax.STATUS_READY;if(xml.status>=200&&xml.status<300&&text.length){var priv_data=fbjs_private.get(this[0]);if(priv_data.inflight){priv_data.inflight=false}else{return}try{var response=eval((text.substring(0,8)=="for(;;);"?"("+text.substring(8)+")":"'"+text+"'"))}catch(e){Util.error("FBJS AJAX eval failed! Response: "+text);var response={error:true}}if(response.error!==undefined){throw"foo"}else{if(this[0].ondone){try{switch(response.type){case fbjs_ajax.RAW:this[0].ondone(response.data);break;case fbjs_ajax.JSON:fbjs_ajax.make_fbjs_recursive(response.data);this[0].ondone(response.data);break;case fbjs_ajax.FBML:this[0].ondone(new fbjs_fbml_string(response.data));break}}catch(ignored){}}}}else{throw"foo"}}}catch(ignored){if(this[0].onerror){this[0].onerror()}else{fbjs_console.error("There was an uncaught Ajax error. Please attach on onerror handler to properly handle failures.")}}};function fbjs_dialog(c){var b=function(e){var d=fbjs_private.get(this);switch(e){case fbjs_dialog.DIALOG_CONTEXTUAL:d.dialog=new contextual_dialog("app_content_"+c);d.dialog.is_stackable=true;break;case fbjs_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 fbjs_dialog.prototype){b.prototype[a]=fbjs_dialog.prototype[a]}b.DIALOG_POP=fbjs_dialog.DIALOG_POP;b.DIALOG_CONTEXTUAL=fbjs_dialog.DIALOG_CONTEXTUAL;return b}fbjs_dialog.DIALOG_POP=1;fbjs_dialog.DIALOG_CONTEXTUAL=2;fbjs_dialog.onconfirm=function(){var a=true;if(this.onconfirm){if(this.onconfirm()===false){a=false}}if(a){this.hide()}};fbjs_dialog.oncancel=function(){var a=true;if(this.oncancel){if(this.oncancel()===false){a=false}}if(a){this.hide()}};fbjs_dialog.build_dialog=function(){var a=fbjs_private.get(this);if(!a.ready){a.dialog.build_dialog();a.ready=true}};fbjs_dialog.prototype.setStyle=function(b,c){var a=fbjs_private.get(this);fbjs_dialog.build_dialog.call(this);var d=null;if(b=="width"||b=="height"){d=a.type==fbjs_dialog.DIALOG_CONTEXTUAL?a.dialog.frame:a.dialog.frame.parentNode}else{d=a.dialog.content}fbjs_dom.set_style(d,b,c);return ref(this)};fbjs_dialog.prototype.showMessage=function(c,b,a){this.showChoice(c,b,a,false);return ref(this)};fbjs_dialog.prototype.showChoice=function(e,d,c,b){var a=fbjs_private.get(this).dialog;fbjs_dialog.build_dialog.call(this);a.show_choice(fbjs_fbml_string.get(e),fbjs_fbml_string.get(d),!c?"Okay":fbjs_fbml_string.get(c),bind(this,fbjs_dialog.onconfirm),b===undefined?"Cancel":(b?fbjs_fbml_string.get(b):false),bind(this,fbjs_dialog.oncancel));a.content.id="app_content_"+gen_unique();return ref(this)};fbjs_dialog.prototype.setContext=function(b){var a=fbjs_private.get(this).dialog;var c=fbjs_dom.get_obj(b);a.set_context(c);return ref(this)};fbjs_dialog.prototype.hide=function(){var a=fbjs_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 fbjs_animation(){var b=function(c){if(this==window){return new arguments.callee(fbjs_dom.get_obj(c))}else{fbjs_private.get(this).animation=new animation(c)}};for(var a in fbjs_animation.prototype){b.prototype[a]=fbjs_animation.prototype[a]}b.ease={begin:animation.ease.begin,end:animation.ease.end,both:animation.ease.both};return b}fbjs_animation.prototype.stop=function(){fbjs_private.get(this).animation.stop();return this};fbjs_animation.prototype.to=function(a,b){fbjs_private.get(this).animation.to(a,b);return this};fbjs_animation.prototype.by=function(a,b){fbjs_private.get(this).animation.by(a,b);return this};fbjs_animation.prototype.from=function(a,b){fbjs_private.get(this).animation.from(a,b);return this};fbjs_animation.prototype.duration=function(a){fbjs_private.get(this).animation.duration(a);return this};fbjs_animation.prototype.checkpoint=function(a,b){fbjs_private.get(this).animation.checkpoint(a,typeof b=="function"?bind(this,b):null);return this};fbjs_animation.prototype.ondone=function(a){if(typeof a=="function"){fbjs_private.get(this).animation.checkpoint(bind(this,a));return this}};fbjs_animation.prototype.blind=function(){fbjs_private.get(this).animation.blind();return this};fbjs_animation.prototype.show=function(){fbjs_private.get(this).animation.show();return this};fbjs_animation.prototype.hide=function(){fbjs_private.get(this).animation.hide();return this};fbjs_animation.prototype.ease=function(a){fbjs_private.get(this).animation.ease(a);return this};fbjs_animation.prototype.go=function(){fbjs_private.get(this).animation.go();return this};function fbjs_fbml_string(a){fbjs_private.get(this).htmlstring=a}fbjs_fbml_string.get=function(a){if(a instanceof fbjs_fbml_string){return fbjs_private.get(a).htmlstring}else{return htmlspecialchars(fbjs_sandbox.safe_string(a))}};fbjs_private=new Object();fbjs_private.len=0;fbjs_private.get=function(a){if(typeof a!="object"){return null}if(a.__priv==undefined){var b={data:{},instance:a};a.__priv=fbjs_private.len;fbjs_private.len++;b.instance=a;fbjs_private[a.__priv]=b;return b.data}else{if(typeof a.__priv=="number"){var b=fbjs_private[a.__priv];if(b.instance==a){return b.data}else{throw ("Invalid object supplied to fbjs_private.get")}}else{throw ("Invalid object supplied to fbjs_private.get")}}};fbjs_private.remove=function(a){if(a.__priv!=undefined){if(fbjs_private[a.__priv].instance==a){delete fbjs_private[a.__priv];delete a.__priv}}};function fbjs_fbml_sanitize(appid){this.appid=appid;this.main=eval("a"+appid+"_document");return this}fbjs_fbml_sanitize.prototype.parseFBML=function(d){if(window.ActiveXObject){var c=new ActiveXObject("Microsoft.XMLDOM");c.async="false";c.loadXML(d);if(c.parseError.reason){fbjs_console.error(c.parseError.reason);return null}}else{var b=new DOMParser();var c=b.parseFromString(d,"text/xml");if(c.documentElement.nodeName=="parsererror"){fbjs_console.error(c.documentElement.textContent);return null}}var a=c.documentElement;return this.processElement(a)};fbjs_fbml_sanitize.prototype.processElement=function(d){if(d.nodeType==3){return new fbjs_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=fbjs_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)};