// Determine whether rollovers can be used.
var can_ro = (document.images != null);

// Directory where rollover images are kept.
var ro_path = "images/topnav/";

if (location.hostname.indexOf('banqonit') != -1) { 
	ro_path = "/GatewayProxyImages/Images_206/";	
}

// Object containing an array of arrays of image objects for each
// image. Each index in the first array contains an array consisting
// of two image objects (one for each state that the image may be in)
var ro_images = new Object();

ro_init();

function ro_init() {

    if (!can_ro) {
        return true;
    }

    ro_setup(
        "about", "about.gif", "about_on.gif",
        "attractions", "attractions.gif", "attractions_on.gif",
        "dayout", "dayout.gif", "dayout_on.gif",
        "feedback", "feedback.gif", "feedback_on.gif",
        "nightaway", "nightaway.gif", "nightaway_on.gif",
        "mapsguides", "mapsguides.gif", "mapsguides_on.gif",
        "subscribe", "subscribe.gif", "subscribe_on.gif"
    );

    return true;

}

function ro_setup() {

    var j = 0;
    while (j < arguments.length) {
        var a = Array(arguments[j++], arguments[j++], arguments[j++]);
        ro_images[a[0]] = new Array(2);
        for (var i=0; i<2; i++) {
            ro_images[a[0]][i] = new Image();
            ro_images[a[0]][i].src = ro_path + a[i+1];
        }
    }
}

function ro(image_name, state) {

    // Set the state of image_name to state (0 = normal, 1 = rolledover)

    if ((document[image_name] != null) && can_ro) {
        document[image_name].src = ro_images[image_name][state].src;
    }

    return true;

}
