/* Source: Backing Store */ /* Location: js/fbml.js r109427 */ /* Machine: 10.16.140.109 */ /* Generated: July 15th 2008 12:34:50 AM PDT */ /* HTTP Host: static.ak.fbcdn.net */ 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=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 promptPermission(app_id,perms,next_js,close_js){var async=new AsyncRequest().setURI('/fbml/ajax/permissions.php').setData({app_id:app_id,perms:perms});new Dialog().setAsync(async).setHandler(function(next_js,button){next_js();Dialog.getCurrent()._submitForm('POST','/fbml/ajax/permissions.php',button);return false;}.bind(this,next_js)).setCloseHandler(close_js).show();} 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);var attr=el.getAttributeNode(attr);if(attr?attr.specified:false){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;i0),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('req_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=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=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;i1){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_livemessage(appid){var proto=function(event_name,callback_fn){if(!event_name){throw('Parameter "event_name" must be non-empty.');} var priv=fbjs_private.get(this);priv.appid=appid;priv.event_name=event_name;priv.send_success_handler=null;priv.send_error_handler=null;if(window.livemessage_dispatcher){livemessage_dispatcher.registerHandler(appid,event_name,callback_fn);}else{if(!window.pendingLiveMessageCallbackRegistrations){window.pendingLiveMessageCallbackRegistrations=[];} window.pendingLiveMessageCallbackRegistrations.push({'app_id':appid,'event_name':event_name,'callback_fn':callback_fn});}} for(var i in fbjs_livemessage.prototype){proto.prototype[i]=fbjs_livemessage.prototype[i];} return proto;} fbjs_livemessage.prototype.send=function(recipient,message){if(!recipient){throw('Parameter "recipient" must be non-empty.');} var priv=fbjs_private.get(this);new AsyncRequest().setURI('/fbml/ajax/livemessage_send.php').setData({app_id:priv.appid,recipient:recipient,event_name:priv.event_name,message:message}).setMethod('POST').setHandler(function(response){payload=response.getPayload();if(payload.error_code){var error_handler=priv.send_error_handler;if(error_handler){error_handler(payload.error_code,payload.error_msg,recipient,message);}}else{var success_handler=priv.send_success_handler;if(success_handler){success_handler(recipient,message);}}}).setErrorHandler(function(response){var error_handler=priv.send_error_handler;if(error_handler){error_handler(response.getError(),response.getErrorSummary(),recipient,message);}}).send();} fbjs_livemessage.prototype.setSendSuccessHandler=function(callback_fn){var priv=fbjs_private.get(this);priv.send_success_handler=callback_fn;return this;} fbjs_livemessage.prototype.setSendErrorHandler=function(callback_fn){var priv=fbjs_private.get(this);priv.send_error_handler=callback_fn;return this;} fbjs_livemessage.prototype.setShutdownHandler=function(callback_fn){var appid=fbjs_private.get(this).appid;if(window.livemessage_dispatcher){livemessage_dispatcher.registerShutdownHandler(appid,callback_fn);}else{if(!window.pendingLiveMessageShutdownRegistrations){window.pendingLiveMessageShutdownRegistrations=[];} window.pendingLiveMessageShutdownRegistrations.push({'app_id':appid,'callback_fn':callback_fn});} return this;} fbjs_livemessage.prototype.setRestartHandler=function(callback_fn){var appid=fbjs_private.get(this).appid;if(window.livemessage_dispatcher){livemessage_dispatcher.registerRestartHandler(appid,callback_fn);}else{if(!window.pendingLiveMessageRestartRegistrations){window.pendingLiveMessageRestartRegistrations=[];} window.pendingLiveMessageRestartRegistrations.push({'app_id':appid,'callback_fn':callback_fn});} 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=appid;this.main=eval('a'+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