/*
HTTP Host: b.static.ak.fbcdn.net
Generated: March 21st 2010 12:01:59 PM PDT
Machine: 10.16.140.106
Locale: nu_ll
Path: js/poke.js
*/

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

function show_poke_dialog(uid,_L1,_L2,_L3,_L4,_L5,ref){new PokeController(uid,_L1,_L3,_L4,_L5,ref).show();return false;}function PokeController(uid,_L1,_L2,_L3,_L4,ref){copy_properties(this,{uid:uid,pokeback:(_L1?1:0),pokeback_obj:_L1,failed_captcha:0,parent:_L2,refresh:_L3,dialog:null,first_name:_L4,title:null,ref:ref});this.dialog=Dialog.getCurrent();if(this.dialog)this.dialog.setHandler(this.poke.bind(this));}PokeController.prototype.show=function(){new AsyncRequest('/ajax/poke.php').setData({can_poke:this.uid,pokeback:this.pokeback,failed_captcha:this.failed_captcha}).setContextData('clicktype','Poke',this.ref==="profile_others").setReplayable(false).setHandler(this.onresponse.bind(this)).send();};PokeController.prototype.onresponse=function(_L0){var p=_L0.getPayload();this.dialog=new Dialog();this.title=p.dialog_title;if(!p.status||p.warned)this.dialog.setModal(true);if(p.status){this.dialog.setTitle(this.title).setBody(p.dialog_contents).setButtons([Dialog.newButton('poke',_tx("Colek"),'',this.poke.bind(this)),Dialog.CANCEL]).show();}else this.dialog.setTitle(this.title).setBody(p.dialog_contents).setButtons([Dialog.OK]).show();};PokeController.prototype.poke=function(){var _L0={uid:this.uid,pokeback:this.pokeback};var _L1=ge('captcha_form');if(_L1){var _L2=_L1.getElementsByTagName('input');for(var i=0;i<_L2.length;i++)_L0[_L2[i].name]=_L2[i].value;}this.show_onpoke_dialog=true;new AsyncRequest('/ajax/poke.php').setData(_L0).setHandler(this.onpoke.bind(this)).send();return false;};function remove_poke(obj,_L1,_L2,_L3){new AsyncRequest().setURI('/ajax/poke.php').setData({'p':_L3}).setHandler(function(){hide_poke_obj(obj,_L1,_L2);}).send();}function hide_poke_obj(obj,_L1,_L2){obj=ge(obj);if(obj&&_L2){pobj=obj;while(!CSS.hasClass(pobj,_L2)&&pobj.parentNode)pobj=pobj.parentNode;}if(obj&&_L1){while(!CSS.hasClass(obj,_L1)&&obj.parentNode)obj=obj.parentNode;if(obj)if(DOM.scry(pobj,'div.ind_poke').length<=1){DOM.remove(pobj);}else DOM.remove(obj);}return false;}PokeController.prototype.onpoke=function(_L0){var p=_L0.getPayload();if(!p.captcha){this.dialog.setAutohide(100);this.failed_captcha=1;this.show();return;}if(this.pokeback){var _L2=this.parent||'sidebar_item pokes';hide_poke_obj(this.pokeback_obj,'ind_poke','pokes');if(this.refresh)update_poke_summary(this.refresh,'poke_start_index','poke_end_index','poke_total');}if(this.show_onpoke_dialog){this.dialog.setTitle(this.title).setBody(p.dialog_contents).setButtons([Dialog.OK]).show();if(p.status)this.dialog.setAutohide(1100);this.show_onpoke_dialog=false;}};function update_poke_summary(_L0,_L1,end,_L3){var _L4=$(_L1).innerHTML;var _L5=$(end).innerHTML-1;var _L6=$(_L3).innerHTML-1;$(end).innerHTML=_L5;$(_L3).innerHTML=_L6;$(_L0).innerHTML=_gen_poke_summary_text(_L4,_L5,_L6);}function _gen_poke_summary_text(_L0,end,_L2){if(_L2==1){return _tx("Tampilkan hanya yang dicolek");}else if(_L2==0||end<_L0){return _tx("Saya tidak memiliki apapun untuk Anda");}else if(end==_L2){return _tx("Menampilkan semua {number} colekan.",{'number':_L2});}else return _tx("Menampilkan colekan {start} - {end} dari {total}.",{'start':_L0,'end':end,'total':_L2});}

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