function initialise() {
    var the_images = document.getElementsByClassName("glowing");
    for (var counter = 0; counter < the_images.length; counter++) {
        the_image = the_images[counter];
        if (the_image) {
            the_image.onmouseover = make_it_glow;
            the_image.onmouseout = stop_it_glow;
        }
    }
}

var make_glow_regex = new RegExp('(.*)\.jpg');

function make_it_glow(the_event) {
    var target = fixIeEvent(the_event);
    var orig_src = target.src;
    var new_src = orig_src.replace(make_glow_regex, '$1_glow.jpg');
    target.src = new_src;
}

var stop_glow_regex = new RegExp('(.*)_glow\.jpg');

function stop_it_glow(the_event) {
    var target = fixIeEvent(the_event);
    var glow_src = target.src;
    var orig_src = glow_src.replace(stop_glow_regex, '$1.jpg');
    target.src = orig_src;
}

function fixIeEvent(the_event) {
    if (!the_event) {
        the_event = window.event;
    }
    var target = the_event.target;
    if (!target) {
        target = the_event.srcElement;
    }
    return target;
}

function randomise_testimonial() {
    var allTestimonials = $(".testimonial");
    allTestimonials.detach();
    do {
        var randomIndex = Math.floor(Math.random() * (allTestimonials.length + 1));
        $("div#content").append(allTestimonials[randomIndex]);
        var head = allTestimonials.slice(0, randomIndex);
        var tail = allTestimonials.slice(randomIndex + 1, allTestimonials.length);
        $.merge(head, tail);
        allTestimonials = head;
    } while (allTestimonials.length > 0);
}