$("#change-loc").click(function(){$("#location").hide();$("#location-box").val("").show(0).focus()});$("#clear-loc").click(function(){$("#loading-bar").show();$("#in-text").text("");$("#location").text("").hide();$("#li-clear-loc").hide();$.get("/ajax/persona/change-location/",{persona_ids:$("#persona-ids").text(),region_id:"",region_name:""},function(A){$("#loading-bar").fadeOut();$("#persona-boxes").html(A);$("#persona-tabs").show();$("#persona-tabs > ul").tabs()})});$("#default-loc").click(function(){$("#loading-bar").show();$("#in-text").text("");$("#li-clear-loc").hide();$.getJSON("/ajax/persona/default-location/",function(A){if(A.id==""){$("#clear-loc").click()}else{$("#location").text(A.name).show();$("#in-text").text("in ");$("#location-box").hide();$("#loading-bar").show();$("#li-clear-loc").show();$.get("/ajax/persona/change-location/",{persona_ids:$("#persona-ids").text(),region_id:A.id,region_name:$("#location-box").val()},function(B){$("#loading-bar").fadeOut();$("#persona-boxes").html(B);$("#persona-tabs").show();$("#persona-tabs > ul").tabs()})}})});$(".persona-page #location-options").click(function(){$(".persona-page #location-options .options-list").toggle("show")});$(document).ready(function(){$("#location-box").autocomplete("/ajax/ac/location/",{minChars:2,matchContains:true,autoFill:true});$("#location-box").result(function(A,C,B){var D=new String(C);D=D.split(",");D=D[D.length-1];$("#location").text($("#location-box").val()).show();$("#in-text").text("in ");$("#location-box").hide();$("#loading-bar").show();$("#li-clear-loc").show();$.get("/ajax/persona/change-location/",{persona_ids:$("#persona-ids").text(),region_id:D,region_name:$("#location-box").val()},function(E){$("#loading-bar").fadeOut();$("#persona-boxes").html(E);$("#persona-tabs").show();$("#persona-tabs > ul").tabs()})});$("#persona-tabs").show();$("#persona-tabs > ul").tabs()});