/* CBarra */ function CBarra() { this.w = 80; this.print = barra_print; } function barra_print(valoracion) { var valor = Math.round((valoracion * this.w) / 100); var resto = this.w - valor; if(valoracion){ var c = '<table class="cbarra" style="width:'+this.w+'px;" cellpadding="0" cellspacing="0">'; c += '  <tr>'; if(valor > 0){ c += '<td class="valor" style="width:'+valor+'px;"></td>'; } if(valor < this.w){ c += '<td class="resto" style="width:'+resto+'px;"></td>'; } c += '  </tr>'; c += '</table>'; } return c; }