/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  February 8th 2010 7:22:19 PM PST                             */
/*      Machine:  10.16.139.101                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/ersdhrt0us8cwwgo.pkg.js h:5wxfrrmt                        */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/ersdhrt0us8cwwgo.pkg.js                                   */

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

function ajax_remove_application(_L0,_L1,ref,_L3){if(!_L3)_L3=_tx("Sorry, removing this application failed.");new AsyncRequest().setURI('/ajax/apps/remove.php').setMethod('POST').setData({profile_fbid:_L1,app_id:_L0,ref:ref}).setHandler(function(_L4){if(!(_L4.getPayload()).success){Util.error(_L3+'for app %d.',_L0);aiert(_L3);}}).setErrorHandler(function(){Util.error(_L3+'for app %d.',_L0);aiert(_L3);}).send();}function profile_log_friend_click(_L0,_L1){new AsyncSignal('/ajax/log_friends.php',{'friend_ids':_L0,'position':_L1}).send();return true;}
function adjustStories(_L0){var _L1=$('notifications').childNodes;var _L2=null;var _L3=0;var _L4=0;for(var i=0;i<_L1.length;i++)if(CSS.hasClass(_L1[i],'date_divider')){setDateDivider(_L2,_L3);_L3=0;_L2=_L1[i];}else if(CSS.hasClass(_L1[i],'story'))if(_L0(_L1[i])){show(_L1[i]);if(_L3==0){CSS.addClass(_L1[i],'no_border');}else CSS.removeClass(_L1[i],'no_border');_L3++;_L4++;}else hide(_L1[i]);setDateDivider(_L2,_L3);if(_L4){hide('empty_box');}else show('empty_box');}function showOnly(_L0){var _L1=document.getElementsByTagName('input');for(var i=0;i<_L1.length;i++)if(_L1[i].type=='checkbox'&&_L1[i].id!='toggle_'+_L0){_L1[i].checked=false;hidden[_L1[i].id.substr('toggle_'.length)]=true;}adjustStories(function(_L3){return CSS.hasClass(_L3,'story_type_'+_L0);});return false;}function toggleNotice(_L0,_L1,_L2,_L3,_L4,_L5){var _L6=ge('note');var _L7;if(_L2&&hidden[_L0]){var _L8=htmlize($('toggle_'+_L0).nextSibling.nodeValue);if(_L1){_L7=_tx("Notifications from {application-name} are now marked as spam.",{'application-name':_L8})+'<br/><br/>'+'<a href="#" onclick="return toggleType('+_L0+', true, false, true, \''+_L5+'\');">'+_tx("Undo marking as spam")+'</a>';}else{_L7=_tx("Notifications from {application-name} are now hidden.",{'application-name':_L8})+'<a href="#" onclick="return markSpam('+_L0+', true, '+_L3+','+_L4+', \''+_L5+'\');">'+'<br/><br/>'+_tx("Mark {application-name} notifications as Spam",{'application-name':_L8})+'</a>';if(_L4)_L7+='<span class="pipe">|</span>'+'<a href="#" onclick="return showRemoveAppPopupDialog('+_L0+','+_L3+',\''+escape_js_quotes(_L8)+'\');">'+_tx("Remove the {application-name} Application",{'application-name':_L8})+'</a>';}_L6.innerHTML=_L7;show(_L6);}else hide(_L6);}function showRemoveAppPopupDialog(_L0,_L1,_L2){new Dialog().setTitle(_tx("Do you want to remove the application {application-name}?",{'application-name':_L2})).setBody(_tx("When you remove this application, it will disappear from your profile, applications menu, and edit application page. If you want to use it again,  you will need to re-add it.")).setButtons([Dialog.newButton('notif-remove-button',_tx("Remove"),'',function(){notificationRemoveApplication(_L0,_L1,_L2,ge('note'));Dialog.getCurrent().hide();}),Dialog.CANCEL]).show();return false;}function toggleType(_L0,_L1,_L2,_L3,_L4,_L5,_L6,_L7){if(_L1)$('toggle_'+_L0).checked=hidden[_L0];hidden[_L0]=!hidden[_L0];adjustStories(function(_L9){if(CSS.hasClass(_L9,'story_type_'+_L0))return !hidden[_L0];return shown(_L9);});toggleNotice(_L0,_L2,_L3,_L5,_L6,_L7);if(!_L4){var _L8={'app_id':_L0,'collapse':hidden[_L0],'type':_L7};if(_L2!=null)_L8['spam']=_L2;new AsyncRequest().setURI('/ajax/notifications.php').setData(_L8).send();}return false;}function markSpam(_L0,_L1,_L2,_L3,_L4){if(_L1){toggleNotice(_L0,_L1,true,_L2,_L3,_L4);}else hide('note');new AsyncRequest().setURI('/ajax/notifications.php').setData({'app_id':_L0,'spam':_L1,'type':_L4}).send();return false;}function initToggles(){adjustStories(function(_L0){var _L1=_L0.className.match(/\bstory_type_([0-9]*)\b/g);id1=_L1[0].replace('story_type_','');id2=_L1[1].replace('story_type_','');return !hidden[id1]&&!hidden[id2];});}function setDateDivider(_L0,num){if(_L0)if(num==0){hide(_L0);}else show(_L0);}function notificationsShowHideDialog(_L0,_L1,_L2,_L3,_L4){var _L5=$('toggle_'+_L1).nextSibling.nodeValue;var _L6=function(){toggleType(_L1,true,null,true,false,_L2,_L3,_L4);_L8.hide();};var _L7=function(){if(_L3){show_remove_app_contextual_dialog(_L8,_L5,_L1,_L2,function(){toggleType(_L1,true,true,true,false,_L2,false,_L4);});return false;}else{toggleType(_L1,true,true,true,false,_L2,_L3,_L4);_L8.hide();}};var _L8=new ContextualDialog().setContext(_L0).setTitle(_tx("Do you want to hide all notifications from {application-name}?",{'application-name':_L5})).setBody(_tx("This will hide all notifications from this application. Use the right hand checkboxes to change your settings.")).setButtons([Dialog.newButton('hide-all',_tx("Hide all"),'',_L6),Dialog.newButton('report',_tx("Report Spam"),'',_L7),Dialog.CANCEL]).show();return false;}function show_remove_app_contextual_dialog(_L0,_L1,_L2,_L3,_L4,_L5,_L6){if(!_L5)_L5=_L4;var _L7=function(){var _L9=$('note');toggleType(_L2,true,true,true,false,_L3,false,_L6);_L4();notificationRemoveApplication(_L2,_L3,_L1,ge('note'));show(_L9);_L0.hide();};var _L8=function(){_L5();_L0.hide();};_L0.setTitle(_tx("Spam Report submitted.")).setBody(_tx("You told us the notification sent by <b>{application-name}<\/b> was spam. In addition to hiding notifications from this application, would you also like to remove this application from your account?",{'application-name':_L1})).setButtons([Dialog.newButton('remove',_tx("Remove {application-name}",{'application-name':_L1}),'',_L7),Dialog.newButton('just-hide',_tx("Just Hide Notifications"),'',_L8)]).show();}function sentNotificationsShowHideDialog(_L0,_L1,_L2,_L3,_L4,_L5){var _L6=$('toggle_'+_L1).nextSibling.nodeValue;var _L7='<div class="UIMessageBox status" style="margin-bottom: 10px">'+_tx("This sent notifications has been reported.")+'</div>';var _L8=function(){reportSentNotification(_L1,_L2,_L5);var _La=$('story_alert_'+_L2);if(_L4){show_remove_app_contextual_dialog(_L9,_L6,_L1,_L3,function(){},function(){_La.innerHTML=_L7;CSS.removeClass(_La,'story_type_record_sent');},_L5);return false;}else{_La.innerHTML=_L7;CSS.removeClass(_La,'story_type_record_sent');_L9.hide();}};var _L9=new ContextualDialog().setClassName('report_sent_notification').setContext(_L0).setTitle(_tx("Report a notification sent by {application-name}?",{'application-name':_L6})).setBody(_tx("What is the reason for reporting this notification?")+'<div class="notification_options">'+'<form name="report_sent_notification_'+_L1+'">'+'<input name="report_sent_notification" class="inputradio" type="radio"'+' value="report_incorrect" name="report_sent_notification"/>'+_tx("I didn't do the action specified in the notification.")+'<br/>'+'<input name="report_sent_notification" class="inputradio" type="radio"'+' value="report_unintentional" name="report_sent_notification"/>'+_tx("I did this action but did not want to send a notification.")+'</form></div>').setButtons([Dialog.newButton('submit-report',_tx("Submit Report"),'',_L8),Dialog.CANCEL]).show();return false;}function reportSentNotification(_L0,_L1,_L2){var _L3='report_sent_notification_'+_L0;var _L4=document.forms[_L3].elements['report_sent_notification'][0].checked;var _L5=document.forms[_L3].elements['report_sent_notification'][1].checked;if(!_L4&&!_L5){return null;}else{new AsyncRequest().setURI('/ajax/notifications.php').setData({app_id:_L0,'sent_notification_incorrect':_L4,'sent_notification_unintentional':_L5,'remove_alert_id':_L1,'type':_L2}).setHandler(bind(this,function(_L6){if(_L6.getPayload())form_hidden_inputs=_L6.getPayload();})).send();return true;}}function notificationRemoveApplication(_L0,_L1,_L2,_L3){remove_app_link_from_notifications_filter(_L0);ajax_remove_application(_L0,_L1,'notif',_tx("Sorry, removing this application failed."));_L3.innerHTML=_tx("The application <strong>{application-name}<\/strong> has been removed.",{'application-name':_L2});}function remove_app_link_from_notifications_filter(_L0){var _L1='notif_filter_'+_L0;if(ge(_L1))hide(_L1);}

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