/*    HTTP Host:  b.static.ak.fbcdn.net                                        */
/*    Generated:  February 9th 2010 9:17:02 AM PST                             */
/*      Machine:  10.16.140.103                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/cmx90qt4vq8gw0ow.pkg.js r142582                           */
/*       Locale:  id_ID                                                        */
/*         Path:  js/cmx90qt4vq8gw0ow.pkg.js                                   */

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


function custom_source(options){this.parent.construct(this);if(options.length&&typeof(options[0])=="string"){for(var ii=0;ii<options.length;ii++){options[ii]={t:options[ii],i:options[ii]};}}
this.values=options;this.build_index();}
custom_source.extend('static_source');custom_source.prototype.text_placeholder=custom_source.prototype.text_noinput=false;custom_source.prototype.gen_html=function(result,highlight){var html=['<div>',typeahead_source.highlight_found(result.t,highlight),'</div>'];if(result.s){html.push('<div><small>',htmlspecialchars(result.s),'</small></div>');}
return html.join('');}

function toggle_app_data(id_new_sel,id_new_show){var el_new_sel=ge(id_new_sel);if(!el_new_sel){return;}
var el_new_show=ge(id_new_show);if(!el_new_show){return;}
var el_app_list=$('dev_app_list').childNodes[0];if(!el_app_list){return;}
var el_app_infos=ge('dev_app_infos');if(!el_app_infos){return;}
var children=el_app_list.childNodes;for(var i=0;i<children.length;i++){if(CSS.hasClass(children[i],'flag_nav_item_selected')){CSS.removeClass(children[i],'flag_nav_item_selected');break;}}
var children=el_app_infos.childNodes;for(var i=0;i<children.length;i++){if(CSS.hasClass(children[i],'app_show')){CSS.removeClass(children[i],'app_show');CSS.addClass(children[i],'app_hide');break;}}
CSS.addClass(el_new_sel,'flag_nav_item_selected');CSS.removeClass(el_new_show,'app_hide');CSS.addClass(el_new_show,'app_show');}
function app_source(options_str){var options=eval(options_str);this.parent.construct(this,options);}
app_source.extend('custom_source');app_source.prototype.text_noinput='Enter an application name.';app_source.prototype.text_placeholder='Enter an application name.';app_source.prototype.gen_html=function(result,highlight){var icon_url=result.it;var html=[];return['<div class="app_option"><div class="icon" style="background-image: url(',icon_url,')">&nbsp;</div>','<span>',typeahead_source.highlight_found(result.t,highlight),'</span></div>'].join('');}

function removeSection(prefix,i){hide(prefix+'_'+i);$(prefix+'_'+i+'_remove').value='true';$('num_'+prefix+'_entries').value--;$(prefix+'add_link').style.display='block';var last_divider=ge(prefix+'last_divider');if(last_divider)
last_divider.style.display='';}
function addSection(prefix,maxSections){var num=parseInt($('num_'+prefix+'_entries').value);show(prefix+'_'+(num+1));$('num_'+prefix+'_entries').value=num+1;if(num+1>=maxSections){$(prefix+'add_link').style.display='none';var last_divider=ge(prefix+'last_divider');if(last_divider)
last_divider.style.display='none';}}
function schoolChangeStatus(el,prefix)
{el=ge(el);var status=el.options[el.selectedIndex].value;concentrate_name=prefix+'_concentration';concentrate_adder=prefix+'_concentration_adder';concentrate_degree=prefix+'_degree';concentrate_value_count=prefix+'_concentration_value_count';switch(status){case'3':case'1':case'2':showTableRow(getParentRow(concentrate_name+'1'));if($(concentrate_value_count).value>=2){showTableRow(getParentRow(concentrate_name+'2'));}else{hide(getParentRow(concentrate_name+'2'));}
if($(concentrate_value_count).value>=3){showTableRow(getParentRow(concentrate_name+'3'));}else{hide(getParentRow(concentrate_name+'3'));showTableRow(getParentRow(concentrate_adder));}
hide(getParentRow(concentrate_degree));$(concentrate_degree).value='';if(status=='2'){showTableRow(getParentRow(concentrate_degree));}
break;default:hide(getParentRow(concentrate_degree));break;}}
function addConcentration(concentrate_name)
{concentrate_adder=concentrate_name+'_adder';concentrate_value_count=concentrate_name+'_value_count';if($(concentrate_value_count).value==2){$(concentrate_value_count).value=3;showTableRow(getParentRow(concentrate_name+'3_name'));hide(getParentRow(concentrate_adder));}else{$(concentrate_value_count).value=2;showTableRow(getParentRow(concentrate_name+'2_name'));}}
function education_autocomplete_onselect(obj){var onfocus=function(){var source=new concentration_source(this.network);source.text_placeholder=_tx("Tulis jurusan atau peminatan anda");source.text_nomatch=source.text_noinput=false;var ta=new typeaheadpro(this,source);}
$(this.custom_prefix+'_school_nk').value=obj?obj.i:-1;for(var i=1;i<=3;i++){var conc=ge(this.custom_prefix+'_concentration'+i+'_name');if(conc){typeaheadpro.kill_typeahead(conc);if(obj){conc.network=obj.i;conc.onfocus=onfocus.bind(conc);}else{CSS.setClass(conc,conc.className.replace(/typeahead_[^\s]+/g,''));conc.onfocus=null;}}}
return false;}
function education_autocomplete_onfound(result){if(!result){$(this.custom_prefix+'_school_nk').value=-1;}}
function workplace_autocomplete_onselect(obj){$(this.custom_prefix+'_company_nk').value=obj?obj.i:-1;return false;}
function workplace_autocomplete_onfound(result){if(!result){$(this.custom_prefix+'_company_nk').value=-1;}}
function checkNameLegit(){if($('i_swear').checked){$('name_change_form').submit();}else{$('error').style.display='';}}
function on_work_history_city_selected(){}
function education_remove_school(prefix,i){var dialog=new Dialog().setTitle(_tx("Hapus {school-name} ini?")).setBody(_tx("Anda yakin ingin menghapus sekolah ini? Anda akan kehilangan semua data yang saat ini disimpan tentang sekolah ini.")).setButtons([Dialog.newButton('remove',_tx("Hapus")),Dialog.CANCEL]).setHandler(function(){removeSection(prefix,i);dialog.hide();}).show();return false;}
function workhistory_remove_entry(i){var dialog=new Dialog().setTitle(_tx("Hapus pekerjaan ini?")).setBody(_tx("Anda yakin ingin menghapus pekerjaan ini? Anda akan kehilangan semua data yang saat ini disimpan.")).setButtons([Dialog.newButton('remove',_tx("Hapus")),Dialog.CANCEL]).setHandler(function(){removeSection('work_history',i);dialog.hide();}).show();return false;}

function feedcrawl(ts,t,c){this.totalSources=ts;this.totalSuggestions=t;this.loadingText='<p class="fc_loading"></p>';if(typeof c=="undefined"){this.configuring=null;}else{this.configuring=c;}
this.updated=false;var arbiterToken=Arbiter.subscribe(Arbiter.PROFILE_PUBLISHER,this._publisherChanged.bind(this));onunloadRegister(Arbiter.unsubscribe.bind(Arbiter,arbiterToken));}
copy_properties(feedcrawl,{APP_ID:26639461332});feedcrawl.prototype={_publisherChanged:function(type,data){if(data.app_id==feedcrawl.APP_ID){var uri=URI.getRequestURI();var query=uri.getQueryData();if(uri.getPath()=='/profile.php'&&query.pub==feedcrawl.APP_ID&&query.import_sid){this.edit(query.import_sid);}}},edit:function(fcid,force_edit){if(this.configuring==fcid){}
CSS.addClass($('feedcrawl_config'),'configuring');if(this.configuring){CSS.removeClass($('fc_new_'+this.configuring),'configuring');}
CSS.addClass($('fc_new_'+fcid),'configuring');this.configuring=fcid;set_inner_html($('fc_source_config'),this.loadingText);this._send({'id':fcid,'action':'edit','force_edit':force_edit},this._editResponseHandler.bind(this));return false;},_editResponseHandler:function(asyncResponse){var payload=asyncResponse.getPayload();set_inner_html($('fc_source_config'),payload['markup']);this._focusInput($('fc_source_config'));this.updated=true;},cancelEdit:function(fcid){CSS.removeClass($('feedcrawl_config'),'configuring');CSS.removeClass($('fc_new_'+fcid),'configuring');this.configuring=null;return false;},update:function(fcid,add){var source_user_id=$('source_user_id'+fcid).value;if(!source_user_id){return false;}
if(add){this.totalSources++;this.totalSuggestions--;}
set_inner_html($('fc_source_config'),this.loadingText);this._send({'id':fcid,'source_user_id':source_user_id,'action':'update'},this._updateResponseHandler.bind(this,fcid));return false;},_updateResponseHandler:function(fcid,asyncResponse){var payload=asyncResponse.getPayload();set_inner_html($('fc_source_config'),payload['markup']);CSS.addClass($('fc_new_'+fcid),'added');CSS.removeClass($('fc_new_'+fcid),'available');CSS.addClass($('fc_existing_'+fcid),'added');CSS.removeClass($('fc_existing_'+fcid),'available');CSS.removeClass($('feedcrawl_config'),'fc_no_sites_added');if(this.totalSuggestions<=0){CSS.addClass($('feedcrawl_config'),'fc_no_sites_left');}
this.updated=true;},remove:function(fcid){set_inner_html($('fc_source_config'),this.loadingText);this.totalSources--;this.totalSuggestions++;this.updated=true;this._send({'id':fcid,'action':'delete'},this._removeResponseHandler.bind(this,fcid));return false;},_removeResponseHandler:function(fcid,asyncResponse){var payload=asyncResponse.getPayload();set_inner_html($('fc_source_config'),'');CSS.removeClass($('feedcrawl_config'),'configuring');CSS.removeClass($('fc_new_'+fcid),'added');CSS.addClass($('fc_new_'+fcid),'available');CSS.removeClass($('fc_existing_'+fcid),'added');CSS.addClass($('fc_existing_'+fcid),'available');CSS.removeClass($('feedcrawl_config'),'fc_no_sites_left');if(this.totalSources<=0){CSS.addClass($('feedcrawl_config'),'fc_no_sites_added');}
this.cancelEdit(fcid);},updateStory:function(fcid){set_inner_html($('fc_source_config'),this.loadingText);this._send({'id':fcid,'action':'update_story'},this._updateStoryResponseHandler.bind(this));return false;},_updateStoryResponseHandler:function(asyncResponse){var payload=asyncResponse.getPayload();set_inner_html($('fc_source_config'),payload['markup']);this._focusInput($('fc_source_config'));this.updated=true;},_focusInput:function(obj){var inputs=obj.getElementsByTagName('input');for(var i=0;i<=inputs.length;i++){if(inputs[i]&&(inputs[i].tagName=="INPUT"&&inputs[i].type.toLowerCase()=="text")){inputs[i].focus();if(inputs[i].value!=''){inputs[i].select();}
return;}}},_send:function(data,callback){new AsyncRequest().setURI('/ajax/feedcrawl.php').setData(data).setHandler(callback||bagofholding).setErrorHandler(bagofholding).send();return false;}}

function ProfileBoxController(profile_id,applications,tab_id,columns){this.profileId=profile_id;this.applications={};this.columns=columns;this.tabId=tab_id;var last_parent=null;var obj;this.placeholderBox=document.createElement('div');CSS.setClass(this.placeholderBox,'box_placeholder');for(var i=0;i<applications.length;i++){if(obj=ge('box_app_'+applications[i])){last_parent=obj.parentNode;var data={box:obj,id:applications[i]};this.applications[data.id]=data;obj.addClass('moveable');(new Draggable(obj)).addHandle(obj.getElementsByTagName('h3')[0]).setNamespace('ProfileBoxController').setGutter(15).setUseAbsolute(true).setGrabHandler(function(controller,obj){controller.expandColumns();controller.placeholderBox.style.height=obj.offsetHeight-6+'px';controller.placeholderBox.style.width=obj.offsetWidth+'px';CSS.addClass(obj,'drag');obj.style.width=obj.offsetWidth+'px';obj.parentNode.insertBefore(controller.placeholderBox,obj);obj.style.zIndex=100;}.bind(null,this,obj)).setDropHandler(function(controller,obj){this.resetPosition();controller.placeholderBox.parentNode.insertBefore(this.getDOM(),controller.placeholderBox);controller.placeholderBox.parentNode.removeChild(controller.placeholderBox);controller.resetColumns();controller.saveChanges(obj);obj.style.width=null;obj.style.zIndex=null;}.bind(null,this,obj)).setKey('app_id',data.id);(new Droppable(obj)).setNamespace('ProfileBoxController').setZIndex(1).setDragMoveHandler(function(controller,app_id,drag,position){if(drag.getDOM().offsetHeight>=position.y){var before=ProfileBoxController.insertElement(controller.placeholderBox,this.getDOM());controller.placeholderBox.style.width=this.getDOM().offsetWidth+'px';}}.bind(null,this,data.id));}}
if(this.columns.length>1){for(var i=0;i<this.columns.length;i++){(new Droppable(this.columns[i].dom)).setNamespace('ProfileBoxController').setZIndex(0).setDragOverHandler(function(controller,column,drag){if(controller.placeholderBox.parentNode!=column){controller.placeholderBox.style.width=column.offsetWidth+'px';column.appendChild(controller.placeholderBox,this.getDOM());}}.bind(null,this,this.columns[i].dom));}}}
ProfileBoxController.insertElement=function(source,target){var before=true,siblings=target.parentNode.childNodes;for(var i=0;i<siblings.length;i++){if(siblings[i]==target){break;}else if(siblings[i]==source){before=false;break;}}
if(before){target.parentNode.insertBefore(source,target);}else{target.parentNode.insertBefore(target,source);}
return before;}
ProfileBoxController.prototype.getAppFromId=function(id){return(/box_app_([0-9]+)/.exec(id)||[]).pop();}
ProfileBoxController.prototype.getOrderFromDOM=function(){var order=[];this.columns.each(function(column){var columnOrder={column:column.column,order:[]};var app_id;var elements=DOM.scry(column.dom,'div.box');for(var i=0;i<elements.length;i++){if(elements[i].id&&(app_id=this.getAppFromId(elements[i].id))){columnOrder.order.push(parseInt(app_id,10));}}
order.push(columnOrder);}.bind(this));return order;}
ProfileBoxController.prototype.saveChanges=function(obj){var app_id=this.getAppFromId(obj.id);var innerContent=DOM.find(obj,'div.app_custom_content');innerContent.style.visibility='hidden';CSS.addClass(obj,'loading');new AsyncRequest().setURI('/ajax/profile/box.php').setData({action:'reorder',tab_id:this.tabId,order:this.getOrderFromDOM(),profile_id:this.profileId,app_id:app_id}).setHandler(function(response){DOM.replace(innerContent,HTML(response.getPayload().box));CSS.removeClass(obj,'drag');CSS.removeClass(obj,'loading');}).send();}
ProfileBoxController.prototype.expandColumns=function(){if(this.columns<2){return;}
var max=null;this.resetColumns();this.columns.each(function(column){max=Math.max(column.dom.offsetHeight,max);});this.columns.each(function(column){if(column.dom.offsetHeight!=max){column.dom.style.height=max+'px';}});}
ProfileBoxController.prototype.resetColumns=function(){this.columns.each(function(column){column.dom.style.height=null;});}
var KEY_VAL=1;var VERTICAL_THUMBS=5;var EDIT_APP_THUMBS=6;var EDIT_REMOVE_APP_SECTION=7;var NO_INLINE_EDITOR={2361831622:1,2530096808:1};function ProfileInfoEdit(profile_id,sections_info){this.section_objs={};for(var i in sections_info){var section_info=sections_info[i];if(section_info.app_id){if(!NO_INLINE_EDITOR[section_info.app_id]){this.section_objs[section_info.section]=new ProfileInfoAppEditSection(section_info,this);ProfileInfoEdit.editors[section_info.section]=this.section_objs[section_info.section];}}else{this.section_objs[section_info.section]=new ProfileInfoEditSection(section_info,this);}}
this.profile_id=profile_id;this.info_tab=$('info_tab');this.info_sections=$('info_edit_sections');this.edit_all=$('info_edit_all');this.done_editing_all=$('info_done_editing_all');this.edit_all.onclick=this.onEditAll.bind(this,true);this.done_editing_all.onclick=this.onDoneEditingAll.bind(this);}
ProfileInfoEdit.editors={};ProfileInfoEdit.uri='/ajax/profile/editinfo.php';ProfileInfoEdit.prototype.onEditAll=function(scroll){this.edit_all_mode=true;for(var i in this.section_objs){var section_obj=this.section_objs[i];if(section_obj.canEdit()){section_obj.has_editor=false;section_obj.closeEditor();}}
CSS.addClass(this.info_tab,'edit_all_mode');var is_first=true;for(var i in this.section_objs){var section_obj=this.section_objs[i];if(!section_obj.canEdit()){continue;}
section_obj.getHeaderElem().onclick=this.editAllSetActiveSection.bind(this,section_obj);if(is_first){section_obj.populateEditor();section_obj.openEditor(false);CSS.addClass(section_obj.getSectionElem(),'edit_mode');if(scroll){ProfileInfoEdit.scrollToSection($('info_edits_div'));}}
is_first=false;}
return false;}
ProfileInfoEdit.prototype.editAllSetActiveSectionNext=function(active_section_prev_obj){var found=false;for(var i in this.section_objs){var section_obj=this.section_objs[i];if(!section_obj.canEdit()){continue;}
if(found){if(!section_obj.is_open&&!section_obj.has_editor){CSS.addClass(section_obj.getSectionElem(),'edit_mode');section_obj.populateEditor();}
section_obj.toggleEditor(true);found=false;}else if(section_obj.section!=active_section_prev_obj.section){section_obj.closeEditor();}
if(section_obj.section==active_section_prev_obj.section){found=true;}}}
ProfileInfoEdit.prototype.editAllSetActiveSection=function(active_section_obj){for(var i in this.section_objs){var section_obj=this.section_objs[i];if(!section_obj.canEdit()){continue;}
if(section_obj.section==active_section_obj.section){if(!section_obj.is_open&&!section_obj.has_editor){CSS.addClass(section_obj.getSectionElem(),'edit_mode');section_obj.populateEditor();}
section_obj.toggleEditor(true);}else{section_obj.closeEditor();}}}
ProfileInfoEdit.prototype.onDoneEditingAll=function(){for(var i in this.section_objs){var section_obj=this.section_objs[i];if(section_obj.canEdit()){var section_elem=section_obj.getSectionElem();section_obj.cancelEditor();section_obj.closeEditor();section_obj.has_editor=false;CSS.removeClass(section_obj.getSectionElem(),'edit_mode');section_obj.getHeaderElem().onclick=null;}}
CSS.removeClass(this.info_tab,'edit_all_mode');this.edit_all_mode=false;return false;}
ProfileInfoEdit.scrollToSection=function(section_elem){animation(DOMScroll.getScrollRoot()).to('scrollTop',elementY(section_elem)-40).ease(animation.ease.end).duration(400).go();}
function ProfileInfoEditSectionBase(section_info,controller){this.type=0;this.is_open=false;this.has_editor=false;this.app_id=0;this.controller=controller;copy_properties(this,section_info);var section=section_info.section;copy_properties(this,{section_id:('info_section_'+section),header_id:('info_section_header_'+section),info_id:('info_section_info_'+section),editor_id:('info_section_editor_'+section),edit_id:('info_section_edit_'+section),edit_jaws_id:('info_section_edit_jaws_'+section),save_id:('info_section_save_'+section),cancel_id:('info_section_cancel_'+section)});this.header_cancel_link=DOM.find(this.getHeaderElem(),'a.close_edit');var section_elem=this.getSectionElem();section_elem.onmouseover=function(){CSS.addClass(this,'hover');};section_elem.onmouseout=function(){CSS.removeClass(this,'hover');};}
copy_properties(ProfileInfoEditSectionBase.prototype,{getSectionElem:function(){return $(this.section_id);},getHeaderElem:function(){return $(this.header_id);},getInfoElem:function(){return $(this.info_id);},getEditorElem:function(){return $(this.editor_id);},getEditElem:function(){return $(this.edit_id);},getEditJawsElem:function(){return $(this.edit_jaws_id);},getSaveElem:function(){return $(this.save_id);},getForm:function(){return $(this.save_id).form;},getCancelElem:function(){return $(this.cancel_id);},getAppId:function(){return this.app_id;},canEdit:function(){return true;}});ProfileInfoEditSectionBase.prototype.onClickEdit=function(){var section_elem=this.getSectionElem();var info_elem=this.getSectionElem();this.populateEditor();CSS.addClass(section_elem,'edit_mode');ProfileInfoEdit.scrollToSection(section_elem);return false;}
ProfileInfoEditSectionBase.prototype.populateEditor=function(){var section_elem=this.getSectionElem();var editor_elem=this.getEditorElem();var loading='<div class="fbloading"><span>'+_tx("Memuat...")+'</span></div>';set_inner_html(editor_elem,loading);var data={profile_id:this.controller.profile_id,section:this.section,type:6,app_id:this.getAppId(),edit_mode:true};new AsyncRequest().setURI(ProfileInfoEdit.uri).setReadOnly(true).setData(data).setHandler(this.replaceEditor.bind(this)).send();return false;}
ProfileInfoEditSectionBase.prototype.replaceEditor=function(resp){var section_elem=this.getSectionElem();var editor_elem=this.getEditorElem();var payload=resp.getPayload();editor_elem.style.height='100px';DOM.setContent(editor_elem,HTML(payload.editor));animation(editor_elem).to('height','auto').from('height','100px').duration(200).go();var save_elem=this.getSaveElem();var cancel_elem=this.getCancelElem();save_elem.onclick=this.onSaveEditor.bind(this);cancel_elem.onclick=this.onCancelEditor.bind(this);this.header_cancel_link.onclick=this.onCancelEditor.bind(this);this.has_editor=true;return false;}
ProfileInfoEditSectionBase.prototype.onSaveEditor=function(){var editor_elem=this.getEditorElem();form=serialize_form(editor_elem);form['section']=this.section;if(this.app_id){form['app_id']=this.app_id;}
form['save']=1;var loading='<div class="fbloading"><span>'+'Saving...'+'</span></div>';set_inner_html(editor_elem,loading);new AsyncRequest().setURI(ProfileInfoEdit.uri).setData(form).setHandler(function(resp){var payload=resp.getPayload();var section_elem=this.getSectionElem();if(payload.editor){this.replaceEditor(resp);return false;}
this.has_editor=false;if(payload.display){CSS.removeClass(section_elem,'empty');}else{CSS.addClass(section_elem,'empty');}
var info_elem=this.getInfoElem();set_inner_html(info_elem,payload.display);if(this.controller.edit_all_mode){this.closeEditor(true);this.controller.editAllSetActiveSectionNext(this);}else{CSS.removeClass(section_elem,'edit_mode');ProfileInfoEdit.scrollToSection(section_elem);}
if(payload.basic_info_summary){profile_basic_info_summary_refresh(payload.basic_info_summary);}}.bind(this)).send();return false;}
ProfileInfoEditSectionBase.prototype.onCancelEditor=function(){var section_elem=this.getSectionElem();CSS.removeClass(section_elem,'edit_mode');if(!this.controller.edit_all_mode){this.cancelEditor();}else{this.closeEditor();this.has_editor=false;}
ProfileInfoEdit.scrollToSection(section_elem);return false;}
ProfileInfoEditSectionBase.prototype.cancelEditor=function(){var section_elem=this.getSectionElem();this.has_editor=false;return false;}
ProfileInfoEditSectionBase.prototype.toggleEditor=function(scroll){var section_elem=this.getSectionElem();if(!this.is_open){this.openEditor(scroll);}else{this.closeEditor();}}
ProfileInfoEditSectionBase.prototype.warnIfUnsaved=function(){if(!this.is_open){return false;}
var form=this.getForm()
if(form&&form.original_state&&!are_equal(form.original_state,serialize_form(form))){var submit=this.getSaveElem();var buttons=[];var saveHandler=function(){submit.click();this.closeEditor(true);}
buttons.push({name:'save',label:_tx("Simpan"),handler:saveHandler.bind(this)});buttons.push({name:'dont_save',label:_tx("Jangan Simpan"),className:'inputaux',handler:this.closeEditor.bind(this,true)});buttons.push(Dialog.CANCEL);new Dialog().setTitle(_tx("Perubahan Belum Disimpan")).setBody(_tx("Beberapa perubahan Anda belum disimpan. Apakah Anda ingin menyimpan perubahan Anda sekarang?")).setButtons(buttons).setModal().show();return true;}
return false;};ProfileInfoEditSectionBase.prototype.closeEditor=function(skipUnsavedCheck){if(!skipUnsavedCheck){if(this.warnIfUnsaved()){return null;}}
var section_elem=this.getSectionElem();CSS.addClass(section_elem,'shut');CSS.removeClass(section_elem,'open');this.is_open=false;}
ProfileInfoEditSectionBase.prototype.openEditor=function(scroll){var section_elem=this.getSectionElem();CSS.addClass(section_elem,'open');CSS.removeClass(section_elem,'shut');this.is_open=true;if(scroll){ProfileInfoEdit.scrollToSection(section_elem);}}
function ProfileInfoEditSection(section_info,controller){this.parent.construct(this,section_info,controller);var elem_ids=[this.edit_id,this.edit_jaws_id];for(i in elem_ids){var link=ge(elem_ids[i]);if(link){link.onclick=this.onClickEdit.bind(this);}}}
ProfileInfoEditSection.extend('ProfileInfoEditSectionBase');function ProfileInfoAppEditSection(section_info,controller){this.parent.construct(this,section_info,controller);this.app_id=section_info.app_id;if(ge('flyout_menu_info_section_'+this.app_id)){var link=this.getEditElem();var option_links=DOM.scry($('flyout_menu_info_section_'+this.app_id),'a');option_links[0].onclick=this.onClickEdit.bind(this);option_links[1].onclick=this.deleteBox.bind(this);flyout_menu(link).registerHTMLMenu('flyout_menu_info_section_'+this.app_id).setPosition(dropmenu.ALIGN_RIGHT).addHook('show',function(){CSS.addClass(link,'selected');}.bind(this)).addHook('hide',function(){CSS.removeClass(link,'selected');}.bind(this));}
this.items={};this.order={};this.on=true;}
ProfileInfoAppEditSection.extend('ProfileInfoEditSectionBase');ProfileInfoAppEditSection.prototype.deleteBox=function(){var container=this.getSectionElem();var uri='/ajax/profile/editinfo.php';var data={profile_id:this.controller.profile_id,section:this.app_id,type:EDIT_REMOVE_APP_SECTION,app_id:this.app_id};new AsyncRequest().setURI(uri).setData(data).setHandler(function(resp){var curHeight=elementY(container);animation(container).to('height',0).blind().duration(200).hide().go();animation(DOMScroll.getScrollRoot()).to('scrollTop',curHeight-150).ease(animation.ease.end).duration(200).go();}).send();return false;}
ProfileInfoAppEditSection.prototype.deleteItem=function(label,id){var item=$('item_'+this.app_id+'_'+id);animation(item).to('height',0).blind().duration(150).hide().go();setTimeout(function(){DOM.remove(item)},200);}
ProfileInfoAppEditSection.editors={};ProfileInfoAppEditSection.prototype.newAdd=function(row){var uri='/ajax/profile/editinfo.php';var data={profile_id:this.controller.profile_id,section:this.app_id,type:EDIT_APP_THUMBS,new_add:true,new_index:row.i,app_id:this.app_id};var newItem=function(resp){var info_box=$('info_section_info_'+this.app_id);var elem=document.createElement('div');set_inner_html(elem,resp.payload.item);info_box.childNodes[0].childNodes[1].appendChild(elem);}.bind(this);new AsyncRequest().setURI(uri).setData(data).setHandler(newItem).send();}
ProfileInfoAppEditSection.prototype.onSaveEditor=function(){var section_obj=this;var section_elem=section_obj.getSectionElem();var editor_elem=section_obj.getEditorElem();var items={};var dds=section_elem.getElementsByTagName('li');for(var i=0;i<dds.length;i++){items[i]=dds[i].getAttribute('item');}
var uri='/ajax/profile/editinfo.php';var data={'profile_id':this.controller.profile_id,'section':this.app_id,'type':EDIT_APP_THUMBS,'save':true,'items':items,'app_id':this.app_id};if(this.controller.edit_all_mode){this.closeEditor(true);this.controller.editAllSetActiveSectionNext(this);}else{CSS.removeClass(section_elem,'edit_mode');ProfileInfoEdit.scrollToSection(section_elem);}
new AsyncRequest().setURI(uri).setData(data).send();return false;}
function ProfileBoxesEdit(id,tab_id,root_boxes_arr,move_to_option){move_to_option=move_to_option||{};for(var j=0;j<root_boxes_arr.length;j++){var boxes_root=$(root_boxes_arr[j]);var boxes=DOM.scry(boxes_root,'div.box');for(var i=0;i<boxes.length;++i){var child=boxes[i];var editors=DOM.scry(child,'a.box_editor');if(editors.length>0){var editor=editors[0];var custom=editor.childNodes.length?editor.firstChild:'';var app_id=child.id.replace('box_app_','');var menu_content=document.createElement('div');if(custom){menu_content.appendChild(custom);CSS.removeClass(custom,'hidden_elem');}
if(!ProfileBoxesEdit.NON_MOVEABLE[app_id]){if(move_to_option['name']&&move_to_option['moveable_to_section'][app_id]){var moveLink=document.createElement('a');moveLink.href='#';moveLink.innerHTML=_tx("Pindahkan ke tab {tab_name}",{'tab_name':move_to_option['name']});moveLink.onclick=moveToTab.bind(this,id,app_id,move_to_option['from'],move_to_option['to'],move_to_option['to_tab_name'],new URI(move_to_option['next_uri']));menu_content.appendChild(moveLink);}else{var noMove=document.createElement('span');CSS.addClass(noMove,'unmovable');DOM.setContent(noMove,_tx("Kotak ini tidak dapat ditambahkan ke tab Dinding"));menu_content.appendChild(noMove);}
var remove=document.createElement('a');remove.href='#';remove.innerHTML=_tx("Hapus Kotak");remove.onclick=removeAppBox.bind(this,id,app_id,tab_id,'box_app_');menu_content.appendChild(remove);}
var css_style=ProfileBoxesEdit.flymenuStyle[app_id]||'flyout_menu_18 link_menu';var menu_id='box_edit_menu_'+app_id;var menu=dropmenu.getExistingInstance(menu_id);if(menu){menu.destroy();}
(new flyout_menu(editor)).setMarkupContent(menu_id,css_style,_tx("Sunting Kotak"),menu_content).addHook('show',function(editor){CSS.addClass(editor,'selected');}.bind(null,editor)).addHook('hide',function(editor){CSS.removeClass(editor,'selected');}.bind(null,editor));}}}}
ProfileBoxesEdit.NON_MOVEABLE={2356318349:1};ProfileBoxesEdit.flymenuStyle={2356318349:'flyout_menu_18'};function profile_insert_loading_layer(target){var _loading_layer=$N('div');CSS.addClass(_loading_layer,'loading_layer');target.parentNode.style.position='relative';_loading_layer.style.position='absolute';target.parentNode.appendChild(_loading_layer);return _loading_layer;}
function profile_basic_info_summary_refresh(content){$('flyout_menu_profile_basic_info_editor').remove();DOM.replace($('basic_info_summary_box'),HTML(content));}
function profile_basic_info_summary_editor_onclick(){var root_ele=$('basic_info_summary_box');var loading_layer=profile_insert_loading_layer(this);var key=this.value;var list_item=DOM.find(root_ele,'div.'+key);var ze_animation=!this.checked?animation(list_item).to('height','0px').to('opacity',0).duration(200).hide():animation(list_item).to('height','auto').from('0px').to('opacity',1).from(0).duration(200).show();new AsyncRequest().setURI('/ajax/profile/basic_info.php').setData(this.checked?{show:key}:{hide:key}).setHandler(function(response){var no_info_div=DOM.find(root_ele,'div.no_info');var all_hidden=true;var checkboxes=DOM.scry(this.form,'input[type="checkbox"]');for(var ii=0;ii<checkboxes.length&&all_hidden;ii++){all_hidden&=!shown(checkboxes[ii])||!checkboxes[ii].checked;}
all_hidden?show(no_info_div):hide(no_info_div);ze_animation.go();}.bind(this)).setErrorHandler(function(response){this.checked=!this.checked;ErrorDialog.showAsyncError(response);}.bind(this)).setFinallyHandler(DOM.remove.bind(null,loading_layer)).send();}
var FriendsBoxEditor={_submit:function(data){var content=$('app_content_2356318349');var placeholder=DOM.find(content,'div.loading_placeholder');var innerContent=$('profile_friends_box_inner_content');Vector2.getElementDimensions(innerContent).setElementHeight(placeholder);CSS.addClass(content,'is_loading');new AsyncRequest().setURI('/ajax/profile/friends_box.php').setData(data).setHandler(function(response){DOM.replace(innerContent,HTML(response.getPayload()));}).setFinallyHandler(CSS.removeClass.bind(null,content,'is_loading')).send();},setNumToShow:function(select){FriendsBoxEditor._submit({max_num_to_show:select.value});},toggleNetwork:function(checkbox){var networks=serialize_form(checkbox.form)['networks'];var data={};var networksErrorElem=DOM.scry($('content_box_edit_menu_2356318349'),'div.networks_error')[0];if(networks){data['networks']=networks;hide(networksErrorElem);}else{show(networksErrorElem);checkbox.checked=true;return false;}
FriendsBoxEditor._submit(data);return true;},addFriendOrList:function(token){var data;if(token.flid){data={add_friend_list:token.flid};}else if(token.i){data={add_friend:token.i};}
FriendsBoxEditor._submit(data);},removeFriendOrList:function(token){var data;if(token.flid){data={remove_friend_list:token.flid};}else if(token.i){data={remove_friend:token.i};}
FriendsBoxEditor._submit(data);},toggleShowNetworks:function(checkbox){FriendsBoxEditor._submit({show_networks:checkbox.checked});}}
function BlurbEditor(root,text,profile_id){this.root=root;this.text=text;this.profileId=profile_id;this.textElem=DOM.find(this.root,'div.text_wrapper');this.editLink=DOM.find(this.root,'a.edit_link');this.promptElem=DOM.find(this.root,'div.prompt');this.editorElem=DOM.find(this.root,'div.edit');this.inputBox=DOM.find(this.editorElem,'textarea');this.needCursorHack=ua.firefox()<3.0;this.cursorHacked=false;this.editLink.onmousedown=chain(this.editLink.onmousedown,this.toggleEditor.bind(this));this.promptElem.onmousedown=chain(this.promptElem.onmousedown,this.toggleEditor.bind(this));this.inputBox.onfocus=chain(this.inputBox.onfocus,DOM.setCaretPosition.bind(null,this.inputBox,0,Number.POSITIVE_INFINITY));this.inputBox.onkeypress=chain(this.inputBox.onkeypress,this.onkeypress.bind(this));if(!this.needCursorHack){this.inputBox.onblur=chain(this.inputBox.onblur,this.blur.bind(this));}else{}
this.mode=BlurbEditor.READ;}
BlurbEditor.EDIT=1;BlurbEditor.READ=2;BlurbEditor.UPDATING=3;copy_properties(BlurbEditor.prototype,{_updateView:function(mode){this.mode=mode;if(this.mode==BlurbEditor.READ){CSS.removeClass(this.root,'blurb_editing');this.editLink.title=_tx("Sunting");hide(this.editorElem);if(!this.text){hide(this.textElem);hide(this.editLink);show(this.promptElem);}else{hide(this.promptElem);show(this.textElem);show(this.editLink);}}else if(this.mode==BlurbEditor.EDIT){CSS.addClass(this.root,'blurb_editing');this.editLink.title=_tx("Simpan");this.inputBox.value=this.text;hide(this.textElem);hide(this.promptElem);show(this.editLink);show(this.editorElem);if(this.needCursorHack&&!this.cursorHacked){this.inputBox.focus();this.inputBox.blur();this.inputBox.onblur=chain(this.inputBox.onblur,this.blur.bind(this));this.cursorHacked=true;}
this.inputBox.focus();}else{Util.error('Trying to update mode with this.mode='+this.mode+'. Oh noez, a race condition.');}},toggleEditor:function(){if(this.mode==BlurbEditor.EDIT){this.blur();}else if(this.mode==BlurbEditor.READ){this._updateView(BlurbEditor.EDIT);}else if(this.mode==BlurbEditor.UPDATING){}
return false;},blur:function(e){if(this.mode!=BlurbEditor.EDIT){return;}
if(this.text==this.inputBox.value){this._updateView(BlurbEditor.READ);return;}
this.mode=BlurbEditor.UPDATING;this.inputBox.disabled=true;CSS.addClass(this.inputBox,'updating');this._syncText(this.inputBox.value);new AsyncRequest().setURI('/ajax/profile/blurb.php').setData({blurb:this.text,profile_id:this.profileId}).setHandler(function(response){DOM.setContent(this.textElem,HTML(response.getPayload()));}.bind(this)).setFinallyHandler(function(){this._updateView(BlurbEditor.READ);CSS.removeClass(this.inputBox,'updating');this.inputBox.disabled=false;}.bind(this)).send();},_syncText:function(text){this.text=trim(text);this.inputBox.value=this.text;},onkeypress:function(e){var key_code=event_get_keypress_keycode(e);if(key_code==KEYS.RETURN||key_code==KEYS.TAB){this.blur();return false;}
if(key_code==KEYS.ESC){this._syncText(this.text);this.blur();return false;}
return true;}});

function profile_pic_remove(profile_id){var removeButton={name:'remove',label:_tx("Hapus Foto"),className:'inputaux',handler:profile_pic_remove}
var currDialog=Dialog.getCurrent()
if(currDialog){currDialog.clearHandler();currDialog.hide();}
var dialog=new Dialog().setTitle(_tx("Hapus Foto?")).setBody(_tx("Anda yakin ingin menghapus gambar ini?")).setButtons(Dialog.OK_AND_CANCEL).setHandler(remove_confirm_handler).show();function remove_confirm_handler(){var async=new AsyncRequest().setURI('/ajax/profile/picture/remove.php').setData({remove:true,id:profile_id}).setHandler(on_response).send();}
function on_response(asyncResponse){var response=asyncResponse.getPayload();if(response['success']){$('profile_pic').src=(response['pic']?response['pic']:'http://static.ak.fbcdn.net/pics/l_silhouette.jpg');}}}

function ProfilePicSquareEditor(profileId,_squareDisplaySize,_narrowGive){copy_properties(this,{squareSwitched:false,squarePicture:null,squarePictureLoaded:false,squareX:0,squareY:0,newSquarePicturePosX:0,newSquarePicturePosY:0,mouseDown:false,mouseDownPos:null,profileId:profileId,squareDisplaySize:_squareDisplaySize,narrowGive:_narrowGive,mouseupRef:null,mousemoveRef:null});ProfilePicSquareEditor.instance=this;onunloadRegister(function(){ProfilePicSquareEditor.instance=null;});new AsyncRequest().setURI('/ajax/profile/picture/square.php').setData({square:true,id:this.profileId}).setHandler(this.showEditor.bind(this)).send();}
copy_properties(ProfilePicSquareEditor.prototype,{showEditor:function(asyncResponse){var response=asyncResponse.getPayload();if(response['body']){var dialog=new Dialog().setTitle(_tx("Sunting Cuplikan")).setBody(response['body']).setButtons([Dialog.SAVE,Dialog.CANCEL]).setHandler(this.squarePictureSave.bind(this)).setCloseHandler(this._clearEventHandlers.bind(this)).show();}},squarePictureOnLoad:function(){this.squarePictureLoaded=true;},squarePictureInit:function(){var halfNarrowGive=this.narrowGive*-0.5;this.squarePicture=$('squarepicture');if(this.squarePicture.height>this.squarePicture.width){this.squarePicture.width=this.squareDisplaySize+this.narrowGive;this.newSquarePicturePosX=halfNarrowGive;this.newSquarePicturePosY=this.squareDisplaySize*0.5-this.squarePicture.height*0.3;if(this.newSquarePicturePosY>halfNarrowGive)
this.newSquarePicturePosY=halfNarrowGive;}
else{this.squarePicture.height=this.squareDisplaySize+this.narrowGive;this.newSquarePicturePosY=halfNarrowGive;this.newSquarePicturePosX=(this.squareDisplaySize-this.squarePicture.width)*0.5;}
this.squarePicture.style.left=this.newSquarePicturePosX+'px';this.squarePicture.style.top=this.newSquarePicturePosY+'px';this.mouseupRef=Event.listen(document.body,'mouseup',this.squarePictureMouseUp.bind(this));this.mousemoveRef=Event.listen(document.body,'mousemove',this.squarePictureMouseMove.bind(this));this.mouseDown=true;this.squarePictureMouseUp();var squarePictureStart=$('squarepicturestart');squarePictureStart.style.display='none';this.squarePicture.style.visibility='visible';},squarePictureMouseDown:function(event){if(this.squarePictureLoaded==false){return;}
if(this.squareSwitched==false){this.squarePictureInit();this.squareSwitched=true;}
this.mouseDown=true;this.mouseDownPos=Vector2.getEventPosition(event);this.squarePictureMouseMove(event);},squarePictureMouseOver:function(){if(this.mouseDown==false)
return;this.squarePictureMouseUp();},squarePictureMouseUp:function(){if(this.mouseDown==false){return;}
this.mouseDown=false;this.squareX=parseFloat(-100*this.newSquarePicturePosX/this.squarePicture.width);if(this.squareX<0.1){this.squareX=0;}
this.squareY=parseFloat(-100*this.newSquarePicturePosY/this.squarePicture.height);if(this.squareY<0.1){this.squareY=0;}},squarePictureMouseMove:function(event){if(this.mouseDown==false){return;}
var diff=Vector2.getEventPosition(event).sub(this.mouseDownPos);var posX=diff.x-parseFloat(this.squareX*this.squarePicture.width*0.01);var posY=diff.y-parseFloat(this.squareY*this.squarePicture.height*0.01);if(posY>0){posY=0;}
else if(posY+this.squarePicture.height<this.squareDisplaySize){posY=-1*this.squarePicture.height+this.squareDisplaySize;}
if(posX>0){posX=0;}
else if(posX+this.squarePicture.width<this.squareDisplaySize){posX=-1*this.squarePicture.width+this.squareDisplaySize;}
this.newSquarePicturePosX=posX;this.newSquarePicturePosY=posY;this.squarePicture.style.left=posX+'px';this.squarePicture.style.top=posY+'px';},squarePictureSave:function(){if(this.squareSwitched){var form=$('squareform');DOM.find(form,'input[name="squarex"]').value=this.squareX;DOM.find(form,'input[name="squarey"]').value=this.squareY;form.submit();this._setFormEnabled(false,false);return false;}
return true;},squarePictureSaveSuccess:function(){Dialog.getCurrent().hide();},squarePictureSaveError:function(){this._setFormEnabled(true,true);},_setFormEnabled:function(enabled,showError){CSS.conditionClass($('square_profile_pic_saving_indicator'),'hidden_elem',enabled);CSS.conditionClass($('square_profile_pic_saving_error'),'hidden_elem',!enabled||!showError);CSS.conditionClass($('squareform_content'),'hidden_elem',!enabled);var cancel_button=Dialog.getCurrent().getButtonElement(Dialog.CANCEL);CSS.conditionClass(cancel_button,'inputaux_disabled',!enabled);if(enabled){cancel_button.removeAttribute('disabled');}else{cancel_button.setAttribute('disabled','disabled');}},_clearEventHandlers:function(){if(this.mouseupRef){this.mouseupRef.remove();this.mouseupRef=null;}
if(this.mousemoveRef){this.mousemoveRef.remove();this.mousemoveRef=null;}}});ProfilePicSquareEditor.getInstance=function(){return ProfilePicSquareEditor.instance;}
ProfilePicSquareEditor._makeInstanceCall=function(callback){var instance=ProfilePicSquareEditor.getInstance();if(instance){callback.bind(instance)();}}
ProfilePicSquareEditor.saveSuccess=function(){ProfilePicSquareEditor._makeInstanceCall(ProfilePicSquareEditor.prototype.squarePictureSaveSuccess);}
ProfilePicSquareEditor.saveError=function(){ProfilePicSquareEditor._makeInstanceCall(ProfilePicSquareEditor.prototype.squarePictureSaveError);}

function profile_pic_camera(profile_id){var async=new AsyncRequest().setMethod('GET').setReadOnly(true).setData({id:profile_id}).setURI('/camera/dialog.php?inline');new Dialog().setAsync(async).setClassName('camera').show();}
function profile_pic_upload(profile_id){var async=new AsyncRequest().setMethod('GET').setReadOnly(true).setData({id:profile_id}).setURI('/ajax/profile/picture/upload.php');new Dialog().setAsync(async).show();}
function submit_to_iframe(){$('form_upload_profile_pic').submit();set_loading_state();return false;}
function set_loading_state(){var indicator=ge('profile_pic_upload_indicator');CSS.toggleClass(indicator,'profile_pic_display_none');var form=ge('profile_pic_form');CSS.toggleClass(form,'profile_pic_display_none');var up_error=ge('error');if(up_error){CSS.toggleClass(up_error,'profile_pic_display_none');}
var cancel_button=Dialog.getCurrent().getButtonElement(Dialog.CANCEL);CSS.toggleClass(cancel_button,'inputaux_disabled');cancel_button.setAttribute('disabled','disabled');}
function profile_picture_upload_success(success){if(success){profile_picture_upload_done(success);}else{profile_picture_upload_fail();}}
function profile_picture_upload_done(success){var profile_pic=ge('profile_pic');profile_pic.src=success;Dialog.getCurrent().hide();}
function profile_picture_upload_fail(){Dialog.getCurrent().hide();profile_pic_upload('try_again');}

function px_width(el){return parseInt(el.style.width.split('px')[0]);}
function round_dec(num,decimals){if(decimals>0){if((num.toString().length-num.toString().lastIndexOf('.'))>(decimals+1)){var round_factor=Math.pow(10,decimals);return Math.round(num*round_factor)/round_factor;}else{return num;}}
else return Math.round(num);}
function get_time_remaining(seconds){var hours=Math.floor(seconds/3600);seconds-=3600*hours;var minutes=Math.floor(seconds/60);seconds-=60*minutes;var time_str;if(hours>1){if(minutes>1){time_str=_tx("{num-hours} jam, {num-minutes} menit yang tersisa",{'num-hours':hours,'num-minutes':minutes});}else if(minutes==1){time_str=_tx("{num-hours} jam, 1 menit yang tersisa",{'num-hours':hours});}else{time_str=_tx("{num-hours} jam lagi",{'num-hours':hours});}}else if(hours==1){if(minutes>1){time_str=_tx("1 jam, {num-minutes} menit tersisa",{'num-minutes':minutes});}else if(minutes==1){time_str=_tx("1 jam, 1 menit lagi");}else{time_str=_tx("sisa 1 jam lagi");}}else if(minutes>1){time_str=_tx("{num-minutes} menit tersisa",{'num-minutes':minutes});}else if(minutes==1){time_str=_tx("1 menit lagi");}else if(seconds>1){time_str=_tx("{num-seconds} detik lagi",{'num-seconds':seconds});}else if(seconds==1){time_str=_tx("sisa 1 detik");}else{time_str='';}
return time_str;}
var current_grow_thread=0;var current_base_thread=0;function grow(bar_id,last_progress,progress,total,update_interval){outer_bar=ge(bar_id+'_outer');inner_bar=ge(bar_id+'_inner');outer_width=px_width(outer_bar);current_bar_width=px_width(inner_bar);last_pct=round_dec(((last_progress+1)/total),3);pct=round_dec((progress/total),3);old_bar_width=Math.round(last_pct*outer_width);new_bar_width=Math.round(pct*outer_width);grow_size=new_bar_width-old_bar_width;if(current_grow_thread){clearTimeout(current_grow_thread);clearTimeout(current_base_thread);}
current_grow_thread=setTimeout(function(){grow_worker(bar_id,old_bar_width,grow_size,update_interval);},0);}
function grow_worker(bar_id,start_px,grow_size,target_length){inner_bar=ge(bar_id+'_inner');inner_bar.style.width=start_px.toString()+'px';if(px_width(inner_bar)>=(start_px+grow_size)){return;}
current_base_thread=grow_base(inner_bar,grow_size,grow_size+start_px,target_length);}
function grow_base(el,amount,max,target_length){amount_this_time=Math.floor(target_length/amount);el.style.width=(px_width(el)+1).toString()+'px';if(px_width(el)>=max){return;}
return setTimeout(function(){grow_base(el,amount,max,target_length);},amount_this_time);}

function video_select_file(file){if(!video_extension_is_valid(file.value)){window.parent.video_show_extension_error(video_extensions_info);try{file.value=''}catch(e){}
return;}else if(window.parent.video_show_agreement){window.parent.video_show_agreement_dialog(file.form,window.parent);return;}
window.parent.video_selected_file(file.form);}
function video_extension_is_valid(filename){var ext=/\.([^.\/\\]+)$/.exec(filename);return ext&&typeof video_extensions[String(ext[1]).toLowerCase()]!='undefined';}
function video_show_extension_error(video_extensions_info){var dialog_header=_tx("Ekstensi tidak valid");var help_link='<a href="http://www.facebook.com/help.php?topic=video">'+_tx("halaman bantuan")+'</a>';var dialog_text=_tx("Maaf, itu bukan file video yang bisa kami dukung. untuk sekarang kami hanya bisa mendukung yang berekstensi sebagai berikut :")+video_extensions_info+
_tx("Jika Anda memerlukan bantuan, silakan baca {=help page} kami.",{'=help page':help_link});new Dialog().setTitle(dialog_header).setBody(dialog_text).setButtons([Dialog.OK]).show();}
function video_show_agreement_dialog(form,context){var dialog=new Dialog().setTitle(_tx("Ketentuan Layanan")).setBody(context.video_upload_tos).setClassName('video_agreement').setButtons([Dialog.newButton('agree',_tx("Setuju"),'',function(){new AsyncRequest().setURI('/ajax/motion_upload.php').setData({action:'obey'}).setHandler(function(response){context.video_selected_file(form);dialog.hide();this.disabled=true;}).send();}),Dialog.newButton('do-not-agree',_tx("Tidak Setuju"),'',function(){dialog.hide();form.file_baby.disabled=false;form.file_baby.value='';})]).show();}
function video_selected_file(form){form.file_baby.disabled=true;var oid=ge('video_upload_oid');var params={action:'get_id'};if(oid){params.oid=oid.value;}
new AsyncRequest().setURI('/ajax/motion_upload.php').setData(params).setHandler(function(response){var upload_data=response.getPayload();form.video_ptoken.value=form.video_id.value=upload_data.video_id;if(ge('error')){hide(ge('error'));}
video_start_upload(form,upload_data.video_id,upload_data.upload_url,upload_data.progress_url,upload_data.max_upload_size,upload_data.progress_rate);}).send();}
var video_complete=false;function video_upload_complete(){var markup='<div class="video_standard_status">'+'<div class="status">'+'<h2>'+_tx("Pengunggahan Berhasil")+'</h2>'+'<p>'+_tx("Setelah selesai menyunting data video, klik \"Simpan Informasi\" untuk melanjutkan.")+'</p>'+'</div>'+'</div>';$('wait_panel').innerHTML=markup;video_complete=true;if(video_redr_url){goURI(video_redr_url);}}
function video_upload_popup_complete(){toggleDisplayNone('s','upload_popup_complete');}
function video_start_upload(form,video_id,upload_url,progress_url,max_upload_size,progress_rate){form.action+='?v='+video_id;$('upload_action').style.position='absolute';$('upload_action').style.top='-5000px';$('upload_action').style.left='-5000px';$('wait_panel').style.display='';form.file_baby.disabled=false;form.submit();form.file_baby.disabled=true;new VideoUploadProgress(video_id,'progress_bar','progress_iframe',progress_url,progress_rate,upload_url,max_upload_size);$('video_id').value=video_id;fade_and_slide_div(ge('upload_file_form'),true);}
function fade_and_slide_div(obj,open){animation(obj).to('height',open?'auto':0).to('opacity',open?1:0)[open?'show':'hide']().duration(450).go();}
function video_toggle_form(form,disabled){var k=['input','select','textarea'];for(var j=0;j<k.length;j++){var inputs=form.getElementsByTagName(k[j]);for(var i=0;i<inputs.length;i++){inputs[i].disabled=disabled;}}}
var video_redr_url=null;function video_save_edit_upload(form){var tags=[];var tag_zone=ge('tag_zone');if(tag_zone){var tag_inputs=tag_zone.getElementsByTagName('input');for(var i=0;i<tag_inputs.length;i++){tags.push(tag_inputs[i].value);}}
var args=serialize_form($('video_metadata_form'));copy_properties(args,{friends:tags,action:'edit_video'});new AsyncRequest().setURI('/ajax/motion_upload.php').setData(args).setHandler(function(response){result=response.getPayload();set_inner_html($('status_panel'),result.html);if(result.error){this.onError();}else{video_redr_url=result.href;if(video_complete){goURI(video_redr_url);}else{fade_and_slide_div(ge('upload_file_form'),false);}}}).setErrorHandler(function(response){video_toggle_form(form,false);}).send();}
function VideoUploadProgress(video_id,progress_bar_id,progress_iframe_id,progress_url,update_speed,upload_url,max_upload_size){this.progress_bar_id=progress_bar_id;this.video_id=video_id;this.upload_url=upload_url;this.last_progress=0;this.max_upload_size=max_upload_size;this.update_speed=update_speed;VideoUploadProgress.instance=this;ge(progress_iframe_id).src=URI(progress_url).addQueryData({'v':video_id,'s':update_speed});}
VideoUploadProgress.getInstance=function(){return VideoUploadProgress.instance;}
VideoUploadProgress.prototype.update_progress=function(sent_bytes,total_bytes,time_elapsed,start_time){if(this.max_upload_size>-1&&total_bytes>0&&total_bytes>this.max_upload_size){return this.too_big();}
if(total_bytes>0&&sent_bytes>0){total_kbytes=round_dec(total_bytes/1024,2);progress_kbytes=round_dec(sent_bytes/1024,2);total_mbytes=round_dec(total_bytes/1024/1024,2);progress_mbytes=round_dec(sent_bytes/1024/1024,2);kbytes_per_second=round_dec(progress_kbytes/time_elapsed,2);seconds_remaining=Math.ceil((total_kbytes-progress_kbytes)/kbytes_per_second);var time_str=get_time_remaining(seconds_remaining);var stats=_tx("{current-MB} MB dari {total-MB} MB ({KB-per-second} KB\/det)",{'current-MB':progress_mbytes,'total-MB':total_mbytes,'KB-per-second':kbytes_per_second})+
(time_str?(' -- '+time_str):'');$(this.progress_bar_id+'_stats').innerHTML=stats;grow(this.progress_bar_id,this.last_progress,sent_bytes,total_bytes,this.update_speed*1000);this.last_progress=sent_bytes;}}
VideoUploadProgress.prototype.too_big=function(){goURI(URI(this.upload_url).addQueryData({'toolarge':null}));}
function video_show_cancel_dialog(obj,cancel_url,close_on_cancel){new Dialog().setTitle(_tx("membatalkan upload")).setBody(_tx("Anda yakin ingin membatalkan unggahan video?")).setButtons([Dialog.newButton('cancel',_tx("Batalkan Pengunggahan"),'',function(){if(close_on_cancel){window.close();}else{goURI(cancel_url);}}),Dialog.newButton('dont-cancel',_tx("Jangan Batalkan"))]).show();}
function video_send_email_when_processed(video_id,send_email){var args={action:'set_send_email',video_id:video_id,send_email:send_email?1:0};new AsyncRequest().setURI('/ajax/motion_upload.php').setData(args).setHandler(function(response){$('notification_status').innerHTML=response.getPayload();}).send();}
function video_verify_account_popup(){var newwindow=window.open('/confirmphone.php','confirm_phone','height=350, width=520, left=100, top=100, resizable=yes, scrollbars=no, toolbar=no, status=no');if(newwindow){newwindow.focus();}else{aiert(_tx("Pemblokir jendela munculan mungkin menonaktifkan Jendela Verifikasi Seluler."));}
return false;}
function video_upload_close_popup_and_edit(edit_url){return _video_upload_close_popup_and_navigate(edit_url);}
function video_upload_close_popup_and_retry(retry_url){return _video_upload_close_popup_and_navigate(retry_url);}
function video_upload_close_popup_and_login(login_url){return _video_upload_close_popup_and_navigate(login_url);}
function _video_upload_close_popup_and_navigate(url){if(window!=window.opener){window.opener.location=url;}else{window.open(url);}
window.close();}

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