/* $Header: /cvs01/Spinfish/beelinersurveys.com/resource/web/shared/js/common.js,v 1.2 2008/03/14 21:42:59 heiko Exp $ */
/*
 * Copyright 2006 ROG, INc.
 */

/*
 * Register onload functions.
 */
window.onload = function() {

    if (navbarInit != null) {
        navbarInit();
    }
}

var buttonListener = new Object();

buttonListener.mouseIn = function(buttonId) {
    var image;

    image = platform.getElement(buttonId);
    if (image != null) {
        var pos = 0;
        var state;

        for ( var idx = 0; idx < 4; idx++) {
            pos = image.src.indexOf(",", pos);
            if (pos < 0) return;
            pos++;
        }
        state = parseInt(image.src.substring(pos, pos + 1));
        // alert(image.src.substring(0, pos) + (state | 1) +
        // image.src.substring(pos+1));
        image.src = image.src.substring(0, pos) + (state | 1)
                + image.src.substring(pos + 1);
    }
}

buttonListener.mouseOut = function(buttonId) {
    var image;

    image = platform.getElement(buttonId);
    if (image != null) {
        var pos = 0;
        var state;

        for ( var idx = 0; idx < 4; idx++) {
            pos = image.src.indexOf(",", pos);
            if (pos < 0) return;
            pos++;
        }
        state = parseInt(image.src.substring(pos, pos + 1));
        image.src = image.src.substring(0, pos) + (state & 6)
                + image.src.substring(pos + 1);
    }
}
