/*    HTTP Host:  b.static.ak.fbcdn.net                                        */
/*    Generated:  February 6th 2010 12:09:22 PM PST                            */
/*      Machine:  10.16.139.108                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/diounk121a800ko8.pkg.js h:96rb5isk                        */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/diounk121a800ko8.pkg.js                                   */

if (window.CavalryLogger) { CavalryLogger.start_js(["js\/diounk121a800ko8.pkg.js"]); }


function ComposerAttachment(){this._container=null;}
copy_properties(ComposerAttachment,{newFromURL:function(url,errorCallback){if(!/(?:https?:\/\/)?\w+\.\w+/.test(url)){return false;}
var attachment=new ComposerAttachment();attachment.url=url;new AsyncRequest().setURI('/ajax/inbox/ajax.php').setData({action:'attachment',url:url}).setHandler(attachment._asyncCallback.bind(attachment)).setErrorHandler(errorCallback).send();return attachment;},setupThumbnails:function(imgs,obj){var sandbox=new ImageSandbox();sandbox.onfinish=function(){imgs=sandbox.getImages();for(var i=imgs.length-1;i>=0;i--){if(imgs[i].width&&(imgs[i].height<50||imgs[i].width<50||imgs[i].height/imgs[i].width>3||imgs[i].width/imgs[i].height>3)){imgs.splice(i,1);}}
if(!imgs.length){CSS.removeClass(obj,'loading');CSS.removeClass(obj.parentNode,'has_image');var input=obj;while(input.parentNode&&input.tagName.toLowerCase()!='form'){input=input.parentNode;}
input=input.getElementsByTagName('input');for(var i=0;i<input.length;i++){if(input[i].name.indexOf('[params][images]')!=-1){input[i].parentNode.removeChild(input[i]);}}
return;}
for(var si=0;si<imgs.length-1;si++){for(var sj=imgs.length-1;sj>=si;sj--){if(imgs[si].width*imgs[si].height<imgs[sj].width*imgs[sj].height){temp=imgs[si];imgs[si]=imgs[sj];imgs[sj]=temp;}}}
var input=obj;while(input.parentNode&&input.tagName.toLowerCase()!='form'){input=input.parentNode;}
input=input.getElementsByTagName('input');for(var i=0;i<input.length;i++){if(input[i].name.indexOf('[params][images]')!=-1){input=input[i];break;}}
CSS.removeClass(obj,'loading');new ThumbnailSelector(obj,input,imgs);}.bind(this);sandbox.loadImages(imgs);}});copy_properties(ComposerAttachment.prototype,{containerReady:function(obj,show_loading){this._container=obj;var inputs=obj.getElementsByTagName('input');var html=[''];for(var i=0;i<inputs.length;i++){if(inputs[i].type=='text'||inputs[i].type=='hidden'){html.push('<input type="hidden" name="'+htmlspecialchars(inputs[i].name)+'" value="'+htmlspecialchars(inputs[i].value)+'" />');}}
if(show_loading){html.push('&nbsp;');obj.innerHTML=html.join('');CSS.addClass(obj,'share_attachment_loading');}else{obj.innerHTML+=html.join('');}},_renderInputsRecursive:function(name,params){if(params===null){return'';}
var html=[];if(typeof(params)=='object'){for(var i in params){html.push(this._renderInputsRecursive(name+'['+i+']',params[i]));}}else if(typeof(params)!='function'){html.push('<input type="hidden" name="',name,'" value="',htmlspecialchars(params),'" />');}
return html.join('');},_asyncCallback:function(response){var payload=response.getPayload();var html=[payload.html];html.push(this._renderInputsRecursive('attachment[params]',payload.params));html.push('<input type="hidden" name="attachment[type]" value="',payload.type,'" />');CSS.removeClass(this._container,'share_attachment_loading');set_inner_html(this._container,html.join(''));}});function ThumbnailSelector(obj,input,images){var html=['<div class="thumbnail_stage"><h4>'+_tx("Choose a Thumbnail")+'</h4><div class="selector clearfix"><div class="arrows clearfix">','<span class="left"><a href="#" class="arrow disabled">&nbsp;</a></span>','<span class="right"><a href="#" class="arrow ',images.length>1?'enabled':'disabled','">&nbsp;</a></span>','</div><div class="counter"><span>1 of ',images.length,'</span></div></div>'];for(var k=0;k<images.length;k++){html.push('<div class="thumbnail',k==0?' thumbnail_selected':' thumbnail_unselected','">','<img class="img_loading" src="',images[k].src,'" onload="adjustImage(this);" />','</div>');}
html.push('<label style="white-space:nowrap"><input name="no_picture" type="checkbox" onclick="this.parentNode.parentNode.parentNode.thumbnail.use_thumbnail(this.checked)" />'+_tx("No Picture")+'</label></div>');obj.innerHTML=html.join('');this.images=images;this.input=input;input.value=this.images[0].src;this.obj=obj;this.obj.thumbnail=this;this.label=obj.getElementsByTagName('span')[2];this.index=0;var anchors=obj.getElementsByTagName('a');this.left=anchors[0];this.right=anchors[1];this.left.onclick=this.left_arrow_press.bind(this);this.right.onclick=this.right_arrow_press.bind(this);this.left.onselectstart=this.right.onselectstart=function(){return false};this.left.onmousedown=this.right.onmousedown=this._onmousedown;this.left.onmouseout=this.right.onmouseout=this._onmouseout;}
copy_properties(ThumbnailSelector.prototype,{use_thumbnail:function(checkbox){if(!checkbox){this.move_selection(0);CSS.removeClass(this.obj,'thumbnail_dont_use');}else{this.input.value='';CSS.addClass(this.obj,'thumbnail_dont_use');}},_onmousedown:function(){CSS.addClass(this,'active');return false;},_onmouseout:function(){CSS.removeClass(this,'active');},left_arrow_press:function(){CSS.addClass(this.left,'active');this.move_selection(-1);return false;},right_arrow_press:function(){CSS.removeClass(this.right,'active');this.move_selection(1);return false;},move_selection:function(offset){var index=this.index+offset;if(index>=0&&index<this.images.length){var divs=this.obj.getElementsByTagName('div');var j=0;this.index=index;for(var i=0;i<divs.length;i++){var className=divs[i].className;if(!CSS.hasClass(divs[i],'thumbnail ')){continue;}
var selected=j==index;if(className.indexOf(selected?'_unselected':'_selected')!=-1){CSS.setClass(divs[i],className.replace(/thumbnail_(?:un)?selected/,selected?'thumbnail_selected':'thumbnail_unselected'));}
j++;}
this.label.innerHTML=_tx("{selected} of {total}",{selected:(index+1),total:j});CSS.setClass(this.left,this.left.className.replace(/[^ ]+abled/,index==0?'disabled':'enabled'));CSS.setClass(this.right,this.right.className.replace(/[^ ]+abled/,index==this.images.length-1?'disabled':'enabled'));this.input.value=this.images[index].src;}}});function ImageSandbox(){this.obj=document.createElement('div');this.obj.style.left=this.obj.style.top='-100px';this.obj.style.width=this.obj.style.height='1px';this.obj.style.overflow='hidden';this.images=0;this.done=0;DOM.getRootElement().appendChild(this.obj);}
copy_properties(ImageSandbox.prototype,{loadImages:function(imgs){this.images=imgs.length;for(var i=0;i<imgs.length;i++){new ImageSandboxLoader(this,imgs[i]);}},onImageLoaded:function(img_loader){this.done++;this._stateChange();},onImageFailed:function(img_loader){img_loader.destroy();this.images--;this._stateChange();},getImages:function(){var imgs=new Array();var collection=this.obj.getElementsByTagName('img');for(var i=0;i<collection.length;i++){imgs.push(collection[i]);}
return imgs;},_stateChange:function(){if(this.done==this.images){if(this.onfinish){this.onfinish();}}}});function ImageSandboxLoader(sandbox,img){this._timeout=4000;this._start=new Date().getTime();this._sandbox=sandbox;if(typeof img!='object'){img={src:img};}
this._obj=document.createElement('img');this._obj.onload=function(){if(this._pollImage)this._pollImage(1);}.bind(this);this._obj.onerror=function(){if(this._pollImage)this._pollImage(2);}.bind(this);copy_properties(this._obj,img);this._sandbox.obj.appendChild(this._obj);if(this._pollImage!==null){this._pollImage();}}
copy_properties(ImageSandboxLoader.prototype,{_pollImage:function(state){if(state==1){this._pollImage=null;this._sandbox.onImageLoaded(this);}else if(state==2){this._pollImage=null;this._sandbox.onImageFailed(this);}else{if(image_has_failed(this._obj)){this._pollImage(2);}else if(image_has_loaded(this._obj)){this._pollImage(1);}else if((this._start+this._timeout)<new Date().getTime()){this._pollImage(2);}else{setTimeout(function(){if(this._pollImage)this._pollImage();}.bind(this),20);}}},destroy:function(){DOM.remove(this._obj);this._obj=null;}});

function UrlDetector(element){this.element=element;this.lastCharCount=0;this.lastScrapedURL=null;this.detectionInterval=null;this.suppressDetection=bagofholding;Event.listen(element,'focus',this.startDetectionInterval.bind(this));Event.listen(element,'blur',this.stopDetectionInterval.bind(this));var useValue=DOM.isNode(this.element,['input','textarea']);copy_properties(this,{getText:useValue?function(){return this.element.value;}:function(){return DOM.getText(this.element);},setText:useValue?function(value){this.element.value=value;}:function(text){DOM.setText(this.element,text);}});};UrlDetector.mixin('Arbiter',{getText:bagofholding,setText:bagofholding,setSuppressDetectionCheck:function(fn){this.suppressDetection=fn;},startDetectionInterval:function(){if(this.detectionInterval||this.suppressDetection()){return;}
this.detectionInterval=setInterval(this.detectionIntervalFire.bind(this),250);},stopDetectionInterval:function(){this.detectionInterval=clearInterval(this.detectionInterval);},detectionIntervalFire:function(){if(this.suppressDetection()){return;}
var charCount=this.getText().length;if((charCount-this.lastCharCount)>5||(this.lastCharCount==0&&charCount>1)){var pastedText=true;}
this.lastCharCount=charCount;var url=this.detectUrl(pastedText);if(url){this.inform('urlDetected',url);}},detectUrl:function(pastedText){var url='',text=this.getText(),startPos=endPos=-1;if(pastedText){url=text.match(/www\.\S*/i);if(url){startPos=text.indexOf(url[0]);endPos=startPos+url[0].length;url="http://"+url[0];}else{var match=text.match(/(http|fb):\/\/\S*/i);if(match){url=match[0];startPos=text.indexOf(match[0]);endPos=startPos+match[0].length;}}}else{url=text.match(/www\.\S*[\s|\)|\!]/i);if(url){startPos=text.indexOf(url[0]);endPos=startPos+url[0].length;url="http://"+url[0];}else{var match=text.match(/(http|fb):\/\/\S*[\s|\)|\!]/i);if(match){url=match[0];startPos=text.indexOf(match[0]);endPos=startPos+match[0].length;}}}
if(url){url=url.replace(/[\s|\)|\!]/g,'');var lastChar=url.charAt(url.length-1);if(lastChar.match(/[,|.]/)){url=url.substr(0,url.length-1);}
if(url!=this.lastScrapedURL){this.lastScrapedURL=url;if(url.search('fb:')==0){this.setText(text.substr(0,startPos)+text.substr(endPos));}}else{url='';}}
return url;}});

function fix_attachment_more_menu_alignment(more_link){var attachment_buttons_list=ge('attachment_buttons_list');var total_width=attachment_buttons_list.offsetWidth;if(more_link){var more_offset=Vector2.getElementPosition(more_link).x;var attachments_offset=Vector2.getElementPosition(attachment_buttons_list).x;var offset=more_offset-attachments_offset;var icon_width=more_link.offsetWidth;var space_left=total_width-offset;if(space_left>=icon_width&&space_left<126){var more_menu=ge('wall_more_menu');var right_margin=0;more_menu.style.left='auto';more_menu.style.right=right_margin+'px';}}}
function wall_video_thumb_adjust(play_img_div,thumb_img){if(ua.ie()>=6&&ua.ie()<7){play_img_div.style.marginTop=(-1*thumb_img.height-3)+'px';play_img_div.style.paddingTop=(thumb_img.height-19)+'px';}
play_img_div.style.display='block';}
function attachments(context_id){this.attachment_added=false;this.attachment_oid=null;this.attachment_app_id=null;this.is_share=false;this.attached_share=false;this.scrape_last_count=0;this.dialog=null;this.wall_attachments={};this.last_url_scraped=null;this.context=context_id;this.edit_container_id='attachment_edit_container_'+context_id;this.edit_loading_id='attachment_edit_loading_'+context_id;this.edit_id='attachment_edit_'+context_id;this.view_container_id='attachment_view_container_'+context_id;this.view_wrapper_id='attachment_view_wrapper_'+context_id;this.view_id='attachment_view_'+context_id;this.remove_id='attachment_remove_'+context_id;this.view_loading_id='attachment_view_loading_'+context_id;this.is_active=false;}
attachments.prototype.show_edit_loading=function(){show(this.edit_loading_id);}
attachments.prototype.hide_edit_loading=function(){hide(this.edit_loading_id);}
attachments.prototype.show_attachment_edit=function(title,html,share_type,ajax_params){this.is_active=true;if(this.dialog){return;}
var is_app=(share_type==14);this.is_share=(share_type==100);var wrapper='<div id="'+this.edit_container_id+'">'+'<div id="'+this.edit_loading_id+'">&nbsp;</div>'+'</div>';this.dialog=new Dialog().setImmediateRendering(true).setClassName('attachment_dialog').setTitle(title).setBody(wrapper).setStackable(true).setButtons([Dialog.newButton('attach',_tx("Attach"),'',function(){if(this.is_share){this._share_attach();}else{this._attach(is_app,ajax_params,true);}
this.dialog.hide();this.dialog=null;this.is_active=false;}.bind(this)),Dialog.newButton('cancel',_tx("Cancel"),'inputaux',function(){this.dialog.hide();this.remove_attachment_view();this.dialog=null;this.is_active=false;}.bind(this))]).show();var container=ge(this.edit_container_id);var div=document.createElement('div');div.className='share_stage';CSS.addClass(div,'attachment_edit');div.id=this.edit_id;div.is_app=is_app;container.appendChild(div);set_inner_html(div,html);if(this.is_share){placeholderSetup('share_link');if(ua.ie()<7){$('share_link').focus();}}
return div;}
attachments.prototype._show_attachment_view=function(html,is_app){var container=ge(this.view_container_id);var div=document.createElement('div');div.className='share_stage';CSS.addClass(div,'attachment_view');div.id=this.view_id;div.is_app=is_app;container.appendChild(div);set_inner_html(div,html);hide('attachment_buttons_list');var wrapper=ge(this.view_wrapper_id);wrapper.style.display='block';this.attachment_added=true;return div;}
attachments.prototype.remove_attachment_view=function(){var container=ge(this.view_container_id);var attachment=ge(this.view_id);if(this.attachment_added&&attachment){this.removed=true;container.removeChild(attachment);hide(this.view_wrapper_id);if(ge('attachment_buttons_list')){show('attachment_buttons_list');}
var attachment_remove=ge(this.remove_id);CSS.setClass(attachment_remove,attachment_remove.className.replace(' edit',''));}
this.attachment_added=false;this.attachment_oid=null;this.attachment_app_id=null;this.is_share=false;this.attached_share=false;}
attachments.prototype.get_all_form_elements=function(attachment){var inputs=[];if(attachment){var html_input=attachment.getElementsByTagName('input');for(var i=0;i<html_input.length;i++){inputs.push(html_input[i]);}
var html_select=attachment.getElementsByTagName('select');for(var i=0;i<html_select.length;i++){inputs.push(html_select[i]);}
var html_textarea=attachment.getElementsByTagName('textarea');for(var i=0;i<html_textarea.length;i++){inputs.push(html_textarea[i]);}}
return inputs;}
attachments.prototype._add_attachment_input_data=function(data,attachment){if(!attachment){return false;}
var inputs=this.get_all_form_elements(attachment);if(attachment.is_app){data['attachment']={'app':{},'type':14};for(var i=0;i<inputs.length;i++){if(!(inputs[i].type=="radio"||inputs[i].type=="checkbox")||inputs[i].checked){data['attachment']['app'][inputs[i].name]=inputs[i].value;}}}else{var has_type=false;for(var i=0;i<inputs.length;i++){if(inputs[i].name=='attachment[type]'){has_type=true;}
if(inputs[i].name=='attachment[params][url]'){if(!inputs[i].value||inputs[i].value=='http://'){return false;}}
data[inputs[i].name]=inputs[i].value;}
if(!has_type){return false;}}
data['context']=this.context;return true;}
attachments.prototype._attach=function(is_app,ajax_params,has_form_data){var asyncData={};if(has_form_data){var attachment=ge(this.edit_id);var added=this._add_attachment_input_data(asyncData,attachment);if(!added){return;}}
if(ajax_params){for(var param in ajax_params){asyncData[param]=ajax_params[param];}}
var loading=ge(this.view_loading_id);loading.style.display='block';var view_container=this._show_attachment_view('',is_app);var onDone=function(response){var responseObj=response.getPayload();if(!view_container.removed){hide(this.view_loading_id);set_inner_html(view_container,responseObj['html']);this.attachment_oid=responseObj['oid'];this.attachment_app_id=responseObj['app_id'];}}.bind(this);new AsyncRequest().setHandler(onDone).setURI('/ajax/attachments.php').setErrorHandler(this.remove_attachment_view).setTransportErrorHandler(this.remove_attachment_view).setData(asyncData).send();}
attachments.prototype.add_post_data=function(post_data){if(this.attachment_added){if(this.attached_share){this._add_attachment_input_data(post_data,ge(this.view_id));}else{post_data['attachment']={'oid':this.attachment_oid,'app_id':this.attachment_app_id};}}}
attachments.prototype.prepare_wall_post=function(){var attachment=ge(this.view_id);if(attachment){var inputs=this.get_all_form_elements(attachment);for(var i=0;i<inputs.length;i++){inputs[i].disabled=true;}}}
attachments.prototype.show_full_attachment=function(post_id){if(typeof this.wall_attachments[post_id]!='string'){return;}
hide('attachment_compact_'+post_id);hide('attached_item_info_'+post_id);hide('attachment_compact_td_'+post_id);attachment_div=ge('wall_attachment_'+post_id);set_inner_html(attachment_div,this.wall_attachments[post_id]);}
attachments.prototype.fix_app_inputs_on_send=function(){var attachment=ge(this.view_id);if(!this.attachment_added||!attachment){return;}
if(!this.attached_share){new_inputs=[];new_inputs.push(create_hidden_input('attachment[oid]',this.attachment_oid));new_inputs.push(create_hidden_input('attachment[app_id]',this.attachment_app_id));if(attachment.is_app){new_inputs.push(create_hidden_input('attachment[type]',14));new_inputs.push(create_hidden_input('attachment[app][message_sent]',true));}
for(var i=0,il=new_inputs.length;i<il;i++){attachment.appendChild(new_inputs[i]);}}}
attachments.prototype.share_attach_from_dialog=function(){this._share_attach();Dialog.getCurrent().hide();this.dialog=null;}
attachments.prototype._share_attach=function(){var share_link=ge('share_link');var url=share_link.value;if(url&&url!='http://'){this._share_submit_url(url);}}
attachments.prototype._share_submit_url=function(url){this._show_attachment_view(this.share_html_block,false);var view_container=ge(this.view_container_id);var stage_area=view_container.childNodes[0].childNodes[0].childNodes[0];this._attach_link_url(stage_area,url,true);var attachment_remove=ge(this.remove_id);attachment_remove.className+=' edit';this.attached_share=true;}
attachments.prototype._attach_link_url=function(obj,url,show_loading){var errorCallback=function(resp){this.remove_attachment_view();}.bind(this);var attachment=ComposerAttachment.newFromURL(url,errorCallback);attachment.containerReady(obj,show_loading);}
attachments.prototype._is_fb_code_url=function(url){return url.search('fb:')==0;}
attachments.prototype._auto_attach_link=function(event,url){if(this._is_fb_code_url(url)){var data={'code':url,'context':this.context};this._attach(true,data,false);}else{this._share_submit_url(url);}}
attachments.prototype.register_url_detection=function(textarea_id){var detector=new UrlDetector($(textarea_id));detector.subscribe('urlDetected',this._auto_attach_link.bind(this));detector.setSuppressDetectionCheck(function(){return this.attachment_added;}.bind(this));}

function FeedFormBase(){this._storyType=63;this._feedData=null;this._uri='/fbml/ajax/prompt_feed.php';this._buttonCallback=null;this._isNile=false;this._supportsUserMessage=false;this._userMessagePrompt='';this._userMessage={value:''};this._currentSize=0;this._connectLocation=0;this._postId=null;this._hasTargets=false;this._profileType=0;};FeedFormBase.SIZES={"small":1,"medium":2};FeedFormBase.AUTO_PUBLISH_OPTIONS={"never":2,"small":4,"medium":5};FeedFormBase.PROFILE_TYPE={"user":101,"page":102,"group":103}
FeedFormBase.shouldShowLoadingToSelf=false;FeedFormBase.shouldShowLoadingToOthers=false;FeedFormBase.prototype.setStoryType=function(storyType){this._storyType=storyType;return this;};FeedFormBase.prototype.setProfileType=function(val){this._profileType=val;return this;}
FeedFormBase.prototype.setForm=function(id){if(this._elements){Util.error('Cannot use both setForm and setElements.  Pick one or the other.');return null;}
this._form=$(id);return this;};FeedFormBase.prototype.setElements=function(elements){if(this._form){Util.error('Cannot use both setForm and setElements.  Pick one or the other.');return null;}
this._elements=elements;return this;}
FeedFormBase.prototype.setFeedData=function(feedData){this._feedData=feedData;return this;};FeedFormBase.prototype.setAppId=function(appId){this._appid=appId;return this;};FeedFormBase.prototype.setConnectLocation=function(connectLocation){this._connectLocation=connectLocation;return this;};FeedFormBase.prototype.setUserMessagePrompt=function(userMessagePrompt){this._userMessagePrompt=userMessagePrompt;return this;};FeedFormBase.prototype.setUserMessage=function(userMessage){if(userMessage){if(typeof userMessage=='string'){this._userMessage={value:userMessage};}else{this._userMessage=userMessage;}}
return this;};FeedFormBase.prototype.setURI=function(uri){this._uri=uri;return this;};FeedFormBase.prototype.setContinuation=function(continuation){this._continuation=continuation;return this;};FeedFormBase.prototype.setButtonCallback=function(callback){this._buttonCallback=callback;return this;}
FeedFormBase.prototype._selectSize=function(option){var size=option['size'];if(size!=this._currentSize){CSS.removeClass(this._selectedSize,'Tabset_selected');animation($('preview_'+this._currentSize)).to('opacity',0).hide().duration(150).go();animation($('preview_'+size)).duration(150).checkpoint().show().from('opacity',0).to('opacity',1).duration(150).go();this._selectedSize=option;this._currentSize=size;CSS.addClass(this._selectedSize,'Tabset_selected');}
return false;};FeedFormBase.prototype.attachHandlers=function(dialog){if(!this._isNile){this._attachSizeHandlers(dialog);}
var links=$('preview_container').scry('a');links.forEach(function(link){link.listen('click',function(e){e.kill();})});if(this._supportsUserMessage){$('feedform_user_message').focus();}
return this;}
FeedFormBase.prototype._attachSizeHandlers=function(dialog){var options=this._selectorOptions;var id_prefix=this._feedformFilter;for(var i=0;i<options.length;i++){var node=$(id_prefix+'_'+options[i]['size']);var anchor=$(id_prefix+'_'+options[i]['size']+'_anchor');var size=options[i]['size'];options[i]['node']=node;if(CSS.hasClass(node,'Tabset_selected')){this._selectedSize=options[i];this._currentSize=size;}
addEventBase(anchor,'click',this._selectSize.bind(this,options[i]),size);}
return true;}
FeedFormBase.prototype._finish=function(){this._enableSubmitButtons();if(this._dialog){this._dialog.hide();}
if(this._continuation){this._continuation(this._postId,null,{user_message:this._userMessage.value});}};FeedFormBase.prototype.shouldShowLoading=function(){return false;}
FeedFormBase.prototype.showDialog=function(async){this._dialog=new Dialog().setContentWidth(580).setClassName('interaction_form').setAsync(async).setHandler(this.handleButton.bind(this)).onloadRegister(this.attachHandlers.bind(this));if(this.shouldShowLoading()){this._dialog.show();}
return this;};FeedFormBase.prototype._confirm=function(data){if(this._isNile&&this._supportsUserMessage){user_message=$('feedform_user_message').value;this._userMessage.value=data.user_message=user_message;}
new AsyncRequest().setURI(this._uri).setData(data).setNectarActionData().setHandler(this.showConfirmed.bind(this)).send();};FeedFormBase.prototype.handleButton=function(button){if(this._buttonCallback){this._buttonCallback(button);}
if(button.name=="publish"){var buttonObj=this._dialog?this._dialog.getButtonElement(button.name):button;if(buttonObj){buttonObj.disabled=true;}
this.confirmFeed();return false;}else if(button.name=="cancel"){this.cancelFeed();}};FeedFormBase.prototype.cancelFeed=function(){this._finish();}
FeedFormBase.prototype.attachProperties=function(userData){copy_properties(this,userData);if(this._continuationJS){this._continuation=new Function(this._continuationJS);delete this._continuationJS;}
return this;};FeedFormBase.prototype._showBase=function(data){var async=new AsyncRequest().setURI(this._uri).setHandler(function(r){var user_data=r.getPayload().userData;this.attachProperties(user_data);if(user_data['no_dialog_shown']){this._finish();}
return true;}.bind(this)).setNectarActionData().setErrorHandler(this._showApplicationError.bind(this)).setData(data);this.showDialog(async);return this;};FeedFormBase.prototype.showConfirmed=function(response){var msg;if(this._profileType==FeedFormBase.PROFILE_TYPE['page']){msg=_tx("The post is now visible on the page's Wall.");}else if(this._profileType==FeedFormBase.PROFILE_TYPE['group']){msg=_tx("The post is now visible on the group's Wall.");}else if(this._hasTargets){msg=_tx("The post is now visible on your friend's Wall.");}else{msg=_tx("The post is now visible on your Wall and your friends' home pages.");}
this.showConfirmedWithMessage(msg,response);}
FeedFormBase.prototype.showConfirmedWithMessage=function(msg,response){this.attachProperties(response.payload.userData);var confirmation='<div class="interim_status">'+msg+'</div>';var title=_tx("Post Published");if(this._dialog){this._dialog.setBody(confirmation);this._dialog.setTitle(title);this._dialog.setButtons(Dialog.OK);this._dialog.setButtonsMessage('');}else{$('dialog_body').innerHTML=confirmation;var publishButton=ge('publish');if(publishButton!=null){DOM.remove(publishButton);}
var cancelButton=ge('cancel');if(cancelButton!=null){cancelButton.value=_tx("Done");}}
setTimeout(this._finish.bind(this),2500);return false;};FeedFormBase.prototype._enableSubmitButtons=function(){var feedFormSubmitButtons=['send','publish'];for(var i=0;i<feedFormSubmitButtons.length;i++){var button=ge(feedFormSubmitButtons[i]);if(button){button.disabled=false;break;}}}
FeedFormBase.prototype._showApplicationError=function(response){this._enableSubmitButtons();var userData=response.getPayload().userData;var showError=function(showMsg){var msg=(showMsg&&(userData.errorMessage!=null))?userData.errorMessage:_tx("There was an application error. Please try again later.");(new ErrorDialog()).showError(userData.errorTitle,msg);}
var err=response.getError();if(err==kError_Platform_ApplicationResponseInvalid){if(userData.showDebug){showError(true);}else{if(this._continuation){this._continuation();}else{showError(false);}}}else{showError(true);}
return false;};function FeedForm(){this.parent.construct(this);}
FeedForm.extend('FeedFormBase');FeedForm.attachSubmitHandler=function(form,app_id,should_show_dialog){form.onsubmit='';form.listen('submit',function(form,app_id,should_show_dialog,event){FeedForm.shouldShowLoadingToSelf=should_show_dialog;new FeedForm().setForm(form).setAppId(app_id).show();return false;}.curry(form,app_id,should_show_dialog));}
FeedForm.prototype._setPublishButtonText=function(text){this.publish_button.value=text;}
FeedForm.prototype._setCancelButtonText=function(text){this.cancel_button.value=text;}
FeedForm.prototype.shouldShowLoading=function(){return FeedForm.shouldShowLoadingToSelf;}
FeedForm.prototype.show=function(){var more={};if(this._form){more={callback:this._form.getAttribute('action'),elements:serialize_form(this._form)};}else if(this._elements){more.elements=this._elements;}
var data={app_id:this._appid,feedform_type:this._storyType,feed_info:this._feedData,user_message_prompt:this._userMessagePrompt,user_message:this._userMessage.value,preview:true,feed_target_type:'self_feed',extern:this._connectLocation};copy_properties(data,more);return this._showBase(data);}
FeedForm.prototype.cancelFeed=function(){this._finish();}
FeedForm.prototype.confirmFeed=function(){var data={feed_info:this._feedData,feedform_type:this._storyType,preview:false,feed_target_type:'self_feed',app_id:this._appid,size:FeedFormBase.SIZES[this._currentSize],extern:this._connectLocation};this._confirm(data);};function MultiFeedForm(){this.parent.construct(this);this._hasTargets=true;}
MultiFeedForm.extend('FeedFormBase');MultiFeedForm.prototype.setPrefillId=function(prefillId){if(prefillId>0){this._prefillId=prefillId;}else{this._prefillId=null;}
return this;};MultiFeedForm.prototype.removeRecipient=function(user){this._toIds=this._toIds.filter(function(u){return u!=user;});if(this._toIds.length==0){this._finish();}else{DOM.remove('sp'+user);}
return false;};MultiFeedForm.prototype.confirmFeed=function(){var data={feed_info:this._feedData,feedform_type:this._storyType,to_ids:this._toIds,preview:false,feed_target_type:'multi_feed',app_id:this._appid,size:FeedFormBase.SIZES[this._currentSize],extern:this._connectLocation};this._confirm(data);};MultiFeedForm.prototype.shouldShowLoading=function(){return FeedFormBase.shouldShowLoadingToOthers;}
MultiFeedForm.prototype.show=function(){var ids=[];if(this._prefillId){ids.push(this._prefillId);}else{var inputs=this._form.getElementsByTagName('input');for(var i=0;i<inputs.length;i++){if(inputs[i].getAttribute('fb_protected')=='true'&&(CSS.hasClass(inputs[i],'fb_token_hidden_input')||inputs[i].name=='ids[]'||inputs[i].name=='friend_selector_id')&&(inputs[i].type!='checkbox'||inputs[i].checked)){ids.push(inputs[i].value);}}}
this._toIds=ids;var data={app_id:this._appid,to_ids:this._toIds,callback:this._form.action,preview:true,form_id:this._form.id,prefill:(this.prefillId>0),elements:serialize_form(this._form),user_message_prompt:this._userMessagePrompt,user_message:this._userMessage.value,feed_target_type:'multi_feed',extern:this._connectLocation};return this._showBase(data);};MultiFeedForm.prototype.attachHandlers=function(dialog){for(var i=0;i<this._toIds.length;i++){var person_link=ge('spl_'+this._toIds[i]);if(person_link){person_link.onclick=this.removeRecipient.bind(this,this._toIds[i]);}}
this.parent.attachHandlers(dialog);return this;};function TargetFeedForm(){this.parent.construct(this);}
TargetFeedForm.extend('MultiFeedForm');TargetFeedForm.prototype.confirmFeed=function(){var data={feed_info:this._feedData,feedform_type:this._storyType,to_ids:this._toIds,preview:false,feed_target_type:'target_feed',app_id:this._appid,size:FeedFormBase.SIZES[this._currentSize],extern:this._connectLocation};this._confirm(data);};TargetFeedForm.prototype.setTarget=function(target){this._toIds=[target];return this;}
TargetFeedForm.prototype.show=function(){var data={app_id:this._appid,to_ids:this._toIds,feed_info:this._feedData,preview:true,prefill:(this.prefillId>0),user_message_prompt:this._userMessagePrompt,user_message:this._userMessage.value,feed_target_type:'target_feed',extern:this._connectLocation};return this._showBase(data);};

var FBML=(function(){var invoked_dialogs={};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.updateID=function(obj){if(obj.i){this._idInput.value=obj.i;}else if(obj.is){this._idInput.value=obj.is;}else{this._idInput.value='';}}
friendSelector.prototype.destroy=function(){this._idInput.parentNode.removeChild(this._idInput);this._idInput.typeahead=null;this._idInput=null;this.parent.destroy();}
friendSelector.prototype._onselect=function(obj){this.updateID(obj);this.parent._onselect(obj);}}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,form,loadingHTML){this.requireLogin(app_id,function(){return _clickRewriteAjax(targetId,url,form,loadingHTML);});return false;}
function _clickRewriteAjax(targetId,url,form,loadingHTML){var target=ge(targetId);if(!target){return err("target "+targetId+" not found");}
var hContext=target.getAttribute("fbcontext");var sContext=FBML.Contexts[hContext];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;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;post["fb_mockajax_rewrite_id"]=targetId;new AsyncRequest().setURI('/fbml/mock_ajax_proxy.php').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){DOM.setContent(target,HTML(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;var content_width=parseInt(dialog_elem.getAttribute('fb_dialog_width'));var elem=dialog_elem.cloneNode(true);DOM.setContent(dialog_elem,'');var dialog=new Dialog();if(content_width)dialog.setContentWidth(content_width);dialog.setImmediateRendering(true).setStackable(true).setBody(dialog_content).setFullBleed(true).show();invoked_dialogs[dialog_elem.id]={'elem':elem,'dialog':dialog};}
return false;}
function closeDialogInvoked(targetId){var hidden_dialog_elem=null;var dialog_target_id='dialog_invoked_'+targetId;for(dialog_id in invoked_dialogs){if(hidden_dialog_elem=ge(dialog_id)){var old_id=hidden_dialog_elem.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_elem.parentNode;DOM.setContent(parent,'');parent.appendChild(invoked_dialogs[dialog_id].elem);invoked_dialogs[dialog_id].elem.id=old_id;}}
if(invoked_dialogs[dialog_target_id].dialog){invoked_dialogs[dialog_target_id].dialog.hide();}}
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,form_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,connect:this.connectParams}).setHandler(bind(this,function(response){if(response.getPayload()){var sig_params=response.getPayload();if(form_id){var form=ge(form_id);addHiddenInputs(form,sig_params);if(this.loginContinuation){this.loginContinuation=this.loginContinuation.bind(form);}}
if(this.sendParams){if(this.loginContinuation){this.loginContinuation=this.loginContinuation.bind(null,sig_params);}}}
this.loginDialog&&this.loginDialog.hide();this.loginContinuation&&this.loginContinuation();this.loginCancellation=this.loginContinuation=this.loginDialog=null;})).send();}
function cancelLogin(){this.loginCancellation&&this.loginCancellation();this.loginDialog&&this.loginDialog.hide();this.loginContinuation=this.loginCancellation=this.loginDialog=null;}
function addHiddenInputs(form_obj,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){DOM.appendContent(form_obj,$N('input',{name:keyVar,value:form_hidden_inputs[keyVar],type:'hidden'}));}}
function _promptPermissionHandler(form,button){this.grantedPerms=true;if(form){DOM.appendContent(form,$N('input',{name:'fb_perms_approved',value:'1',type:'hidden'}));}
Dialog.getCurrent()._submitForm('POST','/fbml/ajax/permissions.php',button);return false;}
function _promptPermissionCloseHandler(next_js,form){if(window.ApiExtendedPermissions&&window.ApiExtendedPermissions.closeHandler){window.ApiExtendedPermissions.closeHandler();}
if(this.grantedPerms){next_js();}
if(form){form.submit();}}
function promptPermission(app_id,perms,next_js,form){var async=new AsyncRequest().setURI('/fbml/ajax/permissions.php').setData({app_id:app_id,perms:perms});this.grantedPerms=false;var dialog=new Dialog().setAsync(async).setHandler(_promptPermissionHandler.bind(this,form)).setCloseHandler(_promptPermissionCloseHandler.bind(this,next_js,form)).show();}
function promptPermissionPro(app_id,perms,callback){var async=new AsyncRequest().setURI('/fbml/ajax/permissions.php').setData({app_id:app_id,perms_string:perms});this.grantedPerms=false;var self=this;var dialog=new Dialog().setAsync(async).setHandler(_promptPermissionHandler.bind(this,null)).setCloseHandler(function(){_promptPermissionCloseHandler.call(self,bagofholding,null);if(self.grantedPerms&&this.getUserData()){callback(this.getUserData().profile_id);}}).show();}
function showPermissionDialog(perms,callback,enableProfileSelector,profileSelectorIds){_callWithConnect(function(){FB.Connect.showPermissionDialog(perms,callback,enableProfileSelector,profileSelectorIds);});}
function createApplication(application_name,callback){_callWithConnect(function(){FB.Connect.createApplication(application_name,callback);});}
function streamPublish(user_message,attachment,action_links,target_id,user_message_prompt,callback,auto_publish,actor_id){_callWithConnect(function(){FB.Connect.streamPublish(user_message,attachment,action_links,target_id,user_message_prompt,callback,auto_publish,actor_id);});}
function _callWithConnect(callback){Arbiter.subscribe('PLATFORM_CANVAS_CONTROLLER_INIT',function(){FB.init({"apiKey":PlatformCanvasController.singleton.api_key,"xdChannelUrl":"/xd_receiver_v0.4.php"});FB.ensureInit(callback);});}
function showFeedDialog(app_id,template_bundle_id,template_data,body_general,target_id,continuation,user_message_prompt,user_message){var feed_data={template_id:template_bundle_id,template_data:template_data,body_general:body_general};var feedform;if(target_id&&(!hasArrayNature(target_id)||target_id.length>0)){if(hasArrayNature(target_id)){target_id=target_id[0];}
feedform=new TargetFeedForm().setTarget(target_id);}else{feedform=new FeedForm();}
feedform.setContinuation(continuation).setFeedData(feed_data).setAppId(app_id).setUserMessagePrompt(user_message_prompt).setUserMessage(user_message).show();}
function closeLoginDialog(){if(this.loginDialog){this.loginDialog.close();}}
function requireLogin(app_id,continuation,cancellation,form,send_params,need_connect_params){if(this.loginDialog){return;}
var form_id=form?form.id:'';this.sendParams=send_params;this.connectParams=need_connect_params?need_connect_params:false;this.loginDialog=new Dialog().setStackable(true).setClassName('api_confirmation');this.loginContinuation=continuation;this.loginCancellation=cancellation;new AsyncRequest().setURI('/ajax/api/tos.php').setData({login_form_id:form_id,app_id:app_id,profile_id:typeof PROFILE_OWNER_ID=='undefined'?0:PROFILE_OWNER_ID,next:document.location.href}).setReadOnly(true).setHandler(bind(this,function(continuation,response){var resp=response.getPayload();if(resp){if(resp.redirect){goURI(resp.uri);}else{this.loginDialog.setTitle(resp.title).setBody(resp.content).show();}}else{continuation();this.loginCancellation=null;this.loginContinuation=null;this.loginDialog=null;}},continuation)).send();}
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=[];var emails=[];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);}
else if(inputs[i].getAttribute('fb_protected')=='true'&&inputs[i].name=='emails[]'){emails.push(inputs[i].value);}}}
var data={app_id:app_id,to_ids:ids,to_emails:emails,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().setClassName('req_dialog').setAsync(async).setStackable(true).show();}else{async.setHandler(function(result){request_form.submit();}).send();}
return false;}
function cancelDialog(elem){if(Dialog.getCurrent()){Dialog.getCurrent().hide();return;}
generic_dialog.get_dialog(elem).fade_out(100);}
function removePreviewRecipients(id){var span=$('sp'+id);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 removeTokenizerRecipient(id,request_form,is_multi){var inputs=request_form.getElementsByTagName('input');for(var i=0;i<inputs.length;i++){if(((inputs[i].name=='emails[]')||(inputs[i].name=='ids[]'))&&(inputs[i].value==id)){delNode=inputs[i].parentNode.parentNode.parentNode.parentNode.parentNode.token;if(delNode){delNode.remove(false);}}}
removePreviewRecipients(id);return false;}
function removeReqRecipient(userid,request_form,is_multi){if(is_multi){if(fs.selected_ids[userid]){fs.unselect(userid);fs.force_reset();}
else{removeTokenizerRecipient(userid,request_form,is_multi);return false;}}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='';}}}}
removePreviewRecipients(userid);return false;}
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;};}}
var enforceStyle=function(element,styles){for(styleName in styles){element.style[styleName]=styles[styleName];}}
var registerFBJSBridge=function(appid,bridgeHash){var sb=fbjs_sandbox.getSandbox(appid);if(sb){sb.setBridgeHash(bridgeHash);}}
var submitForm=function(form,event){if(form.onsubmit){try{if(!form.onsubmit(event)){return;}}catch(e){if(e.message=="Object doesn't support this action"){if(!form.onsubmit()){return;}}else{throw e;}}}
form.submit();}
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,createApplication:createApplication,sendRequest:sendRequest,removeTokenizerRecipient:removeTokenizerRecipient,removeReqRecipient:removeReqRecipient,cancelDialog:cancelDialog,addHiddenInputs:addHiddenInputs,fbmlLogin:fbmlLogin,cancelLogin:cancelLogin,requireLogin:requireLogin,closeLoginDialog:closeLoginDialog,showFeedDialog:showFeedDialog,streamPublish:streamPublish,promptPermission:promptPermission,promptPermissionPro:promptPermissionPro,showPermissionDialog:showPermissionDialog,stripLinks:stripLinks,enforceStyle:enforceStyle,registerFBJSBridge:registerFBJSBridge,submitForm:submitForm};})();

Base64={_initialized:false,_chars:null,_inv:null,_init:function(){Base64._chars=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"];Base64._inv={"A":0,"B":1,"C":2,"D":3,"E":4,"F":5,"G":6,"H":7,"I":8,"J":9,"K":10,"L":11,"M":12,"N":13,"O":14,"P":15,"Q":16,"R":17,"S":18,"T":19,"U":20,"V":21,"W":22,"X":23,"Y":24,"Z":25,"a":26,"b":27,"c":28,"d":29,"e":30,"f":31,"g":32,"h":33,"i":34,"j":35,"k":36,"l":37,"m":38,"n":39,"o":40,"p":41,"q":42,"r":43,"s":44,"t":45,"u":46,"v":47,"w":48,"x":49,"y":50,"z":51,"0":52,"1":53,"2":54,"3":55,"4":56,"5":57,"6":58,"7":59,"8":60,"9":61,"+":62,"/":63};Base64._initialized=true;},encodeObject:function(obj){return Base64.encode(JSON.encode(obj));},decodeObject:function(base64Data){return JSON.decode(Base64.decode(base64Data));},_toUtf8:function(s){var result='';for(var i=0;i<s.length;i++){var c=s.charCodeAt(i);if(c<0x80){result+=String.fromCharCode(c);}else{if(c<0x800){result+=String.fromCharCode((c>>6)|0xc0);}else{if(c<0x10000){result+=String.fromCharCode((c>>12)|0xe0);}else{result+=String.fromCharCode((c>>18)|0xf0);result+=String.fromCharCode(((c>>12)&0x3f)|0x80);}
result+=String.fromCharCode(((c>>6)&0x3f)|0x80);}
result+=String.fromCharCode((c&0x3f)|0x80);}}
return result;},_fromUtf8:function(s){var result='';for(var i=0;i<s.length;i++){var c=s.charCodeAt(i);if(c<0x80){result+=String.fromCharCode(c);}else if(c<0xc0){}else if(c<0xe0&&s.length>i+1){result+=String.fromCharCode(((c&0x1f)<<6)|(s.charCodeAt(++i)&0x3f));}else if(c<0xf0&&s.length>i+2){result+=String.fromCharCode(((c&0x0f)<<12)|((s.charCodeAt(++i)&0x3f)<<6)|(s.charCodeAt(++i)&0x3f));}else if(c<0xf8&&s.length>i+3){result+=String.fromCharCode(((c&0x07)<<18)|((s.charCodeAt(++i)&0x3f)<<12)|((s.charCodeAt(++i)&0x3f)<<6)|(s.charCodeAt(++i)&0x3f));}}
return result;},encode:function(s){if(!Base64._initialized){Base64._init();}
s=Base64._toUtf8(s);var r='';var p='';var c=s.length%3;if(c>0){for(;c<3;c++){p+='=';s+="\0";}}
for(c=0;c<s.length;c+=3){var n=(s.charCodeAt(c)<<16)+(s.charCodeAt(c+1)<<8)+s.charCodeAt(c+2);n=[(n>>>18)&63,(n>>>12)&63,(n>>>6)&63,n&63];r+=Base64._chars[n[0]]+Base64._chars[n[1]]+Base64._chars[n[2]]+Base64._chars[n[3]];}
return r.substring(0,r.length-p.length)+p;},decode:function(s){if(!Base64._initialized){Base64._init();}
s=s.replace(new RegExp('[^'+Base64._chars.join("")+'=]','g'),"");var p=(s.charAt(s.length-1)=='='?(s.charAt(s.length-2)=='='?'AA':'A'):"");var r="";s=s.substr(0,s.length-p.length)+p;for(var c=0;c<s.length;c+=4){var n=(Base64._inv[s.charAt(c)]<<18)+(Base64._inv[s.charAt(c+1)]<<12)+
(Base64._inv[s.charAt(c+2)]<<6)+Base64._inv[s.charAt(c+3)];r+=String.fromCharCode((n>>>16)&255,(n>>>8)&255,n&255);}
r=r.substring(0,r.length-p.length);return Base64._fromUtf8(r);}};

function UIPagelet(element,src,context_data,data){this._id=element||null;this._element=ge(element||$N('div'));this._src=src||null;this._context_data=context_data||{};this._data=data||{};this._handler=bagofholding;return this;}
copy_properties(UIPagelet.prototype,{getElement:function(){return this._element;},setHandler:function(handler){this._handler=handler;return this;},go:function(src,data){if(arguments.length>=2||typeof src=='string'){this._src=src;this._data=data||{};}else if(arguments.length==1){this._data=src;}
this.refresh();return this;},refresh:function(reattach){var handler=function(response){if(reattach&&this._id){this._element=ge(this._id);}
this._element.setContent(HTML(response.getPayload()));this._handler();}.bind(this);new AsyncRequest().setURI(this._src).setMethod('GET').setData({data:JSON.encode(merge(this._context_data,this._data))}).setReadOnly(true).setHandler(handler).setOption('bundle',true).send();return this;}});

function Scroller(canvas){this.canvas=canvas;this.scrollZone=50;this.velocity=100;this.coefficient=1;}
Scroller.findScrollParent=function(el){var sty;el=el.parentNode;while(el){if(el.scrollHeight!=el.offsetTop){sty=CSS.getStyle(el,'overflowY');if(sty=='scroll'||sty=='auto'){return el;}}
el=el.parentNode;}
return document.body;}
Scroller.prototype.activate=function(){this.activate=bagofholding;this.event=Event.listen(document,'mousemove',this._onmousemove.bind(this));this.interval=this._intervalHandler.bind(this).recur(50);this.cursor=null;}
Scroller.prototype.deactivate=function(){delete this.activate;this.event&&this.event.remove();this.event=null;clearInterval(this.interval);}
Scroller.prototype._onmousemove=function(event){this.cursor=new Vector2.getEventPosition(event);}
Scroller.prototype._intervalHandler=function(){if(!this.cursor){return;}
var viewport=this.canvas==document.body?Rect.getViewportBounds():Rect(this.canvas);var rect=new Rect(this.cursor.y-viewport.t,viewport.r-this.cursor.x,viewport.b-this.cursor.y,this.cursor.x-viewport.l);var scrollBy=new Vector2(0,0);if(rect.t<rect.b&&rect.t<this.scrollZone){scrollBy.y=-this.scrollZone+rect.t;}else if(rect.b<this.scrollZone){scrollBy.y=this.scrollZone-rect.b;}
scrollBy.y=this._doMath(scrollBy.y);if(rect.l<rect.r&&rect.l<this.scrollZone){scrollBy.x=-this.scrollZone+rect.l;}else if(rect.r<this.scrollZone){scrollBy.x=this.scrollZone-rect.r;}
scrollBy.x=this._doMath(scrollBy.x);if(scrollBy.x||scrollBy.y){scrollBy.scrollElementBy(this.canvas);if(document.body==this.canvas){this.cursor=this.cursor.add(scrollBy);}
Arbiter.inform('scroller/scroll',this.cursor);}}
Scroller.prototype._doMath=function(diff){return Math.floor(Math.pow((diff>=0?Math.min(diff,this.scrollZone):Math.max(diff,-this.scrollZone))/this.scrollZone*this.velocity,this.coefficient));}

var Drag={};Drag.currentDraggable=null;Drag.grab=function(draggable){if(Drag.currentDraggable){Drag._onmouseup();}
draggable.lastDragOver=null;Drag.attachDragEvents();Drag.currentDraggable=draggable;}
Drag.attachDragEvents=function(){document.onselectstart=function(){document.onselectstart=null;return false;}
if(Drag.dragEventsAttached){return;}
Drag.dragEventsAttached=true;Arbiter.subscribe('scroller/scroll',Drag._onmousemove);Event.listen(document,{'mousemove':Drag._onmousemove,'mouseup':Drag._onmouseup});}
Drag.droppables={};Drag.addDroppable=function(namespace,droppable){(Drag.droppables[namespace]=Drag.droppables[namespace]||[]).push(droppable);}
Drag.removeDroppable=function(namespace,droppable){Drag.droppables[namespace]=Drag.droppables[namespace].filter(function(a){return a!=droppable;});}
Drag._onmousemove=function(event,cursor){if(!Drag.currentDraggable){return;}
var cursorPosition=cursor||Vector2.getEventPosition(event),currentDraggable=Drag.currentDraggable,droppables=Drag.droppables[currentDraggable.namespace];if(currentDraggable.namespace&&currentDraggable.active&&droppables){var zIndexesDict={};droppables.each(function(droppable){zIndexesDict[droppable.zIndex]=droppable.zIndex;});var zIndexes=[];for(var i in zIndexesDict){zIndexes.push(zIndexesDict[i]);}
zIndexes.sort();var lastDragOver=currentDraggable.lastDragOver,currentDragOver=null;for(var z=zIndexes.length;z>=0;z--){if(lastDragOver&&lastDragOver.dom!=null&&lastDragOver.zIndex==zIndexes[z]&&lastDragOver.pointInside(cursorPosition)){currentDragOver=lastDragOver;break;}else{for(var i=0;i<droppables.length;i++){if(zIndexes[z]!=droppables[i].zIndex){continue;}
if(lastDragOver!=droppables[i]&&currentDraggable.dom!=droppables[i].dom&&droppables[i].pointInside(cursorPosition)){currentDragOver=droppables[i];z=-1;break;}}}}
if(currentDragOver&&currentDragOver!=lastDragOver){currentDragOver.ondragover(currentDraggable);}
if(currentDragOver){currentDragOver.ondragmove(currentDraggable,cursorPosition.sub(Vector2.getElementPosition(currentDragOver.dom)));}
currentDraggable.lastDragOver=currentDragOver;}
Drag.currentDraggable._onmousemove(cursorPosition);}
Drag._onmouseup=function(e){document.onselectstart=null;if(Drag.currentDraggable){Drag.currentDraggable._ondrop();Drag.currentDraggable=null;}}
function Draggable(element){if(!element){throw new Error('Element should be a DOM node');}
if(this==window){if(element instanceof Array){var collection=[];element.each(function(instance){collection.push(new Draggable(instance));});return new Collection(Draggable,collection);}else{return new Draggable(element);}}else{this.data={};this.handles=[];this.dom=element;this.boundingBox=null;this.addHandle(this.dom);}}
Draggable.prototype.destroy=function(){this.handles.each(function(handle){this.removeHandle(handle.obj);}.bind(this));this.data=this.dom=null;}
Draggable.prototype._onclick=function(event){if(this.active){return Event.kill(event);}}
Draggable.prototype._ongrab=function(vector){this.ongrab();if(!this.scroller){this.scroller=new Scroller(Scroller.findScrollParent(this.dom));}
this.scroller.activate();if(this.active){if(!this.oldPosition){this.oldPosition=this.dom.style.position;}
this.dom.style.position=this.absolute?'absolute':'relative';vector.sub(this.cursorPositionVector).setElementPosition(this.dom);}}
Draggable.prototype._onmousedown=function(event){var target=$E(event).getTarget();if(DOM.isNode(target,['input','select','textarea','object','embed'])){return true;}
var vector=Vector2.getEventPosition(event);this.draggableInitialVector=Vector2.getElementPosition(this.dom);this.cursorPositionVector=vector.sub(this.draggableInitialVector);Drag.grab(this,event);if(this.gutter){this.cursorInitialVector=vector;}else{this._setActive(true);this._ongrab(vector);}
return Event.kill(event);}
Draggable.prototype._onmousemove=function(vector){if(!this.active){if(vector.distanceTo(this.cursorInitialVector)>=this.gutter){this._setActive(true);this._ongrab(vector);}}
if(this.active){var sub_vector=Vector2.getElementPosition(this.dom).sub(new Vector2(parseInt(this.dom.style.left?this.dom.style.left:CSS.getStyle(this.dom,'left'),10)||0,parseInt(this.dom.style.top?this.dom.style.top:CSS.getStyle(this.dom,'top'),10)||0));var vector2=vector.sub(sub_vector).sub(this.cursorPositionVector);if(this.boundingBox){var box=Rect.newFromVectors(vector2,Vector2.getElementDimensions(this.dom));box=box.boundWithin(this.boundingBox);vector2=box.getPositionVector(box);if(this.boundingBox.w()==0){var final_vector=new Vector2(this.draggableInitialVector.x,vector2.y,'document');}else if(this.boundingBox.h()==0){var final_vector=new Vector2(vector2.x,this.draggableInitialVector.y,'document');}else{var final_vector=vector2;}}else{var final_vector=vector2;}
final_vector.setElementPosition(this.dom);this.ondrag(vector);}}
Draggable.prototype._ondrop=function(){this.scroller&&this.scroller.deactivate();if(this.active){(function(){this._setActive(false);}).bind(this).defer();this.ondrop();if(this.lastDragOver){this.lastDragOver.ondrop(this);}}}
Draggable.prototype.killDrag=function(){this._setActive(false);Drag._onmouseup();}
Draggable.prototype.setBoundingBox=function(bounding_box){this.boundingBox=bounding_box;return this;}
Draggable.prototype.resetPosition=function(){this.dom.style.position=this.oldPosition;this.oldPosition=null;this.dom.style.left=null;this.dom.style.top=null;return this;}
Draggable.prototype.setUseAbsolute=function(absolute){this.absolute=absolute;return this;}
Draggable.prototype.ondrag=bagofholding;Draggable.prototype.setDragHandler=function(func){this.ondrag=func;return this;}
Draggable.prototype.ongrab=bagofholding;Draggable.prototype.setGrabHandler=function(func){this.ongrab=func;return this;}
Draggable.prototype.ondrop=bagofholding;Draggable.prototype.setDropHandler=function(func){this.ondrop=func;return this;}
Draggable.prototype.gutter=0;Draggable.prototype.setGutter=function(gutter){this.gutter=gutter;return this;}
Draggable.prototype.setNamespace=function(namespace){this.namespace=namespace;return this;}
Draggable.prototype.handles=null;Draggable.prototype.addHandle=function(handle){if(this.handles.length==1&&this.handles[0].obj==this.dom){this.removeHandle(this.dom);}
this.handles.push({obj:handle,evt:[Event.listen(handle,'mousedown',this._onmousedown.bind(this)),Event.listen(handle,'click',this._onclick.bind(this)),Event.listen(handle,'drag',Event.kill),Event.listen(handle,'selectstart',Event.kill)]});return this;}
Draggable.prototype.removeHandle=function(handle){this.handles=this.handles.filter(function(a){if(a.obj!=handle){return true;}else{a.evt.each(function(evt){evt.remove();});return false;}});}
Draggable.prototype.getDOM=function(){return this.dom;}
Draggable.prototype.setKey=function(key,value){this.data[key]=value;return this;}
Draggable.prototype.getKey=function(key){return this.data[key];}
Draggable.prototype._setActive=function(state){this.dom.activeDrag=this.active=state;for(var i=0;i<this.handles.length;i++){this.handles[i].obj.activeDrag=state;}}
function Droppable(element){if(!element){throw new Error('Element should be a DOM node');}
if(this==window){if(element instanceof Array){var collection=[];element.each(function(instance){collection.push(new Droppable(instance));});return new Collection(Droppable,collection);}else{return new Droppable(element);}}else{this.data={};this.dom=element;this.namespace=null;}}
Droppable.prototype.destroy=function(){if(this.namespace){Drag.removeDroppable(this.namespace,this);}
this.data=this.dom=null;}
Droppable.prototype.setNamespace=function(namespace){if(this.namespace){Drag.removeDroppable(namespace,this);}
this.namespace=namespace;Drag.addDroppable(namespace,this);return this;}
Droppable.prototype.zIndex=0;Droppable.prototype.setZIndex=function(index){this.zIndex=index;return this;}
Droppable.prototype.pointInside=function(vector){var position=Vector2.getElementPosition(this.dom);return position.x<=vector.x&&this.dom.offsetWidth+position.x>vector.x&&position.y<=vector.y&&this.dom.offsetHeight+position.y>vector.y;}
Droppable.prototype.ondragover=bagofholding;Droppable.prototype.setDragOverHandler=function(func){this.ondragover=func;return this;}
Droppable.prototype.ondragmove=bagofholding;Droppable.prototype.setDragMoveHandler=function(func){this.ondragmove=func;return this;}
Droppable.prototype.ondrop=bagofholding;Droppable.prototype.setDropHandler=function(func){this.ondrop=func;return this;}
Droppable.prototype.getDOM=Draggable.prototype.getDOM;Droppable.prototype.setKey=Draggable.prototype.setKey;Droppable.prototype.getKey=Draggable.prototype.getKey;

function SortableGroup(){this.namespace='sortable'+(++SortableGroup.instanceCount);this.draggables={};this.droppables={};this.sortables={};this.linkedGroups=[];this.linkedGroups.onlinkjump=bagofholding;this.rootNode=null;this.boundingBox=null;this.neverEmpty=false;this.hasEmptyMessage=false;this.isDroppable=true;this.anchor=null;}
SortableGroup.instanceCount=0;SortableGroup.prototype.gutter=15;SortableGroup.prototype.setBoundingBox=function(bounding_box){this.boundingBox=bounding_box;for(var k in this.draggables){this.draggables[k].setBoundingBox(this.boundingBox);}
return this;}
SortableGroup.prototype.setDroppable=function(val){this.isDroppable=val;return this;}
SortableGroup.prototype._initializeAdded=function(key,obj){if(this.rootNode===null){this.rootNode=obj.parentNode;if(!this.linkedGroups.placeholder){this.linkedGroups.placeholder=this.placeholder=$N(obj.tagName,{className:'dragPlaceholder',style:{padding:'0px'}});}else{this.placeholder=this.linkedGroups.placeholder;}}else if(this.rootNode!=obj.parentNode){throw new Error('All sortables of a collection must share the same parentNode');}
if(key in this.draggables){throw new Error('All sortables must have a unique key');}}
SortableGroup.prototype.addSortable=function(key,obj,handle){this._initializeAdded(key,obj);this.sortables[key]=obj;this.draggables[key]=(new Draggable(obj)).setNamespace(this.namespace).setGutter(this.gutter).setUseAbsolute(true).setGrabHandler(this.grabHandler.bind(this,key)).setDropHandler(this.dropHandler.bind(this,key)).setKey('key',key).setBoundingBox(this.boundingBox);if(handle){this.draggables[key].addHandle(handle);}
this.droppables[key]=(new Droppable(obj)).setNamespace(this.namespace).setDragOverHandler(this._dragOverHandlerShim.bind(null,this,key));return this;}
SortableGroup.prototype.addEmptyMessage=function(obj,root){var key='placeholder';if(obj.parentNode!=root){root.appendContent(obj);}
this._initializeAdded(key,obj);this.hasEmptyMessage=true;this.sortables[key]=obj;this.droppables[key]=(new Droppable(obj)).setNamespace(this.namespace).setDragOverHandler(this._dragOverHandlerShim.bind(null,this,key));return this;}
SortableGroup.prototype.setNeverEmpty=function(neverEmpty){this.neverEmpty=neverEmpty;}
SortableGroup.prototype.link=function(sortgroup){sortgroup.linkedGroups=this.linkedGroups;if(!this.linkedGroups.length){this.linkedGroups.push(this);}
this.linkedGroups.push(sortgroup);for(var i=0;i<this.linkedGroups.length;i++){if(this.linkedGroups[i].namespace!=this.namespace){this.linkedGroups[i].namespace=this.namespace;for(var j in this.linkedGroups[i].droppables){this.linkedGroups[i].droppables[j].setNamespace(this.namespace);this.linkedGroups[i].draggables[j].setNamespace(this.namespace);}}}
return this;}
SortableGroup.prototype.getOrder=function(){if(!this.rootNode){return[];}
var ret=[],childNodes=this.rootNode.childNodes;for(var i=0;i<childNodes.length;i++){for(var k in this.sortables){if(this.sortables[k]==childNodes[i]){ret.push(k);break;}}}
return ret;}
SortableGroup.prototype.migrateLinkedSortable=function(key){for(var i=0;i<this.linkedGroups.length;i++){if(key in this.linkedGroups[i].draggables){this.sortables[key]=this.linkedGroups[i].sortables[key];this.draggables[key]=this.linkedGroups[i].draggables[key];this.draggables[key].setGrabHandler(this.grabHandler.bind(this,key)).setDropHandler(this.dropHandler.bind(this,key));this.droppables[key]=this.linkedGroups[i].droppables[key];this.droppables[key].setDragOverHandler(this._dragOverHandlerShim.bind(null,this,key));delete this.linkedGroups[i].sortables[key];delete this.linkedGroups[i].draggables[key];delete this.linkedGroups[i].droppables[key];return true;}}
return false;}
SortableGroup.prototype.setLinkJumpHandler=function(func){this.linkedGroups.onlinkjump=func;return this;}
SortableGroup.prototype.onorderchange=bagofholding;SortableGroup.prototype.setOrderChangeHandler=function(func){this.onorderchange=func;return this;}
SortableGroup.prototype.ongrabcallback=bagofholding;SortableGroup.prototype.setGrabCallback=function(func){this.ongrabcallback=func;return this;}
SortableGroup.prototype._checkLastRemaining=function(draggable){var oneNodeLeft=this.hasEmptyMessage?2:1;return this.neverEmpty&&this.rootNode.childNodes.length==oneNodeLeft;}
SortableGroup.prototype.grabHandler=function(draggableKey){if(this._checkLastRemaining()){this.draggables[draggableKey].killDrag();return;}
CSS.setClass(this.placeholder,this.sortables[draggableKey].className);CSS.addClass(this.placeholder,'droppable_placeholder');CSS.addClass(this.sortables[draggableKey],'drag');Vector2.getElementDimensions(this.sortables[draggableKey]).setElementDimensions(this.placeholder);this.rootNode.insertBefore(this.placeholder,this.sortables[draggableKey]);this.ongrabcallback(draggableKey);if(!this.isDroppable){var sortable=this.sortables[draggableKey];this.anchor=sortable.nextSibling;if(!this.anchor){this.anchor=$N('div');sortable.parentNode.appendChild(this.anchor);}}}
SortableGroup.prototype.ondropcallback=bagofholding;SortableGroup.prototype.setDropCallback=function(func){this.ondropcallback=func;return this;}
SortableGroup.prototype.dropHandler=function(draggableKey){if(this._checkLastRemaining()){this.draggables[draggableKey].resetPosition();return;}
CSS.removeClass(this.sortables[draggableKey],'drag');this.draggables[draggableKey].resetPosition();this.rootNode.insertBefore(this.sortables[draggableKey],this.placeholder);this.rootNode.removeChild(this.placeholder);for(var i=0;i<this.linkedGroups.length;i++){if(this.linkedGroups[i].anchor){delete this.linkedGroups[i].anchor;}}
this.ondropcallback(draggableKey);this.onorderchange();}
SortableGroup.prototype._dragOverHandlerShim=function(that,droppableKey,draggable){that.dragOverHandler(droppableKey,draggable.getKey('key'));};SortableGroup.prototype.dragOverHandler=function(droppableKey,draggableKey){if(!this.isDroppable&&!this.anchor){return;}
var jumped=false;if(!(draggableKey in this.draggables)){if(!this.migrateLinkedSortable(draggableKey)){throw new Error('Draggable dropped onto a foreign droppable!');}
jumped=true;}
var before=true,childNodes=this.rootNode.childNodes,draggable=this.sortables[draggableKey],droppable=this.sortables[droppableKey];if(!this.anchor){for(var i=0;i<childNodes.length;i++){if(childNodes[i]==droppable){break;}else if(childNodes[i]==draggable){before=false;break;}}}else{droppable=this.anchor;}
if(before||this.anchor){this.rootNode.insertBefore(this.placeholder,droppable);}else{this.rootNode.insertBefore(this.placeholder,droppable.nextSibling);}
this.rootNode.insertBefore(draggable,this.placeholder);this.ondragover(draggable,droppable);if(jumped){this.linkedGroups.onlinkjump.call(this,draggableKey);}}
SortableGroup.prototype.ondragover=bagofholding;SortableGroup.prototype.setDragOverCallback=function(func){this.ondragover=func;return this;}
SortableGroup.prototype.destroy=function(){for(var k in this.droppables){this.droppables[k].destroy();}
for(var k in this.draggables){this.draggables[k].destroy();}
this.droppables=this.draggables=this.rootNode=null;this.linkedGroups.remove(this);for(var i=0;i<this.linkedGroups.length;i++){this.linkedGroups[i].linkedGroups=this.linkedGroups;}}
SortableGroup.prototype.removeSortable=function(key){if(key in this.sortables){this.draggables[key].destroy();this.droppables[key].destroy();delete this.draggables[key];delete this.droppables[key];delete this.sortables[key];}}
SortableGroup.prototype.keyExists=function(key){return this.sortables[key];}

function search_friend_source(get_param,manual_init){this.get_param=get_param;this.parent.construct(this);if(!manual_init){this.initialize();}}
search_friend_source.extend('static_source');search_friend_source.prototype.text_noinput=search_friend_source.prototype.text_placeholder=search_friend_source.prototype.text_nomatch='';search_friend_source.prototype.updated_pics={};search_friend_source.prototype._allowed_types=null;search_friend_source.prototype.initialize=function(callback){var current_time=(new Date()).getTime();new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/typeahead_search.php?'+this.get_param).setErrorHandler(function(){}).setTransportErrorHandler(function(){}).setHandler(function(response){var payload=response.getPayload();this.values=payload.entries;this.build_index.bind(this).defer();search_typeahead_log(this.udata,'getdata',current_time);var now_minus_5_min=((new Date()).getTime()/1000)-60*5;if(payload.gen_time<now_minus_5_min){new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/recent_pics.php').setData({ref_time:payload.gen_time}).setErrorHandler(function(){}).setTransportErrorHandler(function(){}).setHandler(function(response){this.updated_pics=response.getPayload().updated_pics;}.bind(this)).send();}
if(callback){callback();}}.bind(this)).send();};search_friend_source.url_templates={};search_friend_source.loaded_images={};search_friend_source.TYPES={USER:'u',CONNECTION:'c',FOLLOWER:'fl',PAGE:'p',APP:'a',GROUP:'g',EVENT:'e',SEARCH:'search',WEB:'web'};search_friend_source.prototype.build_index=function(){var history=this.history?this.history.entries:undefined;if(history!=undefined){this.values=this.values.each(function(value){value.o=history[value.i]!=undefined?history[value.i]:value.o;return value;});}
this.parent.build_index();};search_friend_source.image_load=function(image_elm,insertion_time,user_id){var current_time=(new Date()).getTime();search_friend_source.loaded_images[user_id]=true;if((current_time-insertion_time)<100){CSS.setOpacity(image_elm,1);}else{animation(image_elm).to('opacity',1).duration(100).go();}};search_friend_source.prototype.gen_html=function(friend,highlight){var icon_url=friend.it;if(!icon_url&&friend.ty&&search_friend_source.url_templates[friend.ty]){icon_url=search_friend_source.url_templates[friend.ty].icon;}
if(this.updated_pics[friend.i]){icon_url=this.updated_pics[friend.i];}
switch(friend.ty){case search_friend_source.TYPES.USER:case search_friend_source.TYPES.CONNECTION:case search_friend_source.TYPES.PAGE:if(!icon_url){return['<div>',typeahead_source.highlight_found(friend.t,highlight),'</div><div><small>',friend.n||'&nbsp;','</small></div>'].join('');}else{if(!search_friend_source.loaded_images[friend.i]){var insertion_time=(new Date()).getTime();var attrs=sprintf('onload="search_friend_source.image_load(this, %d, %d);" style="opacity:0;filter:alpha(opacity=0);"',insertion_time,friend.i);}
return['<img ',attrs,' alt="" src="',icon_url,'"/>','<div class="with_pic"><span>',typeahead_source.highlight_found(friend.t,highlight),'</span><small>',friend.n||'&nbsp;','</small></div>'].join('');}
break;case search_friend_source.TYPES.SEARCH:return['<div class="app"><div class="icon" style="background-image: url(',icon_url,')">&nbsp;</div>','<span>',friend.t,'</span></div>'].join('');break;default:return['<div class="app clearfix"><div class="icon" style="background-image: url(',icon_url,')">&nbsp;</div>','<span>',typeahead_source.highlight_found(friend.t,highlight),'</span></div>'].join('');}};search_friend_source.prototype.allowTypes=function(type_arr){this._allowed_types=type_arr;return this;};search_friend_source.prototype.search_value=function(text){var results;var enough_tokens=false;var tokens=typeahead_source.tokenize(text);for(var i=0;i<tokens.length;i++){if(tokens[i]!=''){enough_tokens=true;break;}}
if(enough_tokens){this.owner.less_than_n_chars=false;results=this.parent.search_value(text);}else if(this.is_ready){this.owner.less_than_n_chars=true;results=[];}
var non_people_search=(results&&results.length)?false:true;if(results){for(var i=0;i<results.length;i++){if((results[i].ty!=search_friend_source.TYPES.USER)&&(results[i].ty!=search_friend_source.TYPES.CONNECTION)){non_people_search=true;break;}}}
var num_results_short=this.search_limit;if(results){num_results_short-=results.length;}
if(results&&non_people_search&&enough_tokens&&search_friend_source.WEBSEARCH_USER){results.push({t:_tx("Search Facebook"),ty:search_friend_source.TYPES.SEARCH,i:text});results.push({t:_tx("Search the Web"),ty:search_friend_source.TYPES.WEB,i:text});}
if(results&&this._allowed_types){results=results.filter(function(result){return this._allowed_types.contains(result.ty);}.bind(this));}
return results;};search_friend_source.prototype._sort_text_obj=function(a,b){var history=this.history?this.history.entries:undefined;if(history!=undefined){a.o=history[a.i]||a.o;b.o=history[b.i]||b.o;}
if(a.o!=b.o){return a.o-b.o;}
return a.t.localeCompare(b.t);};search_friend_source.WEBSEARCH_USER=false;window.ADVANCED_SEARCH_TYPEAHEAD=false;

function search_selector_onfound(result){var n;if(!(n=ge('n'))){return;}
n.value=result?result.i:-1;}
function search_result_selector_onsubmit(result){$('search').init.value=ge('filter_init')?$('filter_init').value:'';$('search').sf.value=ge('filter_sf')?$('filter_sf').value:'';$('search').submit();this.hide();this.advance_focus();}
function search_logged_ajax(data){new AsyncSignal('/ajax/search_log.php',data).send();}
function search_log_2nd_action(data){new AsyncRequest().setURI('/ajax/search_log_2nd_action.php').setMethod('POST').setReadOnly(true).setContextData('clicktype',data).setContextData('source','profile_from_search').setHandler(function(){}).send();}
function search_typeahead_log(data,evt,timestart){if(!data){return;}
var moddata=data;if(evt){moddata.evt=evt;}
moddata.t=(new Date()).getTime();if(timestart){moddata.dt=moddata.t-timestart;}
new AsyncSignal('/ajax/typeahead_log.php',moddata).send();}
var SearchDashboardKeyboardHandler=function(){return{right_arrow_key_handler:function(event,type){if(event.ctrlKey){if($('search_dashboard_next_session').href){goURI($('search_dashboard_next_session').href);}}else{if($('search_dashboard_next_query').href){goURI($('search_dashboard_next_query').href);}}
return false;},left_arrow_key_handler:function(event,type){if(event.ctrlKey){if($('search_dashboard_prev_session').href){goURI($('search_dashboard_prev_session').href);}}else{if($('search_dashboard_prev_query').href){goURI($('search_dashboard_prev_query').href);}}
return false;},right_arrow_key_filter:function(event,type){return true;}}}();

if(typeof deconcept=="undefined")var deconcept={};if(typeof deconcept.util=="undefined")deconcept.util={};if(typeof deconcept.SWFObjectUtil=="undefined")deconcept.SWFObjectUtil={};deconcept.SWFObject=function(swf,id,w,h,ver,c,quality,xiRedirectUrl,redirectUrl,detectKey){if(!document.getElementById){return;}
this.DETECT_KEY=detectKey?detectKey:'detectflash';this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];this.fallback_html='';this.fallback_js_fcn=function(){};if(swf){this.setAttribute('swf',swf);}
if(id){this.setAttribute('id',id);}
if(w){this.setAttribute('width',w);}
if(h){this.setAttribute('height',h);}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(ver){if(!(ver instanceof Array)){ver=[ver];}
var x;ver.each(function(ii){x=new deconcept.PlayerVersion(ii.toString().split('.'));if(x.major==this.installedVer.major){this.setAttribute('version',x);return;}else if(!this.getAttribute('version')||x.major<this.getAttribute('version').major){this.setAttribute('version',x);}}.bind(this));}
if(!window.opera&&document.all&&this.installedVer.major>7){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);}
window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}
if(c){this.addParam('bgcolor',c);}
var q=quality?quality:'high';this.addParam('quality',q);this.setAttribute('useExpressInstall',false);this.setAttribute('doExpressInstall',false);var xir=(xiRedirectUrl)?xiRedirectUrl:window.location;this.setAttribute('xiRedirectUrl',xir);this.setAttribute('redirectUrl','');if(redirectUrl){this.setAttribute('redirectUrl',redirectUrl);}}
deconcept.SWFObject.prototype={useExpressInstall:function(path){this.xiSWFPath=!path?"/swf/expressinstall.swf":path;this.setAttribute('useExpressInstall',true);},setAttribute:function(name,value){this.attributes[name]=value;},getAttribute:function(name){return this.attributes[name]||"";},addParam:function(name,value){this.params[name]=value;},getParams:function(){return this.params;},addVariable:function(name,value){this.variables[name]=value;},getVariable:function(name){return this.variables[name]||"";},getVariables:function(){return this.variables;},getVariablePairs:function(){var variablePairs=[];var key;var variables=this.getVariables();for(key in variables){variablePairs[variablePairs.length]=key+"="+variables[key];}
return variablePairs;},getSWFHTML:function(){var swfNode="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute('swf',this.xiSWFPath);}
swfNode='<embed type="application/x-shockwave-flash" src="'+htmlspecialchars(this.getAttribute('swf'))+'" width="'+htmlspecialchars(this.getAttribute('width'))+'" height="'+htmlspecialchars(this.getAttribute('height'))+'" style="'+htmlspecialchars(this.getAttribute('style')||"")+'"';swfNode+=' id="'+htmlspecialchars(this.getAttribute('id'))+'" name="'+htmlspecialchars(this.getAttribute('id'))+'" ';var params=this.getParams();for(var key in params){swfNode+=htmlspecialchars(key)+'="'+htmlspecialchars(params[key])+'" ';}
var pairs=this.getVariablePairs().join("&");if(pairs.length>0){swfNode+='flashvars="'+pairs+'"';}
swfNode+='/>';}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute('swf',this.xiSWFPath);}
swfNode='<object id="'+this.getAttribute('id')+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'" style="'+(this.getAttribute('style')||"")+'">';swfNode+='<param name="movie" value="'+this.getAttribute('swf')+'" />';var params=this.getParams();for(var key in params){swfNode+='<param name="'+key+'" value="'+params[key]+'" />';}
var pairs=this.getVariablePairs().join("&");if(pairs.length>0){swfNode+='<param name="flashvars" value="'+pairs+'" />';}
swfNode+="</object>";}
return swfNode;},write:function(elementId){if(this.getAttribute('useExpressInstall')){var expressInstallReqVer=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(expressInstallReqVer)&&!this.installedVer.versionIsValid(this.getAttribute('version'))){this.setAttribute('doExpressInstall',true);this.addVariable("MMredirectURL",escape(this.getAttribute('xiRedirectUrl')));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}
var n=(typeof elementId=='string')?document.getElementById(elementId):elementId;if(this.skipDetect||this.getAttribute('doExpressInstall')||this.installedVer.versionIsValid(this.getAttribute('version'))){n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute('redirectUrl')!=""){document.location.replace(this.getAttribute('redirectUrl'));}
need_version=this.getAttribute('version').major+'.'+this.getAttribute('version').minor+'.'+this.getAttribute('version').rev;have_version=this.installedVer.major+'.'+this.installedVer.minor+'.'+this.installedVer.rev;this.fallback_js_fcn(have_version,need_version);n.innerHTML=this.fallback_html;}
return false;}}
deconcept.SWFObjectUtil.getPlayerVersion=function(){var PlayerVersion=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){for(k=0;k<navigator.plugins.length;k++){try{x=navigator.plugins[k];if(x.name=='Shockwave Flash'){PlayerVersion_tmp=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));if(typeof PlayerVersion=='undefined'||PlayerVersion_tmp.major>PlayerVersion.major||(PlayerVersion_tmp.major==PlayerVersion.major&&(PlayerVersion_tmp.minor>PlayerVersion.minor||(PlayerVersion_tmp.minor==PlayerVersion.minor&&PlayerVersion_tmp.rev>PlayerVersion.rev)))){PlayerVersion=PlayerVersion_tmp;}}}catch(honk){}}}else if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var counter=3;while(axo){try{counter++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+counter);PlayerVersion=new deconcept.PlayerVersion([counter,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");PlayerVersion=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(PlayerVersion.major==6){return PlayerVersion;}}
try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}
if(axo!=null){PlayerVersion=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return PlayerVersion;}
deconcept.PlayerVersion=function(arrVersion){this.major=arrVersion[0]!=null?parseInt(arrVersion[0]):0;this.minor=arrVersion[1]!=null?parseInt(arrVersion[1]):0;this.rev=arrVersion[2]!=null?parseInt(arrVersion[2]):0;}
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major)return false;if(this.major>fv.major)return true;if(this.minor<fv.minor)return false;if(this.minor>fv.minor)return true;if(this.rev<fv.rev)return false;return true;}
deconcept.util={getRequestParameter:function(param){var q=document.location.search||document.location.hash;if(param==null){return q;}
if(q){var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return pairs[i].substring((pairs[i].indexOf("=")+1));}}}
return"";}}
deconcept.SWFObjectUtil.cleanupSWFs=function(){var objects=document.getElementsByTagName("OBJECT");for(var i=objects.length-1;i>=0;i--){objects[i].style.display='none';for(var x in objects[i]){if(typeof objects[i][x]=='function'){objects[i][x]=function(){};}}}}
if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];}}
var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var flash_update_dialog_shown=false;function spawn_flash_update_dialog(have_version,need_version){if(flash_update_dialog_shown){return;}
flash_update_dialog_shown=true;new AsyncRequest().setURI('/ajax/flash_update_dialog.php').setData({have_version:have_version,need_version:need_version}).setHandler(function(response){message_data=response.getPayload();new Dialog().setClassName('errorDialog').setTitle(message_data.title).setBody(message_data.body).setButtons([Dialog.CLOSE]).show();}).send();}
function setFlashFallback(id,required_versions){var fallback=ge(id);var current_version=deconcept.SWFObjectUtil.getPlayerVersion();var min_version;required_versions.each(function(ii){ii=new deconcept.PlayerVersion(ii.toString().split('.'));if(ii.major==current_version.major){min_version=ii;return;}else if(typeof min_version=='undefined'||ii.major<min_version.major){min_version=ii;}}.bind(this));if(fallback&&current_version.major>0){var have_version_str=current_version.major+'.'+current_version.minor+'.'+current_version.rev;var need_version_str=min_version.major+'.'+min_version.minor+'.'+min_version.rev;fallback.innerHTML=_tx("Flash {required-version} is required to view this content. Your current version is {current-version}. Please download the latest Flash Player.",{'required-version':need_version_str,'current-version':have_version_str});}}
function getFlashPlayer(){goURI('http://get.adobe.com/flashplayer');return false;}

if (window.Bootloader) { Bootloader.done(["js\/diounk121a800ko8.pkg.js"]); }