var interval=false;var limit=90;var millis=10000;var i=0;$(document).ready(function(){GetList();interval=setInterval(GetList,millis)});function GetList(){if(i==limit){window.location.reload();return false}$.getJSON("./ajax/whoshere/",{pavilion:pid},function(c){var f=c.available;var e=c.hidden;var d=e.concat(f);$("#available").text(f.length);$("#hidden").text(e.length);TestCurrent(d);for(var b=0;b<d.length;b++){var a=d[b];if($("li#user-"+a).length<1){AddAnotherUser(a)}}});i=i+1}function TestCurrent(a){$("li.userrow").each(function(){var b=parseInt($(this).attr("data-uid"));if($.inArray(b,a)===-1){$(this).hide("slow",function(){$(this).remove()})}})}function AddAnotherUser(a){$.get("./ajax/userblurb/",{user:a,pavilion:pid},function(b){var c=$('<li data-uid="'+a+'" id="user-'+a+'"></li>').addClass("userrow").hide();c.html(b);$("ul#presenceList").append(c);c.show("slow");if(typeof ValetFunctions=="function"){ValetFunctions()}})};