<script>
jQuery(document).ready(function() {
    jQuery("TABLE.comment, TABLE.downtime").each(function() {
        var headers = jQuery(this).find("th");
        var count = headers.length;

        var index = headers.filter(function() {
            return jQuery.trim(jQuery(this).text()) === "Comment";
        }).index();

        if (index === -1) {
            return;
        }

        index = count - index;

        jQuery(this).find("TD:nth-last-child(" + index + ")").each(function() {
            jQuery(this).html(jQuery(this).html().replace(/(\b\d{6}\b)/g, "<a href='http://example.com?ticket=$1' target='_blank'>$1</a>"));
        });
    });
});
</script>
