﻿$(document).ready(function() {
    // put all your jQuery goodness in here.
    $('#s1').cycle
           ({
               fx: 'fade',
               next: '#cycle',
               speed: 3000,
               timeout: 3000
           });
    $('#s2').cycle
           ({
               fx: 'fade',
               next: '#cycle',
               speed: 3000,
               timeout: 3000
           });
    $('#s3').cycle
           ({
               fx: 'fade',
               next: '#cycle',
               speed: 3000,
               timeout: 3000
           });
    $('#s4').cycle
           ({
               fx: 'fade',
               next: '#cycle',
               speed: 3000,
               timeout: 3000
           });
});
function initializeDropDownMenu() {
    // get 'navbar' element
    var navbar = document.getElementById('nav');
    if (!navbar) { return };
    // get all menu items
    var menuitems = navbar.getElementsByTagName('li');
    if (!menuitems) { return };
    for (var i = 0; i < menuitems.length; i++) {
        // assign 'over' class attribute to each menu item on 'mouseover'
        menuitems[i].onmouseover = function() {
            this.className += ' over';
        }
        // remove 'over' class attribute to each menu item on 'mouseout'
        menuitems[i].onmouseout = function() {
            this.className = this.className.replace(' over', '');
        }
    }
}
// initialize drop-down menu when web page is loaded
window.onload = function() {
    if (document.all && document.getElementById && document.getElementsByTagName) {
        initializeDropDownMenu();
    }
}
