﻿var splash = new Array();
var splashIndex = 0;
var splashOn = 0;

$(document).ready(function() {

    initMenu();
//    initSplash();
});

function initMenu() {

    $(".menugfx").each(function(obj) {
        var objId = $(this).attr("id");
        $(this).bind("mouseover", function() {
            this.src = "../images/" + objId + "_on.png";
        });
        $(this).bind("mouseout", function() {
            this.src = "../images/" + objId + "_off.png";
        });
    })

}

function initSplash() {

    $(".splash").each(function(obj) {
        splash[splashIndex] = $(this).attr("id");
        splashIndex++;
    });
    splashIndex = 0;
    splashRotator();

}

function splashRotator() {
    if (splashOn == 0) {
        $("#" + splash[splashIndex]).fadeIn(1500);
        splashOn = 1;
        interval = 5000;
    } else {
        $("#" + splash[splashIndex]).fadeOut(1500);
        splashIndex++;
        splashOn = 0;
        interval = 1500;
    }
    if (splashIndex == 3) {
        splashIndex = 0;
        interval = 1500;
    }
    setTimeout(splashRotator, interval)
}
