/*
HTTP Host: static.ak.fbcdn.net
Generated: March 20th 2010 5:09:23 PM PDT
Machine: 10.16.140.101
Locale: nu_ll
Path: js/buocafjhouo8wg8s.pkg.js
*/

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

function search_selector_onfound(b){var a;if(!(a=ge('n')))return;a.value=b?b.i:-1;}function search_result_selector_onsubmit(a){$('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(a){new AsyncSignal('/ajax/search_log.php',a).send();}function search_log_2nd_action(a){new AsyncRequest().setURI('/ajax/search_log_2nd_action.php').setMethod('POST').setReadOnly(true).setContextData('clicktype',a).setContextData('source','profile_from_search').setHandler(function(){}).send();}function search_typeahead_log(a,b,d){if(!a)return;var c=a;if(b)c.evt=b;c.t=(new Date()).getTime();if(d)c.dt=c.t-d;new AsyncSignal('/ajax/typeahead_log.php',c).send();}var SearchDashboardKeyboardHandler=function(){return {right_arrow_key_handler:function(event,a){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,a){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,a){return true;}};}();
function search_friend_source(a,b){this.get_param=a;this.parent.construct(this);if(!b)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.search_limit=5;search_friend_source.prototype._allowed_types=null;search_friend_source.prototype.do_dark_test=false;search_friend_source.prototype.initialize=function(a){var b=(new Date()).getTime();new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/typeahead_search.php?'+this.get_param).setErrorHandler(function(){}).setTransportErrorHandler(function(){}).setHandler(function(e){var d=e.getPayload();this.values=d.entries;search_friend_source.url_templates=this.templates=d.templates;this.build_index.bind(this).defer();search_typeahead_log(this.udata,'getdata',b);var c=((new Date()).getTime()/1000)-60*5;if(d.gen_time<c)new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/recent_pics.php').setData({ref_time:d.gen_time}).setErrorHandler(function(){}).setTransportErrorHandler(function(){}).setHandler(function(f){this.updated_pics=f.getPayload().updated_pics;}.bind(this)).send();if(a)a();}.bind(this)).send();};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 a=this.history?this.history.entries:undefined;if(a!=undefined)this.values=this.values.each(function(b){b.o=a[b.i]!=undefined?a[b.i]:b.o;return b;});this.parent.build_index();};search_friend_source.image_load=function(b,c,d){var a=(new Date()).getTime();search_friend_source.loaded_images[d]=true;if((a-c)<100){CSS.setOpacity(b,1);}else animation(b).to('opacity',1).duration(100).go();};search_friend_source.prototype.gen_html=function(b,c){var d=b.it;if(!d&&b.ty&&this.templates[b.ty])d=this.templates[b.ty].icon;if(this.updated_pics[b.i])d=this.updated_pics[b.i];switch(b.ty){case search_friend_source.TYPES.USER:case search_friend_source.TYPES.CONNECTION:case search_friend_source.TYPES.PAGE:if(!d){return ['<div>',typeahead_source.highlight_found(b.t,c),'</div><div><small>',b.n||'&nbsp;','</small></div>'].join('');}else{if(!search_friend_source.loaded_images[b.i]){var e=(new Date()).getTime();var a=sprintf('onload="search_friend_source.image_load(this, %d, %d);" style="opacity:0;filter:alpha(opacity=0);"',e,b.i);}return ['<img ',a,' alt="" src="',d,'"/>','<div class="with_pic"><span>',typeahead_source.highlight_found(b.t,c),'</span><small>',b.n||'&nbsp;','</small></div>'].join('');}break;case search_friend_source.TYPES.SEARCH:return ['<div class="app"><div class="icon" style="background-image: url(',d,')">&nbsp;</div>','<span>',b.t,'</span></div>'].join('');break;default:return ['<div class="app clearfix"><div class="icon" style="background-image: url(',d,')">&nbsp;</div>','<span>',typeahead_source.highlight_found(b.t,c),'</span></div>'].join('');}};search_friend_source.prototype.allowTypes=function(a){this._allowed_types=a;return this;};search_friend_source.prototype.search_value=function(f){if(this.do_dark_test)new AsyncSignal('/ajax/search/typeahead_dark.php',{query:f}).send();var e;var a=false;var g=typeahead_source.tokenize(f);for(var b=0;b<g.length;b++)if(g[b]!=''){a=true;break;}if(a){this.owner.less_than_n_chars=false;e=this.parent.search_value(f);}else if(this.is_ready){this.owner.less_than_n_chars=true;e=[];}var c=(e&&e.length)?false:true;if(e)for(var b=0;b<e.length;b++)if((e[b].ty!=search_friend_source.TYPES.USER)&&(e[b].ty!=search_friend_source.TYPES.CONNECTION)){c=true;break;}var d=this.search_limit;if(e)d-=e.length;if(e&&c&&a&&search_friend_source.WEBSEARCH_USER){e.push({t:_tx("Facebook\u3092\u691c\u7d22"),ty:search_friend_source.TYPES.SEARCH,i:f});e.push({t:_tx("\u30a6\u30a7\u30d6\u3092\u691c\u7d22"),ty:search_friend_source.TYPES.WEB,i:f});}if(e&&this._allowed_types)e=e.filter(function(h){return this._allowed_types.contains(h.ty);}.bind(this));return e;};search_friend_source.prototype._sort_text_obj=function(a,b){var c=this.history?this.history.entries:undefined;if(c!=undefined){a.o=c[a.i]||a.o;b.o=c[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;
function UIComposerAttachmentArea(b,c){this.composer=b;this.root=c;this.area=c.find('div.UIComposer_AttachmentArea_Cache');this.cache={};this.visible=null;this.attachment={};this.dirtyOnReset=false;var a=c.find('a.UIComposer_AttachmentArea_CloseButton');Event.listen(a,'click',function(event){Event.kill(event);b.reset(true);});}UIComposerAttachmentArea.prototype={show:function(b,c){this.composer.addState(UIComposer.STATE.ATTACHMENT_AREA);this.attachment=b;this.dirtyOnReset=false;if(ua.ie()<7)this.area.setStyle('width',this.area.offsetWidth);var a=b.app_id;if(this.cache[a]&&!c){this.showAttachment(a);}else this.loadAttachment(a,c);},loadAttachment:function(a,c){var b={app_id:a,composer_id:this.composer.id,stream_id:this.composer.targetID,is_inbox:this.composer.isInbox};if(c)copy_properties(b,{data:c});new AsyncRequest().setURI(UIComposerAttachmentArea.ENDPOINT).setData(b).setHandler(UIComposerAttachmentArea.handleResponse.bind(this,c)).setErrorHandler(this.composer.handleError.bind(this.composer)).setTransportErrorHandler(this.composer.handleError.bind(this.composer)).send();},showAttachment:function(a){if(!this.composer.hasState(UIComposer.STATE.ATTACHMENT_AREA))return;this.visible=this.cache[a];this.visible.addClass(UIComposerAttachmentArea.CLASS.VISIBLE);this.composer.addState(UIComposer.STATE.ATTACHMENT_LOADED);this.fireAttachmentEvent('load');},createAttachment:function(b){var a=$N('div',{className:UIComposerAttachmentArea.CLASS.CACHED});this.area.appendChild(a).setContent(HTML(b.html));return a;},setAttachment:function(a){if(this.attachment){this.attachment.controller=a;a.initialize(this.composer,this.cache[this.attachment.app_id],this.attachment.app_id);}return this;},getAttachment:function(){if(this.attachment&&this.attachment.controller)return this.attachment.controller;return null;},getData:function(){if(this.attachment&&this.attachment.controller)return this.attachment.controller.getData();return null;},getEndpoint:function(a){if(this.attachment&&this.attachment.controller)return this.attachment.controller.getEndpoint(a);return null;},post:function(){if(!this.visible)return;var a=this.getData();var b=this.getEndpoint(true);if(!a||!b)return;a.composer_id=this.composer.id;this.composer.removeState(UIComposer.STATE.ATTACHMENT_LOADED);new AsyncRequest().setURI(b).setData(a).setHandler(UIComposerAttachmentArea.handleResponse.bind(this,null)).setErrorHandler(this.composer.handleError.bind(this.composer)).send();},reset:function(){if(!this.visible)return;this.visible.removeClass(UIComposerAttachmentArea.CLASS.VISIBLE);this.visible=null;if(this.dirtyOnReset){var a=this.attachment.app_id;this.cache[a].remove();this.cache[a]=null;}this.fireAttachmentEvent('reset');},fireAttachmentEvent:function(event){if(this.attachment&&this.attachment.controller)this.attachment.controller[event]();}};copy_properties(UIComposerAttachmentArea,{handleResponse:function(e,g){var a=this.attachment.app_id,b=this.cache[a],f=g.getPayload(),d=g.getError(),c=g.getErrorIsWarning();if(d&&c)this.composer.showError(g.getErrorSummary(),g.getErrorDescription());if(!b){this.cache[a]=this.createAttachment(f);this.dirtyOnReset=!!e;}else{b.setContent(HTML(f.html));this.dirtyOnReset=true;}this.showAttachment(a);}});copy_properties(UIComposerAttachmentArea,{CLASS:{CACHED:'UIComposer_Attachment_Cached',VISIBLE:'UIComposer_Attachment_Visible'},ENDPOINT:'/ajax/composer/attachment.php',PARAM_STRUCTURE:'app_data[attachment][params]'});
function dropmenu(a){if(this==window){return new dropmenu(a);}else{this.className=null;this.menu=null;this.menuClickArea=null;this.showHandler=null;this.hideHandler=null;this.alignment=null;this.direction=null;this.isShown=false;this.canHide=false;this.show_hooks=[];this.hide_hooks=[];this.clickTarget=$(a);this.displayTarget=$(a);this.id=null;this.rtl=false;this._clickToHide=true;this._markupContentCallback=bagofholding;this.clickHandle=this.clickTarget.listen('click',this.toggle.bind(this));this.container=ge('dropmenu_container')||document.body;return this;}}dropmenu.ALIGN_RIGHT=1;dropmenu.ALIGN_LEFT=2;dropmenu.DIRECTION_UP=3;dropmenu.DIRECTION_DOWN=4;dropmenu.INSTANCES={};dropmenu.prototype.setPosition=function(a){this.alignment=a;return this;};dropmenu.prototype.setDirection=function(a){this.direction=a;return this;};dropmenu.prototype.setMenuClickArea=function(a){this.menuClickArea=$(a);return this;};dropmenu.prototype.setDisplayTarget=function(a){this.displayTarget=$(a);return this;};dropmenu.prototype.setClickToHide=function(a){this._clickToHide=a;return this;};dropmenu.prototype.setMarkupContent=function(b,a,c){this.menuContent=c;this.className=a;this.id=b;return this;};dropmenu.prototype.setMarkupContentCallback=function(a){this._markupContentCallback=a;return this;};dropmenu.prototype._getMarkupContent=function(){return this.menuContent||this._markupContentCallback();};dropmenu.prototype.registerHTMLMenu=function(a){this.registered_menu_id=a;return this;};dropmenu.prototype.addHook=function(b,a){this[b+'_hooks'].push(a);return this;};dropmenu.prototype.removeHook=function(c,a){for(var b=0;b<this[c+'_hooks'].length;b++)if(a==this[c+'_hooks'][b]){this[c+'_hooks'].splice(b,1);return true;}return this;};dropmenu.prototype.toggle=function(a){if(!this.isShown){this._show();this.canHide=false;}else this._hide();if(a)$E(a).prevent();};dropmenu.prototype.show=function(){this._show();};dropmenu.prototype.hide=function(){if(!this.menu)return;this._hide();};dropmenu.prototype.destroy=function(){if(this.menu&&this.menu.parentNode){this.menu.parentNode.removeChild(this.menu);this.menu=null;}};dropmenu.prototype._buildMenu=function(){if(intl_locale_is_rtl()&&!this.rtl){this.alignment=(this.alignment==dropmenu.ALIGN_RIGHT)?dropmenu.ALIGN_LEFT:dropmenu.ALIGN_RIGHT;this.rtl=true;}if(this.registered_menu_id){this.menu=$(this.registered_menu_id);if(this.alignment||this.direction)this.container.appendChild(this.menu);}else this._buildDynamicMenu();dropmenu.INSTANCES[this.id]=this;this.menuClickArea=this.menuClickArea||DOM.scry(this.menu,'div.menu_content');this.menuClickArea.onclick=chain(this.menuClickArea.onclick,Event.stop);var b=DOM.scry(this.menu,'a');for(var a=0;a<b.length;a++)addEventBase(b[a],'click',function(){if(this._clickToHide)this._hide();}.bind(this),this.menu_id+'_link_'+a);};dropmenu.prototype._buildDynamicMenu=function(){this.menu=document.createElement('div');this.menu.className='dropdown_menu hidden_elem '+(this.className?' '+this.className:'');this.menu.id='dropdown_menu_'+this.id;var a=this._getMarkupContent();if(!is_scalar(a)){DOM.setContent(this.menu,a);}else set_inner_html(this.menu,a);this.container.appendChild(this.menu);};dropmenu.prototype._positionMenu=function(){if(this.alignment||this.direction||(!this.alignment&&!this.direction&&!this.registered_menu_id)){if(this.menu.parentNode!=this.container)this.container.appendChild(this.menu);var b=Vector2.getElementPosition(this.displayTarget,'document');var a=Vector2.getElementPosition(this.container,'document');var e=b.x-a.x;var f=b.y-a.y+this.displayTarget.offsetHeight;if(this.alignment==dropmenu.ALIGN_RIGHT||this.direction==dropmenu.DIRECTION_UP){CSS.removeClass(this.menu,'hidden_elem');this.menu.style.left='-9999px';this.menu.style.top='-9999px';if(this.alignment==dropmenu.ALIGN_RIGHT){var d=this.menu.offsetWidth;e=e+this.displayTarget.offsetWidth-d;}if(this.direction==dropmenu.DIRECTION_UP){var c=this.menu.offsetHeight;f=f-this.displayTarget.offsetHeight-c+1;}CSS.addClass(this.menu,'hidden_elem');}this.menu.style.left=e+'px';this.menu.style.top=f+'px';}};dropmenu.prototype._onclick=function(event){this._hide();return false;};dropmenu.prototype._show=function(){if(!this.menu)this._buildMenu();this._positionMenu();CSS.removeClass(this.menu,'hidden_elem');var a=this._documentHideHandler.bind(this);this.click_event=addEventBase(document.body,'click',a,this.menu.id);onbeforeunloadRegister(a);this.isShown=true;for(var b=0;b<this.show_hooks.length;b++)this.show_hooks[b]();};dropmenu.prototype._documentHideHandler=function(a){if(!this.canHide){this.canHide=true;}else this._hide();};dropmenu.prototype._hide=function(){if(this.menu)CSS.addClass(this.menu,'hidden_elem');if(this.click_event)removeEventBase(document.body,'click',this.click_event,this.menu.id);this.click_event=null;this.isShown=false;for(var a=0;a<this.hide_hooks.length;a++)this.hide_hooks[a]();if(!this.registered_menu_id)this.destroy();};dropmenu.prototype._build_menu_shim=function(){this.shim=null;if(ua.ie()<7){this.shim=document.createElement('iframe');CSS.setClass(shim,'iframe_shim');this.container.appendChild(this.shim);}};dropmenu.getExistingInstance=function(a){return dropmenu.INSTANCES[a];};function flyout_menu(a){if(this==window){return new flyout_menu(a);}else{this.title='';this.parent.construct(this,a);}}flyout_menu.extend('dropmenu');flyout_menu.prototype.setMarkupContent=function(b,a,d,c){this.parent.setMarkupContent(b,a,c);this.title=d;return this;};flyout_menu.prototype.setIconPosition=function(a){this.iconElem=a;return this;};flyout_menu.prototype._buildDynamicMenu=function(){this.menu=document.createElement('div');CSS.addClass(this.menu,(this.className||'')+' flyout_menu hidden_elem');if(this.alignment==dropmenu.ALIGN_RIGHT)CSS.addClass(this.menu,'flyout_menu_left');this.menu.id='flyout_menu_'+this.id;var c='content_'+this.id;var a=[];a.push('<div class="flyout_menu_header_shadow">');a.push('<div class="flyout_menu_header clearfix">');a.push('<div class="flyout_menu_mask"></div>');a.push('<div class="flyout_menu_title">'+this.title+'</div>');a.push('</div></div>');a.push('<div class="flyout_menu_content_shadow">');a.push('<div class="menu_content" id="content_'+this.id+'">');a.push('</div></div>');set_inner_html(this.menu,a.join(''));this.container.appendChild(this.menu);var b=this._getMarkupContent();if(!is_scalar(b)){DOM.setContent($(c),b);}else set_inner_html($(c),b);this.menuClickArea=$(c);};flyout_menu.prototype._positionMenu=function(){if(this.alignment||(!this.alignment&&!this.registered_menu_id)){var e;var a=this.iconElem?this.iconElem:this.clickTarget;switch(this.alignment){case dropmenu.ALIGN_LEFT:case null:e=elementX(a)-elementX(this.container);break;case dropmenu.ALIGN_RIGHT:this.menu.style.left='-9999px';this.menu.style.top='-9999px';CSS.removeClass(this.menu,'hidden_elem');var b=Vector2.getElementDimensions(this.menu).x;var d=Rect.getElementBounds(a).r-elementX(this.container);var c=4;e=d-b+c*2;CSS.addClass(this.menu,'hidden_elem');break;}var f=elementY(a)-elementY(this.container);this.menu.style.left=e+'px';this.menu.style.top=f+'px';}};function hover_menu(a){if(this==window){return new hover_menu(a);}else{this.parent.construct(this,a);this.timeOut=0;this.clickHandle.remove();this.enterTimer=null;this.exitTimer=null;}}hover_menu.extend('dropmenu');hover_menu.prototype.setTimeoutInterval=function(a){this.timeOut=a;return this;};hover_menu.prototype._clickTarget_onmouseover=function(b,a){clearTimeout(this.exitTimer);if(!this.isShown)this.enterTimer=setTimeout(function(){this._show();}.bind(this),this.timeOut);};hover_menu.prototype._clickTarget_onmouseout=function(c,a){a=a||window.event;var b=(a.relatedTarget)?a.relatedTarget:a.toElement;if(DOM.contains(c,b))return;clearTimeout(this.enterTimer);if(this.isShown&&!DOM.contains(this.menu,b))this.exitTimer=setTimeout(function(){this._hide();}.bind(this),this.timeOut);};hover_menu.prototype._menu_onmouseover=function(b,a){clearTimeout(this.exitTimer);};hover_menu.prototype._menu_onmouseout=function(c,a){a=a||window.event;var b=(a.relatedTarget)?a.relatedTarget:a.toElement;if(DOM.contains(c,b))return;clearTimeout(this.enterTimer);if(this.isShown)this.exitTimer=setTimeout(function(){this._hide();}.bind(this),this.timeOut);};hover_menu.prototype.initialize=function(){if(!this.menu)this._buildMenu();this.clickTarget.listen('mouseover',this._clickTarget_onmouseover.bind(this,this.clickTarget));this.clickTarget.listen('mouseout',this._clickTarget_onmouseout.bind(this,this.clickTarget));this.menu.listen('mouseout',this._menu_onmouseout.bind(this,this.menu));this.menu.listen('mouseover',this._menu_onmouseover.bind(this,this.menu));this._positionMenu();return this;};
function Scroller(a){this.canvas=a;this.scrollZone=50;this.velocity=100;this.coefficient=1;}Scroller.findScrollParent=function(a){var b;a=a.parentNode;while(a){if(a.scrollHeight!=a.offsetTop){b=CSS.getStyle(a,'overflowY');if(b=='scroll'||b=='auto')return a;}a=a.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 c=this.canvas==document.body?Rect.getViewportBounds():Rect(this.canvas);var a=new Rect(this.cursor.y-c.t,c.r-this.cursor.x,c.b-this.cursor.y,this.cursor.x-c.l);var b=new Vector2(0,0);if(a.t<a.b&&a.t<this.scrollZone){b.y=-this.scrollZone+a.t;}else if(a.b<this.scrollZone)b.y=this.scrollZone-a.b;b.y=this._doMath(b.y);if(a.l<a.r&&a.l<this.scrollZone){b.x=-this.scrollZone+a.l;}else if(a.r<this.scrollZone)b.x=this.scrollZone-a.r;b.x=this._doMath(b.x);if(b.x||b.y){b.scrollElementBy(this.canvas);if(document.body==this.canvas)this.cursor=this.cursor.add(b);Arbiter.inform('scroller/scroll',this.cursor);}};Scroller.prototype._doMath=function(a){return Math.floor(Math.pow((a>=0?Math.min(a,this.scrollZone):Math.max(a,-this.scrollZone))/this.scrollZone*this.velocity,this.coefficient));};
var Drag={};Drag.currentDraggable=null;Drag.grab=function(a){if(Drag.currentDraggable)Drag._onmouseup();a.lastDragOver=null;Drag.attachDragEvents();Drag.currentDraggable=a;};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(b,a){(Drag.droppables[b]=Drag.droppables[b]||[]).push(a);};Drag.removeDroppable=function(b,a){Drag.droppables[b]=Drag.droppables[b].filter(function(c){return c!=a;});};Drag._onmousemove=function(event,c){if(!Drag.currentDraggable)return;var d=c||Vector2.getEventPosition(event),b=Drag.currentDraggable,e=Drag.droppables[b.namespace];if(b.namespace&&b.active&&e){var j={};e.each(function(k){j[k.zIndex]=k.zIndex;});var i=[];for(var f in j)i.push(j[f]);i.sort();var g=b.lastDragOver,a=null;for(var h=i.length;h>=0;h--)if(g&&g.dom!=null&&g.zIndex==i[h]&&g.pointInside(d)){a=g;break;}else for(var f=0;f<e.length;f++){if(i[h]!=e[f].zIndex)continue;if(g!=e[f]&&b.dom!=e[f].dom&&e[f].pointInside(d)){a=e[f];h=-1;break;}}if(a&&a!=g)a.ondragover(b);if(a)a.ondragmove(b,d.sub(Vector2.getElementPosition(a.dom)));b.lastDragOver=a;}Drag.currentDraggable._onmousemove(d);};Drag._onmouseup=function(a){document.onselectstart=null;if(Drag.currentDraggable){Drag.currentDraggable._ondrop();Drag.currentDraggable=null;}};function Draggable(b){if(!b)throw new Error('Element should be a DOM node');if(this==window){if(b instanceof Array){var a=[];b.each(function(c){a.push(new Draggable(c));});return new Collection(Draggable,a);}else return new Draggable(b);}else{this.data={};this.handles=[];this.dom=b;this.boundingBox=null;this.addHandle(this.dom);}}Draggable.prototype.destroy=function(){this.handles.each(function(a){this.removeHandle(a.obj);}.bind(this));this.data=this.dom=null;};Draggable.prototype._onclick=function(event){if(this.active)return Event.kill(event);};Draggable.prototype._ongrab=function(a){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';a.sub(this.cursorPositionVector).setElementPosition(this.dom);}};Draggable.prototype._onmousedown=function(event){var a=$E(event).getTarget();if(DOM.isNode(a,['input','select','textarea','object','embed']))return true;var b=Vector2.getEventPosition(event);this.draggableInitialVector=Vector2.getElementPosition(this.dom);this.cursorPositionVector=b.sub(this.draggableInitialVector);Drag.grab(this,event);if(this.gutter){this.cursorInitialVector=b;}else{this._setActive(true);this._ongrab(b);}return Event.kill(event);};Draggable.prototype._onmousemove=function(d){if(!this.active)if(d.distanceTo(this.cursorInitialVector)>=this.gutter){this._setActive(true);this._ongrab(d);}if(this.active){var c=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 e=d.sub(c).sub(this.cursorPositionVector);if(this.boundingBox){var a=Rect.newFromVectors(e,Vector2.getElementDimensions(this.dom));a=a.boundWithin(this.boundingBox);e=a.getPositionVector(a);if(this.boundingBox.w()==0){var b=new Vector2(this.draggableInitialVector.x,e.y,'document');}else if(this.boundingBox.h()==0){var b=new Vector2(e.x,this.draggableInitialVector.y,'document');}else var b=e;}else var b=e;b.setElementPosition(this.dom);this.ondrag(d);}};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(a){this.boundingBox=a;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(a){this.absolute=a;return this;};Draggable.prototype.ondrag=bagofholding;Draggable.prototype.setDragHandler=function(a){this.ondrag=a;return this;};Draggable.prototype.ongrab=bagofholding;Draggable.prototype.setGrabHandler=function(a){this.ongrab=a;return this;};Draggable.prototype.ondrop=bagofholding;Draggable.prototype.setDropHandler=function(a){this.ondrop=a;return this;};Draggable.prototype.gutter=0;Draggable.prototype.setGutter=function(a){this.gutter=a;return this;};Draggable.prototype.setNamespace=function(a){this.namespace=a;return this;};Draggable.prototype.handles=null;Draggable.prototype.addHandle=function(a){if(this.handles.length==1&&this.handles[0].obj==this.dom)this.removeHandle(this.dom);this.handles.push({obj:a,evt:[Event.listen(a,'mousedown',this._onmousedown.bind(this)),Event.listen(a,'click',this._onclick.bind(this)),Event.listen(a,'drag',Event.kill),Event.listen(a,'selectstart',Event.kill)]});return this;};Draggable.prototype.removeHandle=function(a){this.handles=this.handles.filter(function(b){if(b.obj!=a){return true;}else{b.evt.each(function(c){c.remove();});return false;}});};Draggable.prototype.getDOM=function(){return this.dom;};Draggable.prototype.setKey=function(a,b){this.data[a]=b;return this;};Draggable.prototype.getKey=function(a){return this.data[a];};Draggable.prototype._setActive=function(b){this.dom.activeDrag=this.active=b;for(var a=0;a<this.handles.length;a++)this.handles[a].obj.activeDrag=b;};function Droppable(b){if(!b)throw new Error('Element should be a DOM node');if(this==window){if(b instanceof Array){var a=[];b.each(function(c){a.push(new Droppable(c));});return new Collection(Droppable,a);}else return new Droppable(b);}else{this.data={};this.dom=b;this.namespace=null;}}Droppable.prototype.destroy=function(){if(this.namespace)Drag.removeDroppable(this.namespace,this);this.data=this.dom=null;};Droppable.prototype.setNamespace=function(a){if(this.namespace)Drag.removeDroppable(a,this);this.namespace=a;Drag.addDroppable(a,this);return this;};Droppable.prototype.zIndex=0;Droppable.prototype.setZIndex=function(a){this.zIndex=a;return this;};Droppable.prototype.pointInside=function(b){var a=Vector2.getElementPosition(this.dom);return a.x<=b.x&&this.dom.offsetWidth+a.x>b.x&&a.y<=b.y&&this.dom.offsetHeight+a.y>b.y;};Droppable.prototype.ondragover=bagofholding;Droppable.prototype.setDragOverHandler=function(a){this.ondragover=a;return this;};Droppable.prototype.ondragmove=bagofholding;Droppable.prototype.setDragMoveHandler=function(a){this.ondragmove=a;return this;};Droppable.prototype.ondrop=bagofholding;Droppable.prototype.setDropHandler=function(a){this.ondrop=a;return this;};Droppable.prototype.getDOM=Draggable.prototype.getDOM;Droppable.prototype.setKey=Draggable.prototype.setKey;Droppable.prototype.getKey=Draggable.prototype.getKey;
function friend_source(a){if(typeof(a)=='object')a=a[0];this.bootstrap=this.bootstrap.bind(this,a);this.parent.construct(this);}friend_source.extend('static_source');friend_source.prototype.text_noinput=friend_source.prototype.text_placeholder=_tx("\u540d\u524d\u3092\u5165\u529b");friend_source.friends={};friend_source.friends_index={};friend_source.viewer_id=0;friend_source.prototype.cache_results=true;friend_source.prototype.bootstrap=function(a){if(friend_source.friends[a]){this.values=friend_source.friends[a];this.index=friend_source.friends_index[a];this.ready();}else new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/typeahead_friends.php?'+a).setHandler(function(b){friend_source.friends[a]=this.values=this.filter_excluded(b.getPayload().friends);this.viewer_id=b.getPayload().viewer_id;this.build_index();friend_source.friends_index[a]=this.index;}.bind(this)).send();};friend_source.dirty=function(){friend_source.friends={};friend_source.friends_index={};typeaheadpro.dirty_instances();};friend_source.prototype.gen_html=function(a,b){var e=a.n||'&nbsp;';if(a.n===false){e=_tx("\u53cb\u90540\u4eba");}else if(typeof(a.n)=="object"){var d=[];for(var c in a.n)d.push(a.n[c]);if(d.length>3){e=_tx("{name1}\u3055\u3093\u3001{name2}\u3055\u3093\u3001\u4ed6{count}\u540d",{name1:d[0],name2:d[1],count:d.length-2});}else if(d.length){e=d.join(', ');}else e=_tx("\u53cb\u90540\u4eba");}return ['<div>',typeahead_source.highlight_found(a.t,b),'</div><div><small>',e,'</small></div>'].join('');};friend_source.prototype.search_value=function(a){if(a=='\x5e\x5f\x5e')return [{t:a,n:'\x6b\x65\x6b\x65',i:10,it:'http://static.ak.facebook.com/pics/t_default.jpg'}];return this.parent.search_value(a);};friend_source.prototype._sort_text_obj=function(a,b){if(a.e&&!b.e)return 1;if(!a.e&&b.e)return -1;if(this.viewer_id==a.i)return -1;if(this.viewer_id==b.i)return 1;return a.t.localeCompare(b.t);};
function email_source(a){a=a?a+'&include_emails=1':'';this.parent.construct(this,a);}email_source.extend('friend_and_email_source');email_source.prototype.text_noinput=email_source.prototype.text_placeholder=_tx("\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3067\u304d\u307e\u3059\u2026");email_source.prototype.text_nomatch=_tx("\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3067\u304d\u307e\u3059\u2026");email_source.prototype.bootstrap=function(a){this.values='';this.index=0;this.ready();};
function token(b,c,a){if(b.is&&(c.count_names(b.is)>c.max_selections)){new ContextualDialog().setContext(c.obj).setTitle(_tx("\u30ea\u30b9\u30c8\u3092\u8ffd\u52a0\u3067\u304d\u307e\u305b\u3093\u3002")).setBody(_tx("\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u3001\u4e00\u5ea6\u306b20\u4eba\u307e\u3067\u3057\u304b\u9001\u308c\u307e\u305b\u3093\u3002")).show().setAutohide(1500);return null;}this.tokenizer=c;this.element=document.createElement('a');CSS.setClass(this.element,'token'+('class' in b?' '+b['class']:''));this.element.href='#';this.element.tabIndex=-1;this.element.onclick=function(event){return this._onclick(event?event:window.event);}.bind(this);this.element.onmousedown=function(event){(event?event:window.event).cancelBubble=true;return false;};this.render_obj(b);this.obj=b;this.element.token=this;this.tokenizer.hide_inline_placeholder();a?this.tokenizer.obj.insertBefore(this.element,a):this.tokenizer.obj.appendChild(this.element);}token.prototype.render_obj=function(f){var e='';if(f.np){var b='';}else var b='fb_protected="true" ';var a='class="fb_token_hidden_input" ';if(f.e){e=['<input type="hidden" ',a,b,'name="emails[]" value="',f.e,'" />'].join('');}else if(f.i||f.i===0){e=['<input type="hidden" ',a,b,'name="',this.tokenizer.obj.name,'[]" value="',f.i,'" />'].join('');}else if(f.is){for(var c=0,d=f.is.length;c<d;c++)e+=['<input type="hidden" ',a,b,'name="',this.tokenizer.obj.name,'[]" value="',f.is[c],'" />'].join('');this.explodable=true;this.n=f.n;}this.text=f.t;this.element.innerHTML=['<span><span><span><span>',e,htmlspecialchars(f.t),'<span onclick="this.parentNode.parentNode.parentNode.parentNode.parentNode.token.remove(true); event.cancelBubble=true; return false;" ','onmouseover="CSS.setClass(this, \'x_hover\');" onmouseout="CSS.setClass(this, \'x\');" class="x">&nbsp;</span>','</span></span></span></span>'].join('');this.obj=f;};token.prototype._onclick=function(event){var e=(new Date()).getTime();if(this.explodable&&this.tokenizer.last_select_time&&(e-this.tokenizer.last_select_time<1400)){var f=this.n;this.remove();var d=this.tokenizer.obj.getElementsByTagName('input');var a={};for(var b=0;b<d.length;++b)if(d[b].name==this.tokenizer.obj.id+'[]')a[d[b].value]=true;for(var c in f)if(!a[c])new token({t:f[c],i:c},this.tokenizer);}else this.select();this.tokenizer.last_select_time=e;event.cancelBubble=true;return false;};token.prototype.select=function(a){if(this.tokenizer.selected_token&&!a)this.tokenizer.selected_token.deselect();CSS.setClass(this.element,trim(this.element.className.replace('token_selected',''))+' token_selected');this.tokenizer.tab_stop_ignore_focus=true;if(this.tokenizer.tab_stop.disabled)this.tokenizer.tab_stop.disabled=false;this.tokenizer.tab_stop.focus();this.tokenizer.selected_token=this;if(a!==true){setTimeout(function(){this.select(true);}.bind(this),0);}else setTimeout(function(){this.tab_stop_ignore_focus=false;}.bind(this.tokenizer),0);};token.prototype.remove=function(a){this.element.parentNode.removeChild(this.element);this.element.token=null;this.tokenizer.selected_token=null;if(a)this.tokenizer._onmousedown();if(this.obj)this.tokenizer._ontokenremoved(this.obj);};token.prototype.deselect=function(){CSS.setClass(this.element,trim(this.element.className.replace('token_selected','')));this.tokenizer.selected_token=null;};
function tokenizer_input(c,a){if(!tokenizer_input.hacks){tokenizer_input.should_use_borderless_hack=ua.safari();tokenizer_input.should_use_shadow_hack=ua.ie()<8||ua.opera();tokenizer_input.hacks=true;}this.tokenizer=c;c.tokenizer_input=this;this.obj=document.createElement('input');this.obj.input=this;this.obj.tabIndex=-1;this.obj.size=1;this.obj.onmousedown=function(event){(event?event:window.event).cancelBubble=true;}.bind(this);this.shadow=document.createElement('span');CSS.setClass(this.shadow,'tokenizer_input_shadow');this.element=document.createElement('div');CSS.setClass(this.element,'tokenizer_input'+(tokenizer_input.should_use_borderless_hack?' tokenizer_input_borderless':''));this.element.appendChild(document.createElement('div'));this.element.firstChild.appendChild(this.obj);var b=(tokenizer_input.should_use_shadow_hack?DOM.getRootElement():this.element.firstChild);b.appendChild(this.shadow);a?c.obj.insertBefore(this.element,a):c.obj.appendChild(this.element);this.tokenizer.tab_stop.disabled=true;this.update_shadow();this.update_shadow=this.update_shadow.bind(this);this.tokenizer.inputs.push(this);this.parent.construct(this,this.obj,this.tokenizer.typeahead_source);if(this.focused){this.focus();this.obj.select();}copy_properties(this,c.properties||{});setInterval(this.update_shadow.bind(this),100);}tokenizer_input.extend('typeaheadpro');tokenizer_input.prototype.gen_nomatch=tokenizer_input.prototype.gen_loading=tokenizer_input.prototype.gen_placeholder=tokenizer_input.prototype.gen_noinput='';tokenizer_input.prototype.max_display=8;tokenizer_input.prototype.setup_anchor=function(){return this.tokenizer.obj;};tokenizer_input.prototype.update_shadow=function(){if(this.obj===null)return;try{var a=this.obj.value;}catch(e){return;}if(this.shadow_input!=a){this.shadow.innerHTML=htmlspecialchars((this.shadow_input=a)+'^_^');if(tokenizer_input.should_use_shadow_hack){this.obj.style.width=this.shadow.offsetWidth+'px';this.obj.value=a;}}};tokenizer_input.prototype._onblur=function(a){if(this.parent._onblur(a)===false)return false;this.tokenizer._onblur(a);if(this.changed&&!this.interactive){this.dirty_results();this.changed=false;return;}if(this.changed||this.interactive)this.select_suggestion(this.selectedindex);setTimeout(function(){this.disabled=false;}.bind(this.tokenizer.tab_stop),1000);tokenizerToDestroy=this;setTimeout(function(){tokenizerToDestroy.destroy();},0);};tokenizer_input.prototype._onfocus=function(){this.tokenizer.tab_stop.disabled=true;this.parent._onfocus();return true;};tokenizer_input.prototype._onkeydown=function(event){switch(event.keyCode){case 13:break;case 37:case 8:if(this.get_selection_start()!=0||this.obj.value!='')break;var b=this.element.previousSibling;if(b&&b.token)setTimeout(b.token.select.bind(b.token),0);break;case 39:case 46:if(this.get_selection_start()!=this.obj.value.length)break;var a=this.element.nextSibling;if(a&&a.token)setTimeout(a.token.select.bind(a.token),0);break;case 188:this._onkeydown({keyCode:13});return false;case 9:if(this.obj.value){this.advance_focus();this._onkeydown({keyCode:13});return false;}else if(!event.shiftKey){this.advance_focus();this.parent._onkeydown(event);return false;}break;}return this.parent._onkeydown(event);};tokenizer_input.prototype._onkeypress=function(event){switch(event.keyCode){case 9:return false;}setTimeout(this.update_shadow,0);return this.parent._onkeypress(event);};tokenizer_input.prototype.select_suggestion=function(b){if(this.suggestions&&b>=0&&this.suggestions.length>b){var c=this.tokenizer.obj.getElementsByTagName('input');var a=this.suggestions[b].i;for(i=0;i<c.length;i++)if(c[i].name==this.tokenizer.obj.id+'[]'&&c[i].value==a)return false;}return this.parent.select_suggestion(b);};tokenizer_input.prototype.get_selection_start=function(){if(this.obj.selectionStart!=undefined){return this.obj.selectionStart;}else return Math.abs(document.selection.createRange().moveStart('character',-1024));};tokenizer_input.prototype.onselect=function(b){if(this.get_value()==''&&this.last_key==13){return this.tokenizer.onsubmit();}else if(b){var a=this.tokenizer.obj.getElementsByTagName('input');for(i=0;i<a.length;i++)if(a[i].name==this.tokenizer.obj.id+'[]'&&a[i].value==b.i)return false;new token(b,this.tokenizer,this.element);this.clear();if(this.tokenizer.max_selections<=this.tokenizer.count_names())this.destroy.bind(this).defer();this.tokenizer._ontokenadded(b);}this.tokenizer.typeahead_source.onselect_not_found.call(this);return false;};tokenizer_input.prototype._onsubmit=function(){return false;};tokenizer_input.prototype.capture_submit=function(){return false;};tokenizer_input.prototype.clear=function(){this.parent.clear();this.update_shadow();};tokenizer_input.prototype.destroy=function(){this.parent.destroy();if(this.shadow&&tokenizer_input.should_use_shadow_hack)DOM.remove(this.shadow);if(this.element)DOM.remove(this.element);if(this.tokenizer){var a=this.tokenizer.inputs.indexOf(this);if(a!=-1)this.tokenizer.inputs.splice(a,1);}this.tokenizer=this.element=this.shadow=null;return null;};
function tokenizer(c,e,b,a,d){if(ua.safari()<500){tokenizer.valid_arrow_count=0;tokenizer.valid_arrow_event=function(){return tokenizer.valid_arrow_count++%2==0;};}else tokenizer.valid_arrow_event=function(){return true;};this.obj=c;this.obj.tokenizer=this;this.obj.name=c.id;this.typeahead_source=e;while(!/\btokenizer\b/.test(this.obj.className))this.obj=this.obj.parentNode;this.tab_stop=this.obj.getElementsByTagName('input')[0];this.inputs=[];this.tokenizer_inputs=[];this.obj.onmousedown=function(event){return this._onmousedown(event?event:window.event);}.bind(this);if(this.tab_stop){this.tab_stop.onfocus=function(event){return this._onfocus(event?event:window.event);}.bind(this);this.tab_stop.onblur=function(event){return this.tab_stop_onblur(event?event:window.event);}.bind(this);this.tab_stop.onkeydown=function(event){return this.tab_stop_onkeydown(event?event:window.event);}.bind(this);}if(!b&&elementY(this.obj)>0&&this.obj.offsetWidth)this._onfocus();this.max_selections=a;copy_properties(this,d||{});this.properties=d;if(this.inline_placeholder_text)this.init_inline_placeholder();}tokenizer.prototype.onsubmit=bagofholding;tokenizer.prototype.setName=function(a){this.obj.name=a;};tokenizer.is_empty=function(a){if(CSS.hasClass(a,'tokenizer_locked')){return a.getElementsByTagName('input').length==0;}else return (!a.tokenizer||a.tokenizer.count_names()==0);};tokenizer.prototype.get_token_values=function(){var c=[];var b=this.obj.getElementsByTagName('input');for(var a=0;a<b.length;++a)if(b[a].name&&b[a].value)c.push(b[a].value);return c;};tokenizer.prototype.get_token_strings=function(){var b=[];var c=this.obj.getElementsByTagName('a');for(var a=0;a<c.length;++a)if(typeof c[a].token!='undefined')b.push(c[a].token.text);return b;};tokenizer.prototype.clear=function(){var b=this.obj.getElementsByTagName('a');for(var a=b.length-1;a>=0;--a)if(typeof b[a].token!='undefined')b[a].token.remove();};tokenizer.prototype.remove_token=function(b){var c=this.obj.getElementsByTagName('a');for(var a=c.length-1;a>=0;--a)if(typeof c[a].token!='undefined'&&(c[a].token.obj.i==b||c[a].token.obj.flid==b)){c[a].token.remove();break;}};tokenizer.prototype.clear_current_input=function(){this.tokenizer_input.clear();};tokenizer.prototype._onmousedown=function(event){if(this.onfocus)this.onfocus();this.hide_inline_placeholder();setTimeout(function(){if(!this.inputs.length){if(this.max_selections>this.count_names()){this.tokenizer_inputs.push(new tokenizer_input(this));}else{var b=this.obj.getElementsByTagName('a');for(var a=b.length-1;a>=0;a--)if(typeof b[a].token!='undefined'){b[a].token.select();break;}}}else this.inputs[0].focus();}.bind(this),0);event?event.cancelBubble=true:false;return false;};tokenizer.prototype._onfocus=function(event){if(this.tab_stop_ignore_focus){this.tab_stop_ignore_focus=false;return;}this._onmousedown();};tokenizer.prototype._onblur=function(event){if(this.onblur)this.onblur();this.show_inline_placeholder();};tokenizer.prototype.tab_stop_onblur=function(event){this.selected_token?this.selected_token.deselect():false;};tokenizer.prototype.tab_stop_onkeydown=function(event){if(!event.keyCode||!this.selected_token)return;switch(event.keyCode){case 8:case 46:var d=this.selected_token;var c=d.element.previousSibling;if(c&&c.input){c.input.element.focus();}else this.tokenizer_inputs.push(new tokenizer_input(this,d.element));d.remove();return false;case 37:if(!tokenizer.valid_arrow_event())break;var d=this.selected_token;var c=d.element.previousSibling;if(c&&c.input){c.input.element.focus();}else if(this.max_selections>this.count_names()){this.tokenizer_inputs.push(new tokenizer_input(this,d.element));}else return false;d.deselect();return false;case 39:if(!tokenizer.valid_arrow_event())break;var d=this.selected_token;var b=d.element.nextSibling;if(b&&b.input){b.input.focus();}else if(this.max_selections>this.count_names()){var a=new tokenizer_input(this,d.element.nextSibling);this.tokenizer_inputs.push(a);}else return false;d.deselect();return false;}};tokenizer.prototype.count_names=function(e){var c=this.obj.getElementsByTagName('input');var f={};var a=0;for(var b=0;b<c.length;b++)if(c[b].type=='hidden'&&!f[c[b].value]){f[c[b].value]=true;++a;}if(e)for(var d=0;d<e.length;d++)if(!f[e[d]]){f[e[d]]=true;++a;}return a;};tokenizer.prototype.disable=function(){this.tab_stop.parentNode.removeChild(this.tab_stop);this.obj.className+=' tokenizer_locked';};tokenizer.prototype._ontokenadded=function(a){if(this.ontokenadded)this.ontokenadded.call(this,a);};tokenizer.prototype._ontokenremoved=function(a){if(this.ontokenremoved)this.ontokenremoved.call(this,a);};tokenizer.prototype._ontokennotfound=function(a){if(this.ontokennotfound)this.ontokennotfound.call(this,a);};tokenizer.prototype.init_inline_placeholder=function(){if(this.inline_placeholder)return;var a=$N('span',{className:'inline_placeholder'},this.inline_placeholder_text);if(!tokenizer.is_empty(this.obj))a.setStyle('display','none');this.obj.appendChild(a);this.inline_placeholder=a;};tokenizer.prototype.show_inline_placeholder=function(){if(this.inline_placeholder&&tokenizer.is_empty(this.obj))show(this.inline_placeholder);};tokenizer.prototype.hide_inline_placeholder=function(){if(this.inline_placeholder&&shown(this.inline_placeholder))hide(this.inline_placeholder);};tokenizer.prototype.get_source=function(){return this.typeahead_source;};tokenizer.prototype.set_source=function(b){this.typeahead_source=b;if(this.tokenizer_inputs.length)for(var a=0;a<this.tokenizer_inputs.length;a++)this.tokenizer_inputs[a].set_source(b);if(this.tokenizer_input)this.tokenizer_input.set_source(b);};
function newBoxAdded(f,b,g,e){if(!ge(e+b))return;var a=$(e+b);var c=document.createElement('div');var d='<div class="popcontent_advanced border_frame">'+'<div class="pop_content popcontent_old" id="pop_content"></div>'+'<div class="dialog_buttons">'+'<input type="submit" class="inputsubmit inputbutton" value="Keep"/>'+'<input type="submit" class="inputaux inputbutton" value="Remove">'+'</div></div>';set_inner_html(c,d);c.getElementsByTagName('input')[0].onclick=function(){animation(a.previousSibling).to('opacity',0).duration(200).hide().go();return false;};c.getElementsByTagName('input')[1].onclick=function(){removeAppBox(f,b,g,e);DOM.remove(a.previousSibling);};CSS.addClass(c,'add_new_box_border');c.childNodes[0].style.width=a.offsetWidth+20+'px';c.childNodes[0].style.position='absolute';c.childNodes[0].childNodes[0].style.height=a.offsetHeight+9+'px';a.parentNode.insertBefore(c,a);animation(DOMScroll.getScrollRoot()).to('scrollTop',elementY(a)-40).ease(animation.ease.end).duration(800).go();}function removeAppBox(d,b,e,c){if(!ge(c+b))return false;new AsyncRequest().setURI('/ajax/profile/box.php').setData({profile_id:d,app_id:b,action:'remove',tab_id:e}).send();var a=$(c+b);animation(a).to('opacity',0).duration(200).hide().ondone(DOM.remove.bind(null,c+b)).go();return false;}function moveToTab(d,a,b,e,f,c){new AsyncRequest().setURI('/ajax/profile/box.php').setData({to_tab:e,profile_id:d,app_id:a,action:'move_to_tab',from_tab:b}).setHandler(function(g){tab_controller.dirtyCachedView(f);if(f=='feed'||f=='wall')tab_controller.dirtyCachedView('box_3');DOM.remove('box_app_'+a);goURI(c);DOMScroll.scrollTo(new Vector2(0,0,'document'),false);}).send();return false;}
function ProfileTabController(j,u,e,s,m,f,n,r,p,b,k,a,l,g){this.tabs={};this.addTabLink=null;this.moreLink=null;this.topBar=s;this.numTabs=0;addEventBase($('top_bar_pic'),'click',function(v,event){v.onselect('wall');return Event.kill(event);}.bind(null,this));var q=m.getElementsByTagName('li');for(var i=0;i<q.length;i++){var d=q[i].getAttributeNode('view');if(d?d.specified:false){var t=q[i].getAttribute('view');if(CSS.hasClass(q[i],'selected'))this.currentView=t;this._hookUpTab(q[i],t);this.tabs[t]=q[i];var c=q[i].getElementsByTagName('a')[0];$(c).listen('click',function(event){if(this.activeDrag)return event.kill();});if(q[i].getElementsByTagName('a').length>1){var h=q[i].getElementsByTagName('a')[1];this._hookUpEdit(h,t,c.innerHTML);}this.numTabs++;}}if(ge(r)){this.tab_more=$(r);this.moreDropMenu=dropmenu(this.tab_more.childNodes[0]).registerHTMLMenu('menu_tab_more').setPosition(dropmenu.ALIGN_LEFT).addHook('show',function(){CSS.addClass(this.tab_more,'selected_tab_more');}.bind(this)).addHook('hide',function(){CSS.removeClass(this.tab_more,'selected_tab_more');}.bind(this));}if(ge(p)){this.add_tab=$(p);CSS.removeClass(this.add_tab,'hidden_elem');this.addMenu=flyout_menu(this.add_tab.childNodes[0]).registerHTMLMenu('flyout_menu_profile_add_tab').setMenuClickArea(DOM.find($('profile_tab_add'),'div.add_tab_app_typeahead')).setPosition(dropmenu.ALIGN_LEFT).addHook('show',function(){CSS.addClass(this.add_tab,'selected_menu_icon');}.bind(this)).addHook('hide',function(){CSS.removeClass(this.add_tab,'selected_menu_icon');}.bind(this));}this.id=j;this.viewer=u;this.is_impersonated=k;this.can_edit=e;this.root=m;this.canvas=f;this.leftColumn=f.firstChild;this.href='';this.cachedTabs={};this.ads_wanted=a;this.rightColumn=$('tab_canvas');if(!b){this.cachedTabs[n]=this.rightColumn.childNodes[0];}else onloadRegister(this.selectView.bind(this,n));this.nonSortables=l;this.maxSortableTabs=ProfileTabController.MAX_TABS-this.nonSortables.length;this.composerTab=g;if(e){this.sortableMainRoot=$('profile_tabs');this.sortableMoreRoot=this.tab_more&&this.tab_more.getElementsByTagName('ul')[0];this.sortableMain=new SortableGroup();if(this.sortableMore=this.sortableMoreRoot&&new SortableGroup())this.sortableMain.link(this.sortableMore);this.sortableMain.setLinkJumpHandler(this.onSortableLinkJump.bind(this));for(t in this.tabs){var o=this.tabs[t];if(!this.nonSortables.contains(o.getAttribute('view')))(o.parentNode==this.sortableMainRoot?this.sortableMain:this.sortableMore).addSortable(t,o,o.getElementsByTagName('a')[0]);}this.sortableMain.setOrderChangeHandler(this.saveTabOrder.bind(this));this.sortableMore.setOrderChangeHandler(this.saveTabOrder.bind(this));}PageTransitions.registerHandler(bind(this,'handleNavigation',n));tab_controller=this;}ProfileTabController.MAX_TABS=6;ProfileTabController.twoColumnViews={posts:true,info:true,wall:true};ProfileTabController.facebookTabs=['wall','posts','info','photos','box_3','app_2347471856','app_2392950137','app_2344061033','app_2373072738','app_6261817190'];ProfileTabController.prototype.getLastDisplayedView=function(){var a=this.sortableMain.getOrder();if(!a.length)return null;return a[a.length-1];};ProfileTabController.prototype.getFirstOverflowView=function(){var a=this.sortableMore.getOrder();if(!a.length)return null;return a[0];};ProfileTabController.prototype.onSortableLinkJump=function(b){var d=this.sortableMain.getOrder(),c=null;if(d.length>this.maxSortableTabs){for(var a=d.length-1;a>=0;a--)if(d[a]!=b&&d[a]!=this.currentView){c=d[a];break;}this.sortableMoreRoot.insertBefore(this.tabs[c],this.sortableMoreRoot.firstChild);this.sortableMore.migrateLinkedSortable(c);}else if(d.length<this.maxSortableTabs){d=this.sortableMore.getOrder();for(var a=0;a<d.length;a++)if(d[a]!=b){c=d[a];break;}this.sortableMainRoot.insertBefore(this.tabs[c],this.tab_more);this.sortableMain.migrateLinkedSortable(c);}if(this.moreDropMenu)this.moreDropMenu._positionMenu();};ProfileTabController.prototype._hookUpTab=function(d,e,a){var c=null;if(this.numTabs>=ProfileTabController.MAX_TABS){if(a){var b=$('tabs_more_menu').firstChild;b.appendChild(d);this.numTabs++;CSS.removeClass(this.tab_more,'hidden_elem');c=this.sortableMore;}}else if(a){if(this.tab_more){this.root.insertBefore(d,this.tab_more);}else this.root.insertBefore(d,this.add_tab);this.numTabs++;c=this.sortableMain;}if(c)c.addSortable(e,d,d.getElementsByTagName('a')[0]);};ProfileTabController.prototype.onselect=function(a){if(this.currentView==a||this.waitingForAjax)return;goURI(URI.getRequestURI().addQueryData({v:a}));};ProfileTabController.prototype._hookUpEdit=function(e,d,a){var c=document.createElement('div');var b=document.createElement('a');b.innerHTML=_tx("\u30bf\u30d6\u3092\u524a\u9664");b.setAttribute('href','#');b.onclick=this.deleteTab.bind(this,d);c.appendChild(b);flyout_menu(e).setMarkupContent('edit_menu_'+d,'link_menu flyout_menu_18',_tx("\u30bf\u30d6\u306e\u30aa\u30d7\u30b7\u30e7\u30f3"),c).addHook('show',function(){CSS.addClass(e,'selected');}.bind(this)).addHook('hide',function(){CSS.removeClass(e,'selected');}.bind(this));return false;};ProfileTabController.prototype.handleNavigation=function(a,h){var e=h.getQueryData();var f=e.viewas||this.viewer;var c=function(i){if(this.ads_wanted&&parseInt(this.viewer)>0)ads_refresh(this.currentView,new URI(h).getPath(),false,false,false,i);PageTransitions.transitionComplete();}.bind(this);if(e.app_page){this.selectPage(e.fbhref,c);return true;}if(e.story_fbid)return false;if(!(ProfileURIController.isDestinationURIProfilePage(h)&&f==this.viewer))return false;if(!e.v&&this.currentView==a)return false;if(window.ProfilePhotosTabController){var g=ProfilePhotosTabController.transitionHandler(this.currentView,h,a);if(g!==null)return g;}var b={v:1,id:1,viewas:1,ref:1};for(var d in e)if(!b[d])return false;if(e.ref=='search')search_log_2nd_action('Select tab:'+e.v);this.selectView(e.v||a,c);return true;};ProfileTabController.prototype.selectView=function(b,a){if(this.addMenu)this.addMenu.hide();if(!this.tabs[b]){new URI('/profile.php').addQueryData({v:b}).go();return false;}this.selectTab(b);if(!ProfileTabController.twoColumnViews[b]&&ProfileTabController.twoColumnViews[this.currentView]){CSS.removeClass(document.body,'profile_two_columns');}else if(ProfileTabController.twoColumnViews[b]&&!ProfileTabController.twoColumnViews[this.currentView])CSS.addClass(document.body,'profile_two_columns');this.changePage(b,'',a);};ProfileTabController.prototype.selectTab=function(h){if(intl_locale_is_rtl()){var g='padding-left';}else var g='padding-right';for(var c in this.tabs)if(c==h){if(this.sortableMore&&this.sortableMore.getOrder().contains(h)){var e=this.getLastDisplayedView();var d=this.tabs[e];var b=this.getFirstOverflowView();var a=this.tabs[b];var f=d.previousSibling;DOM.insertBefore(d,a);DOM.insertAfter(f,this.tabs[c]);this.sortableMore.migrateLinkedSortable(e);this.sortableMain.migrateLinkedSortable(h);}if(this.tabs[c].childNodes[1]){animation(this.tabs[c].childNodes[0]).from(g,'11px').to(g,'25px').duration(100).go();animation(this.tabs[c].childNodes[1]).from('width','0').to('width','19px').duration(100).go();}CSS.addClass(this.tabs[c],'selected');}else if(CSS.hasClass(this.tabs[c],'selected')){CSS.removeClass(this.tabs[c],'selected');if(this.tabs[c].childNodes[1])animation(this.tabs[c].childNodes[0]).from(g,'25px').to(g,'11px').duration(100).go();}};ProfileTabController.prototype.selectPage=function(a,b){this.changePage(this.currentView,a,b);};ProfileTabController.prototype.fetchPage=function(e,b,a,c,d){c=c||'';subdomain=ProfileTabController.facebookTabs.contains(e)?'www':'apps';var f={id:this.id,v:e,href:b,iframe:true};if(this.is_impersonated&&this.viewer)f.viewas=this.viewer;new AsyncRequest().setOption('useIframeTransport',true).setReadOnly(true).setMethod('GET').setURI(new URI('/ajax/profile/tab.php').setSubdomain(subdomain)).setData(f).setContextData('src_tab_name',c).setContextData('dst_tab_name',e).setNectarActionData().setHandler(function(h){var g=h.getPayload();if(g.redirect){goURI(g.redirect);}else{var i=!b;a(HTML(g.tab_content),e,i,g.additional_content);}}.bind(this)).setFinallyHandler(function(g){this.waitingForAjax=false;d&&d(0);}.bind(this)).send();this.waitingForAjax=true;};ProfileTabController.prototype.changePage=function(f,a,d){var e=this.rightColumn;while(this.rightColumn.childNodes.length)this.rightColumn.removeChild(this.rightColumn.childNodes[0]);CSS.addClass(this.rightColumn,'loading');var b=this.currentView;this.currentView=f;this.href=a;var c=function(k,m,l,g){if(g)for(var j=0;j<g.length;++j){var h=g[j];DOM.setContent($(h.div_id),HTML(h.html));}CSS.removeClass(e,'loading');var n;if(k instanceof HTML){var i=$N('div');e.appendChild(i);DOM.setContent(i,k);if(l)this.cachedTabs[m]=i;n=false;}else{e.appendChild(k);n=true;}}.bind(this);if(this.cachedTabs[f]&&!a&&(b!=f)){c(this.cachedTabs[f],f,true);d&&d(1);}else this.fetchPage(f,a,c,b,d);};ProfileTabController.prototype.dirtyCachedView=function(a){if(this.cachedTabs[a])delete this.cachedTabs[a];};ProfileTabController.prototype.addNewTab=function(g,a,f,b){if(this.addMenu)this.addMenu.hide();var e=document.createElement('li');var d=document.createElement('a');CSS.setClass(d,'tab_link');d.innerHTML=f;var c=document.createElement('a');CSS.setClass(c,'edit');e.appendChild(d);e.appendChild(c);if(b){new AsyncRequest().setURI('/ajax/profile/tab.php').setData({id:this.id,action:'add_app_tab'}).setHandler(function(h){var i='box_'+h.payload.tab_id;e.setAttribute('view',i);this._hookUpTab(e,i,true);this._hookUpView(e,d,c,f,i);if(g)CSS.addClass(g,'hidden_elem');}.bind(this)).send();}else new AsyncRequest().setURI('/ajax/profile/tab.php').setData({id:this.id,action:'add_tab',tab_id:a}).setHandler(function(h){var i=(f=="Photos"?'photos':'app_'+a);e.setAttribute('view',i);this._hookUpTab(e,i,true);this._hookUpView(e,d,c,f,i);if(g)CSS.addClass(g,'hidden_elem');}.bind(this)).send();};ProfileTabController.prototype._hookUpView=function(e,d,c,a,g){var b=ProfileURIController.getCurrentProfileBaseURI();var f={v:g};if(this.is_impersonated&&this.viewer)f.viewas=this.viewer;d.href=b.addQueryData(f).toString();this._hookUpEdit(c,g,a);this.tabs[g]=e;this.onselect(g);};ProfileTabController.prototype.editTabName=function(j,d){var i=j.split('_')[1];var h=this.tabs[j];h.style.width=h.offsetWidth-2+'px';h.style.height=h.offsetheight+'px';var c=h.firstChild.offsetWidth-16;for(var e=0;e<h.childNodes.length;e++)hide(h.childNodes[e]);var f=document.createElement('form');var g=DOM.find(h,'.app_tab_title').innerHTML;f.innerHTML='<input type="text" id="tab_name_edit" class="inputtext" style="width:'+c+'px" value="'+g+'">';h.appendChild(f);$('tab_name_edit').focus();function b(k){f.onsubmit();}function a(k){Event.kill(k);}f.onsubmit=function(){var l=f.firstChild.value;var m=DOM.find(h,'.app_tab_title');m.innerHTML=l;h.removeChild(f);for(var k=0;k<h.childNodes.length;k++)show(h.childNodes[k]);document.body.removeEventListener('click',b,false);h.removeEventListener('click',a,true);new AsyncRequest().setURI('/ajax/profile/tab.php').setData({id:this.id,action:'rename_tab',tab_id:i,tab_name:l}).send();h.style.width=null;return false;}.bind(this);document.body.addEventListener('click',b,false);h.addEventListener('click',a,true);Event.kill(d);};ProfileTabController.prototype.deleteTab=function(h){var g;if(h=='photos'){g=2305272732;}else g=h.split('_')[1];new AsyncRequest().setURI('/ajax/profile/tab.php').setData({id:this.id,action:'delete_tab',tab_id:g}).send();var b=this.getFirstOverflowView();var a=this.tabs[b];var d=this.getLastDisplayedView();var c=this.tabs[d];if(b)DOM.insertAfter(c,a);this.sortableMain.migrateLinkedSortable(b);this.sortableMain.removeSortable(h);this.root.removeChild(this.tabs[h]);delete this.tabs[h];this.numTabs--;var e=ge('new_tab_'+g);if(e)CSS.removeClass(e,'hidden_elem');var f=this.getFirstOverflowView();if(!f)CSS.addClass(this.tab_more,'hidden_elem');this.onselect('wall');return false;};ProfileTabController.prototype.saveTabOrder=function(){var a=this.sortableMain.getOrder();if(this.sortableMore)a=a.concat(this.sortableMore.getOrder());new AsyncRequest().setURI('/ajax/profile/tab.php').setData({id:this.id,action:'reorder_tabs',tab_order:a}).send();};var ProfileURIController={_profileId:0,_profilePage:false,init:function(a){this._profileId=a;this._profileURI=URI.getRequestURI();this._setProfilePage(true);onunloadRegister(this._setProfilePage.bind(this,false));},_setProfilePage:function(a){this._profilePage=a;},isProfilePage:function(){return this._profilePage;},isDestinationURIProfilePage:function(b){if(!this.isProfilePage())return false;var a=b.getQueryData().id;if(b.getPath()=='/profile.php')return a==this._profileId;return this._profileURI.getPath()==b.getPath();},getCurrentProfileBaseURI:function(){var b=URI.getMostRecentURI();var a=b.getQueryData().id;var c={};if(a)c.id=a;return b.setQueryData(c);}};
function motion_spawn_delete_dialog(c,b){var a={v:c,delete_dialog:true};if(b)a.parent_oid=b;new AsyncRequest().setURI('/ajax/motion.php').setData(a).setHandler(function(d){dialog_data=d.getPayload();_motion_show_delete_dialog(c,dialog_data.preview_content,dialog_data.success_content,b);}).send();}function _motion_show_delete_dialog(e,a,d,c){var b=new Dialog().setTitle(a.title).setBody(a.html).setButtons([Dialog.newButton(a.verb.toLowerCase(),a.verb,'',function(){_motion_delete_video(e,d,c);}),Dialog.CANCEL]).show();}function _motion_delete_video(d,c,b){var a={delete_video:true,v:d};if(b)a.parent_oid=b;new AsyncRequest().setURI('/ajax/motion.php').setData(a).setHandler(function(f){var e=Dialog.getCurrent();if(e)e.hide();new Dialog().setTitle(c.title).setBody(c.html).show();goURI.bind(null,c.url).defer(2000);}).send();}function motion_show_profile_video_dialog(d,a,c){var b=new Dialog().setTitle(a.title).setBody(a.html).setButtons([Dialog.newButton('make-profile-video',_tx("\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u52d5\u753b\u306b\u3059\u308b"),'',function(){_motion_set_profile_video(d,c);}),Dialog.CANCEL]).show();}function _motion_set_profile_video(b,a){new AsyncRequest().setURI('/ajax/motion.php').setData({profile_video:1,v:b}).setHandler(function(c){goURI('/video/video.php?profile&v='+b);return true;}).send();}function video_send_email_when_processed(c,b){var a={action:'set_send_email',video_id:c,send_email:b?1:0};new AsyncRequest().setURI('/ajax/motion_upload.php').setData(a).setHandler(function(d){$('notification_status').innerHTML=d.getPayload();}).send();}var recorder_dialog;function motion_submit_video_handler(a){video_id=a.video_id;video_category=a.video_category;oid=a.parent_oid;if(!video_id)goURI('/video/editvideo.php?error');switch(video_category){case 1:new AsyncRequest().setURI('/ajax/motion_fvr_dialog.php').setData({action:'fvr_get_permalink',video_id:video_id}).setHandler(function(b){inboxAttachments.attach_link_url(ge('attachment_stage_area'),b.getPayload(),true);}).send();break;case 2:new AsyncRequest().setURI('/ajax/motion.php').setData({obj_attach:1,v:video_id,parent_oid:oid}).setHandler(function(b){goURI('/video/editvideo.php?created&v='+video_id+'&oid='+oid);}).send();break;case 0:default:goURI('/video/editvideo.php?created&v='+video_id);break;}}function video_add_video_msg_inputs(b){video_id=b.video_id;if(inboxAttachments.is_active){var a=ge(inboxAttachments.edit_id);}else var a=ge(wallAttachments.edit_id);if(a)if(ge('video_msg_id')){$('video_msg_id').value=video_id;}else{var d=document.createElement('input');d.name='attachment[params][0]';d.id='video_msg_id';d.value=video_id;d.type='hidden';var c=document.createElement('input');c.name='attachment[type]';c.id='video_msg_share_type';c.value=15;c.type='hidden';a.appendChild(d);a.appendChild(c);}}function video_remove_video_msg_inputs(){if(inboxAttachments.is_active){var a=ge(inboxAttachments.edit_id);}else var a=ge(wallAttachments.edit_id);if(a){var b=ge('video_msg_id');if(b){a.removeChild(b);var c=ge('video_msg_share_type');if(c)a.removeChild(c);}}}function video_toggle_dialog(b,c){var a={action:'toggle_dialog',dialog_type:b,dialog_value:c};new AsyncRequest().setURI('/ajax/motion_invite.php').setData(a).setHandler(function(d){}).send();}

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