var global_newsFilterURL="http://www.rightnow.com/filtSortAjax.php";function buildListingExtraInfo(b){var a="",e=b.location&&b.location!="",c=b.publication&&b.publication!="",d=b.releaseDate&&b.releaseDate!="";if(e||c||d){if(d){a+=b.releaseDate;if(e||c)a+="<br />"}d="";if(e&&c)d=" | ";if(e)a+=b.location;a+=d;if(c)a+=b.publication;a="<p>"+a+"</p>"}return a}
function populateListing(b,a,e,c){var d=global_newsFilterURL,h=jQuery("#filter1_"+a).val();if(h==null)h="All";var f=jQuery("#filter2_"+a).val();if(f==null)f="All";var i=jQuery("#sortlist_"+a).val();if(i==null&&b!=="releases"&&b!=="articles")i="Ascending";else if(i==null)i="Decending";var g=jQuery("#listingarea_"+a),k=jQuery("#loadingarea_"+a);g.fadeOut(500,function(){g.html("");k.show();jQuery.getJSON(d+"?filter1="+h+"&filter2="+f+"&type="+b+"&listSize="+e+"&sort="+i+"&callback=?",function(j){if(j.error)g.append("<em>No items matched your filter selections.</em>").fadeIn(500);
else if(c=="links")jQuery.each(j,function(){g.append("<li><a href='"+this.linkHref+"'>"+this.title+"</a></li>")});else if(c=="details")jQuery.each(j,function(){g.append("<li><div><h2><a href='"+this.linkHref+"'><span class='tag'>"+this.title+"</span></a></h2>"+buildListingExtraInfo(this)+"<p>"+this.description+" <a href='"+this.linkHref+"'>[continue]</a></p></div></li>")});else c=="summary"?jQuery.each(j,function(){g.append("<a style='text-decoration: none;' href='"+this.linkHref+"'><h2>"+this.title+
"</h2></a>"+buildListingExtraInfo(this)+"<p>"+this.description+"</p><hr />")}):alert("populateListing: Unknown listType '"+c+"' on listingID '"+a+"'. The only type of listings supported are 'links', 'details' and 'summary'")})});g.fadeIn(1500,function(){k.hide()})}
function initFilters(b,a){var e=global_newsFilterURL,c=jQuery("#filter1_"+a),d=jQuery("#filter2_"+a),h=jQuery("#sortlist_"+a);jQuery.getJSON(e+"?type="+b+"&function=getCats&level=first&callback=?",function(f){c.append("<option value='All'>All</option>");jQuery.each(f,function(){c.append("<option>"+this+"</option>")});c.show()});jQuery.getJSON(e+"?type="+b+"&function=getCats&level=second&callback=?",function(f){d.append("<option value='All'>All</option>");jQuery.each(f,function(){this.toLowerCase()!=
"[category]"&&d.append("<option>"+this+"</option>")});d.show()});jQuery.getJSON(e+"?type="+b+"&function=getSort&callback=?",function(f){jQuery.each(f,function(){h.append("<option>"+this+"</option>")});h.show()})};

