
function show_add_network_dialog(name,nkey,ntype,uri){var dialog=new pop_dialog('add_network_dialog');var title='Join the '+name+' Network';var button_title='Join';var content='<p>You must have a valid <strong>'+name+'</strong> email address to join this network.  Please enter it below.</p>'
+'<label>Email:</label>'
+'<input type="hidden" name="from" value="'+uri+'" />'
+'<input type="hidden" name="network_type" value="'+ntype+'" />'
+'<input type="hidden" name="network_key" value="'+nkey+'" />'
+'<input type="text" class="inputtext" name="network_email" />';dialog.show_form(title,content,button_title,'/networks/addnetwork.php');return false;}
function portal_privacy_help_popup(type,title,content,edit,oid){var dialog=new pop_dialog();if(type=="notebook"){dialog.show_choice(title,content,edit,function(){document.location='/privacy.php?view=notes';},"Cancel",function(){generic_dialog.get_dialog(this).hide();});}else{dialog.show_choice(title,content,edit,function(){generic_dialog.get_dialog(this).hide();portal_remove_item_and_change_privacy(type,oid);},"Cancel",function(){generic_dialog.get_dialog(this).hide();});}}
function portal_remove_item_and_change_privacy(type,oid){ajax=new Ajax();ajax.onDone=function(ajax_obj,response_text){};ajax.onFail=function(){};var content=type+"_"+oid;var privacy_url='/ajax/privacy_portal.php';var privacy_params='id='+oid+'&ot='+type;ajax.post(privacy_url,privacy_params);var bigdate=find_child_with_class(ge(content),'bigdate');if(bigdate&&bigdate.innerHTML!=''){var next=$(content).nextSibling;if(next){var next_bigdate=find_child_with_class(next,'bigdate');if(!next_bigdate){next.innerHTML='<div class="bigdate">'+bigdate.innerHTML+'</div>'+next.innerHTML;}else if(next_bigdate.innerHTML==''){next_bigdate.innerHTML=bigdate.innerHTML;}}}
hide(content);}
function find_child_with_class(el,cl){if(!el){return null;}
var children=el.childNodes;if(!children){return null;}
for(var i=0;i<children.length;i++){if(has_css_class_name(children[i],cl)){return children[i];}}
return null;}
function join_select_geo_by_country(){hide('join_city_selector');hide('sel_by_country');hide('city_label');hide('geo_selector');init_geo_by_country();$('country').style.display='block';$('sel_by_city').style.display='block';$('country_label').style.display='block';}
function join_select_geo_by_city(){$('join_city_selector').style.display='block';$('sel_by_country').style.display='block';$('city_label').style.display='block';$('geo_selector').style.display='block';hide('country');hide('sel_by_city');hide('country_label');}
function portal_load_activity(nkey,type){var ajax=new Ajax();ajax.onDone=function(ajaxObj,responseText){$('portal_activity_section').innerHTML=responseText;}
ajax.onFail=function(){}
var activity_url='/ajax/network_activity_ajax.php';var activity_params='nk='+nkey+'&'+type;ajax.get(activity_url,activity_params);}