/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  February 9th 2010 6:52:09 PM PST                             */
/*      Machine:  10.16.139.107                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/7cvj6vnfojwoc0oo.pkg.js h:co5oa6et                        */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/7cvj6vnfojwoc0oo.pkg.js                                   */

if (window.CavalryLogger) { CavalryLogger.start_js(["js\/7cvj6vnfojwoc0oo.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_show_export_dialog(eid){var async=new AsyncRequest().setMethod('POST').setURI('/ajax/events/export.php').setData({'eid':eid});var dialog=new Dialog().setAsync(async).show();return false;}
function export_dialog_submit(obj,eid){var do_download=$('download_export').checked;Dialog.getCurrent().hide();if(do_download){var ics_file_endpoint='/ical/event.php?eid='+eid;goURI(ics_file_endpoint);}else{var form_data=serialize_form(obj);new AsyncRequest().setMethod('POST').setURI('/ajax/events/export.php').setData(form_data).send();}}
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 event_profile_rsvp(eid,rsvp){new AsyncRequest().setURI('/ajax/event_actions_ajax.php').setData({'eid':eid,'rsvp':rsvp,'inline':true}).setHandler(function(response){var payload=response.getPayload();var rsvp=ge('event_rsvp_status');var guests=ge('event_profile_guests');var guestlist=ge('event_profile_guestlist');var wall=ge('event_profile_wall');var actions=ge('event_profile_actions');if(rsvp){DOM.replace(rsvp,HTML(payload['event_rsvp_status']));}
if(guests){DOM.replace(guests,HTML(payload['event_profile_guests']));}
if(guestlist){DOM.replace(guestlist,HTML(payload['event_profile_guestlist']));}
if(wall){DOM.replace(wall,HTML(payload['event_profile_wall']));}
if(actions){DOM.replace(actions,HTML(payload['event_profile_actions']));}}).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;}}

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