﻿if (document.getElementById) { window.onload = swap };
function swap() {
    var numimages = 7;
    rndimg = new Array("../_img/background/bg1.jpg", "../_img/background/bg2.jpg", "../_img/background/bg3.jpg", "../_img/background/bg4.jpg", "../_img/background/bg5.jpg", "../_img/background/bg6.jpg", "../_img/background/bg7.jpg");
    x = (Math.floor(Math.random() * numimages));
    randomimage = (rndimg[x]);
    document.getElementById("bgImage").style.backgroundImage = "url(" + randomimage + ")";
}

function popup(url, popname, this_width, this_height) {
    var width = this_width;
    var height = this_height;
    var left = (screen.width - width) / 2;
    var top = (screen.height - height) / 2;
    var params = 'width=' + width + ', height=' + height;
    params += ', top=' + top + ', left=' + left;
    params += ', directories=0';
    params += ', location=0';
    params += ', menubar=0';
    params += ', resizable=0';
    params += ', scrollbars=0';
    params += ', status=0';
    params += ', toolbar=0';
    newwin = window.open(url, popname, params);
    if (window.focus) { newwin.focus() }
    return false;
}



function clearTextBox(textBoxID) {
    document.getElementById(textBoxID).value = "";
}

// Nav
window.addEvent('domready', function() {
    $$('.flood').each(function(item, index) {
        var div = item.getParent();
        var li = div.getParent();
        if (div && li) {
            div.setStyle('display', 'block');
            var sub = new Fx.Slide(item, { duration: 200, link: 'cancel', transition: 'quad:out' }).hide();
            var subFx = new Fx.Tween(item, { duration: 200, link: 'cancel' });
            li.addEvents({
                'mouseenter': function() {
                    this.addClass('hover');
                    subFx.cancel();
                    sub.cancel();
                    subFx.set('opacity', 1);
                    sub.slideIn();
                },
                'mouseleave': function() {
                    this.removeClass('hover');
                    subFx.cancel();
                    sub.cancel();
                    subFx.start('opacity', 0);
                    sub.slideOut();
                }
            });
        }
    })
});





