/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  February 9th 2010 9:45:44 PM PST                             */
/*      Machine:  10.16.140.108                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/7l2oocawlf0og0o8.pkg.js r143635                           */
/*       Locale:  id_ID                                                        */
/*         Path:  js/7l2oocawlf0og0o8.pkg.js                                   */

if (window.CavalryLogger) { CavalryLogger.start_js(["js\/7l2oocawlf0og0o8.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("Silakan Pilih Sebuah Gambar")+'</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("Tidak Ada Gambar")+'</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} dari {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 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("Lampirkan"),'',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("Batalkan"),'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._detect_url=function(obj,force){var url='';var start_position=-1;var end_position=-1;if(force==true){if(url=obj.value.match(/www\.\S*/i)){start_position=obj.value.indexOf(url[0]);end_position=start_position+url[0].length;url="http://"+url[0];}else{var match='';if(match=obj.value.match(/(http|fb):\/\/\S*/i)){url=match[0];start_position=obj.value.indexOf(match[0]);end_position=start_position+match[0].length;}}}else{if(url=obj.value.match(/www\.\S*[\s|\)|\!]/i)){start_position=obj.value.indexOf(url[0]);end_position=start_position+url[0].length;url="http://"+url[0];}else{var match='';if(match=obj.value.match(/(http|fb):\/\/\S*[\s|\)|\!]/i)){url=match[0];start_position=obj.value.indexOf(match[0]);end_position=start_position+match[0].length;}}}
if(url){url=url.replace(/[\s|\)|\!]/g,'');var last_char=url.charAt(url.length-1);if(last_char.match(/[,|.]/)){url=url.substr(0,url.length-1);}
var cursor_position=DOM.getCaretPosition(obj).start;if(url!=this.last_url_scraped&&cursor_position&&start_position>=0&&end_position>=0&&(cursor_position<start_position||cursor_position>=end_position)){this.last_url_scraped=url;if(this._is_fb_code_url(url)){obj.value=obj.value.substr(0,start_position)+obj.value.substr(end_position);}}else{url='';}}
return url;}
attachments.prototype._auto_scrape_url=function(obj){if(this.attachment_added){return false;}
if(!this.scrape_last_count){this.scrape_last_count=0;}
if((obj.value.length-this.scrape_last_count)>5||(this.scrape_last_count==0&&obj.value.length>1)){var force=true;}
var url=this._detect_url(obj,force);if(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);}}
this.scrape_last_count=obj.value.length;return false;}
attachments.prototype.start_textarea_interval=function(obj){this.textarea_obj=obj;this.textarea_interval=setInterval(this._textarea_interval_function.bind(this),50);}
attachments.prototype._textarea_interval_function=function(){if(typeof this!='undefined'&&this.textarea_obj&&(!this.attachment_added&&ge(this.view_wrapper_id))){this._auto_scrape_url(this.textarea_obj);}else{this.stop_textarea_interval();}}
attachments.prototype.stop_textarea_interval=function(){clearInterval(this.textarea_interval);}

function FeedFormBase(){this._storyType=63;this._feedData=null;this._uri='/fbml/ajax/prompt_feed.php';this._buttonCallback=null;this._shouldShowDialog=false;};FeedFormBase.SIZES={"small":1,"medium":2,"large":4};FeedFormBase.AUTO_PUBLISH_OPTIONS={"never":2,"small":4,"medium":5,"large":6};FeedFormBase.prototype.setStoryType=function(storyType){this._storyType=storyType;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.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){this._attachSizeHandlers(dialog);return this;}
FeedFormBase.prototype._attachSizeHandlers=function(dialog){var options=this._selectorOptions;var id_prefix=this._feedformFilter;var feedform_remember=this._rememberData;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;}
if(feedform_remember){var explanation_elem=$(feedform_remember['explanation_id']);var checkbox_elem=$(feedform_remember['checkbox_id']);if(this._dialog){this.cancel_button=this._dialog.getButtonElement('cancel');this.publish_button=this._dialog.getButtonElement('publish');}else{this.cancel_button=$('cancel');this.publish_button=$('publish');}
checkbox_elem.onclick=function(checkbox_elem){if(checkbox_elem.checked){this._setPublishButtonText(_tx("Publikasikan\n"));this._setCancelButtonText(_tx("Jangan Publikasikan"));explanation_elem.removeClass('hidden_elem');}else{this._setPublishButtonText(_tx("Terbitkan"));this._setCancelButtonText(_tx("Tidak, Terima Kasih"));explanation_elem.addClass('hidden_elem');}}.bind(this,checkbox_elem);}
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();}};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._shouldShowDialog){this._dialog.show();}
return this;};FeedFormBase.prototype._confirm=function(data){new AsyncRequest().setURI(this._uri).setData(data).setHandler(this.showConfirmed.bind(this)).send();};FeedFormBase.prototype.handleButton=function(button){if(this._buttonCallback){this._buttonCallback(button);}
if(button.name=="publish"){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);}
return this;};FeedFormBase.prototype.shouldShowDialog=function(shouldShow){this._shouldShowDialog=shouldShow;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)).setErrorHandler(this._showApplicationError.bind(this)).setData(data);this.showDialog(async);return this;};FeedFormBase.prototype.showConfirmed=function(){var msg=this.is_never_publish?_tx("Pengaturan Disimpan."):_tx("Berita telah dipublikasikan.");var confirmation='<div class="interim_status"><h3>'+msg+'</h3></div>';if(this._dialog){this._dialog.setBody(confirmation);}else{$('dialog_body').innerHTML=confirmation;}
setTimeout(this._finish.bind(this),500);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 showError=function(showMsg){(new ErrorDialog()).showError(response.getPayload().errorTitle,showMsg?(response.getPayload().errorMessage):_tx("Terjadi kesalahan aplikasi. Silakan coba beberapa saat lagi."));}
var err=response.getError();if(err==kError_Platform_CallbackValidationFailure){showError(true);}else if(err==kError_Platform_ApplicationResponseInvalid){if(response.getPayload().showDebug){showError(true);}else{if(this._continuation){this._continuation();}else{showError(false);}}}else{ErrorDialog.showAsyncError(response);}
return false;};function FeedForm(){this.parent.construct(this);}
FeedForm.extend('FeedFormBase');FeedForm.prototype._setPublishButtonText=function(text){this.publish_button.value=text;}
FeedForm.prototype._setCancelButtonText=function(text){this.cancel_button.value=text;}
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,preview:true,feed_target_type:'self_feed'};copy_properties(data,more);return this._showBase(data);}
FeedForm.prototype.cancelFeed=function(){if($('feed_never_show').checked){this.confirmFeed(true);}else{this._finish();}}
FeedForm.prototype.confirmFeed=function(no_publish){var never_show=$('feed_never_show').checked?1:0;var selected_option=no_publish?FeedFormBase.AUTO_PUBLISH_OPTIONS['never']:FeedFormBase.AUTO_PUBLISH_OPTIONS[this._currentSize];var data={feed_info:this._feedData,feedform_type:this._storyType,has_selected_option:never_show,selected_option:selected_option,preview:false,feed_target_type:'self_feed',app_id:this._appid,size:FeedFormBase.SIZES[this._currentSize]};this._confirm(data);};function MultiFeedForm(){this.parent.construct(this);}
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]};this._confirm(data);};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'&&(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),feed_target_type:'multi_feed'};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]};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),feed_target_type:'target_feed'};return this._showBase(data);};

function typeaheadpro(obj,source,properties){if(!typeaheadpro.hacks){typeaheadpro.should_check_missing_events=ua.safari()<500;typeaheadpro.should_simulate_keypress=(ua.ie()<8)||(ua.safari()>500&&ua.safari()<523||ua.safari()>=525);if(typeaheadpro.should_use_iframe==undefined){typeaheadpro.should_use_iframe=typeaheadpro.should_simulate_keypress;}
typeaheadpro.should_use_overflow=ua.opera()<9.5||ua.safari()<500;if(ua.firefox()){this.activate_poll_on_focus_events=true;}
typeaheadpro.hacks=true;}
typeaheadpro.instances=(typeaheadpro.instances||[]);typeaheadpro.instances.push(this);this.instance=typeaheadpro.instances.length-1;copy_properties(this,properties||{});this.obj=obj;this.obj.typeahead=this;this.obj.onfocus=this._onfocus.bind(this);this.obj.onblur=chain(this.obj.onblur,this._onblur.bind(this));this.obj.onchange=this._onchange.bind(this);this.obj.onkeyup=function(event){return this._onkeyup(event||window.event);}.bind(this);this.obj.onkeydown=function(event){return this._onkeydown(event||window.event);}.bind(this);this.obj.onkeypress=function(event){return this._onkeypress(event||window.event);}.bind(this);this.want_icon_list=false;this.showing_icon_list=false;this.stop_suggestion_select=false;if(this.typeahead_icon_class&&this.typeahead_icon_get_return){this.typeahead_icon=document.createElement('div');CSS.addClass(this.typeahead_icon,'typeahead_list_icon');CSS.addClass(this.typeahead_icon,this.typeahead_icon_class);this.typeahead_icon.innerHTML='&nbsp;';this.setup_typeahead_icon();setTimeout(function(){this.focus();}.bind(this),50);this.typeahead_icon.onmousedown=function(event){return this.typeahead_icon_onclick(event||window.event);}.bind(this);}
this.focused=this.focused||this.obj.offsetWidth?true:false;this.anchor=this.setup_anchor();this.dropdown=document.createElement('div');CSS.addClass(this.dropdown,'typeahead_list');if(!this.focused){this.dropdown.style.display='none';}
this.anchor_block=this.anchor_block||this.anchor.tagName.toLowerCase()=='div';DOMScroll.getScrollRoot().appendChild(this.dropdown);this.dropdown.className+=' typeahead_list_absolute';this.dropdown.appendChild(this.list=document.createElement('div'));this.dropdown.onmousedown=function(event){return this.dropdown_onmousedown(event||window.event);}.bind(this);if(typeaheadpro.should_use_iframe&&!typeaheadpro.iframe){typeaheadpro.iframe=document.createElement('iframe');typeaheadpro.iframe.src="/common/blank.html";CSS.setClass(typeaheadpro.iframe,'typeahead_iframe');typeaheadpro.iframe.style.display='none';typeaheadpro.iframe.frameBorder=0;DOMScroll.getScrollRoot().appendChild(typeaheadpro.iframe);}
if(typeaheadpro.should_use_iframe&&typeaheadpro.iframe){typeaheadpro.iframe.style.zIndex=parseInt(CSS.getStyle(this.dropdown,'zIndex'))-1;}
this.log_data={'kt':0,'kp':0,'sm':null,'ty':0,'f':1};this.results_text='';this.last_key_suggestion=0;this.status=typeaheadpro.STATUS_BLOCK_ON_SOURCE_BOOTSTRAP;this.clear_placeholder();if(source){this.set_source(source);}
if(this.source){this.selectedindex=-1;if(this.focused){this._onfocus();this.show();this._onkeyup();this.set_class('');this.capture_submit();}}else{this.hide();}
onunloadRegister(bind(this,'hide'),true);}
typeaheadpro.prototype.enumerate=false;typeaheadpro.prototype.interactive=false;typeaheadpro.prototype.changed=false;typeaheadpro.prototype.render_block_size=50;typeaheadpro.prototype.typeahead_icon_class=false;typeaheadpro.prototype.typeahead_icon_get_return=false;typeaheadpro.prototype.old_value="";typeaheadpro.prototype.poll_handle=null;typeaheadpro.prototype.activate_poll_on_focus_events=false;typeaheadpro.prototype.suggestion_count=0;typeaheadpro.STATUS_IDLE=0;typeaheadpro.STATUS_WAITING_ON_SOURCE=1;typeaheadpro.STATUS_BLOCK_ON_SOURCE_BOOTSTRAP=2;typeaheadpro.prototype.clear_value_on_blur=true;typeaheadpro.prototype.max_results=0;typeaheadpro.prototype.max_display=10;typeaheadpro.prototype.allow_placeholders=false;typeaheadpro.prototype.auto_select=true;typeaheadpro.dirty_instances=function(){if(typeaheadpro.instances){typeaheadpro.instances.forEach(function(instance){instance.update_status(typeaheadpro.STATUS_BLOCK_ON_SOURCE_BOOTSTRAP);if(instance.source){instance.source.is_ready=false;}});}}
typeaheadpro.prototype.set_source=function(source){this.source=source;this.source.set_owner(this);this.status=typeaheadpro.STATUS_IDLE;this.cache={};this.last_search=0;this.suggestions=[];}
typeaheadpro.prototype.setup_anchor=function(){return this.obj;}
typeaheadpro.prototype.destroy=function(){if(this.typeahead_icon){DOM.remove(this.typeahead_icon);this.toggle_icon_list=function(){};}
this.clear_render_timeouts();if(!this.anchor_block&&this.anchor.nextSibling.tagName.toLowerCase()=='br'){DOM.remove(this.anchor.nextSibling);}
if(this.dropdown){DOM.remove(this.dropdown);}
if(this.obj){this.obj.onfocus=this.obj.onblur=this.obj.onkeyup=this.obj.onkeydown=this.obj.onkeypress=this.obj.typeahead=null;DOM.remove(this.obj);}
this.anchor=this.obj=this.dropdown=null;delete typeaheadpro.instances[this.instance];}
typeaheadpro.prototype.check_value=function(){if(this.obj){var new_value=this.obj.value;if(new_value!=this.old_value){this.dirty_results();this.old_value=new_value;}}}
typeaheadpro.prototype._onkeyup=function(e){this.last_key=e?e.keyCode:-1;if(this.key_down==this.last_key){this.key_down=0;}
var return_val=true;switch(this.last_key){case KEYS.ESC:this.selectedindex=-1;this._onselect(false);this.hide();e.stop();return_val=false;break;}
return return_val;}
typeaheadpro.prototype._onkeydown=function(e){this.key_down=this.last_key=e?e.keyCode:-1;this.interactive=true;switch(this.last_key){case 33:case 34:case KEYS.UP:case KEYS.DOWN:this.log_data.kt+=1;if(typeaheadpro.should_simulate_keypress){this._onkeypress({keyCode:this.last_key});}
return false;case KEYS.TAB:this.log_data.kt+=1;this.select_suggestion(this.selectedindex);if(e.shiftKey){this.reverse_focus();}else{this.advance_focus();}
break;case KEYS.RETURN:this.log_data.sm='key_ret';if(this.select_suggestion(this.selectedindex)){this.hide();}
if(typeof(this.submit_keydown_return)!='undefined'){this.submit_keydown_return=this._onsubmit(this.get_current_selection());}
return this.submit_keydown_return;case 229:if(!this.poll_handle){this.poll_handle=setInterval(this.check_value.bind(this),100);}
break;default:this.log_data.kp+=1;setTimeout(bind(this,'check_value'),10);}}
typeaheadpro.prototype._onkeypress=function(e){var multiplier=1;this.last_key=e?event_get_keypress_keycode(e):-1;this.interactive=true;switch(this.last_key){case 33:multiplier=this.max_display;case KEYS.UP:this.set_suggestion(multiplier>1&&this.selectedindex>0&&this.selectedindex<multiplier?0:this.selectedindex-multiplier);this.last_key_suggestion=(new Date()).getTime();return false;case 34:multiplier=this.max_display;case KEYS.DOWN:if(trim(this.get_value())==''&&!this.enumerate){this.enumerate=true;this.results_text=null;this.dirty_results();}else{this.set_suggestion(this.suggestions.length<=this.selectedindex+multiplier?this.suggestions.length-1:this.selectedindex+multiplier);this.last_key_suggestion=(new Date()).getTime();}
return false;case KEYS.RETURN:var ret=null;if(typeof(this.submit_keydown_return)=='undefined'){ret=this.submit_keydown_return=this._onsubmit(this.get_current_selection());}else{ret=this.submit_keydown_return;delete this.submit_keydown_return;}
return ret;default:setTimeout(bind(this,'check_value'),10);break;}
return true;}
typeaheadpro.prototype._onchange=function(){this.changed=true;}
typeaheadpro.prototype._onfound=function(obj){return this.onfound?this.onfound.call(this,obj):true;}
typeaheadpro.prototype._onsubmit=function(obj){if(this.onsubmit){var ret=this.onsubmit.call(this,obj);if(ret&&this.obj.form){if(!this.obj.form.onsubmit||this.obj.form.onsubmit()){this.obj.form.submit();}
return false;}
return ret;}else{this.advance_focus();return false;}}
typeaheadpro.prototype._onselect=function(obj){var call_select_handler=(function(){if(this.onselect){this.onselect.call(this,obj);}}).bind(this);if(obj.no_email){var async=new AsyncRequest().setData({action:'require',require_field:'email',uid:obj.i}).setMethod('GET').setReadOnly(true).setURI('/friends/ajax/external.php');new Dialog().setCloseHandler(function(typeahead){var email=this.getUserData();if(email){call_select_handler();}else{typeahead.set_value('');}}.bind(null,this)).setAsync(async).show();}else{call_select_handler();}}
typeaheadpro.prototype._onfocus=function(){if(!this.poll_handle&&this.activate_poll_on_focus_events){this.poll_handle=setInterval(this.check_value.bind(this),100);}
if(this.source){this.source.bootstrap();}
if(this.last_dropdown_mouse>(new Date()).getTime()-10||this.focused){return;}
if(this.changed){this.dirty_results();}
this.focused=true;this.changed=false;this.clear_placeholder();this.results_text='';this.set_class('');this.show();this.capture_submit();if(this.typeahead_icon){show(this.typeahead_icon);}}
typeaheadpro.prototype._onblur=function(event){if(this.last_dropdown_mouse&&this.last_dropdown_mouse>(new Date()).getTime()-10){Event.kill(event);setTimeout(function(){this.focus();}.bind(this),0);return false;}
if(!this.stop_hiding){if(this.showing_icon_list){this.toggle_icon_list(true);}}else{this.focus();return false;}
this.focused=false;if(this.changed&&!this.interactive){this.dirty_results();this.changed=false;return;}
if(!this.suggestions){this._onselect(false);}else if(this.selectedindex>=0&&this.auto_select){this.select_suggestion(this.selectedindex);}
this.hide();this.update_class();if(this.clear_value_on_blur&&!this.get_value()){var noinput=this.allow_placeholders?this.source.gen_noinput():'';this.set_value(noinput?noinput:'');this.set_class('typeahead_placeholder')}
if(this.poll_handle){clearInterval(this.poll_handle);this.poll_handle=null;}}
typeaheadpro.prototype.typeahead_icon_onclick=function(event){this.stop_hiding=true;this.focus();setTimeout(function(){this.toggle_icon_list();}.bind(this),50);Event.kill(event);return false;}
typeaheadpro.prototype.dropdown_onmousedown=function(event){this.last_dropdown_mouse=(new Date()).getTime();}
typeaheadpro.prototype.setup_typeahead_icon=function(){this.typeahead_parent=document.createElement('div');CSS.addClass(this.typeahead_parent,'typeahead_parent');this.typeahead_parent.appendChild(this.typeahead_icon);this.obj.parentNode.insertBefore(this.typeahead_parent,this.obj);}
typeaheadpro.prototype.mouse_set_suggestion=function(index){if(!this.visible){return;}
if((new Date()).getTime()-this.last_key_suggestion>50){this.set_suggestion(index);}}
typeaheadpro.prototype.capture_submit=function(){if(!typeaheadpro.should_check_missing_events)return;if((!this.captured_form||this.captured_substitute!=this.captured_form.onsubmit)&&this.obj.form){this.captured_form=this.obj.form;this.captured_event=this.obj.form.onsubmit;this.captured_substitute=this.obj.form.onsubmit=function(){return((this.key_down&&this.key_down!=KEYS.RETURN&&this.key_down!=KEYS.TAB)?this.submit_keydown_return:(this.captured_event?this.captured_event.apply(arguments,this.captured_form):true))?true:false;}.bind(this);}}
typeaheadpro.prototype.set_suggestion=function(index){this.stop_suggestion_select=false;if(!this.suggestions||this.suggestions.length<=index){return}
var old_node=this.get_suggestion_node(this.selectedindex);this.selectedindex=(index<=-1)?-1:index;var cur_node=this.get_suggestion_node(this.selectedindex);if(old_node){CSS.removeClass(old_node,'typeahead_selected');CSS.addClass(old_node,'typeahead_not_selected');}
if(cur_node){CSS.removeClass(cur_node,'typeahead_not_selected');CSS.addClass(cur_node,'typeahead_selected');}
this.recalc_scroll();this._onfound(this.get_current_selection());}
typeaheadpro.prototype.get_suggestion_node=function(index){var nodes=this.list.childNodes;return index==-1?null:nodes[Math.floor(index/this.render_block_size)].childNodes[index%this.render_block_size];}
typeaheadpro.prototype.get_current_selection=function(){return this.selectedindex==-1?false:this.suggestions[this.selectedindex];}
typeaheadpro.prototype.update_class=function(){if(this.suggestions&&this.selectedindex!=-1&&typeahead_source.flatten_string(this.get_current_selection().t)==typeahead_source.flatten_string(this.get_value())){this.set_class('typeahead_found');}else{this.set_class('');}}
typeaheadpro.prototype.select_suggestion=function(index){if(!this.stop_suggestion_select&&this.current_selecting!=index){this.current_selecting=index;}
if(!this.suggestions||index==undefined||index===false||this.suggestions.length<=index||index<0){this._onfound(false);this._onselect(false);this.selectedindex=-1;this.set_class('');}else{this.selectedindex=index;var type=this.suggestions[index].ty;if(type!='web'&&type!='search'){this.set_value(this.suggestions[index].t);}
this.set_class('typeahead_found');this._onfound(this.suggestions[this.selectedindex]);this._onselect(this.suggestions[this.selectedindex]);}
if(!this.interactive){this.hide();this.blur();}
this.current_selecting=null;return true;}
typeaheadpro.prototype.is_showing_suggestions=function(){return(this.suggestions)&&(this.suggestions.length>0);}
typeaheadpro.prototype.set_value=function(value){this.obj.value=value;}
typeaheadpro.prototype.get_value=function(){if(this.showing_icon_list&&this.old_typeahead_value!=this.obj.value){this.toggle_icon_list();}
if(this.want_icon_list){return this.typeahead_icon_get_return;}else{if(this.showing_icon_list){this.toggle_icon_list();}}
return this.obj.value;}
typeaheadpro.prototype.found_suggestions=function(suggestions,text,fake_data){if(!suggestions){suggestions=[];}
this.suggestion_count=suggestions.length;if(!fake_data){this.status=typeaheadpro.STATUS_IDLE;this.add_cache(text,suggestions);}
this.clear_render_timeouts();if(this.get_value()==this.results_text){return;}else if(!fake_data){this.results_text=typeahead_source.flatten_string(text);if(this.enumerate&&trim(this.results_text)!=''){this.enumerate=false;}}
var current_selection=-1;if(this.selectedindex!=-1){var selected_id=this.suggestions[this.selectedindex].i;for(var i=0,l=suggestions.length;i<l;i++){if(suggestions[i].i==selected_id){current_selection=i;break;}}}
if(current_selection==-1&&this.auto_select&&suggestions.length){current_selection=0;this._onfound(suggestions[0]);}
this.selectedindex=current_selection;this.suggestions=suggestions;if(!fake_data){this.real_suggestions=suggestions;}
if(suggestions.length){var html=[],blocks=Math.ceil(suggestions.length/this.render_block_size),must_render={},firstblock,samplenode=null;this.list.innerHTML='';for(var i=0;i<blocks;i++){this.list.appendChild(document.createElement('div'));}
if(current_selection>-1){firstblock=Math.floor(current_selection/this.render_block_size);must_render[firstblock]=true;if(current_selection%this.render_block_size>this.render_block_size/2){must_render[firstblock+1]=true;}else if(firstblock!=0){must_render[firstblock-1]=true;}}else{must_render[0]=true;}
for(var node in must_render){this.render_block(node);sample=this.list.childNodes[node].firstChild;}
this.show();if(blocks){var suggestion_height=sample.offsetHeight;this.render_timeouts=[];for(var i=1;i<blocks;i++){if(!must_render[i]){this.list.childNodes[i].style.height=suggestion_height*Math.min(this.render_block_size,suggestions.length-i*this.render_block_size)+'px';this.list.childNodes[i].style.width='1px';this.render_timeouts.push(setTimeout(this.render_block.bind(this,i),700+i*50));}}}}else{this.selectedindex=-1;this.set_message(this.status==typeaheadpro.STATUS_IDLE?this.source.gen_nomatch():this.source.gen_loading());this._onfound(false);}
this.recalc_scroll();if(!fake_data&&this.results_text!=typeahead_source.flatten_string(this.get_value())){this.dirty_results();}}
typeaheadpro.prototype.render_block=function(block,stack){var suggestions=this.suggestions,selectedindex=this.selectedindex,text=this.get_value(),instance=this.instance,html=[],node=this.list.childNodes[block];for(var i=block*this.render_block_size,l=Math.min(suggestions.length,(block+1)*this.render_block_size);i<l;i++){html.push('<div class="');if(selectedindex==i){html.push('typeahead_suggestion typeahead_selected');}else{html.push('typeahead_suggestion typeahead_not_selected');}
if(i>0&&suggestions[i-1].o<0&&suggestions[i].o>=0){html.push(' typeahead_delimiter');}
html.push('" onmouseover="typeaheadpro.instances[',instance,'].mouse_set_suggestion(',i,')" ','onmousedown="var instance=typeaheadpro.instances[',instance,']; instance.select_suggestion(',i,');instance.hide();Event.kill(event);">',this.source.gen_html(suggestions[i],text),'</div>');}
node.innerHTML=html.join('');CSS.addClass(node,'typeahead_suggestions');}
typeaheadpro.prototype.clear_render_timeouts=function(){if(this.render_timeouts){for(var i=0;i<this.render_timeouts.length;i++){clearTimeout(this.render_timeouts[i]);}
this.render_timeouts=null;}}
typeaheadpro.prototype.recalc_scroll=function(){var cn=this.list.firstChild;if(!cn){return;}
if(cn.childNodes.length>this.max_display){var last_child=cn.childNodes[this.max_display-1];var height=last_child.offsetTop+last_child.offsetHeight;this.dropdown.style.height=height+'px';var selected=this.get_suggestion_node(this.selectedindex);if(selected){var scrollTop=this.dropdown.scrollTop;if(selected.offsetTop<scrollTop){this.dropdown.scrollTop=selected.offsetTop;}else if(selected.offsetTop+selected.offsetHeight>height+scrollTop){this.dropdown.scrollTop=selected.offsetTop+selected.offsetHeight-height;}}
if(!typeaheadpro.should_use_overflow){this.dropdown.style.overflowY='scroll';this.dropdown.style.overflowX='hidden';}}else{this.dropdown.style.height='auto';if(!typeaheadpro.should_use_overflow){this.dropdown.style.overflowY='hidden';}}}
typeaheadpro.prototype.search_cache=function(text){return this.cache[typeahead_source.flatten_string(text)];}
typeaheadpro.prototype.add_cache=function(text,results){if(this.source.cache_results){this.cache[typeahead_source.flatten_string(text)]=results;}}
typeaheadpro.prototype.update_status=function(status){this.status=status;this.dirty_results();}
typeaheadpro.prototype.set_class=function(name){CSS.setClass(this.obj,(this.obj.className.replace(/typeahead_[^\s]+/g,'')+' '+name).replace(/ {2,}/g,' '));}
typeaheadpro.prototype.dirty_results=function(){if(!this.enumerate&&trim(this.get_value())==''){this.list.innerHTML='';this.results_text='';this.set_message(this.source.gen_placeholder());this.suggestions=[];this.selectedindex=-1;return;}else if(this.results_text==typeahead_source.flatten_string(this.get_value())){return;}else if(this.status==typeaheadpro.STATUS_BLOCK_ON_SOURCE_BOOTSTRAP){this.set_message(this.source.gen_loading());return;}
var time=(new Date).getTime();var updated=false;if(this.last_search<=(time-this.source.search_limit)&&this.status==typeaheadpro.STATUS_IDLE){updated=this.perform_search();}else{if(this.status==typeaheadpro.STATUS_IDLE){if(!this.search_timeout){this.search_timeout=setTimeout(function(){this.search_timeout=false;if(this.status==typeaheadpro.STATUS_IDLE){this.dirty_results();}}.bind(this),this.source.search_limit-(time-this.last_search));}}}
if(this.source.allow_fake_results&&this.real_suggestions&&!updated){var ttext=typeahead_source.tokenize(this.get_value()).sort(typeahead_source._sort);var fake_results=[];for(var i=0;i<this.real_suggestions.length;i++){if(typeahead_source.check_match(ttext,this.real_suggestions[i].t+' '+this.real_suggestions[i].n)){fake_results.push(this.real_suggestions[i]);}}
if(fake_results.length){this.found_suggestions(fake_results,this.get_value(),true);}else{this.selectedindex=-1;this.set_message(this.source.gen_loading());}}}
typeaheadpro.prototype.perform_search=function(){if(this.get_value()==this.results_text){return true;}
var results;if((results=this.search_cache(this.get_value()))===undefined&&!(results=this.source.search_value(this.get_value()))){this.status=typeaheadpro.STATUS_WAITING_ON_SOURCE;this.last_search=(new Date).getTime();return false;}
this.found_suggestions(results,this.get_value(),false);return true;}
typeaheadpro.prototype.set_message=function(text){this.clear_render_timeouts();if(text){this.list.innerHTML='<div class="typeahead_message">'+text+'</div>';this.reset_iframe();}else{this.hide();}
this.recalc_scroll();}
typeaheadpro.prototype.reset_iframe=function(){if(!typeaheadpro.should_use_iframe){return}
typeaheadpro.iframe.style.top=this.dropdown.style.top;typeaheadpro.iframe.style.left=this.dropdown.style.left;typeaheadpro.iframe.style.width=this.dropdown.offsetWidth+'px';typeaheadpro.iframe.style.height=this.dropdown.offsetHeight+'px';typeaheadpro.iframe.style.display='';}
typeaheadpro.prototype.advance_focus=function(){return this._move_focus(true);}
typeaheadpro.prototype.reverse_focus=function(){return this._move_focus(false);}
typeaheadpro.prototype._move_focus=function(move_forward){var inputs=this.obj.form?get_all_form_inputs(this.obj.form):get_all_form_inputs();var next_inputs=[];next_inputs._insert=move_forward?next_inputs.push:next_inputs.unshift;var should_insert=!move_forward;for(var i=0;i<inputs.length;i++){if(!move_forward&&inputs[i]==this.obj){should_insert=false;}else if(should_insert&&inputs[i].type!='hidden'&&inputs[i].tabIndex!=-1&&inputs[i].offsetParent){next_inputs._insert(inputs[i]);}else if(inputs[i]==this.obj){should_insert=true;}}
setTimeout(function(){for(var i=0;i<this.length;i++){try{if(this[i].offsetParent){this[i].focus();setTimeout(function(){try{this.focus();}catch(e){}}.bind(this[i]),0);return;}}catch(e){}}}.bind(next_inputs?next_inputs:[]),0);}
typeaheadpro.prototype.clear_placeholder=function(){if(this.obj.className.indexOf('typeahead_placeholder')!=-1){this.set_value('');this.set_class('');}}
typeaheadpro.prototype.clear=function(){this.set_value('');this.set_class('');this.selectedindex=-1;this.enumerate=false;this.dirty_results();}
typeaheadpro.prototype.hide=function(){if(this.stop_hiding){return;}
this.visible=false;this.dropdown.style.display='none';this.clear_render_timeouts();if(typeaheadpro.should_use_iframe){typeaheadpro.iframe.style.display='none';}}
typeaheadpro.prototype.show=function(){this.visible=true;if(this.focused){this.dropdown.style.top=elementY(this.anchor)+this.anchor.offsetHeight+'px';this.dropdown.style.left=elementX(this.anchor)+'px';this.dropdown.style.width=(this.anchor.offsetWidth-2)+'px';this.dropdown.style.display='';if(typeaheadpro.should_use_iframe){typeaheadpro.iframe.style.display='';this.reset_iframe();}}}
typeaheadpro.prototype.toggle_icon_list=function(no_focus){if(this.showing_icon_list){this.showing_icon_list=false;this.source.showing_icon_list=false;if(!no_focus){this.focus();}
CSS.removeClass(this.typeahead_icon,'on_selected');this.want_icon_list=false;this.showing_icon_list=false;this.stop_suggestion_select=true;if(this.obj){this.dirty_results();}}else{this.source.showing_icon_list=true;this.old_typeahead_value=this.obj.value;this.stop_suggestion_select=true;this.want_icon_list=true;this.dirty_results();this.focus();CSS.addClass(this.typeahead_icon,'on_selected');this.show();this.set_suggestion(-1);this.showing_icon_list=true;}
setTimeout(function(){this.stop_hiding=false;}.bind(this),100)}
typeaheadpro.prototype.focus=function(){this.obj.focus();}
typeaheadpro.prototype.blur=function(){if(this.obj){this.obj.blur();}}
typeaheadpro.kill_typeahead=function(obj){if(obj.typeahead){if(!this.anchor_block){obj.parentNode.removeChild(obj.nextSibling);}
obj.parentNode.removeChild(obj.nextSibling);if(obj.typeahead.source){obj.typeahead.source=obj.typeahead.source.owner=null;}
obj.onfocus=obj.onblur=obj.onkeypress=obj.onkeyup=obj.onkeydown=obj.typeahead=null;}}

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.destroy=function(){this._idInput.parentNode.removeChild(this._idInput);this._idInput.typeahead=null;this._idInput=null;this.parent.destroy();}
friendSelector.prototype._onselect=function(e){this.parent._onselect(e);if(e.i){this._idInput.value=e.i;}else if(e.is){this._idInput.value=e.is;}}}else{friendSelector=null;}
var Contexts=new Object();function err(msg){if(window.console){window.console.log('Facebook FBML Mock AJAX ERROR: '+msg);}
return false;}
function attachCurlFromObject(ajax_params,container,pre_fn,post_fn){if(!ajax_params['url']){return err("no input with id url in form");}
if(!ajax_params['fb_sig_api_key']){return err("no input with id fb_api_key in form");}
if(pre_fn){pre_fn();}
attachCurlFromFormValues(ajax_params,container,post_fn);}
function attachCurlFromFormValues(ajax_params,container,post_fn){new AsyncRequest().setURI('/fbml/ajax/attach.php').setData(ajax_params).setMethod('POST').setHandler(function(response){if(post_fn){post_fn();}
if(!container.removed){set_inner_html(container,response.getPayload().html);}}.bind(this)).send();}
function attachFromPreview(context){if(context=='wall'){var attachments=wallAttachments;}else if(context=='message'){var attachments=inboxAttachments;}
if(attachments){var parent=ge(attachments.edit_id);var inputs=attachments.get_all_form_elements(parent);var params=Object();for(var i=0;i<inputs.length;i++){if(!(inputs[i].type=="radio"||inputs[i].type=="checkbox")||inputs[i].checked){params[inputs[i].name]=inputs[i].value;}}
params['context']=attachments.context;params['action']='edit';attachCurlFromFormValues(params,parent);}}
function clickRewriteAjax(app_id,loggedIn,targetId,url,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){target.innerHTML=loadingHTML;}
return false;}
function clickToShow(targetId){return clickToSetDisplay(targetId,"");}
function clickToShowDialog(targetId){var dialog_elem=null;if(dialog_elem=ge(targetId)){var dialog_content=dialog_elem.parentNode.innerHTML;dialog_elem.id='dialog_invoked_'+dialog_elem.id;var elem=dialog_elem.cloneNode(true);dialog_elem.innerHTML='';var dialog=new 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;parent.innerHTML='';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}).setHandler(bind(this,function(response){if(response.getPayload()){var form_hidden_inputs=response.getPayload();if(form_id){var form=ge(form_id);addHiddenInputs(form,form_hidden_inputs);if(this.loginContinuation){this.loginContinuation=this.loginContinuation.bind(form);}}}
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 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;new Dialog().setAsync(async).setHandler(function(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;}.bind(this)).setCloseHandler(function(){if(this.grantedPerms){next_js();}
if(form){form.submit();}}.bind(this)).show();}
function requireLogin(app_id,continuation,cancellation,form){if(this.loginDialog){return;}
var form_id=form?form.id:'';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}).setReadOnly(true).setHandler(bind(this,function(continuation,response){if(response.getPayload()){this.loginDialog.setBody(response.getPayload()).show();}else{continuation();this.loginCancellation=null;this.loginContinuation=null;this.loginDialog=null;}},continuation)).setErrorHandler(bind(this,function(response){if(response.getError()==kError_Async_NotLoggedIn){uri=new URI('/login.php').setSubdomain('www').addQueryData({next:document.location.href});goURI(uri);}else{ErrorDialog.showAsyncError(response);}})).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;}
function createProfileBox(app_id,position){var classname='profile_form'+(position=='info'?' profile_info_form':'');var dialog=new pop_dialog(classname);dialog.is_stackable=true;dialog.show_loading(_tx("Memuat..."));var data={app_id:app_id,position:position};var ajax_uri='/fbml/ajax/fetch_profile_box.php';new AsyncRequest().setURI(ajax_uri).setData(data).setHandler(function(resp){dialog.show_dialog(resp.getPayload().content,true);}).send();}
var stripLinks=function(container){var links=container.getElementsByTagName('a');for(var i=0;i<links.length;i++){if(!links[i].getAttribute('flash')){addEventBase(links[i],'click',Event.kill);}}
var forms=container.getElementsByTagName('form');for(var i=0;i<forms.length;i++){forms[i].onsubmit=function(){return false;};}}
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);}}
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,sendRequest:sendRequest,removeTokenizerRecipient:removeTokenizerRecipient,removeReqRecipient:removeReqRecipient,cancelDialog:cancelDialog,addHiddenInputs:addHiddenInputs,fbmlLogin:fbmlLogin,cancelLogin:cancelLogin,requireLogin:requireLogin,promptPermission:promptPermission,stripLinks:stripLinks,enforceStyle:enforceStyle,registerFBJSBridge:registerFBJSBridge};})();

function typeahead_source(){}
typeahead_source.prototype.cache_results=false;typeahead_source.prototype.enumerable=false;typeahead_source.prototype.allow_fake_results=false;typeahead_source.prototype.search_limit=10;typeahead_source.prototype.bootstrap=bagofholding;typeahead_source.check_match=function(search,value){value=typeahead_source.tokenize(value);for(var i=0,il=search.length;i<il;i++){if(search[i].length){var found=false;for(var j=0,jl=value.length;j<jl;j++){if(value[j].length>=search[i].length&&value[j].substring(0,search[i].length)==search[i]){found=true;value[j]='';break;}}
if(!found){return false;}}}
return true;}
typeahead_source.tokenize=function(text,capture,noflatten){return(noflatten?text:typeahead_source.flatten_string(text)).split(capture?typeahead_source.normalizer_regex_capture:typeahead_source.normalizer_regex);}
typeahead_source.normalizer_regex_str='(?:(?:^| +)["\'.\\-]+ *)|(?: *[\'".\\-]+(?: +|$)|[@_]| +)';typeahead_source.normalizer_regex=new RegExp(typeahead_source.normalizer_regex_str,'g');typeahead_source.normalizer_regex_capture=new RegExp('('+typeahead_source.normalizer_regex_str+')','g');typeahead_source.flatten_string=function(text){if(!typeahead_source.accents){typeahead_source.accents={a:/\u0430|\u00e0|\u00e1|\u00e2|\u00e3|\u00e4|\u00e5/g,b:/\u0431/g,c:/\u0446|\u00e7/g,d:/\u0434|\u00f0/g,e:/\u044d|\u0435|\u00e8|\u00e9|\u00ea|\u00eb/g,f:/\u0444/g,g:/\u0433/g,h:/\u0445/g,i:/\u0438|\u00ec|\u00ed|\u00ee|\u00ef/g,j:/\u0439/g,k:/\u043a/g,l:/\u043b/g,m:/\u043c/g,n:/\u043d|\u00f1/g,o:/\u043e|\u00f8|\u00f6|\u00f5|\u00f4|\u00f3|\u00f2/g,p:/\u043f/g,r:/\u0440/g,s:/\u0441/g,t:/\u0442/g,u:/\u0443|\u044e|\u00fc|\u00fb|\u00fa|\u00f9/g,v:/\u0432/g,y:/\u044b|\u00ff|\u00fd/g,z:/\u0437/g,ae:/\u00e6/g,oe:/\u0153/g,ts:/\u0446/g,ch:/\u0447/g,sh:/\u0448/g,ya:/\u044f/g}}
text=text.toLowerCase();for(var i in typeahead_source.accents){text=text.replace(typeahead_source.accents[i],i);}
return text;}
typeahead_source.prototype.set_owner=function(obj){this.owner=obj;if(this.is_ready){this.owner.update_status(typeaheadpro.STATUS_IDLE);}}
typeahead_source.prototype.ready=function(){if(this.owner&&!this.is_ready){this.is_ready=true;this.owner.update_status(typeaheadpro.STATUS_IDLE);}else{this.is_ready=true;}}
typeahead_source.highlight_found=function(result,search){var html=[];resultv=typeahead_source.tokenize(result,true,true);result=typeahead_source.tokenize(result,true);search=typeahead_source.tokenize(search);search.sort(typeahead_source._sort);for(var i=0,il=resultv.length;i<il;i++){var found=false;for(var j=0,jl=search.length;j<jl;j++){if(search[j]&&result[i].lastIndexOf(search[j],0)!=-1){html.push('<em>',htmlspecialchars(resultv[i].substring(0,search[j].length)),'</em>',htmlspecialchars(resultv[i].substring(search[j].length,resultv[i].length)));found=true;break;}}
if(!found){html.push(htmlspecialchars(resultv[i]));}}
return html.join('');}
typeahead_source._sort=function(a,b){return b.length-a.length;}
typeahead_source.prototype.gen_nomatch=function(){return this.text_nomatch!=null?this.text_nomatch:_tx("Tidak ada yang ditemukan");}
typeahead_source.prototype.gen_loading=function(){return this.text_loading!=null?this.text_loading:_tx("Memuat...");}
typeahead_source.prototype.gen_placeholder=function(){return this.text_placeholder!=null?this.text_placeholder:_tx("Mulai mengetik...");}
typeahead_source.prototype.gen_noinput=function(){return this.text_noinput!=null?this.text_noinput:_tx("Mulai mengetik...");}
typeahead_source.prototype.onselect_not_found=function(){if(typeof this.tokenizer._ontokennotfound!='undefined'){this.tokenizer._ontokennotfound(this.obj.value);}
if(typeof this.tokenizer.onselect!='undefined'){return this.tokenizer.onselect();}}

function static_source(){this.values=null;this.index=null;this.index_includes_hints=false;this.exclude_ids={};this.parent.construct(this);}
static_source.extend('typeahead_source');static_source.prototype.enumerable=true;static_source.prototype.build_index=function(){var index=[];var values=this.values;var gen_id=values.length&&typeof values[0].i=='undefined';for(var i=0,il=values.length;i<il;i++){var tokens=typeahead_source.tokenize(values[i].t);for(var j=0,jl=tokens.length;j<jl;j++){index.push({t:tokens[j],o:values[i]});}
if(this.index_includes_hints&&values[i].s){var tokens=typeahead_source.tokenize(values[i].s);for(var j=0,jl=tokens.length;j<jl;j++){index.push({t:tokens[j],o:values[i]});}}
if(gen_id){values[i].i=i;}}
index.sort(function(a,b){return(a.t==b.t)?0:(a.t<b.t?-1:1)});this.index=index;this.ready();}
static_source.prototype._sort_text_obj=function(a,b){if(a.e&&!b.e){return 1;}
if(!a.e&&b.e){return-1;}
if(a.t==b.t){return 0;}
return a.t<b.t?-1:1}
static_source.prototype.search_value=function(text){if(!this.is_ready){return;}
var results;if(text==''){results=this.values;}else{var ttext=typeahead_source.tokenize(text).sort(typeahead_source._sort);var index=this.index;var lo=0;var hi=this.index.length-1;var p=Math.floor(hi/2);while(lo<=hi){if(index[p].t>=ttext[0]){hi=p-1;}else{lo=p+1;}
p=Math.floor(lo+((hi-lo)/2));}
var results=[];var stale_keys={};var check_ignore=typeof _ignoreList!='undefined';for(var i=lo;i<index.length&&index[i].t.lastIndexOf(ttext[0],0)!=-1;i++){var elem_id=index[i].o.flid?index[i].o.flid:index[i].o.i;if(typeof stale_keys[elem_id]!='undefined'){continue;}else{stale_keys[elem_id]=true;}
if((!check_ignore||!_ignoreList[elem_id])&&!this.exclude_ids[elem_id]&&(ttext.length==1||typeahead_source.check_match(ttext,index[i].o.t))){results.push(index[i].o);}}}
results.sort(this._sort_text_obj.bind(this));if(this.owner.max_results){results=results.slice(0,this.owner.max_results);}
return results;}
static_source.prototype.set_exclude_ids=function(ids){this.exclude_ids=ids;}

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').setContextData('clicktype',data).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 (window.Bootloader) { Bootloader.done(["js\/7l2oocawlf0og0o8.pkg.js"]); }