// From http://www.svendtofte.com/code/usefull_prototypes/
String.prototype.reverse = function() {
    var s = "";
    var i = this.length;
    while (i > 0) {
        s += this.substring(i - 1,i);
        i--;
    }
    return s;
};

function insertAddress(user, host) {
    var addr = user.reverse() + '@' + host.reverse();
    document.write('<a href=\"mailto:' + addr + '\">' + addr + '</a>');
}

function viewRtPcrImages(event_id) {
    window.open('rt_pcr_images.php?event_id=' + escape(event_id), '_blank',
                'width=800, height=600, scrollbars=yes');
}

function viewImage(url, width, height) {
    window.open(url, '_blank',
	        'width=' + width + ', height=' + height + ', scrollbars=no');
}
