AJAX.registerTeardown("server_status_advisor.js",function(){$('a[href="#openAdvisorInstructions"]').unbind("click");$("#statustabs_advisor").html("");$("#advisorDialog").remove();$("#instructionsDialog").remove()});AJAX.registerOnload("server_status_advisor.js",function(){var d=$("<div />").attr("id","advisorDialog");var h=$("<div />").attr("id","instructionsDialog").html($("#advisorInstructionsDialog").html());$('a[href="#openAdvisorInstructions"]').click(function(){var i={};i[PMA_messages.strClose]=function(){$(this).dialog("close")};h.dialog({title:PMA_messages.strAdvisorSystem,width:700,buttons:i})});var c=$("#statustabs_advisor");var a,b,g,f=true;data=$.parseJSON($("#advisorData").text());c.html("");if(data.parse.errors.length>0){c.append("<b>Rules file not well formed, following errors were found:</b><br />- ");c.append(data.parse.errors.join("<br/>- "));c.append("<p></p>")}if(data.run.errors.length>0){c.append("<b>Errors occured while executing rule expressions:</b><br />- ");c.append(data.run.errors.join("<br/>- "));c.append("<p></p>")}if(data.run.fired.length>0){c.append("<p><b>"+PMA_messages.strPerformanceIssues+"</b></p>");c.append('<table class="data" id="rulesFired" border="0"><thead><tr><th>'+PMA_messages.strIssuse+"</th><th>"+PMA_messages.strRecommendation+"</th></tr></thead><tbody></tbody></table>");a=c.find("table#rulesFired");var e;$.each(data.run.fired,function(i,j){e=$.trim($("<div>").html(j.recommendation).text());a.append(b=$('<tr class="linkElem noclick '+(f?"even":"odd")+'"><td>'+j.issue+"</td><td>"+e+" </td></tr>"));f=!f;b.data("rule",j);b.click(function(){var l=$(this).data("rule");d.dialog({title:PMA_messages.strRuleDetails}).html("<p><b>"+PMA_messages.strIssuse+":</b><br />"+l.issue+"</p><p><b>"+PMA_messages.strRecommendation+":</b><br />"+l.recommendation+"</p><p><b>"+PMA_messages.strJustification+":</b><br />"+l.justification+"</p><p><b>"+PMA_messages.strFormula+":</b><br />"+l.formula+"</p><p><b>"+PMA_messages.strTest+":</b><br />"+l.test+"</p>");var k={};k[PMA_messages.strClose]=function(){$(this).dialog("close")};d.dialog({width:600,buttons:k})})})}});