/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  December 14th 2008 7:33:15 PM PST                            */
/*      Machine:  10.16.139.102                                                */
/*       Source:  Global Cache                                                 */
/*     Location:  js/2lt6agisyskkk0oc.pkg.js h:51q7wxdl                        */
/*       Locale:  en_US                                                        */
/*         Path:  js/2lt6agisyskkk0oc.pkg.js                                   */


function events_dashboard_rsvp(eid,redir_page,current_rsvp_code){var attending_id=eid+'_attending';var maybe_id=eid+'_maybe';var not_attending_id=eid+'not_attending';var attending_checked=(current_rsvp_code=='Attending')?'checked':'';var maybe_checked=(current_rsvp_code=='Maybe Attending')?'checked':'';var not_attending_checked=(current_rsvp_code=='Not Attending')?'checked':'';var content='<p>'+
_tx("Select your RSVP:")+'</p>'+'<table>'+'<tr>'+'<td>'+'<input id="'+attending_id+'" type="radio" name="rsvp_status" value="Attending" '+attending_checked+' />'+'<label for="'+attending_id+'">'+_tx("Attending")+'</label>'+'</td>'+'<td>'+'<input id="'+maybe_id+'" type="radio" name="rsvp_status" value="Maybe Attending" '+maybe_checked+' /> '+'<label for="'+maybe_id+'">'+_tx("Maybe Attending")+'</label>'+'</td>'+'<td>'+'<input id="'+not_attending_id+'" type="radio" name="rsvp_status" value="Not Attending" '+not_attending_checked+' />'+'<label for="'+not_attending_id+'">'+_tx("Not Attending")+'</label>'+'</td>'+'</tr>'+'</table>';var dialog=new Dialog().setTitle(_tx("RSVP to this Event")).setBody(content).setButtons([Dialog.newButton('rsvp',_tx("RSVP"),'',function(){var radios=[attending_id,maybe_id,not_attending_id];var rsvp_status='';for(var i=0;i<radios.length;i++){var radio=$(radios[i]);if(radio.checked){rsvp_status=radio.value;break;}}
dialog.hide();dynamic_post('/events.php',{eid:eid,set_rsvp:true,redir_page:redir_page,rsvp_status:rsvp_status});}),Dialog.CANCEL]).show();return false;}
function events_show_export_dialog(url){new Dialog().setTitle(_tx("Export Events")).setBody('<p>'+_tx("You can export your Facebook Events into many other programs, such as Apple iCal, Microsoft Outlook, and Google Calendar.")+'</p><p>'+_tx("Simply click the Export button that appears beneath the picture on any Event page or use the following URL to export all your upcoming events:")+'</p>'+'<p style="text-align:center;">'+'<a href="'+url+'">'+url+'</a></p>').setButtons([Dialog.CLOSE]).show();return false;}

function event_show_remove_dialog(eid,name){new Dialog().setTitle(_tx("Remove event?")).setBody(_tx("Are you sure you want to remove your membership from {event-name}?",{'event-name':htmlize(name)})).setButtons([Dialog.newButton('remove',_tx("Remove"),'',function(){event_remove_user(eid);}),Dialog.CANCEL]).show();return false;}
function event_remove_user(eid){new AsyncRequest().setURI('/ajax/event_actions_ajax.php').setData({'eid':eid,'remove':1}).setHandler(function(response){if(response.getPayload()==='1'){goURI('/event.php?eid='+eid);}else{goURI('/events.php');}}).send()}
function confirm_event_join(eid){new AsyncRequest().setURI('/ajax/event_actions_ajax.php').setData({'eid':eid,'join':1}).setHandler(function(response){goURI('/event.php?eid='+eid);}).send()}
function save_event_map_pref(map_id){new AsyncRequest().setURI('/ajax/event_map_pref.php').setData({'map_id':map_id}).send();}

function change_network(n_id,autosubmit){if(n_id=='other'){hide('search_within');var typeahead=$('n_selector').getElementsByTagName('input')[0].typeahead;if(typeahead){typeahead.clear();}
$('n_selector').style.display='block';$('sq').focus();}else{$('search').n.value=n_id;$('search').init.value=ge('filter_init')?$('filter_init').value:'';$('search').sf.value=ge('filter_sf')?$('filter_sf').value:'';if(autosubmit){if($('search').q.value!=''){$('search').submit();}}}}
function toggle_filterset(set)
{if($(set).className=='collapsed'){CSS.setClass($(set),'');}else{CSS.setClass($(set),'collapsed');}}
function filter_toggle()
{if(filter_are_active()){filter_clear();show('web_search_results');}
else{filter_reveal();hide('web_search_results');}}
function filter_reveal()
{CSS.setClass($('search_results'),'search_results clearfix filters_active');hide('show_filters');show('hide_filters');}
function filter_clear()
{CSS.setClass($('search_results'),'search_results clearfix');hide('hide_filters');show('show_filters');}
function filter_are_active()
{return $('search_results').className.indexOf('filters_active')!==-1;}
function age_check(){val1=parseInt($('y1').value);val2=parseInt($('y2').value);if(val1>val2){$('y2').value=ge('y1').value;return;}
if(Math.abs(val1-val2)>7){$('y2').value=val1+7;$('max_age_range_warning').style.display='block';}}
function age_update_endage(){val1=parseInt($('y1').value);age2=ge('y2');while(i=age2.childNodes.length){DOM.remove(age2.childNodes[i-1]);}
if(!val1){option=document.createElement('option');option.appendChild(document.createTextNode(''));age2.appendChild(option);val1=18}
for(i=val1;i<=97;i++){option=document.createElement('option');option.value=i;option.appendChild(document.createTextNode(i));age2.appendChild(option);}}
function age_submit(){val1=parseInt($('y1').value);val2=parseInt($('y2').value);if(!val2&&val1){$('y2').value=val1;}
if(!val1&&val2){$('y1').value=val2;}}

function group_remove_user(gid){new AsyncRequest().setURI('/ajax/group_actions_ajax.php').setData({gid:gid,remove:1}).setHandler(goURI.bind(null,'/groups.php')).setErrorHandler(ErrorDialog.showAsyncError).send();}
function group_add_user(gid){new AsyncRequest().setURI('/ajax/group_actions_ajax.php').setData({gid:gid,join:1}).setHandler(goURI.bind(null,'/group.php?gid='+gid)).setErrorHandler(ErrorDialog.showAsyncError).send();}
function group_remove_officer(gid,uid){new AsyncRequest().setURI('/ajax/group_actions_ajax.php').setData({gid:gid,uid:uid,remove_officer:1}).setHandler(function(){document.location.reload();}).setErrorHandler(ErrorDialog.showAsyncError).send();}
function confirm_group_join(gid){group_add_user(gid);}
function group_ask_leave(gid,msg,name){if(msg!=""){msg+="<br /><br />";}
msg+=_tx("Are you sure you want to remove your membership from {group-name}?",{'group-name':htmlize(name)});var dialog=new Dialog().setTitle(_tx("Remove group membership?")).setBody(msg).setButtons([Dialog.newButton('remove',_tx("Remove"),'',function(){group_remove_user(gid);dialog.hide();}),Dialog.CANCEL]).show();return false;}
function group_ask_join(gid,name){var msg_text=_tx("Do you want to join {group-name}?",{'group-name':htmlize(name)});var dialog=new Dialog().setTitle(_tx("Add group membership?")).setBody(msg_text).setButtons([Dialog.newButton('join',_tx("Join"),'',function(){group_add_user(gid);dialog.hide();}),Dialog.CANCEL]).show();return false;}

function network_source(get_selected_type){this.get_selected_type=get_selected_type;this.parent.construct(this);this.ready();}
network_source.extend('typeahead_source');network_source.prototype.cache_results=true;network_source.prototype.search_limit=200;network_source.prototype.text_placeholder=network_source.prototype.text_noinput=_tx("Enter a city, workplace, school, or region.");network_source.prototype.base_uri='';network_source.prototype.allow_fake_results=true;network_source.prototype.search_value=function(text){this.search_text=text;var async_params={q:text};if((type=typeof(this.get_selected_type))!='undefined'){async_params['t']=(type!='string')?JSON.encode(this.get_selected_type):this.get_selected_type;}
if((type=typeof(this.t))!='undefined'){async_params['t']=(type!='string')?JSON.encode(this.t):this.t;}
if(this.show_email){async_params['show_email']=1;}
if(this.show_network_type){async_params['show_network_type']=1;}
if(this.disable_school_status){async_params['disable_school_status']=1;}
new AsyncRequest().setReadOnly(true).setMethod('GET').setURI('/ajax/typeahead_networks.php').setData(async_params).setHandler(function(response){this.owner.found_suggestions(response.getPayload(),this.search_text);}.bind(this)).setErrorHandler(function(response){this.owner.found_suggestions(false,this.search_text);}.bind(this)).send();}
network_source.prototype.gen_html=function(result,highlight){return['<div>',typeahead_source.highlight_found(result.t,highlight),'</div><div><small>',typeahead_source.highlight_found(result.l,highlight),'</small></div>'].join('');}

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