function h_statsObject(a,d,b,c,e,f,h,g,i,j){this.gait=a;this.name=d;this.starts=b;this.wins=c;this.places=e;this.shows=f;this.earnings=g;this.h_statsObjectType=i;this.key=j;this.showStableLink=this.showGait=false;if(this.h_statsObjectType=="H"){this.showGait=true;this.formattedName=this.name}else{if(this.h_statsObjectType=="T")this.showStableLink=true;a=d.split(",");this.formattedName=a[a.length-1]+" "+a[0]}for(;this.formattedName.length>0&&this.formattedName.substring(0,1)==" ";)this.formattedName= this.formattedName.substring(1);this.roi=calcROI(b,c,h);this.udr=calcUDR(c,e,f,b);this.win_perc=calcPerc(c,b);this.place_perc=calcPerc(e,b);this.show_perc=calcPerc(f,b);this.itm_perc=calcPerc(c+e+f,b);this.eps=calcEPS(b,g);this.name_sort=d;this.starts_sort=parseInt(b,10);this.wins_sort=parseInt(c,10);this.places_sort=parseInt(e,10);this.shows_sort=parseInt(f,10);this.udr_sort=parseFloat(this.udr);this.roi_sort=parseInt(this.roi,10);this.earnings_sort=parseInt(g,10);this.win_perc_sort=parseInt(this.win_perc, 10);this.place_perc_sort=parseInt(this.place_perc,10);this.show_perc_sort=parseInt(this.show_perc,10);this.itm_perc_sort=parseInt(this.itm_perc,10);this.eps_sort=parseInt(this.eps,10);this.earnings=formatDollars(this.earnings);this.eps=formatDollars(this.eps);this.generateTableRow=generateTableRow} function generateTableRow(){var a="<tr "+getCSSLabel(2)+">\n";if(this.showGait)a+='<td id="left" '+columnClasses[0]+" >"+this.gait+"</td>";a+=this.showStableLink&&document.statsmaster.angles[2].checked===false?'<td id="left" '+columnClasses[1]+" >"+this.name+" <a href=\"javascript:getTrainerHorses('"+this.key+"', '"+this.formattedName+"');\" onMouseover=\"showtip(this,event,'Click to view all horses currently trained by "+this.formattedName+'\')" onMouseout="hidetip()" ><img src="/images/smallstats.gif" width="25" height="15" border="0" align="absmiddle"></a></td>': '<td id="left" '+columnClasses[1]+" >"+this.name+"</td>";a+="<td "+columnClasses[2]+" >"+this.starts+"</td>";a+="<td "+columnClasses[3]+" >"+this.wins+"</td>";a+="<td "+columnClasses[4]+" >"+this.win_perc+"</td>";a+="<td "+columnClasses[5]+" >"+this.places+"</td>";a+="<td "+columnClasses[6]+" >"+this.place_perc+"</td>";a+="<td "+columnClasses[7]+" >"+this.shows+"</td>";a+="<td "+columnClasses[8]+" >"+this.show_perc+"</td>";a+="<td "+columnClasses[9]+" >"+this.udr+"</td>";a+="<td "+columnClasses[10]+ " >"+this.itm_perc+"</td>";a+="<td "+columnClasses[11]+" >"+this.roi+"</td>";a+="<td "+columnClasses[12]+" >"+this.earnings+"</td>";a+="<td "+columnClasses[13]+" >"+this.eps+"</td>";a+="</tr>\n";return a}function formatDollars(a){var d="$",b=false;a=parseInt(a,10);for(var c=1E12;c>=1E3;c/=1E3)if(a>=c){b=true;var e=parseInt(a/c,10);d+=e+",";a-=e*c}d+=b?("000"+a).slice(-3):a;return d}function calcPerc(a,d){a=a>=d?100:a<=0?0:Math.round(100*a/d);return a<10?" "+a+"%":a<100?" "+a+"%":"100%"} function calcEPS(a,d){var b="N/A";if(a>0)b=d<=0?"0":""+Math.round(d/a);return b}function calcROI(a,d,b){var c=" ";if(a>0)if(d===0)c="-100%";else{a=100*((d+b)/a)-100;if(a%1==0.5)a-=1;a=Math.round(a);c=a<10?" "+a+"%":a<100?" "+a+"%":a+"%"}return c}function calcUDR(a,d,b,c){var e="0.000";if(c>0){a=(a*9+d*5+b*3)/(c*9);a=Math.round(1E3*a);e=a>999?(""+a).substring(0,1)+"."+(""+a).slice(-3):"0."+("000"+a).slice(-3)}return e};
