var LinkController={ALL:1,ALL_LINK_TARGETS:2,ALL_KEY_MODIFIERS:4,registerHandler:function(callback,filters){LinkController._registerHandler(LinkController._handlers,callback,filters);},registerFallbackHandler:function(callback,filters){LinkController._registerHandler(LinkController._fallback_handlers,callback,filters);},bindLinks:function(root_element){var tabconsole=ge('tabconsole');if(tabconsole){if((root_element.id&&root_element.id.substring(0,8)=='cacheobs')||is_descendent(root_element,tabconsole)){return;}}
var should_insert=ua.firefox()&&!is_descendent(root_element,document.body);if(should_insert){var invisible_div=ge('an_invisible_div');if(!invisible_div){invisible_div=DOM.create('div',{id:'an_invisible_div'});invisible_div.style.display='none';document.body.appendChild(invisible_div);}
invisible_div.appendChild(root_element);}
var links=root_element.getElementsByTagName('a');try{for(var i=0;i<links.length;++i){if(links[i].onclick){links[i].onclick=chain(links[i].onclick,LinkController._onclick);}else{links[i].onclick=LinkController._onclick;}}}catch(ex){Util.error('Uncaught exception while chaining onclick handler for %s: %s',links[i],ex);}
if(should_insert){invisible_div.removeChild(root_element);}},_onclick:function(event){var link=this;event=event_get(event);var handlers=LinkController.getHandlers();for(var i=0;i<handlers.length;++i){var callback=handlers[i].callback;var filters=handlers[i].filters;try{if(LinkController._filter(filters,link,event)){var abort=callback(link,event);if(abort===false){return event_abort(event);}}}catch(exception){Util.error('Uncaught exception in link handler: %x',exception);}}},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(handler_array,callback,filters){LinkController._init();handler_array.push({callback:callback,filters:filters||0});},_filter:function(filters,link,event){if(filters&LinkController.ALL){return true;}
if(!(filters&LinkController.ALL_LINK_TARGETS)){if(link.target){return false;}}
if(!(filters&LinkController.ALL_KEY_MODIFIERS)){if(event.ctrlKey||event.shiftKey||event.altKey||event.metaKey){return false;}}
return true;},_handlers:[],_fallback_handlers:[]};var FBML=(function(){var _addEventListener;var invoked_dialogs=Array();var form_hidden_inputs=null;if(window.addEventListener){_addEventListener=function(obj,eventName,fun){obj.addEventListener(eventName,fun,false);}}else{_addEventListener=function(obj,eventName,fun){obj.attachEvent("on"+eventName,fun);}}
if(typeof typeaheadpro!='undefined'){function friendSelector(obj,source,properties){var idInput=document.createElement('INPUT');idInput.name=obj.getAttribute('idname');idInput.type='hidden';idInput.setAttribute('fb_protected','true');idInput.typeahead=this;if(obj.form){obj.form.appendChild(idInput);}
this._idInput=idInput;return this.parent.construct(this,obj,source,properties);}
friendSelector.extend(typeaheadpro);friendSelector.prototype.destroy=function(){this._idInput.parentNode.removeChild(this._idInput);this._idInput.typeahead=null;this._idInput=null;this.parent.destroy();}
friendSelector.prototype._onselect=function(e){this.parent._onselect(e);if(e.i){this._idInput.value=e.i;}else if(e.is){this._idInput.value=e.is;}}}else{friendSelector=null;}
var Contexts=new Object();function err(msg){if(window.console){window.console.log('Facebook FBML Mock AJAX ERROR: '+msg);}
return false;}
function attachCurlFromObject(ajax_params,container,pre_fn,post_fn){if(!ajax_params['url']){return err("no input with id url in form");}
if(!ajax_params['fb_sig_api_key']){return err("no input with id fb_api_key in form");}
if(pre_fn){pre_fn();}
attachCurlFromFormValues(ajax_params,container,post_fn);}
function attachCurlFromFormValues(ajax_params,container,post_fn){new AsyncRequest().setURI('/fbml/ajax/attach.php').setData(ajax_params).setMethod('POST').setHandler(function(response){if(post_fn){post_fn();}
if(!container.removed){set_inner_html(container,response.getPayload().html);}}.bind(this)).send();}
function attachFromPreview(context){if(context=='wall'){var attachments=wallAttachments;}else if(context=='message'){var attachments=inboxAttachments;}
if(attachments){var parent=ge(attachments.edit_id);var inputs=attachments.get_all_form_elements(parent);var params=Object();for(var i=0;i<inputs.length;i++){if(!(inputs[i].type=="radio"||inputs[i].type=="checkbox")||inputs[i].checked){params[inputs[i].name]=inputs[i].value;}}
params['context']=attachments.context;params['action']='edit';attachCurlFromFormValues(params,parent);}}
function clickRewriteAjax(app_id,loggedIn,targetId,url,formId,loadingHTML){this.requireLogin(app_id,function(){return _clickRewriteAjax(targetId,url,formId,loadingHTML);});return false;}
function _clickRewriteAjax(targetId,url,formId,loadingHTML){var target=ge(targetId);if(!target){return err("target "+targetId+" not found");}
var hContext=target.getAttribute("fbcontext");var sContext=FBML.Contexts[hContext];var form=null;if(typeof formId=="string"){form=ge(formId);}else{form=formId;}
if(!form){return err("You must either specify a clickrewriteform (an id) or use the clickrewrite attribute inside a form");}
var owner_id=typeof this.PROFILE_OWNER_ID=='undefined'?0:this.PROFILE_OWNER_ID;addHiddenInputs(form);var post=serialize_form(form);post["fb_mockajax_context"]=sContext;post["fb_mockajax_context_hash"]=hContext;post["fb_mockajax_url"]=url;post["fb_target_id"]=owner_id;new AsyncRequest().setURI(FBML._mockAjaxProxyUrl).setMethod("POST").setFBMLForm().setData(post).setHandler(function(response){var ma=response.getPayload();if(ma.ok){set_inner_html(target,ma.html);}else{return err(ma["error_message"]);}
FBML.mockAjaxResponse=ma;return ma.ok;}.bind(this)).setErrorHandler(function(response){return err("Failed to successfully retrieve data from Facebook when making mock AJAX call to rewrite id "+targetId);}.bind(this)).send();if(loadingHTML){target.innerHTML=loadingHTML;}
return false;}
function clickToShow(targetId){return clickToSetDisplay(targetId,"");}
function clickToShowDialog(targetId){var dialog_elem=null;if(dialog_elem=ge(targetId)){var dialog_content=dialog_elem.parentNode.innerHTML;dialog_elem.id='dialog_invoked_'+dialog_elem.id;invoked_dialogs[dialog_elem.id]=dialog_elem.cloneNode(true);dialog_elem.innerHTML='';var dialog=new pop_dialog();dialog.is_stackable=true;dialog.show_dialog(dialog_content);}
return false;}
function closeDialogInvoked(obj){var hidden_dialog=null;for(dialog_id in invoked_dialogs){if(hidden_dialog=ge(dialog_id)){var old_id=hidden_dialog.id.replace('dialog_invoked_','');var old_elem=null;if(old_elem=ge(old_id)){old_elem.id='dialog_closed_'+old_id;}
var parent=hidden_dialog.parentNode;parent.innerHTML='';parent.appendChild(invoked_dialogs[dialog_id]);invoked_dialogs[dialog_id].id=old_id;}}
generic_dialog.get_dialog(obj).fade_out(100);}
function clickToHide(targetId){return clickToSetDisplay(targetId,"none");}
function clickToToggle(targetId){var target=ge(targetId);if(!target){return err("Could not find target "+targetId);}else{target.style.display=(target.style.display=="none")?'':'none';return false;}}
function clickToSetDisplay(targetId,disp){var target=ge(targetId);if(!target){return err("Could not find target "+targetId);}else{target.style.display=disp;return false;}}
function clickToEnable(targetId){return clickToSetDisabled(targetId,'');}
function clickToDisable(targetId){return clickToSetDisabled(targetId,'disabled');}
function clickToSetDisabled(targetId,disabled){var target=ge(targetId);if(!target){return err("Could not find target "+targetId);}else{target.disabled=disabled;return false;}}
function fbmlLogin(app_id){new AsyncRequest().setURI('/ajax/api/tos.php').setData({app_id:app_id,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(response){if(response.getPayload()){form_hidden_inputs=response.getPayload();}
this.loginDialog&&this.loginDialog.fade_out(100);this.loginContinuation&&this.loginContinuation();this.loginCancellation=this.loginContinuation=this.loginDialog=null;})).send();}
function cancelLogin(){this.loginCancellation&&this.loginCancellation();this.loginDialog&&this.loginDialog.fade_out(100);this.loginContinuation=this.loginCancellation=this.loginDialog=null;}
function addHiddenInputs(form_obj){if(form_hidden_inputs){var i;for(i=form_obj.childNodes.length-1;i>=0;i--){if(form_obj.childNodes[i].name&&form_obj.childNodes[i].name.indexOf('fb_sig')==0){form_obj.removeChild(form_obj.childNodes[i]);}}
for(keyVar in form_hidden_inputs){var newInput=document.createElement('input');newInput.name=keyVar;newInput.value=form_hidden_inputs[keyVar];newInput.type='hidden';form_obj.appendChild(newInput);}}}
function requireLogin(app_id,continuation,cancellation){if(this.loginDialog){return;}
this.loginDialog=new pop_dialog('api_confirmation');this.loginDialog.is_stackable=true;this.loginContinuation=continuation;this.loginCancellation=cancellation;new AsyncRequest().setURI('/ajax/api/tos.php').setData({app_id:app_id,profile_id:typeof PROFILE_OWNER_ID=='undefined'?0:PROFILE_OWNER_ID}).setReadOnly(true).setHandler(bind(this,function(continuation,response){if(response.getPayload()){this.loginDialog.show_dialog(response.getPayload());}else{continuation();this.loginCancellation=null;this.loginContinuation=null;this.loginDialog=null;}},continuation)).send();}
function attrBool(element,attr,defaultValue){if(!defaultValue){defaultValue=false;}
var el=ge(element);if(el.hasAttribute(attr)){var val=el.getAttribute(attr).toLowerCase();switch(val){case"false":case"no":case"0":return false;case"true":case"yes":return true;default:var intval=parseInt(val);if((intval<0)||(intval>0)){return true;}
return defaultValue;}}}
function sendRequest(request_form,app_id,request_type,invite,preview,is_multi,prefill){var message='';if(!preview){if(is_multi){request_form.onSubmit=fsth.captured_event;}
message=$$$('message').value;}
if(prefill){var ids=[];ids.push(prefill);}else{var inputs=request_form.getElementsByTagName('input');var ids=[];for(var i=0;i<inputs.length;i++){if(inputs[i].getAttribute('fb_protected')=='true'&&(inputs[i].name=='ids[]'||inputs[i].name=='friend_selector_id')&&(inputs[i].type!='checkbox'||inputs[i].checked)){ids.push(inputs[i].value);}}}
var data={app_id:app_id,to_ids:ids,request_type:request_type,invite:invite,content:request_form.getAttribute('content'),preview:preview,is_multi:is_multi,form_id:request_form.id,prefill:(prefill>0),message:message,donot_send:ge('donotsend')?$('donotsend').checked:false};var async=new AsyncRequest().setURI('/fbml/ajax/prompt_send.php').setData(data);if(preview){new Dialog().setAsync(async).setStackable(true).show();}else{async.setHandler(function(result){request_form.submit();}).send();}
return false;}
function cancelDialog(elem){generic_dialog.get_dialog(elem).fade_out(100);}
function removeReqRecipient(userid,request_form,is_multi){if(is_multi){fs.unselect(userid);fs.force_reset();}else{var inputs=request_form.getElementsByTagName('input');for(var i=0;i<inputs.length;i++){if(inputs[i].getAttribute('fb_protected')=='true'&&inputs[i].value==userid){if(inputs[i].name=='ids[]'){if(inputs[i].type=='checkbox'){if(inputs[i].checked){inputs[i].click();}}else{inputs[i].parentNode.parentNode.parentNode.parentNode.parentNode.token.remove(true);}}else if(inputs[i].name=='friend_selector_id'){inputs[i].typeahead.select_suggestion(false);inputs[i].typeahead.set_value('');inputs[i].value='';}}}}
var span=ge('sp'+userid);var recipients_list=span.parentNode;recipients_list.removeChild(span);for(var i=0;i<recipients_list.childNodes.length;i++){if(recipients_list.childNodes[i].nodeName=='SPAN'){return false;}}
generic_dialog.get_dialog(recipients_list).fade_out(100);return false;}
function showFeedConfirmed(next){hide($('feed_buttons'));set_inner_html($('feed_dialog'),'<div class="status"><h3>'+tx('fbml:publish-story')+'</h3></div>');setTimeout(function(){document.location=next;},500);}
function showApplicationError(response){this.hide(false);var showError=function(showMsg){(new ErrorDialog()).showError(response.getPayload().errorTitle,showMsg?(response.getPayload().errorMessage):tx('fbml:dialog-error'));}
var err=response.getError();if(err==kError_Platform_CallbackValidationFailure){showError(true);}else if(err==kError_Platform_ApplicationResponseInvalid){if(response.getPayload().showDebug){showError(true);}else{var next=response.getPayload().next;if(next){document.location=next;}else{showError(false);}}}else{ErrorDialog.showAsyncError(response);}}
function removeFeedRecipient(user){var to_ids=$$$('fb_to_ids').value.split(',');var feed=$$$('fb_feed').value;var next=$$$('fb_next').value;var app_id=$$$('fb_app_id').value;var new_to_ids=to_ids.filter(function(u){return u!=user});$$$('fb_to_ids').value=new_to_ids.join(',');if(new_to_ids.length==0){document.location=next;}else{DOM.remove('fe'+user);}}
function confirmMultiFeed(feed){var to_ids=$$$('fb_to_ids').value.split(',');var next=$$$('fb_next').value;var app_id=$$$('fb_app_id').value;var data={feed_info:feed,to_ids:to_ids,preview:false,multiFeed:true,app_id:app_id};var ajax_uri='/fbml/ajax/prompt_feed.php';new AsyncRequest().setURI(ajax_uri).setData(data).setHandler(showFeedConfirmed.bind(null,next)).setErrorHandler(function(err){alert('error: '+err);}).send();}
function sendMultiFeed(multifeed_form,app_id,prefill){var ids=[];if(prefill){ids.push(prefill);}else{var inputs=multifeed_form.getElementsByTagName('input');for(var i=0;i<inputs.length;i++){if(inputs[i].getAttribute('fb_protected')=='true'&&(inputs[i].name=='ids[]'||inputs[i].name=='friend_selector_id')&&(inputs[i].type!='checkbox'||inputs[i].checked)){ids.push(inputs[i].value);}}}
var data={app_id:app_id,to_ids:ids,callback:multifeed_form.action,preview:true,form_id:multifeed_form.id,next:multifeed_form.getAttribute('fbnext'),prefill:(prefill>0),elements:serialize_form(multifeed_form),multiFeed:true};var ajax_uri='/fbml/ajax/prompt_feed.php';var dialog=new pop_dialog('interaction_form');dialog.is_stackable=true;dialog.show_loading(tx('sh:loading'));new AsyncRequest().setURI(ajax_uri).setData(data).setHandler(function(resp){dialog.show_dialog(resp.getPayload().content,true);}).setErrorHandler(showApplicationError.bind(dialog)).send();return false;}
function confirmFeed(feed,next,app_id){var data={feed_info:feed,next:next,preview:false,multiFeed:false,app_id:app_id};var ajax_uri='/fbml/ajax/prompt_feed.php';new AsyncRequest().setURI(ajax_uri).setData(data).setHandler(showFeedConfirmed.bind(null,next)).send();}
function sendFeed(feed_form,app_id){var data={app_id:app_id,preview:true,callback:feed_form.getAttribute('action'),elements:serialize_form(feed_form),multiFeed:false,next:feed_form.getAttribute('fbnext')};var ajax_uri='/fbml/ajax/prompt_feed.php';var dialog=new pop_dialog('interaction_form');dialog.is_stackable=true;dialog.show_loading(tx('sh:loading'));new AsyncRequest().setURI(ajax_uri).setData(data).setHandler(function(resp){dialog.show_dialog(resp.getPayload().content,true);}).setErrorHandler(showApplicationError.bind(dialog)).send();return false;}
function createProfileBox(profile_form,app_id,callback,update){var dialog=new pop_dialog('profile_form');dialog.is_stackable=true;dialog.show_loading(tx('sh:loading'));var data={app_id:app_id,callback:callback,form_id:profile_form.id,elements:serialize_form(profile_form),update:update};var ajax_uri='/fbml/ajax/fetch_profile_box.php';new AsyncRequest().setURI(ajax_uri).setData(data).setHandler(function(resp){dialog.show_dialog(resp.getPayload().content,true);}).setErrorHandler(showApplicationError.bind(dialog)).send();}
function confirmProfileBox(profile_fbml,profile){var next=$$$('fb_next').value;var app_id=$$$('fb_app_id').value;var data={profile_fbml:profile_fbml,app_id:app_id,next:next,confirm:true};var showBoxConfirmed=function(user){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=profile;},1000);}
var ajax_uri='/fbml/ajax/fetch_profile_box.php';new AsyncRequest().setURI(ajax_uri).setData(data).setHandler(showBoxConfirmed).send();}
var stripLinks=function(container){var links=container.getElementsByTagName('a');for(var i=0;i<links.length;i++){if(!links[i].getAttribute('flash')){addEventBase(links[i],'click',event_kill);}}
var forms=container.getElementsByTagName('form');for(var i=0;i<forms.length;i++){forms[i].onsubmit=function(){return false;};}}
return{friendSelector:friendSelector,Contexts:Contexts,attachCurlFromObject:attachCurlFromObject,attachFromPreview:attachFromPreview,clickRewriteAjax:clickRewriteAjax,clickToShow:clickToShow,clickToShowDialog:clickToShowDialog,clickToHide:clickToHide,clickToEnable:clickToEnable,clickToDisable:clickToDisable,clickToToggle:clickToToggle,closeDialogInvoked:closeDialogInvoked,confirmFeed:confirmFeed,sendFeed:sendFeed,sendRequest:sendRequest,removeReqRecipient:removeReqRecipient,confirmMultiFeed:confirmMultiFeed,confirmProfileBox:confirmProfileBox,cancelDialog:cancelDialog,sendMultiFeed:sendMultiFeed,removeFeedRecipient:removeFeedRecipient,addHiddenInputs:addHiddenInputs,fbmlLogin:fbmlLogin,cancelLogin:cancelLogin,requireLogin:requireLogin,createProfileBox:createProfileBox,stripLinks:stripLinks};})();function fbjs_sandbox(appid){if(fbjs_sandbox.instances['a'+appid]){return fbjs_sandbox.instances['a'+appid];}
this.appid=appid;this.pending_bootstraps=[];this.bootstrapped=false;fbjs_sandbox.instances['a'+appid]=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(that){if(that==window){return null;}else if(that.ownerDocument==document){fbjs_console.error('ref called with a DOM object!');return fbjs_dom.get_instance(that);}else{return that;}}
var $FBJS=function(that){if(that==window){return null;}else if(that.ownerDocument==document){fbjs_console.error('ref called with a DOM object!');return fbjs_dom.get_instance(that);}else{return that;}}
function idx(b){return(b instanceof Object||fbjs_blacklist_props[b])?'__unknown__':b;}
var fbjs_blacklist_props={'caller':true}
function arg(args){var new_args=[];for(var i=0;i<args.length;i++){new_args.push(args[i]);}
return new_args;}
fbjs_sandbox.safe_string=function(str){if(ua.safari()){delete String.prototype.replace;delete String.prototype.toLowerCase;}
return str+'';}
fbjs_sandbox.set_timeout=function(js,timeout){if(typeof js!='function'){fbjs_console.error('setTimeout may not be used with a string. Please enclose your event in an anonymous function.');}else{return setTimeout(js,timeout);}}
fbjs_sandbox.set_interval=function(js,interval){if(typeof js!='function'){fbjs_console.error('setInterval may not be used with a string. Please enclose your event in an anonymous function.');}else{return setInterval(js,interval);}}
function fbjs_main(appid){fbjs_private.get(this).appid=appid;}
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(id){var appid=fbjs_private.get(this).appid;return fbjs_dom.get_instance(document.getElementById(id),appid);}
fbjs_main.prototype.getRootElement=function(){var appid=fbjs_private.get(this).appid;return fbjs_dom.get_instance(document.getElementById('app_content_'+appid).firstChild,appid);}
fbjs_main.prototype.createElement=function(element){var mix=fbjs_sandbox.safe_string(element.toLowerCase());if(fbjs_main.allowed_elements[mix]){return fbjs_dom.get_instance(document.createElement(mix),fbjs_private.get(this).appid);}else{switch(mix){case'fb:swf':return new fbjs_fbml_dom('fb:swf',fbjs_private.get(this).appid);break;default:fbjs_console.error(mix+' is not an allowed DOM element');break;}}}
fbjs_main.prototype.setLocation=function(url){url=fbjs_sandbox.safe_string(url);if(fbjs_dom.href_regex.test(url)){document.location.href=url;return this;}else{fbjs_console.error(url+' is not a valid location');}}
function fbjs_facebook(appid){var priv=fbjs_private.get(this);priv.sandbox=fbjs_sandbox.instances['a'+appid];}
fbjs_facebook.prototype.getUser=function(){var priv=fbjs_private.get(this);if(priv.sandbox.data.loggedin){return priv.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(text){if(urchinTracker){urchinTracker(text);}else{fbjs_console.error('There is no fb:google-analytics tag on this page!');}}
function fbjs_dom(obj,appid){this.__instance=fbjs_dom.len;try{obj.fbjs_instance=fbjs_dom.len;}catch(e){}
fbjs_dom[fbjs_dom.len]={instance:this,obj:obj,events:{},appid:appid}
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(obj,appid){if(!obj.tagName||((!fbjs_main.allowed_elements[obj.tagName.toLowerCase()]&&!fbjs_main.allowed_editable[obj.tagName.toLowerCase()])||(obj.tagName=='INPUT'&&(obj.name.substring(0,2)=='fb'||obj.name=='post_form_id'))||obj.getAttribute('fb_protected')=='true')){return null;}else{return new this(obj,appid);}}
fbjs_dom.get_data=function(handle){if(handle.__instance instanceof Object){return null;}else{var data=fbjs_dom[handle.__instance];return data.instance==handle?data:null;}}
fbjs_dom.get_obj=function(handle){if(handle instanceof fbjs_fbml_dom){return fbjs_fbml_dom.get_obj(handle);}else{if(typeof handle.__instance=='number'){var data=fbjs_dom[handle.__instance];if(data&&data.instance==handle){return data.obj;}else{throw('This DOM node is no longer valid.');}}else{throw('This DOM node is no longer valid.');}}}
fbjs_dom.render=function(handle){if(handle instanceof fbjs_fbml_dom){fbjs_fbml_dom.render(handle);}}
fbjs_dom.get_instance=function(obj,appid){if(!obj){return null;}
if(typeof obj.fbjs_instance=='undefined'){return fbjs_dom.factory(obj,appid);}else{return fbjs_dom[obj.fbjs_instance].instance;}}
fbjs_dom.get_instance_list=function(list,appid){var objs=[];for(var i=0;i<list.length;i++){var obj=fbjs_dom.get_instance(list[i],appid);if(obj){objs.push(obj);}}
return objs;}
fbjs_dom.get_first_valid_instance=function(obj,next,appid){var ret=null;if(obj&&((obj.id&&obj.id.indexOf('app_content')!=-1)||(obj.tagName&&obj.tagName.toLowerCase()=='body'))){return null;}
while(obj&&(!(ret=fbjs_dom.factory(obj,appid)))){if((obj.id&&obj.id.indexOf('app_content')!=-1)||(obj.tagName&&obj.tagName.toLowerCase()=='body')){return null;}
obj=obj[next];}
return ret;}
fbjs_dom.clear_instances=function(obj,include){if(include&&obj.fbjs_instance){delete fbjs_dom[obj.fbjs_instance].obj;delete fbjs_dom[obj.fbjs_instance].events;delete fbjs_dom[obj.fbjs_instance].instance;delete fbjs_dom[obj.fbjs_instance];obj.fbjs_instance=undefined;}
var cn=obj.childNodes;for(var i=0;i<cn.length;i++){fbjs_dom.clear_instances(cn[i],true);}}
fbjs_dom.prototype.appendChild=function(child){fbjs_dom.get_obj(this).appendChild(fbjs_dom.get_obj(child));fbjs_dom.render(child);return child;}
fbjs_dom.prototype.insertBefore=function(child,caret){if(caret){fbjs_dom.get_obj(this).insertBefore(fbjs_dom.get_obj(child),fbjs_dom.get_obj(caret));}else{fbjs_dom.get_obj(this).appendChild(fbjs_dom.get_obj(child));}
fbjs_dom.render(child);return child;}
fbjs_dom.prototype.removeChild=function(child){var child=fbjs_dom.get_obj(child);fbjs_dom.clear_instances(child,true);fbjs_dom.get_obj(this).removeChild(child);return this;}
fbjs_dom.prototype.replaceChild=function(newchild,oldchild){fbjs_dom.clear_instances(oldchild,true);fbjs_dom.get_obj(this).replaceChild(fbjs_dom.get_obj(newchild),fbjs_dom.get_obj(oldchild));return this;}
fbjs_dom.prototype.cloneNode=function(tree){var data=fbjs_dom.get_data(this);return fbjs_dom.get_instance(data.obj.cloneNode(tree),data.appid);}
fbjs_dom.prototype.getParentNode=function(){var data=fbjs_dom.get_data(this);return fbjs_dom.get_first_valid_instance(data.obj.parentNode,'parentNode',data.appid);}
fbjs_dom.prototype.getNextSibling=function(){var data=fbjs_dom.get_data(this);return fbjs_dom.get_first_valid_instance(data.obj.nextSibling,'nextSibling',data.appid);}
fbjs_dom.prototype.getPreviousSibling=function(){var data=fbjs_dom.get_data(this);return fbjs_dom.get_first_valid_instance(data.obj.previousSibling,'previousSibling',data.appid);}
fbjs_dom.prototype.getFirstChild=function(){var data=fbjs_dom.get_data(this);return fbjs_dom.get_first_valid_instance(data.obj.firstChild,'nextSibling',data.appid);}
fbjs_dom.prototype.getLastChild=function(){var data=fbjs_dom.get_data(this);return fbjs_dom.get_first_valid_instance(data.obj.lastChild,'previousSibling',data.appid);}
fbjs_dom.prototype.getChildNodes=function(){var data=fbjs_dom.get_data(this);return fbjs_dom.get_instance_list(data.obj.childNodes,data.appid);}
fbjs_dom.prototype.getElementsByTagName=function(tag){var data=fbjs_dom.get_data(this);return fbjs_dom.get_instance_list(data.obj.getElementsByTagName(tag),data.appid);}
fbjs_dom.prototype.getOptions=function(){var data=fbjs_dom.get_data(this);return fbjs_dom.get_instance_list(data.obj.options,data.appid);}
fbjs_dom.prototype.getForm=function(){var data=fbjs_dom.get_data(this);return fbjs_dom.get_instance(data.obj.form,data.appid);}
fbjs_dom.prototype.serialize=function(){var elements=fbjs_dom.get_data(this).obj.elements;var data={};for(var i=elements.length-1;i>=0;i--){if(elements[i].name&&elements[i].name.substring(0,2)!='fb'&&elements[i].name!='post_form_id'&&!elements[i].disabled){if(elements[i].tagName=='SELECT'){var name=elements[i].multiple?elements[i].name+'[]':elements[i].name;for(var j=0,jl=elements[i].options.length;j<jl;j++){if(elements[i].options[j].selected){serialize_form_helper(data,name,(elements[i].options[j].getAttribute('value')==null)?undefined:elements[i].options[j].value);}}}else if(!(elements[i].type=='radio'||elements[i].type=='checkbox')||elements[i].checked||(!elements[i].type||elements[i].type=='text'||elements[i].type=='password'||elements[i].type=='hidden'||elements[i].tagName=='TEXTAREA')){serialize_form_helper(data,elements[i].name,elements[i].value);}}}
return data;}
fbjs_dom.prototype.setInnerXHTML=function(html){var data=fbjs_dom.get_data(this);var sanitizer=new fbjs_fbml_sanitize(data.appid);var htmlElem=sanitizer.parseFBML(html);if(!htmlElem)return this;var obj=fbjs_dom.get_obj(this);switch(obj.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(obj,false);obj.innerHTML='';this.appendChild(htmlElem);break;}
return this;}
fbjs_dom.prototype.setInnerFBML=function(fbml_ref){var html=fbml_ref;var obj=fbjs_dom.get_obj(this);switch(obj.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(obj,html);break;}
return this;}
fbjs_dom.prototype.setTextValue=function(text){var obj=fbjs_dom.get_obj(this);fbjs_dom.clear_instances(obj,false);obj.innerHTML=htmlspecialchars(fbjs_sandbox.safe_string(text));return this;}
fbjs_dom.prototype.setValue=function(value){fbjs_dom.get_obj(this).value=value;return this;}
fbjs_dom.prototype.getValue=function(){var obj=fbjs_dom.get_obj(this);if(obj.tagName=='SELECT'){var si=obj.selectedIndex;if(si==-1){return null;}else{if(obj.options[si].getAttribute('value')==null){return undefined;}else{return obj.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(si){fbjs_dom.get_obj(this).selectedIndex=si;return this;}
fbjs_dom.prototype.getChecked=function(){return fbjs_dom.get_obj(this).checked;}
fbjs_dom.prototype.setChecked=function(c){fbjs_dom.get_obj(this).checked=c;return this;}
fbjs_dom.prototype.getSelected=function(){return fbjs_dom.get_obj(this).selected;}
fbjs_dom.prototype.setSelected=function(s){fbjs_dom.get_obj(this).selected=s;return this;}
fbjs_dom.set_style=function(obj,style,value){if(typeof style=='string'){if(style=='opacity'){set_opacity(obj,parseFloat(value,10));}else{value=fbjs_sandbox.safe_string(value);if(fbjs_dom.css_regex.test(value)){obj.style[style]=value;}else{fbjs_console.error(style+': '+value+' is not a valid CSS style');}}}else{for(var i in style){fbjs_dom.set_style(obj,i,style[i]);}}}
fbjs_dom.css_regex=/^(?:[\w\-#%+]+|rgb\(\d+ *, *\d+, *\d+\)|url\('?http[^ ]+?'?\)| +)*$/i
fbjs_dom.prototype.setStyle=function(style,value){fbjs_dom.set_style(fbjs_dom.get_obj(this),style,value);return this;}
fbjs_dom.prototype.getStyle=function(style_str){return fbjs_dom.get_obj(this).style[idx(style_str)];}
fbjs_dom.prototype.setHref=function(href){href=fbjs_sandbox.safe_string(href);if(fbjs_dom.href_regex.test(href)){fbjs_dom.get_obj(this).href=href;return this;}else{fbjs_console.error(href+' 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(a){a=fbjs_sandbox.safe_string(a);if(fbjs_dom.href_regex.test(a)){fbjs_dom.get_obj(this).action=a;return this;}else{fbjs_console.error(a+' is not a valid hyperlink');}}
fbjs_dom.prototype.getAction=function(){return fbjs_dom.get_obj(this).action;}
fbjs_dom.prototype.setMethod=function(m){m=fbjs_sandbox.safe_string(m);fbjs_dom.get_obj(this).method=m.toLowerCase()=='get'?'get':'post';return this;}
fbjs_dom.prototype.getMethod=function(){return fbjs_dom.get_obj(this).method;}
fbjs_dom.prototype.setSrc=function(src){src=fbjs_sandbox.safe_string(src);if(fbjs_dom.href_regex.test(src)){fbjs_dom.get_obj(this).src=src;return this;}else{fbjs_console.error(src+' is not a valid hyperlink');}}
fbjs_dom.prototype.getSrc=function(){return fbjs_dom.get_obj(this).src;}
fbjs_dom.prototype.setTarget=function(target){fbjs_dom.get_obj(this).target=target;return this;}
fbjs_dom.prototype.getTarget=function(){return fbjs_dom.get_obj(this).target;}
fbjs_dom.prototype.setClassName=function(classname){fbjs_dom.get_obj(this).className=classname;return this;}
fbjs_dom.prototype.getClassName=function(){return fbjs_dom.get_obj(this).className;}
fbjs_dom.prototype.hasClassName=function(classname){return has_css_class_name(fbjs_dom.get_obj(this),classname);}
fbjs_dom.prototype.addClassName=function(classname){add_css_class_name(fbjs_dom.get_obj(this),classname);return this;}
fbjs_dom.prototype.removeClassName=function(classname){remove_css_class_name(fbjs_dom.get_obj(this),classname);return this;}
fbjs_dom.prototype.toggleClassName=function(classname){this.hasClassName(classname)?this.removeClassName(classname):this.addClassName(classname);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 id=fbjs_dom.get_obj(this).id;if(id){return id.replace(/^app\d+_/,'');}else{return id;}}
fbjs_dom.prototype.setId=function(id){var data=fbjs_dom.get_data(this);data.obj.id=['','','',id].join('');return this;}
fbjs_dom.prototype.setDir=function(dir){fbjs_dom.get_obj(this).dir=dir;return this;}
fbjs_dom.prototype.getdir=function(dir){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(val){return fbjs_dom.get_obj(this).scrollWidth;}
fbjs_dom.prototype.getScrollTop=function(){return fbjs_dom.get_obj(this).scrollTop;}
fbjs_dom.prototype.setScrollTop=function(val){fbjs_dom.get_obj(this).scrollTop=val;return this;}
fbjs_dom.prototype.getScrollLeft=function(){return fbjs_dom.get_obj(this).scrollLeft;}
fbjs_dom.prototype.setScrollLeft=function(val){fbjs_dom.get_obj(this).scrollLeft=val;return this;}
fbjs_dom.prototype.getTabIndex=function(){return fbjs_dom.get_obj(this).tabIndex;}
fbjs_dom.prototype.setTabIndex=function(tabindex){fbjs_dom.get_obj(this).tabIndex=tabindex;return this;}
fbjs_dom.prototype.getTitle=function(){return fbjs_dom.get_obj(this).title;}
fbjs_dom.prototype.setTitle=function(title){fbjs_dom.get_obj(this).title=title;return this;}
fbjs_dom.prototype.getRowSpan=function(){return fbjs_dom.get_obj(this).rowSpan;}
fbjs_dom.prototype.setRowSpan=function(rowSpan){fbjs_dom.get_obj(this).rowSpan=rowSpan;return this;}
fbjs_dom.prototype.getColSpan=function(){return fbjs_dom.get_obj(this).colSpan;}
fbjs_dom.prototype.setColSpan=function(colSpan){fbjs_dom.get_obj(this).colSpan=colSpan;return this;}
fbjs_dom.prototype.getName=function(){return fbjs_dom.get_obj(this).name;}
fbjs_dom.prototype.setName=function(name){fbjs_dom.get_obj(this).name=name;return this;}
fbjs_dom.prototype.getCols=function(){return fbjs_dom.get_obj(this).cols;}
fbjs_dom.prototype.setCols=function(cols){fbjs_dom.get_obj(this).cols=cols;return this;}
fbjs_dom.prototype.getRows=function(){return fbjs_dom.get_obj(this).rows;}
fbjs_dom.prototype.setRows=function(rows){fbjs_dom.get_obj(this).rows=rows;return this;}
fbjs_dom.prototype.getAccessKey=function(){return fbjs_dom.get_obj(this).accessKey;}
fbjs_dom.prototype.setAccessKey=function(accesskey){fbjs_dom.get_obj(this).accessKey=accesskey;return this;}
fbjs_dom.prototype.setDisabled=function(disabled){fbjs_dom.get_obj(this).disabled=disabled;return this;}
fbjs_dom.prototype.getDisabled=function(){return fbjs_dom.get_obj(this).disabled;}
fbjs_dom.prototype.setMaxLength=function(length){fbjs_dom.get_obj(this).maxLength=length;return this;}
fbjs_dom.prototype.getMaxLength=function(){return fbjs_dom.get_obj(this).maxLength;}
fbjs_dom.prototype.setReadOnly=function(readonly){fbjs_dom.get_obj(this).readOnly=readonly;return this;}
fbjs_dom.prototype.getReadOnly=function(){return fbjs_dom.get_obj(this).readOnly;}
fbjs_dom.prototype.setType=function(type){type=fbjs_sandbox.safe_string(type);fbjs_dom.get_obj(this).type=type;return this;}
fbjs_dom.prototype.getType=function(){return fbjs_dom.get_obj(this).type;}
fbjs_dom.prototype.getSelection=function(){var obj=fbjs_dom.get_obj(this);return get_caret_position(obj);}
fbjs_dom.prototype.setSelection=function(start,end){var obj=fbjs_dom.get_obj(this);set_caret_position(obj,start,end);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(event){var e=(event instanceof fbjs_event)?event:new fbjs_event(event?event:window.event,this[2]);if(e.ignore){return;}
var r=this[1].call(this[0],e);if(r===false){e.preventDefault();}
return fbjs_event.destroy(e);}
fbjs_dom.prototype.addEventListener=function(type,func){type=fbjs_sandbox.safe_string(type.toLowerCase());if(!fbjs_main.allowed_events[type]){fbjs_console.error(type+' is not an allowed event');return false;}
var data=fbjs_dom.get_data(this);var obj=data.obj;if(!data.events[type]){data.events[type]=[];}
var handler=null;if(obj.addEventListener){obj.addEventListener(type,func,false);}else if(obj.attachEvent){obj.attachEvent('on'+type,handler=fbjs_dom.eventHandler.bind([this,func,data.appid]));}
data.events[type].push({func:func,handler:handler});return this;}
fbjs_dom.prototype.removeEventListener=function(type,func){type=type.toLowerCase();var data=fbjs_dom.get_data(this);var obj=data.obj;if(data.events[type]){for(var i=0,il=data.events[type].length;i<il;i++){if(data.events[type][i].func==func){if(obj.removeEventListener){obj.removeEventListener(type,data.events[type][i].handler,false);}else if(obj.detachEvent){obj.detachEvent('on'+type,data.events[type][i].handler);}
data.events[type].splice(i,1);}}}
if(obj['on'+type]==func){obj['on'+type]=null;}
return this;}
fbjs_dom.prototype.listEventListeners=function(type){type=type.toLowerCase();var data=fbjs_dom.get_data(this);var events=[];if(data.events[type]){for(var i=0,il=data.events[type].length;i<il;i++){events.push(data.events[type].func);}}
if(data.obj['on'+type]){events.push(data.obj['on'+type]);}
return events;}
fbjs_dom.prototype.purgeEventListeners=function(type){type=type.toLowerCase();var data=fbjs_dom.get_data(this);var obj=data.obj;if(data.events[type]){for(var i=0,il=data.events[type].length;i<il;i++){if(obj.removeEventListener){obj.removeEventListener(type,data.events[type][i].handler,false);}else if(obj.detachEvent){obj.detachEvent('on'+type,data.events[type][i].handler);}}}
if(obj['on'+type]){obj['on'+type]=null;}
return this;}
fbjs_dom.prototype.callSWF=function(method){var obj=fbjs_dom.get_data(this).obj;var args=new Array(arguments.length-1);for(var i=1;i<arguments.length;i++){args[i-1]=arguments[i];}
if(ua.ie()){var id=0;for(var i=0;i<obj.childNodes.length;i++){if(obj.childNodes[i].name=="fbjs"){id=obj.childNodes[i].getAttribute("value");}}
var fbjsBridge=window["so_swf_fbjs"];}else{var id=obj.getAttribute("fbjs");var fbjsBridge=document["so_swf_fbjs"];}
return fbjsBridge.callFlash(id,method,args);}
function fbjs_fbml_dom(type,appid){var data=fbjs_private.get(this);data.type=type;data.appid=appid;}
fbjs_fbml_dom.get_obj=function(instance){var data=fbjs_private.get(instance);if(!data.obj){data.obj=document.createElement('div');data.obj.className='__fbml_tag';}
return data.obj;}
fbjs_fbml_dom.render=function(instance){var data=fbjs_private.get(instance);if(data.rendered){return;}
if(!data.id){data.id='swf'+parseInt(Math.random()*999999);}
switch(data.type){case'fb:swf':var flash_obj=new SWFObject(data.swf_src,data.id,data.width,data.height,'5.0.0',data.bg_color?data.bg_color:'000000');var flash_params={loop:true,quality:true,scale:true,align:true,salign:true};for(i in flash_params){if(data[i]){flash_obj.addParam(i,data[i]);}}
flash_obj.addParam('wmode','transparent');flash_obj.addParam('allowScriptAccess','never');if(data.flash_vars){for(var i in data.flash_vars){flash_obj.addVariable(i,data.flash_vars[i]);}}
var sandbox=fbjs_sandbox.instances['a'+data.appid];if(sandbox.validation_vars){for(var i in sandbox.validation_vars){flash_obj.addVariable(i,sandbox.validation_vars[i]);}}
if(ge('fbjs_bridge_id')){var local_connection=$$$('fbjs_bridge_id').value;flash_obj.addVariable('fb_local_connection','_'+local_connection);var fbjs_conn='_'+'swf'+parseInt(Math.random()*999999);flash_obj.addVariable('fb_fbjs_connection',fbjs_conn);flash_obj.addParam('fbjs',fbjs_conn);}
if(data.wait_for_click){var img=document.createElement('img');img.src=data.img_src;if(data.width){img.width=data.width;}
if(data.height){img.height=data.height;}
if(data.img_style){fbjs_dom.set_style(img,data.img_style);}
if(data.img_class){img.className=data.img_class;}
var anchor=document.createElement('a');anchor.href='#';anchor.onclick=function(){flash_obj.write(data.obj);return false;}
anchor.appendChild(img);data.obj.appendChild(anchor);}else{flash_obj.write(data.obj);}
break;}}
fbjs_fbml_dom.prototype.setId=function(id){var data=fbjs_private.get(this);data.id=['',data.appid,'',id].join('');return this;}
fbjs_fbml_dom.prototype.setSWFSrc=function(swf){var data=fbjs_private.get(this);swf=fbjs_sandbox.safe_string(swf);if(fbjs_dom.href_regex.test(swf)){data.swf_src=swf;}else{fbjs_console.error(swf+' is not a valid swf');}}
fbjs_fbml_dom.prototype.setImgSrc=function(img){var data=fbjs_private.get(this);img=fbjs_sandbox.safe_string(img);if(fbjs_dom.href_regex.test(img)){data.img_src=img;}else{fbjs_console.error(img+' is not a valid src');}
return this;}
fbjs_fbml_dom.prototype.setWidth=function(width){var data=fbjs_private.get(this);data.width=(/\d+%?/.exec(width)||[]).pop();return this;}
fbjs_fbml_dom.prototype.setHeight=function(height){var data=fbjs_private.get(this);data.height=(/\d+%?/.exec(height)||[]).pop();return this;}
fbjs_fbml_dom.prototype.setImgStyle=function(style,value){var data=fbjs_private.get(this);var style_obj=data.img_style?data.img_style:data.img_style={};if(typeof style=='string'){style_obj[style]=value;}else{for(var i in style){this.setImgStyle(i,style[i]);}}
return this;}
fbjs_fbml_dom.prototype.setImgClass=function(img_class){var data=fbjs_private.get(this);data.img_class=img_class;return this;}
fbjs_fbml_dom.prototype.setFlashVar=function(key,val){var data=fbjs_private.get(this);var flash_vars=data.flash_vars?data.flash_vars:data.flash_vars={};flash_vars[key]=val;return this;}
fbjs_fbml_dom.prototype.setSWFBGColor=function(bg){var data=fbjs_private.get(this);if(fbjs_dom.css_regex.text(bg)){data.bg_color=bg;}else{fbjs_console.error(bg+' is not a valid background color.');}
return this;}
fbjs_fbml_dom.prototype.setWaitForClick=function(wait){var data=fbjs_private.get(this);data.wait_for_click=wait;return this;}
fbjs_fbml_dom.prototype.setLoop=function(val){var data=fbjs_private.get(this);data.loop=val;return this;}
fbjs_fbml_dom.prototype.setQuality=function(val){var data=fbjs_private.get(this);data.quality=val;return this;}
fbjs_fbml_dom.prototype.setScale=function(val){var data=fbjs_private.get(this);data.scale=val;return this;}
fbjs_fbml_dom.prototype.setAlign=function(val){var data=fbjs_private.get(this);data.align=val;return this;}
fbjs_fbml_dom.prototype.setSAlign=function(val){var data=fbjs_private.get(this);data.salign=val;return this;}
function fbjs_event(event,appid){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 i in fbjs_event.allowed_properties){this[i]=event[i];}
var target=null;if(event.target){target=event.target;}else if(event.srcElement){target=event.srcElement;}
if(target&&target.nodeType==3){target=target.parentNode;}
this.target=fbjs_dom.get_instance(target,appid);var posx=0;var posy=0;if(event.pageX||event.pageY){posx=event.pageX;posy=event.pageY;}else if(event.clientX||event.clientY){posx=event.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;posy=event.clientY+document.body.scrollTop+document.documentElement.scrollTop;}
this.pageX=posx;this.pageY=posy;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=event;}
fbjs_event.allowed_properties={type:true,ctrlKey:true,keyCode:true,metaKey:true,shiftKey:true}
fbjs_event.prototype.preventDefault=function(){var data=fbjs_private.get(this);if(!data.prevented&&data.event.preventDefault){data.event.preventDefault();data.prevented=true;}
data.return_value=false;}
fbjs_event.prototype.stopPropagation=function(){var event=fbjs_private.get(this).event;if(event.stopPropagation){event.stopPropagation();}else{event.cancelBubble=true;}}
fbjs_event.destroy=function(obj){var return_value=fbjs_private.get(obj).return_value;fbjs_private.remove(obj);delete obj.target;return return_value==undefined?true:return_value;}
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 date=function(){var ret=new Date();if(arguments.length){ret.setFullYear.apply(ret,arguments);}
return ret;}
date.parse=Date.parse;return date;}
function fbjs_regexp(){var regexp=function(){var ret=arguments.length?new RegExp(arguments[0],arguments[1]):new RegExp();return ret;}
return regexp;}
function fbjs_console(){}
fbjs_console.error=function(text){if(typeof console!='undefined'&&console.error){console.error(text);}}
fbjs_console.render=function(obj){if(obj&&typeof obj.__priv!='undefined'){var new_obj={};for(var i in obj){new_obj[i]=obj[i];}
delete new_obj.__priv;delete new_obj.__private;for(var i in new_obj){new_obj[i]=fbjs_console.render(new_obj[i]);}
var priv=fbjs_private.get(obj);for(var i in priv){new_obj['PRIV_'+i]=priv[i];}
if(obj.__private){var priv=fbjs_private.get(obj.__private);for(var i in priv){new_obj['PRIV_'+i]=priv[i];}}
return new_obj;}else if(obj&&typeof obj.__instance!='undefined'&&obj.setInnerFBML){var new_obj={};for(var i in obj){new_obj[i]=obj[i];}
delete new_obj.__instance;new_obj.PRIV_obj=fbjs_dom.get_obj(obj);return new_obj;}else if(obj&&typeof obj=='object'&&obj.ownerDocument!=document){var new_obj=obj instanceof Array?[]:{};var changed=false;for(var i in obj){obj instanceof Array?new_obj.push(fbjs_console.render(obj[i])):new_obj[i]=fbjs_console.render(obj[i]);if(new_obj[i]!=obj[i]){changed=true;}}
return changed?new_obj:obj;}else{return obj;}}
fbjs_console.render_args=function(args){var new_args=[];for(var i=0;i<args.length;i++){new_args[i]=fbjs_console.render(args[i]);}
return new_args;}
if(typeof console!='undefined'){for(var i in console){fbjs_console.prototype[i]=console[i];}}
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(obj){if(typeof console!='undefined'&&console.dirxml){if(obj.get_obj){console.dirxml(obj.get_obj(obj));}else{console.dirxml(obj);}}}
function fbjs_ajax(appid){var proto=function(){}
for(var i in fbjs_ajax.prototype){proto.prototype[i]=fbjs_ajax.prototype[i];}
var priv=fbjs_private.get(proto.prototype.__private={});priv.appid=appid;priv.sandbox=fbjs_sandbox.instances['a'+appid];proto.JSON=fbjs_ajax.JSON;proto.FBML=fbjs_ajax.FBML;proto.RAW=fbjs_ajax.RAW;return proto;}
fbjs_ajax.proxy_url='/fbml/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(e){try{return new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{return new ActiveXObject('Microsoft.XMLHTTP');}catch(e){return null;}}}}
fbjs_ajax.get_transport=function(instance,force_new){var data=fbjs_private.get(instance);if(data.xml&&!force_new){return data.xml;}else{data.xml=fbjs_ajax.new_xml_http();data.xml.onreadystatechange=fbjs_ajax.onreadystatechange.bind([instance,data.xml]);return data.xml;}}
fbjs_ajax.prototype.abort=function(){var xml=fbjs_ajax.get_transport(this,true);if(xml.abort){xml.abort();}
fbjs_private.get(this).inflight=false;};fbjs_ajax.flash_success=function(res,t){fbjs_ajax.tokens[t].success(res);};fbjs_ajax.flash_fail=function(t){fbjs_ajax.tokens[t].fail();};fbjs_ajax.prototype.post=function(url,query){var priv=fbjs_private.get(this.__private);var appid=priv.appid;var post_form_id=ge('post_form_id');if(!priv.sandbox.data.loggedin&&this.requireLogin){this.status=fbjs_ajax.STATUS_WAITING_FOR_USER;FBML.requireLogin(appid,function(){this.status=fbjs_ajax.STATUS_READY;priv.sandbox.data.loggedin=true;this.post(url,query);}.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(e){this.status=fbjs_ajax.STATUS_READY;this.ondone(e);}.bind(this),"fail":function(e){this.status=fbjs_ajax.STATUS_READY;if(this.onerror()){this.onerror();}}.bind(this)};var usejson=(this.responseType==fbjs_ajax.JSON);var callUrl=localProxy.callUrl(url+'?query='+query,usejson,"fbjs_ajax.flash_success","fbjs_ajax.flash_fail",fbjs_ajax.tokencount);if(!callUrl&&this.onerror){this.onerror();}
return;}else{var xml=fbjs_ajax.get_transport(this,true);if(xml){this.status=fbjs_ajax.STATUS_WAITING_FOR_SERVER;xml.open('POST',fbjs_ajax.proxy_url,true);xml.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xml.send(URI.implodeQuery({url:url,query:query,type:this.responseType,require_login:this.requireLogin,fb_mockajax_context:fbjs_sandbox.instances['a'+appid].contextd,fb_mockajax_context_hash:fbjs_sandbox.instances['a'+appid].context,appid:appid}));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(obj){for(var i in obj){if(i.substring(0,5)=='fbml_'){obj[i]=new fbjs_fbml_string(obj[i]);}else if(typeof obj[i]=='object'){fbjs_ajax.make_fbjs_recursive(obj[i]);}}}
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{eval('var response = '+(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(appid){var proto=function(type){var priv=fbjs_private.get(this);switch(type){case fbjs_dialog.DIALOG_CONTEXTUAL:priv.dialog=new contextual_dialog('app_content_'+appid);priv.dialog.is_stackable=true;break;case fbjs_dialog.DIALOG_POP:default:priv.dialog=new pop_dialog('app_content_'+appid);priv.dialog.is_stackable=true;break;}
priv.type=type;priv.ready=false;}
for(var i in fbjs_dialog.prototype){proto.prototype[i]=fbjs_dialog.prototype[i];}
proto.DIALOG_POP=fbjs_dialog.DIALOG_POP;proto.DIALOG_CONTEXTUAL=fbjs_dialog.DIALOG_CONTEXTUAL;return proto;}
fbjs_dialog.DIALOG_POP=1;fbjs_dialog.DIALOG_CONTEXTUAL=2;fbjs_dialog.onconfirm=function(){var hide=true;if(this.onconfirm){if(this.onconfirm()===false){hide=false;}}
if(hide){this.hide();}}
fbjs_dialog.oncancel=function(){var hide=true;if(this.oncancel){if(this.oncancel()===false){hide=false;}}
if(hide){this.hide();}}
fbjs_dialog.build_dialog=function(){var priv=fbjs_private.get(this);if(!priv.ready){priv.dialog.build_dialog();priv.ready=true;}}
fbjs_dialog.prototype.setStyle=function(style,value){var priv=fbjs_private.get(this);fbjs_dialog.build_dialog.call(this);var obj=null;if(style=='width'||style=='height'){obj=priv.type==fbjs_dialog.DIALOG_CONTEXTUAL?priv.dialog.frame:priv.dialog.frame.parentNode;}else{obj=priv.dialog.content;}
fbjs_dom.set_style(obj,style,value);return ref(this);}
fbjs_dialog.prototype.showMessage=function(title,content,button1){this.showChoice(title,content,button1,false);return ref(this);}
fbjs_dialog.prototype.showChoice=function(title,content,button1,button2){var dialog=fbjs_private.get(this).dialog;fbjs_dialog.build_dialog.call(this);dialog.show_choice(fbjs_fbml_string.get(title),fbjs_fbml_string.get(content),!button1?'Okay':fbjs_fbml_string.get(button1),bind(this,fbjs_dialog.onconfirm),button2===undefined?'Cancel':(button2?fbjs_fbml_string.get(button2):false),bind(this,fbjs_dialog.oncancel));dialog.content.id='app_content_'+gen_unique();return ref(this);}
fbjs_dialog.prototype.setContext=function(node){var dialog=fbjs_private.get(this).dialog;var obj=fbjs_dom.get_obj(node);dialog.set_context(obj);return ref(this);}
fbjs_dialog.prototype.hide=function(){var dialog=fbjs_private.get(this).dialog;if(generic_dialog.dialog_stack&&generic_dialog.dialog_stack.length>1){dialog.hide();}else{dialog.fade_out(200);}
return ref(this);}
function fbjs_animation(){var proto=function(obj){if(this==window){return new arguments.callee(fbjs_dom.get_obj(obj));}else{fbjs_private.get(this).animation=new animation(obj);}}
for(var i in fbjs_animation.prototype){proto.prototype[i]=fbjs_animation.prototype[i];}
proto.ease={begin:animation.ease.begin,end:animation.ease.end,both:animation.ease.both};return proto;}
fbjs_animation.prototype.stop=function(){fbjs_private.get(this).animation.stop();return this;}
fbjs_animation.prototype.to=function(attr,val){fbjs_private.get(this).animation.to(attr,val);return this;}
fbjs_animation.prototype.by=function(attr,val){fbjs_private.get(this).animation.by(attr,val);return this;}
fbjs_animation.prototype.from=function(attr,val){fbjs_private.get(this).animation.from(attr,val);return this;}
fbjs_animation.prototype.duration=function(duration){fbjs_private.get(this).animation.duration(duration);return this;}
fbjs_animation.prototype.checkpoint=function(length,callback){fbjs_private.get(this).animation.checkpoint(length,typeof callback=='function'?bind(this,callback):null);return this;}
fbjs_animation.prototype.ondone=function(callback){if(typeof callback=='function'){fbjs_private.get(this).animation.checkpoint(bind(this,callback));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(callback){fbjs_private.get(this).animation.ease(callback);return this;}
fbjs_animation.prototype.go=function(){fbjs_private.get(this).animation.go();return this;}
function fbjs_fbml_string(html){fbjs_private.get(this).htmlstring=html;}
fbjs_fbml_string.get=function(html){if(html instanceof fbjs_fbml_string){return fbjs_private.get(html).htmlstring;}else{return htmlspecialchars(fbjs_sandbox.safe_string(html));}}
fbjs_private=new Object();fbjs_private.len=0;fbjs_private.get=function(instance){if(typeof instance!='object'){return null;}
if(instance.__priv==undefined){var priv={data:{},instance:instance};instance.__priv=fbjs_private.len;fbjs_private.len++;priv.instance=instance;fbjs_private[instance.__priv]=priv;return priv.data;}else if(typeof instance.__priv=='number'){var priv=fbjs_private[instance.__priv];if(priv.instance==instance){return priv.data;}else{throw('Invalid object supplied to fbjs_private.get');}}else{throw('Invalid object supplied to fbjs_private.get');}}
fbjs_private.remove=function(instance){if(instance.__priv!=undefined){if(fbjs_private[instance.__priv].instance==instance){delete fbjs_private[instance.__priv];delete instance.__priv;}}}
function fbjs_fbml_sanitize(appid){this.appid=app_1.appid;this.main=eval('a'+this.appid+'_document');return this;}
fbjs_fbml_sanitize.prototype.parseFBML=function(text){if(window.ActiveXObject){var doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(text);if(doc.parseError.reason){fbjs_console.error(doc.parseError.reason);return null;}}
else{var parser=new DOMParser();var doc=parser.parseFromString(text,"text/xml");if(doc.documentElement.nodeName=='parsererror'){fbjs_console.error(doc.documentElement.textContent);return null;}}
var x=doc.documentElement;return this.processElement(x);};fbjs_fbml_sanitize.prototype.processElement=function(node){if(node.nodeType==3){return new fbjs_dom(document.createTextNode(node.nodeValue),this.appid);}else if(node.nodeType!=1){return null;}
var domElement=this.main.createElement(node.nodeName);if(!domElement)return null;for(var x=0;x<node.attributes.length;x++){var attr=node.attributes[x];var aname=attr.nodeName;if(aname=='style'){var elems=attr.nodeValue.split(";");for(var i=0;i<elems.length;i++){if(elems[i]!=''){var props=elems[i].split(":");domElement.setStyle(props[0],props[1].replace(/^\s+|\s+$/g,''));}}}else{setter=fbjs_dom.attr_setters[aname];if(domElement[setter]){domElement[setter](attr.nodeValue);}}}
for(var x=0;x<node.childNodes.length;x++){var child=node.childNodes[x];var ch=this.processElement(child);if(ch){domElement.appendChild(ch);}}
return domElement;};if(window.Bootloader){Bootloader.done(2);}
function animation(obj){if(obj==undefined){Util.error("Creating animation on non-existant object");return;}
if(this==window){return new animation(obj);}else{this.obj=obj;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 container=document.createElement('div');container.style.padding='0px';container.style.margin='0px';container.style.border='0px';container.__animation_refs=1;var children=this.obj.childNodes;while(children.length){container.appendChild(children[0]);}
this.obj.appendChild(container);this.obj.style.overflow='hidden';this.container_div=container;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 children=this.container_div.childNodes;while(children.length){this.obj.appendChild(children[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(attr,value,mode){attr=attr.replace(/-[a-z]/gi,function(l){return l.substring(1).toUpperCase();});var auto=false;switch(attr){case'background':this._attr('backgroundColor',value,mode);return this;case'margin':value=animation.parse_group(value);this._attr('marginBottom',value[0],mode);this._attr('marginLeft',value[1],mode);this._attr('marginRight',value[2],mode);this._attr('marginTop',value[3],mode);return this;case'padding':value=animation.parse_group(value);this._attr('paddingBottom',value[0],mode);this._attr('paddingLeft',value[1],mode);this._attr('paddingRight',value[2],mode);this._attr('paddingTop',value[3],mode);return this;case'backgroundColor':case'borderColor':case'color':value=animation.parse_color(value);break;case'opacity':value=parseFloat(value,10);break;case'height':case'width':if(value=='auto'){auto=true;}else{value=parseInt(value,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':value=parseInt(value,10);break;default:throw new Error(attr+' is not a supported attribute!');}
if(this.state.attrs[attr]===undefined){this.state.attrs[attr]={};}
if(auto){this.state.attrs[attr].auto=true;}
switch(mode){case animation.ATTR_FROM:this.state.attrs[attr].start=value;break;case animation.ATTR_BY:this.state.attrs[attr].by=true;case animation.ATTR_TO:this.state.attrs[attr].value=value;break;}}
animation.prototype.to=function(attr,value){if(value===undefined){this._attr(this.last_attr,attr,animation.ATTR_TO);}else{this._attr(attr,value,animation.ATTR_TO);this.last_attr=attr;}
return this;}
animation.prototype.by=function(attr,value){if(value===undefined){this._attr(this.last_attr,attr,animation.ATTR_BY);}else{this._attr(attr,value,animation.ATTR_BY);this.last_attr=attr;}
return this;}
animation.prototype.from=function(attr,value){if(value===undefined){this._attr(this.last_attr,attr,animation.ATTR_FROM);}else{this._attr(attr,value,animation.ATTR_FROM);this.last_attr=attr;}
return this;}
animation.prototype.duration=function(duration){this.state.duration=duration?duration:0;return this;}
animation.prototype.checkpoint=function(distance,callback){if(distance===undefined){distance=1;}
this.state.checkpoint=distance;this.queue.push(this.state);this._reset_state();this.state.checkpointcb=callback;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(ease){this.state.ease=ease;return this;}
animation.prototype.go=function(){var time=(new Date()).getTime();this.queue.push(this.state);for(var i=0;i<this.queue.length;i++){this.queue[i].start=time-animation.offset;if(this.queue[i].checkpoint){time+=this.queue[i].checkpoint*this.queue[i].duration;}}
animation.push(this);return this;}
animation.prototype._frame=function(time){var done=true;var still_needs_container=false;var whacky_firefox=false;for(var i=0;i<this.queue.length;i++){var cur=this.queue[i];if(cur.start>time){done=false;continue;}
if(cur.checkpointcb){this._callback(cur.checkpointcb,time-cur.start);cur.checkpointcb=null;}
if(cur.started===undefined){if(cur.show){this.obj.style.display='block';}
for(var a in cur.attrs){if(cur.attrs[a].start!==undefined){continue;}
switch(a){case'backgroundColor':case'borderColor':case'color':var val=animation.parse_color(CSS.getStyle(this.obj,a=='borderColor'?'borderLeftColor':a));if(cur.attrs[a].by){cur.attrs[a].value[0]=Math.min(255,Math.max(0,cur.attrs[a].value[0]+val[0]));cur.attrs[a].value[1]=Math.min(255,Math.max(0,cur.attrs[a].value[1]+val[1]));cur.attrs[a].value[2]=Math.min(255,Math.max(0,cur.attrs[a].value[2]+val[2]));}
break;case'opacity':var val=CSS.getOpacity(this.obj);if(cur.attrs[a].by){cur.attrs[a].value=Math.min(1,Math.max(0,cur.attrs[a].value+val));}
break;case'height':case'width':var val=animation['get_'+a](this.obj);if(cur.attrs[a].by){cur.attrs[a].value+=val;}
break;case'scrollLeft':case'scrollTop':var val=(this.obj==document.body)?(document.documentElement[a]||document.body[a]):this.obj[a];if(cur.attrs[a].by){cur.attrs[a].value+=val;}
cur['last'+a]=val;break;default:var val=parseInt(CSS.getStyle(this.obj,a),10);if(cur.attrs[a].by){cur.attrs[a].value+=val;}
break;}
cur.attrs[a].start=val;}
if((cur.attrs.height&&cur.attrs.height.auto)||(cur.attrs.width&&cur.attrs.width.auto)){if(ua.firefox()<3){whacky_firefox=true;}
this._destroy_container();for(var a in{height:1,width:1,fontSize:1,borderLeftWidth:1,borderRightWidth:1,borderTopWidth:1,borderBottomWidth:1,paddingLeft:1,paddingRight:1,paddingTop:1,paddingBottom:1}){if(cur.attrs[a]){this.obj.style[a]=cur.attrs[a].value+(typeof cur.attrs[a].value=='number'?'px':'');}}
if(cur.attrs.height&&cur.attrs.height.auto){cur.attrs.height.value=animation.get_height(this.obj);}
if(cur.attrs.width&&cur.attrs.width.auto){cur.attrs.width.value=animation.get_width(this.obj);}}
cur.started=true;if(cur.blind){this._build_container();}}
var p=(time-cur.start)/cur.duration;if(p>=1){p=1;if(cur.hide){this.obj.style.display='none';}}else{done=false;}
var pc=cur.ease?cur.ease(p):p;if(!still_needs_container&&p!=1&&cur.blind){still_needs_container=true;}
if(whacky_firefox&&this.obj.parentNode){var parentNode=this.obj.parentNode;var nextChild=this.obj.nextSibling;parentNode.removeChild(this.obj);}
for(var a in cur.attrs){switch(a){case'backgroundColor':case'borderColor':case'color':this.obj.style[a]='rgb('+
animation.calc_tween(pc,cur.attrs[a].start[0],cur.attrs[a].value[0],true)+','+
animation.calc_tween(pc,cur.attrs[a].start[1],cur.attrs[a].value[1],true)+','+
animation.calc_tween(pc,cur.attrs[a].start[2],cur.attrs[a].value[2],true)+')';break;case'opacity':CSS.setOpacity(this.obj,animation.calc_tween(pc,cur.attrs[a].start,cur.attrs[a].value));break;case'height':case'width':this.obj.style[a]=pc==1&&cur.attrs[a].auto?'auto':animation.calc_tween(pc,cur.attrs[a].start,cur.attrs[a].value,true)+'px';break;case'scrollLeft':case'scrollTop':var val=(this.obj==document.body)?(document.documentElement[a]||document.body[a]):this.obj[a];if(cur['last'+a]!=val){delete cur.attrs[a];}else{var diff=animation.calc_tween(pc,cur.attrs[a].start,cur.attrs[a].value,true)-val;if(a=='scrollLeft'){window.scrollBy(diff,0);}else{window.scrollBy(0,diff);}
cur['last'+a]=diff+val;}
break;default:this.obj.style[a]=animation.calc_tween(pc,cur.attrs[a].start,cur.attrs[a].value,true)+'px';break;}}
if(p==1){this.queue.splice(i--,1);this._callback(cur.ondone,time-cur.start-cur.duration);}}
if(whacky_firefox){parentNode[nextChild?'insertBefore':'appendChild'](this.obj,nextChild);}
if(!still_needs_container&&this.container_div){this._destroy_container();}
return!done;}
animation.prototype.ondone=function(fn){this.state.ondone=fn;return this;}
animation.prototype._callback=function(callback,offset){if(callback){animation.offset=offset;callback.call(this);animation.offset=0;}}
animation.calc_tween=function(p,v1,v2,whole){return(whole?parseInt:parseFloat)((v2-v1)*p+v1,10);}
animation.parse_color=function(color){var hex=/^#([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{1,2})$/i.exec(color);if(hex){return[parseInt(hex[1].length==1?hex[1]+hex[1]:hex[1],16),parseInt(hex[2].length==1?hex[2]+hex[2]:hex[2],16),parseInt(hex[3].length==1?hex[3]+hex[3]:hex[3],16)];}else{var rgb=/^rgba? *\(([0-9]+), *([0-9]+), *([0-9]+)(?:, *([0-9]+))?\)$/.exec(color);if(rgb){if(rgb[4]==='0'){return[255,255,255];}else{return[parseInt(rgb[1],10),parseInt(rgb[2],10),parseInt(rgb[3],10)];}}else if(color=='transparent'){return[255,255,255];}else{throw'Named color attributes are not supported.';}}}
animation.parse_group=function(value){var value=trim(value).split(/ +/);if(value.length==4){return value;}else if(value.length==3){return[value[0],value[1],value[2],value[1]];}else if(value.length==2){return[value[0],value[1],value[0],value[1]];}else{return[value[0],value[0],value[0],value[0]];}}
animation.get_height=function(obj){var pT=parseInt(CSS.getStyle(obj,'paddingTop'),10),pB=parseInt(CSS.getStyle(obj,'paddingBottom'),10),bT=parseInt(CSS.getStyle(obj,'borderTopWidth'),10),bW=parseInt(CSS.getStyle(obj,'borderBottomWidth'),10);return obj.offsetHeight-(pT?pT:0)-(pB?pB:0)-(bT?bT:0)-(bW?bW:0);}
animation.get_width=function(obj){var pL=parseInt(CSS.getStyle(obj,'paddingLeft'),10),pR=parseInt(CSS.getStyle(obj,'paddingRight'),10),bL=parseInt(CSS.getStyle(obj,'borderLeftWidth'),10),bR=parseInt(CSS.getStyle(obj,'borderRightWidth'),10);return obj.offsetWidth-(pL?pL:0)-(pR?pR:0)-(bL?bL:0)-(bR?bR:0);}
animation.push=function(instance){if(!animation.active){animation.active=[];}
animation.active.push(instance);if(!animation.timeout){animation.timeout=setInterval(animation.animate.bind(animation),animation.resolution,false);}
animation.animate(true);}
animation.animate=function(last){var time=(new Date()).getTime();for(var i=last===true?animation.active.length-1:0;i<animation.active.length;i++){try{if(!animation.active[i]._frame(time)){animation.active.splice(i--,1);}}catch(e){animation.active.splice(i--,1);}}
if(animation.active.length==0){clearInterval(animation.timeout);animation.timeout=null;}}
animation.ease={}
animation.ease.begin=function(p){return p*p;}
animation.ease.end=function(p){p-=1;return-(p*p)+1;}
animation.ease.both=function(p){if(p<=0.5){return(p*p)*2;}else{p-=1;return(p*p)*-2+1;}}
function escapeURI(u)
{if(encodeURIComponent){return encodeURIComponent(u);}
if(escape){return escape(u);}}
function htmlspecialchars(text){if(typeof(text)=='undefined'||!text.toString){return'';}
if(text===false){return'0';}else if(text===true){return'1';}
return text.toString().replace(/&/g,'&amp;').replace(/"/g,'&quot;').replace(/'/g,'&#039;').replace(/</g,'&lt;').replace(/>/g,'&gt;');}
function htmlize(text){return htmlspecialchars(text).replace(/\n/g,'<br />');}
function escape_js_quotes(text){if(typeof(text)=='undefined'||!text.toString){return'';}
return text.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');}
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 agent=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera.(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))/.exec(navigator.userAgent);var os=/(Mac OS X;)|(Windows;)/.exec(navigator.userAgent);if(agent){ua._ie=agent[1]?parseFloat(agent[1]):NaN;ua._firefox=agent[2]?parseFloat(agent[2]):NaN;ua._opera=agent[3]?parseFloat(agent[3]):NaN;ua._safari=agent[4]?parseFloat(agent[4]):NaN;}else{ua._ie=ua._firefox=ua._opera=ua._safari=NaN;}
if(os){ua._osx=!!os[1];ua._windows=!!os[2];}else{ua._osx=ua._windows=false;}}};function set_inner_html(obj,html,defer_js_execution){obj.innerHTML=html;}
function has_css_class_name(elem,cname){return(elem&&cname)?new RegExp('\\b'+trim(cname)+'\\b').test(elem.className):false;}
function create_hidden_input(name,value){var new_input=document.createElement('input');new_input.name=name;new_input.id=name;new_input.value=value;new_input.type='hidden';return new_input;}
function swap_css_class_name(elements,class1,class2){for(var i=0;i<elements.length;i++){var element=ge(elements[i]);if(element.className.indexOf(class1)!=-1){element.className=element.className.replace(class1,class2);}else{element.className=element.className.replace(class2,class1);}}}
function add_css_class_name(elem,cname){if(elem&&cname){if(elem.className){if(has_css_class_name(elem,cname)){return false;}else{elem.className+=' '+trim(cname);return true;}}else{elem.className=cname;return true;}}else{return false;}}
function remove_css_class_name(elem,cname){if(elem&&cname&&elem.className){cname=trim(cname);var old=elem.className;elem.className=elem.className.replace(new RegExp('\\b'+cname+'\\b'),'');return elem.className!=old;}else{return false;}}
function toggle_css_class_name(elem,cname){if(has_css_class_name(elem,cname)){remove_css_class_name(elem,cname);}else{add_css_class_name(elem,cname);}}
String.prototype.trim=function(){if(this==window){return null;}
return this.replace(/^\s*|\s*$/g,'');}
function trim(text){return String(text).trim();}
function Vector2(x,y,domain){copy_properties(this,{x:parseFloat(x),y:parseFloat(y),domain:domain||'pure'});};copy_properties(Vector2.prototype,{toString:function(){return'('+this.x+', '+this.y+')';},add:function(vx,vy){var x=this.x,y=this.y,l=arguments.length;if(l==1){if(vx.domain!='pure'){vx=vx.convertTo(this.domain);}
x+=vx.x;y+=vx.y;}else if(l==2){x+=parseFloat(vx);y+=parseFloat(arguments[1]);}else{Util.warn('Vector2.add called with %d arguments, should be one (a vector) or '+'two (x and y coordinates).',l);}
return new Vector2(x,y,this.domain);},mul:function(sx,sy){if(typeof(sy)=="undefined"){sy=sx;}
return new Vector2(this.x*sx,this.y*sy,this.domain);},sub:function(v){var x=this.x,y=this.y,l=arguments.length;if(l==1){if(v.domain!='pure'){v=v.convertTo(this.domain);}
x-=v.x;y-=v.y;}else if(l==2){x-=parseFloat(v);y-=parseFloat(arguments[1]);}else{Util.warn('Vector2.add called with %d arguments, should be one (a vector) or '+'two (x and y coordinates).',l);}
return new Vector2(x,y,this.domain);},distanceTo:function(v){return this.sub(v).magnitude();},magnitude:function(){return Math.sqrt((this.x*this.x)+(this.y*this.y));},convertTo:function(newDomain){if(newDomain!='pure'&&newDomain!='viewport'&&newDomain!='document'){Util.error('Domain %q is not valid; legitimate coordinate domains are %q, %q, '+'%q.',newDomain,'pure','viewport','document');return new Vector2(0,0);}
if(newDomain==this.domain){return new Vector2(this.x,this.y,this.domain);}
if(newDomain=='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.',newDomain);return new Vector2(0,0);}
var o=Vector2.getScrollPosition('document');var x=this.x,y=this.y;if(this.domain=='document'){x-=o.x;y-=o.y;}else{x+=o.x;y+=o.y;}
return new Vector2(x,y,newDomain);},setElementPosition:function(el){var p=this.convertTo('document');el.style.left=parseInt(p.x)+'px';el.style.top=parseInt(p.y)+'px';return this;},setElementDimensions:function(el){return this.setElementWidth(el).setElementHeight(el);},setElementWidth:function(el){el.style.width=parseInt(this.x,10)+'px';return this;},setElementHeight:function(el){el.style.height=parseInt(this.y,10)+'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'},getEventPosition:function(e,domain){domain=domain||'document';e=$E(e);var x=e.pageX||(e.clientX+
(document.documentElement.scrollLeft||document.body.scrollLeft));var y=e.pageY||(e.clientY+
(document.documentElement.scrollTop||document.body.scrollTop));var v=new Vector2(x,y,'document');if(DOMScroll.getScrollWrapper()){v=v.add(Vector2.getScrollPosition());}
return v.convertTo(domain);},getScrollPosition:function(domain){domain=domain||'document';var wrapper=DOMScroll.getScrollWrapper();if(wrapper){var x=wrapper.scrollLeft;var y=wrapper.scrollTop;}else{var x=document.body.scrollLeft||document.documentElement.scrollLeft;var y=document.body.scrollTop||document.documentElement.scrollTop;}
return(new Vector2(x,y,'document').convertTo(domain));},getElementPosition:function(el,domain){domain=domain||'document';if(!el){return;}
if(ua.safari()<500&&el.tagName=='TR'){el=el.firstChild;}
var left=el.offsetLeft;var top=el.offsetTop;var op=el.offsetParent;var root=document.body;var fixed=false;while(el.parentNode&&root!=el.parentNode&&document.body!=el.parentNode){el=el.parentNode;if(!isNaN(el.scrollTop)){if(!(ua.opera()<9.50)||!operaIgnoreScroll[window.getComputedStyle(el,'').getPropertyValue('display')]){top-=el.scrollTop;left-=el.scrollLeft;}}
if(op==el){if(ua.safari()<500&&el.tagName=='TR'){top+=el.firstChild.offsetTop;left+=el.firstChild.offsetLeft;}else{top+=el.offsetTop;left+=el.offsetLeft;}
op=el.offsetParent;}
if(op&&CSS.getStyle(op,'position')=='fixed'){fixed=true;top+=op.offsetTop;left+=op.offsetLeft;break;}}
if(fixed){var scrollPosition=Vector2.getScrollPosition('document');left+=scrollPosition.x;top+=scrollPosition.y;}
return(new Vector2(left,top,'document').convertTo(domain));},getElementDimensions:function(el,useClient){if(ua.safariPreWebkit()&&el.nodeName=='TR'){var tds=el.getElementsByTagName('td');var dimensions=Vector2.getElementCompassPoint(tds[tds.length-1],Vector2.compass.southeast,useClient).sub(Vector2.getElementPosition(tds[0],'document',useClient));return dimensions;}
var x=(useClient?el.clientWidth:el.offsetWidth)||0;var y=(useClient?el.clientHeight:el.offsetHeight)||0;return new Vector2(x,y);},getHiddenElementDimensions:function(el){var element=$(el);var els=element.style;var originalVisibility=els.visibility;var originalPosition=els.position;var originalDisplay=els.display;if(originalDisplay=='none'){els.visibility='hidden';els.position='absolute';els.display='block';}
var originalDimensions=Vector2.getElementDimensions(element);els.display=originalDisplay;els.position=originalPosition;els.visibility=originalVisibility;return originalDimensions;},getElementCompassPoint:function(el,which,useClient){which=which||Vector2.compass.southeast;var p=Vector2.getElementPosition(el);var d=Vector2.getElementDimensions(el,useClient);var c=Vector2.compass;switch(which){case c.east:return p.add(d.x,d.y*.5);case c.west:return p.add(0,d.y*.5);case c.north:return p.add(d.x*.5,0);case c.south:return p.add(d.x*.5,d.y);case c.center:return p.add(d.mul(.5));case c.northwest:return p;case c.northeast:return p.add(d.x,0);case c.southwest:return p.add(0,d.y);case c.southeast:return p.add(d);}
Util.error('Unknown compass point %s.',which);return p;},getViewportDimensions:function(){var x=(window&&window.innerWidth)||(document&&document.documentElement&&document.documentElement.clientWidth)||(document&&document.body&&document.body.clientWidth)||0;var y=(window&&window.innerHeight)||(document&&document.documentElement&&document.documentElement.clientHeight)||(document&&document.body&&document.body.clientHeight)||0;return new Vector2(x,y,'viewport');},getDocumentDimensions:function(){var wrapper=DOMScroll.getScrollWrapper();var x=(wrapper&&wrapper.scrollWidth)||(document&&document.documentElement&&document.documentElement.scrollWidth)||(document&&document.body&&document.body.scrollWidth)||0;var y=(wrapper&&wrapper.scrollHeight)||(document&&document.documentElement&&document.documentElement.scrollHeight)||(document&&document.body&&document.body.scrollHeight)||0;return new Vector2(x,y,'document');}});var mouseX=function(e){return Vector2.getEventPosition(e).x;}
var mouseY=function(e){return Vector2.getEventPosition(e).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(obj){return Vector2.getElementPosition(obj,'document').x;}
function elementY(obj){return Vector2.getElementPosition(obj,'document').y;}
var DOMScroll={_scrollWrapper:0,usingScrollWrapper:function(){return env_get('use_scroll_wrapper');},getScrollWrapper:function(){if(DOMScroll._scrollWrapper===0){DOMScroll._scrollWrapper=DOMScroll.usingScrollWrapper()?ge('scroll_wrapper'):null;}
return DOMScroll._scrollWrapper;},getScrollRoot:function(){return DOMScroll.getScrollWrapper()||document.body;},SCROLL_CHANGE:'scroll_change',_hasScrollListeners:false,_isScrolled:null,registerScrollChangeHandler:function(cb){Arbiter.subscribe(DOMScroll.SCROLL_CHANGE,cb);if(!DOMScroll._hasScrollListeners){DOMScroll._hasScrollListeners=true;Event.listen(window,'resize',DOMScroll.updateScrollState);}},updateScrollState:function(){if(DOMScroll.usingScrollWrapper()){var wrapper=DOMScroll.getScrollWrapper();var offset_dim=Vector2.getElementDimensions(wrapper);var client_dim=Vector2.getElementDimensions(wrapper,true);var is_scrolled_x=(offset_dim.y>client_dim.y);var is_scrolled_y=(offset_dim.x>client_dim.x);}else{var viewport_dim=Vector2.getViewportDimensions();var document_dim=Vector2.getDocumentDimensions();var is_scrolled_x=(document_dim.x>viewport_dim.x);var is_scrolled_y=(document_dim.y>viewport_dim.y);}
is_scrolled_x+=0;is_scrolled_y+=0;var changed=(DOMScroll._isScrolled===null)||(is_scrolled_x!=DOMScroll._isScrolled.x)||(is_scrolled_y!=DOMScroll._isScrolled.y);if(changed){DOMScroll._isScrolled=new Vector2(is_scrolled_x,is_scrolled_y);var message={sender:DOMScroll,is_scrolled:DOMScroll.getScrollState()};Arbiter.inform(DOMScroll.SCROLL_CHANGE,message,Arbiter.BEHAVIOR_STATE);}},getScrollState:function(){if(DOMScroll._isScrolled===null){DOMScroll.updateScrollState();}
return DOMScroll._isScrolled;},_scrollbarSize:null,_initScrollbarSize:function(){var inner=$N('p');inner.style.width='100%';inner.style.height='200px';var outer=$N('div');outer.style.position='absolute';outer.style.top='0px';outer.style.left='0px';outer.style.visibility='hidden';outer.style.width='200px';outer.style.height='150px';outer.style.overflow='hidden';outer.appendChild(inner);document.body.appendChild(outer);var w1=inner.offsetWidth;outer.style.overflow='scroll';var w2=inner.offsetWidth;if(w1==w2){w2=outer.clientWidth;}
document.body.removeChild(outer);DOMScroll._scrollbarSize=w1-w2;if(DOMScroll._scrollbarSize<5){DOMScroll._scrollbarSize=15;}},getScrollbarSize:function(){if(DOMScroll._scrollbarSize===null){DOMScroll._initScrollbarSize();}
return DOMScroll._scrollbarSize;},scrollTo:function(v,use_animation){use_animation=use_animation||use_animation===undefined;if(!(v instanceof Vector2)){var x=Vector2.getScrollPosition().x;var y=Vector2.getElementPosition($(v)).y;y=y-Math.min(0,Math.max(Vector2.getViewportDimensions().y/3,100));v=new Vector2(x,y,'document');}
v=v.convertTo('document');var wrapper=DOMScroll.getScrollWrapper();if(use_animation&&window.animation){var root=wrapper||document.body;animation(root).to('scrollTop',v.y).to('scrollLeft',v.x).ease(animation.ease.end).duration(750).go();}else if(wrapper){wrapper.scrollTop=v.y;wrapper.scrollLeft=v.x;}else if(window.scrollTo){window.scrollTo(v.x,v.y);}}};function hasArrayNature(obj){if(!obj){return false;}
if(typeof obj!='object'){return false;}
if(obj instanceof Array){return true;}
if(!('length'in obj)){return false;}
if('callee'in obj){return true;}
if('push'in obj&&'pop'in obj){return true;}
return false;}
function copy_properties(u,v){if(!u||!v){throw new TypeError("Can not copy between types "+typeof(u)+" and "+typeof(v)+".");}
for(var k in v){u[k]=v[k];}
if(v.hasOwnProperty&&v.hasOwnProperty('toString')&&(typeof v.toString!='undefined')&&(u.toString!==v.toString)){u.toString=v.toString;}
return u;}
function arrayize(obj){if(!hasArrayNature(obj)){return[obj];}
return obj;}
function is_empty(obj){if(obj instanceof Array){return obj.length==0;}else if(obj instanceof Object){for(var i in obj){return false;}
return true;}else{return!obj;}}
var Bootloader={configurePage:function(reverse_map){var links=document.getElementsByTagName('link');this._cssLinks=[];for(var ii=0;ii<links.length;++ii){if(links[ii].rel!='stylesheet'){continue;}
for(var k in reverse_map){if(links[ii].href.indexOf(k)!==-1){var name=reverse_map[k][0],permanent=reverse_map[k][1];this._cssLinkMap[name]=this._cssLinks.length;if(permanent){this._permanent[name]=true;}
delete reverse_map[k];break;}}
this._cssLinks.push(links[ii]);}},loadComponents:function(components,callback){components=arrayize(components);var required_resources=[];for(var ii=0;ii<components.length;++ii){var component_resource_list=this._componentMap[components[ii]];if(!component_resource_list){throw new Error("Can not bootload `"+components[ii]+"'.");}
for(var jj=0;jj<component_resource_list.length;++jj){required_resources.push(component_resource_list[jj]);}}
this.loadResources(required_resources,callback);},loadResources:function(resources,callback,replace){resources=arrayize(resources);if(replace){var map={};for(var ii=0;ii<resources.length;++ii){map[resources[ii].name]=true;}
for(var k in this._requested){if(!(k in this._permanent)&&!(k in map)){this._unloadResource(k);}}}
var request_index=this._pending.length;var will_request=[];var pending_request=false;for(var ii=0;ii<resources.length;++ii){var rsrc=resources[ii];if(rsrc.permanent){this._permanent[rsrc.name]=true;}
if(this._loaded[rsrc.name]){continue;}
if(callback){if(!this._pending[request_index]){this._pending[request_index]={names:{},callback:callback};}
this._pending[request_index].names[rsrc.name]=true;pending_request=true;}
if(!this._requested[rsrc.name]){this.requested(rsrc.name);will_request.push(rsrc);}}
for(var ii=0;ii<will_request.length;++ii){this.requestResource(will_request[ii].type,will_request[ii].src,will_request[ii].name);}
if(!pending_request&&callback){this._invoke(callback);}},requestResource:function(type,source,name){var h=this._getHardpoint();switch(type){case'js':var script=document.createElement('script');script.src=source;script.type='text/javascript';h.appendChild(script);break;case'css':var link=null;for(var jj=0;jj<this._cssLinks.length;++jj){if(this._cssLinks[jj]._unused){link=this._cssLinks[jj];if(name){this._cssLinkMap[name]=jj;}
break;}}
if(!link){var link=document.createElement('link');link.rel="stylesheet";link.type="text/css";link.media="all";link.href=source;this._cssLinks.push(link);h.appendChild(link);}else{link.href=source;}
link._unused=false;var id=Bootloader._getDivIdForCSSComponent(name);var div=document.getElementById(id);if(!div){div=document.createElement('div');div.id=id;document.body.appendChild(div);setTimeout(Bootloader._pollCSS.bind(Bootloader,name,Bootloader._CSS_POLL_EXPIRATION),Bootloader._CSS_POLL_INTERVAL,false);}
break;default:throw new TypeError("Bad resource type `"+type+"'.");}},_getDivIdForCSSComponent:function(name){return'bootloader_'+name.replace(/[^a-z0-9]/ig,'_');},_pollCSS:function(name,remaining){var id=Bootloader._getDivIdForCSSComponent(name);var div=document.getElementById(id);if(!div){return;}
var expected='42';var done=div.offsetHeight==expected||div.currentStyle&&div.currentStyle['height']==expected+'px'||window.getComputedStyle&&document.defaultView.getComputedStyle(div,null).getPropertyValue('height')==expected+'px';if(done||remaining<=0){Bootloader.done([name]);div.parentNode.removeChild(div);}else{setTimeout(Bootloader._pollCSS.bind(Bootloader,name,remaining-Bootloader._CSS_POLL_INTERVAL),Bootloader._CSS_POLL_INTERVAL,false);}},done:function(names){var preloaded=PrimordialBootloader.loaded;PrimordialBootloader.loaded=[];for(var ii=0;ii<preloaded.length;++ii){Bootloader.done(preloaded[ii]);}
this.requested(names);for(var ii=0;ii<names.length;++ii){var loaded_resource=names[ii];this._loaded[loaded_resource]=true;for(var jj=0;jj<this._pending.length;++jj){var required_resources=this._pending[jj].names;delete required_resources[loaded_resource];if(is_empty(required_resources)){var callback=this._pending[jj].callback;this._pending.splice(jj,1);--jj;if(callback){this._invoke(callback);}}}}
if(window.Arbiter){var message={sender:this};Arbiter.inform(Arbiter.BOOTLOAD,message,Arbiter.BEHAVIOR_EVENT);}},requested:function(resources){resources=arrayize(resources);for(var ii=0;ii<resources.length;++ii){this._requested[resources[ii]]=true;}},enableBootload:function(map){copy_properties(this._componentMap,map);},_unloadResource:function(name){if(this._cssLinks&&(name in this._cssLinkMap)){var link_id=this._cssLinkMap[name];var link=this._cssLinks[link_id];link.href=Bootloader._UNUSED_CSS_URL;link._unused=true;delete this._cssLinkMap[name];delete this._requested[name];delete this._loaded[name];}},_invoke:function(callback){setTimeout(callback,0);},_getHardpoint:function(){if(!this._hardpoint){var n,heads=document.getElementsByTagName('head');if(heads.length){n=heads[0];}else{n=document.body;}
this._hardpoint=n;}
return this._hardpoint;},initialResourcesReady:function(){return this._initialResourcesReady;},loadInitialResources:function(resources){this._initialResourcesReady=false;this.loadResources(resources,bind(this,function(){this._initialResourcesReady=true;window.onResourceReady&&window.onResourceReady();}));},_initialResourcesReady:true,_requested:{},_permanent:{},_loaded:{},_pending:[],_componentMap:{},_cssLinkMap:{},_cssLinks:[],_hardpoint:null,_CSS_POLL_EXPIRATION:5000,_CSS_POLL_INTERVAL:20,_UNUSED_CSS_URL:'javascript:void(0)'};function env_get(k){return typeof(window['Env'])!='undefined'&&Env[k];}
function muffinize(str){var muffin_top='a';var muffin_bottom='d';var muffin=[muffin_top,muffin_bottom].join('')
return str.replace(/muffin/g,muffin);}
var Util={_suppress:false,fallbackErrorHandler:function(msg){aiert(msg);},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(msg,type){if(Util._suppress){return;}
if(Util.isDevelopmentEnvironment()){type=type||'log';if(typeof(console)!='undefined'&&console[type]){console[type](msg);}else if(typeof(window.TabConsole)!='undefined'){var con=TabConsole.getInstance();if(con){con.log(HTML(msg),type);}}else if(Util.fallbackErrorHandler){Util.fallbackErrorHandler(msg);}}else{if(type=='error'){msg+='\n\n'+Util.stack();(typeof(window['Env'])!='undefined')&&(Env.rlog)&&(typeof(window['debug_rlog'])=='function')&&debug_rlog(msg);}}},setSuppressed:function(suppress){Util._suppress=suppress;},stack:function(){return(new Stack()).toString();},trace:function(){Util.log(Util.stack());}};function chain(u,v){var fn,calls=[];for(var ii=0;ii<arguments.length;ii++){calls.push(arguments[ii]);}
fn=function(event){event=event||window.event;for(var ii=0;ii<calls.length;ii++){if(calls[ii]&&calls[ii].apply(this,arguments)===false){return false;}else if(event&&event.cancelBubble){return true;}}
return true;};fn.toString=function(){return chain._toString(calls);};return fn;}
chain._toString=chain._toString||function(calls){var ret='chained fns',call=calls.filter();for(var i=0;i<calls.length;i++){ret+='\n'+calls[i].toString();}
return ret;};function addEventBase(obj,type,fn,name_hash)
{if(obj.addEventListener){obj.addEventListener(type,fn,false);}
else if(obj.attachEvent)
{var fn_name=type+fn+name_hash;obj["e"+fn_name]=fn;obj[fn_name]=function(){obj["e"+fn_name](window.event);}
obj.attachEvent("on"+type,obj[fn_name]);}
return fn;}
function removeEventBase(obj,type,fn,name_hash)
{if(obj.removeEventListener){obj.removeEventListener(type,fn,false);}
else if(obj.detachEvent)
{var fn_name=type+fn+name_hash;if(obj[fn_name]){obj.detachEvent("on"+type,obj[fn_name]);obj[fn_name]=null;obj["e"+fn_name]=null;}}}
window.Event=window.Event||function(){};Event.prototype._inherits_from_prototype=true;function $E(e){e=e||window.event;e=e||{};if(!e._inherits_from_prototype){for(var k in Event.prototype){try{e[k]=Event.prototype[k];}catch(ignored){}}}
return e;}
Event.prototype.kill=function(){this.stop();this.prevent();return false;}
Event.prototype.prevent=function(){this.returnValue=false;this.preventDefault&&this.preventDefault();}
Event.prototype.stop=function(){this.cancelBubble=true;this.stopPropagation&&this.stopPropagation();}
function EventHandlerRef(handler,container,index){this._handler=handler;this._container=container;this._index=index;}
copy_properties(EventHandlerRef.prototype,{remove:function(){delete this._handler;delete this._container[this._index];},fire:function(element,event){return this._handler.call(element,event);}});Event.prototype.getTarget=function(){var target=this.target||this.srcElement;if(target){return $$$(target);}
return null;}
Event.prototype.getModifiers=function(){var m={control:!!this.ctrlKey,shift:!!this.shiftKey,alt:!!this.altKey,meta:!!this.metaKey};m.access=ua.osx()?m.control:m.alt;m.any=m.control||m.shift||m.alt||m.meta;return m;}
function event_get_keypress_keycode(event){event=$E(event);if(!event){return false;}
switch(event.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(event.shiftKey){switch(event.keyCode){case 33:case 34:case 37:case 38:case 39:case 40:return null;}}
return event.keyCode;}
function Arbiter(){copy_properties(this,{_listeners:[],_events:{}});copy_properties(this,Arbiter);}
copy_properties(Arbiter,{SUBSCRIBE_NEW:'new',SUBSCRIBE_ALL:'all',BEHAVIOR_EVENT:'event',BEHAVIOR_PERSISTENT:'persistent',BEHAVIOR_STATE:'state',ALL:'all',LIVEMESSAGE:'livemessage',BOOTLOAD:'bootload',PAGE_TRANSITION:'pagetransitions/transition',PROFILE_PUBLISHER:'profile/publisher',subscribe:function(types,callback,subscription_policy){var a=Arbiter._getInstance(this);types=types||Arbiter.ALL;a._listeners.push({callback:callback,types:types});subscription_policy=subscription_policy||Arbiter.SUBSCRIBE_ALL;if(subscription_policy==Arbiter.SUBSCRIBE_ALL){if(!(types instanceof Array)){types=[types];}
var e;var type;var ret;for(var idx=0;idx<types.length;idx++){type=types[idx];if(typeof type!="string"){throw new TypeError("Event types must be strings.");}
if(type in a._events){for(var ii=0;ii<a._events[type].length;ii++){e=a._events[type][ii];if(Arbiter._checkType(e[0],types)){ret=callback.apply(null,e);if(ret===false){a._events[type].splice(ii,1);ii--;}}}}}}else if(subscription_policy!=Arbiter.SUBSCRIBE_NEW){throw new TypeError("Bad subscription policy.");}
return{arbiterID:a._listeners.length-1};},unsubscribe:function(token){if(!('arbiterID'in token)){throw new TypeError("Not an arbiter token.");}
delete Arbiter._getInstance(this)._listeners[token.arbiterID];},inform:function(type,data,behavior){var a=Arbiter._getInstance(this);var e=[type,data];var idx=null;behavior=behavior||Arbiter.BEHAVIOR_EVENT;if(behavior==Arbiter.BEHAVIOR_PERSISTENT){idx=a._events.length;if(!(type in a._events)){a._events[type]=[];}
a._events[type].push(e);a._events[type]._stateful=false;}else if(behavior==Arbiter.BEHAVIOR_STATE){idx=0;a._events[type]=[e];a._events[type]._stateful=true;}else if(type in a._events){a._events[type]._stateful=false;}
var res;for(var ii=0;ii<a._listeners.length;ii++){if(a._listeners[ii]){if(Arbiter._checkType(e[0],a._listeners[ii].types)){res=a._listeners[ii].callback.apply(null,e);if(res===false){if(idx!==null){a._events[type].splice(idx,1);}
break;}}}}},query:function(type){var a=Arbiter._getInstance(this);if(!(type in a._events)){return null;}
if(!a._events[type]._stateful){throw new Error("Querying state of an unstateful event.");}
if(a._events[type].length){return a._events[type][0];}
return null;},_instance:null,_getInstance:function(self){if(self instanceof Arbiter){return self;}
if(!Arbiter._instance){Arbiter._instance=new Arbiter();}
return Arbiter._instance;},_checkType:function(event_type,callback_type){if(callback_type==Arbiter.ALL){return true;}
if(event_type==callback_type){return true;}
if(callback_type.length){for(var ii=0;ii<callback_type.length;ii++){if(callback_type[ii]==event_type){return true;}}}
return false;}});Function.prototype.extend=function(superclass){if(typeof superclass!='string'){throw new TypeError('You must extend() with the name of a class, not the function object. '+'This generally means you need to replace "Dog.extend(Animal);" with '+'"Dog.extend(\'Animal\');".');}
if(!Metaprototype._arbiterHandle){Metaprototype._arbiterHandle=Arbiter.subscribe(Arbiter.BOOTLOAD,Metaprototype._onbootload.bind(Metaprototype));}
Metaprototype._queue(this,superclass);}
function Metaprototype(){}
copy_properties(Metaprototype,{_pending:[],_queue:function(subclass,superclass){this._pending.push({subclass:subclass,superclass:superclass});var src=this._pending;var dst=[];for(var ii=0;ii<src.length;++ii){var node=src[ii];for(var jj=0;jj<dst.length;++jj){if(window[dst[jj].superclass]==node.subclass){dst.splice(jj,0,node);break;}}
if(jj==dst.length){dst.push(node);}}
this._pending=dst;},_onbootload:function(type,data){this._update();},_update:function(){for(var ii=0;ii<this._pending.length;++ii){var node=this._pending[ii];var super_object=window[node.superclass];if(!super_object){continue;}
for(var jj=0;jj<this._pending.length;++jj){if(this._pending[jj].subclass==super_object){break;}}
if(jj==this._pending.length){this._pending.splice(ii,1);--ii;this._apply(node.subclass,super_object);}}},_apply:function(subclass,superclass){var superprototype=__metaprototype(superclass,0);var subprototype=__metaprototype(subclass,superprototype.prototype.__level+1);subprototype.parent=superprototype;}});function __metaprototype(obj,level){if(obj.__metaprototype){return obj.__metaprototype;}
var metaprototype=new Function();metaprototype.construct=__metaprototype_construct;metaprototype.prototype.construct=__metaprototype_wrap(obj,level,true);metaprototype.prototype.__level=level;metaprototype.base=obj;obj.prototype.parent=metaprototype;obj.__metaprototype=metaprototype;return metaprototype;}
function __metaprototype_construct(instance){__metaprototype_init(instance.parent);var parents=[];var obj=instance;while(obj.parent){parents.push(new_obj=new obj.parent());new_obj.__instance=instance;obj=obj.parent;}
instance.parent=parents[1];parents.reverse();parents.pop();instance.__parents=parents;instance.__instance=instance;return instance.parent.construct.apply(instance.parent,arguments);}
function __metaprototype_init(metaprototype){if(metaprototype.initialized)return;var base=metaprototype.base.prototype;if(metaprototype.parent){__metaprototype_init(metaprototype.parent);var parent_prototype=metaprototype.parent.prototype;for(i in parent_prototype){if(i!='__level'&&i!='construct'&&base[i]===undefined){base[i]=metaprototype.prototype[i]=parent_prototype[i]}}}
metaprototype.initialized=true;var level=metaprototype.prototype.__level;for(i in base){if(i!='parent'){base[i]=metaprototype.prototype[i]=__metaprototype_wrap(base[i],level);}}}
function __metaprototype_wrap(method,level,shift){if(typeof method!='function'||method.__prototyped){return method;}
var func=function(){var instance=this.__instance;if(instance){var old_parent=instance.parent;instance.parent=level?instance.__parents[level-1]:null;if(shift){var args=[];for(var i=1;i<arguments.length;i++){args.push(arguments[i]);}
var ret=method.apply(instance,args);}else{var ret=method.apply(instance,arguments);}
instance.parent=old_parent;return ret;}else{return method.apply(this,arguments);}}
func.__prototyped=true;return func;}
Function.prototype.bind=function(context){var argv=[arguments[0],this];var argc=arguments.length;for(var ii=1;ii<argc;ii++){argv.push(arguments[ii]);}
return bind.apply(null,argv);}
Function.prototype.shield=function(context){if(typeof this!='function'){throw new TypeException();}
var bound=this.bind.apply(this,to_array(arguments));return function(){return bound();}};Function.prototype.defer=function(msec){if(typeof this!='function'){throw new TypeError();}
msec=msec||0;return setTimeout(this,msec);};Function.prototype.recur=function(msec){if(typeof this!='function'){throw new TypeError();}
return setInterval(this,msec);};Function.prototype.occur=function(){if(typeof this!='function'){throw new TypeError();}
return this.apply(this,arguments);};Function.prototype.memoize=function(){if(typeof this!='function'){throw new TypeError();}
var cache={};var functor=this;return function(){var key=JSON.encode(arguments);if(!(key in cache)){cache[key]=functor.apply(this,arguments);}
return cache[key];};};Function.prototype.toString=(function(native_fn){return function(full){var raw_output=native_fn.call(this);if(full){return raw_output;}
var lines=raw_output.split('\n'),max_lines=5;if(lines.length>max_lines){lines.splice(3,lines.length-max_lines,'    ...');}
return lines.join('\n');};})(Function.prototype.toString);function bagofholding(){return undefined;}
function abstractMethod(){throw new Error('You must implement this function in your base class.');}
function identity(input){return input;}
function call_or_eval(obj,func,args_map){if(!func){return undefined;}
args_map=args_map||{};if(typeof(func)=='string'){var params=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,values(args_map));}
var CSS={hasClass:function(element,className){element=$(element);if(element&&className&&element.className){return new RegExp('\\b'+trim(className)+'\\b').test(element.className);}
return false;},addClass:function(element,className){element=$(element);if(element&&className){if(!CSS.hasClass(element,className)){className=trim(className);if(element.className){element.className+=' '+className;}else{element.className=className;}
window.CssManager&&CssManager.useClasses(className);}}
return this;},removeClass:function(element,className){element=$(element);if(element&&className&&element.className){className=trim(className);var regexp=new RegExp('\\b'+className+'\\b','g');element.className=element.className.replace(regexp,'');}
return this;},conditionClass:function(element,className,shouldShow){element=$(element);if(shouldShow){CSS.addClass(element,className);}else{CSS.removeClass(element,className);}},setClass:function(element,className){element=$(element,true);element.className=className;window.CssManager&&CssManager.useClasses(className);return this;},toggleClass:function(element,className){element=$(element);if(CSS.hasClass(element,className)){return CSS.removeClass(element,className);}else{return CSS.addClass(element,className);}},setStyle:function(element,name,value){element.style[name]=value;return element;},getStyle:function(element,property){function hyphenate(property){return property.replace(/[A-Z]/g,function(match){return'-'+match.toLowerCase();});}
if(window.getComputedStyle){return window.getComputedStyle(element,null).getPropertyValue(hyphenate(property));}
if(document.defaultView&&document.defaultView.getComputedStyle){var computedStyle=document.defaultView.getComputedStyle(element,null);if(computedStyle)
return computedStyle.getPropertyValue(hyphenate(property));if(property=="display")
return"none";Util.error("Can't retrieve requested style %q due to a bug in Safari",property);}
if(element.currentStyle){return element.currentStyle[property];}
return element.style[property];},setOpacity:function(element,opacity){element=$(element);var opaque=(opacity==1);try{element.style.opacity=(opaque?'':''+opacity);}catch(ignored){}
try{element.style.filter=(opaque?'':'alpha(opacity='+(opacity*100)+')');}catch(ignored){}},getOpacity:function(element){element=$(element);var opacity=CSS.getStyle(element,'filter');var val=null;if(opacity&&(val=/(\d+(?:\.\d+)?)/.exec(opacity))){return parseFloat(val.pop())/100;}else if(opacity=CSS.getStyle(element,'opacity')){return parseFloat(opacity);}else{return 1.0;}},Cursor:{kGrabbable:'grabbable',kGrabbing:'grabbing',kEditable:'editable',set:function(element,name){element=$(element);element=element||document.body;switch(name){case CSS.Cursor.kEditable:name='text';break;case CSS.Cursor.kGrabbable:if(ua.firefox()){name='-moz-grab';}else{name='move';}
break;case CSS.Cursor.kGrabbing:if(ua.firefox()){name='-moz-grabbing';}else{name='move';}
break;}
element.style.cursor=name;}}};var DOM={tryElement:function(id){if(typeof(id)=='undefined'){Util.error('Tried to get "undefined" element!');return null;}
var obj;if(typeof(id)=='string'){obj=document.getElementById(id);if(!(ua.ie()>=7)){return obj;}
if(!obj){return null;}else if(typeof(obj.id)=='string'&&obj.id==id){return obj;}else{var candidates=document.getElementsByName(id);if(!candidates||!candidates.length){return null;}
var maybe=[];for(var ii=0;ii<candidates.length;ii++){var c=candidates[ii];if(!c.id&&id){continue;}
if(typeof(c.id)=='string'&&c.id!=id){continue;}
maybe.push(candidates[ii]);}
if(!maybe.length){return null;}
return maybe[0];}}
return id;},getElement:function(id){var el=DOM.tryElement.apply(null,arguments);if(!el){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 el;},setText:function(el,text){if(ua.firefox()){el.textContent=text;}else{el.innerText=text;}},getText:function(el){if(ua.firefox()){return el.textContent;}else{return el.innerText;}},setContent:function(el,content){if(ua.ie()){for(var ii=el.childNodes.length-1;ii>=0;--ii){DOM.remove(el.childNodes[ii]);}}else{el.innerHTML='';}
if(content instanceof HTML){set_inner_html(el,content.toString());}else if(is_scalar(content)){content=document.createTextNode(content);el.appendChild(content);}else if(is_node(content)){el.appendChild(content);}else if(content instanceof Array){for(var ii=0;ii<content.length;ii++){var node=content[ii];if(!is_node(node)){node=document.createTextNode(node);}
el.appendChild(node);}}else{Util.error('No way to set content %q.',content);}},remove:function(element){element=$$$(element);if(element.removeNode){element.removeNode(true);}else{for(var ii=element.childNodes.length-1;ii>=0;--ii){DOM.remove(element.childNodes[ii]);}
element.parentNode.removeChild(element);}},create:function(element,attributes,children){element=document.createElement(element);if(attributes){attributes=copy_properties({},attributes);if(attributes.style){copy_properties(element.style,attributes.style);delete attributes.style;}
copy_properties(element,attributes);}
if(children!=undefined){DOM.setContent(element,children);}
return element;},scry:function(element,pattern){pattern=pattern.split('.');var tag=pattern[0]||null;if(!tag){return[];}
var cls=pattern[1]||null;var candidates=element.getElementsByTagName(tag);if(cls!==null){var satisfy=[];for(var ii=0;ii<candidates.length;ii++){if(CSS.hasClass(candidates[ii],cls)){satisfy.push(candidates[ii]);}}
candidates=satisfy;}
return candidates;},prependChild:function(parent,child){parent=$$$(parent);if(parent.firstChild){parent.insertBefore(child,parent.firstChild);}else{parent.appendChild(child);}},getCaretPosition:function(element){element=$$$(element);if(!is_node(element,['input','textarea'])){return{start:undefined,end:undefined};}
if(!document.selection){return{start:element.selectionStart,end:element.selectionEnd};}
if(is_node(element,'input')){var range=document.selection.createRange();return{start:-range.moveStart('character',-element.value.length),end:-range.moveEnd('character',-element.value.length)};}else{var range=document.selection.createRange();var range2=range.duplicate();range2.moveToElementText(element);range2.setEndPoint('StartToEnd',range);var end=element.value.length-range2.text.length;range2.setEndPoint('StartToStart',range);return{start:element.value.length-range2.text.length,end:end};}},addEvent:function(element,type,func,name_hash){return addEventBase(element,type,func,name_hash);}};var $N=DOM.create;var ge=DOM.tryElement;var $$=function _$$(rules){var args=[document].concat(Array.prototype.slice.apply(arguments));return DOM.scry.apply(null,args);}
var $$$=DOM.getElement;var remove_node=DOM.remove;var prependChild=DOM.prependChild;var get_caret_position=DOM.getCaretPosition;function is_node(o,of_type){if(typeof(Node)=='undefined'){Node=null;}
try{if(!o||!((Node!=undefined&&o instanceof Node)||o.nodeName)){return false;}}catch(ignored){return false;}
if(typeof(of_type)!=="undefined"){if(!(of_type instanceof Array)){of_type=[of_type];}
var name;try{name=new String(o.nodeName).toUpperCase();}catch(ignored){return false;}
for(var ii=0;ii<of_type.length;ii++){try{if(name==of_type[ii].toUpperCase()){return true;}}catch(ignored){}}
return false;}
return true;}
function is_descendent(base_obj,target_id){var target_obj=ge(target_id);if(base_obj==null)return;while(base_obj!=target_obj){if(base_obj.parentNode){base_obj=base_obj.parentNode;}else{return false;}}
return true;}
function iterTraverseDom(root,visitCb){var c=root,n=null;var it=0;do{n=c.firstChild;if(!n){if(visitCb(c)==false)
return;n=c.nextSibling;}
if(!n){var tmp=c;do{n=tmp.parentNode;if(n==root)
break;if(visitCb(n)==false)
return;tmp=n;n=n.nextSibling;}
while(!n);}
c=n;}
while(c!=root);}
function insertAfter(parent,child,elem){if(parent!=child.parentNode){Util.error('child is not really a child of parent - wtf, seriously.');}
if(child.nextSibling){var ret=parent.insertBefore(elem,child.nextSibling);}else{var ret=parent.appendChild(elem);}
if(!ret){return null;}
return elem;}
function set_caret_position(obj,start,end){if(document.selection){if(obj.tagName=='TEXTAREA'){var i=obj.value.indexOf("\r",0);while(i!=-1&&i<end){end--;if(i<start){start--;}
i=obj.value.indexOf("\r",i+1);}}
var range=obj.createTextRange();range.collapse(true);range.moveStart('character',start);if(end!=undefined){range.moveEnd('character',end-start);}
range.select();}else{obj.selectionStart=start;var sel_end=end==undefined?start:end;obj.selectionEnd=Math.min(sel_end,obj.value.length);obj.focus();}}
var onloadRegister=window.onloadRegister||function(h){onloadhooks.push(h);};var onloadhooks=window.onloadhooks||[];var onafterloadRegister=window.onafterloadRegister||function(h){onafterloadhooks.push(h);};var onafterloadhooks=window.onafterloadhooks||[];function wait_for_load(element,e,f){f=bind(element,f,e);if(window.loaded){return f();}
switch((e||event).type){case'load':onloadRegister(f);return;case'click':if(element.original_cursor===undefined){element.original_cursor=element.style.cursor;}
if(document.body.original_cursor===undefined){document.body.original_cursor=document.body.style.cursor;}
element.style.cursor=document.body.style.cursor='progress';onafterloadRegister(function(){element.style.cursor=element.original_cursor;document.body.style.cursor=document.body.original_cursor;element.original_cursor=document.body.original_cursor=undefined;if(element.tagName.toLowerCase()=='a'){var original_event=window.event;window.event=e;var ret_value=element.onclick.call(element,e);window.event=original_event;if(ret_value!==false&&element.href){window.location.href=element.href;}}else if(element.click){element.click();}});break;}
return false;};function bind(obj,method){var args=[];for(var ii=2;ii<arguments.length;ii++){args.push(arguments[ii]);}
var fn=function(){var _obj=obj||(this==window?false:this);var _args=args.slice();for(var jj=0;jj<arguments.length;jj++){_args.push(arguments[jj]);}
if(typeof(method)=="string"){if(_obj[method]){return _obj[method].apply(_obj,_args);}}else{return method.apply(_obj,_args);}};if(typeof method=='string'){fn.name=method;}else if(method&&method.name){fn.name=method.name;}
fn.toString=function(){return bind._toString(obj,args,method);};return fn;};bind._toString=bind._toString||function(obj,args,method){return(typeof method=='string')?('late bind<'+method+'>'):('bound<'+method.toString()+'>');};function goURI(uri){uri=uri.toString();if(window.PageTransitions&&PageTransitions.isInitialized()){PageTransitions.go(uri);}else if(window.location.href==uri){window.location.reload();}else{window.location.href=uri;}}
var PrimordialBootloader=window.PrimordialBootloader||{loaded:[],done:function(names){PrimordialBootloader.loaded.push(names);}};var Bootloader=window.Bootloader||{done:PrimordialBootloader.done};appid=1;var app_1=new fbjs_sandbox(appid);app_1.bootstrap();
