var Mc360 = {};

Mc360.slideMenuTimeout;

Mc360.sideMenu = function(){
	$('#shortcuts ul > li > ul').hide();
	
	$('#shortcuts li').mouseover(function(){
        // create a reference to the active element (this)
        // so we don't have to keep creating a jQuery object
        $heading = $(this);
        // check to see if any sub menus are open
        if ($heading.siblings().find('ul:visible').size()!=0) {
            // close open sub menus
            $heading.siblings().find('ul:visible').slideUp(500, function(){
                // open current menu if it's closed
                $heading.find('ul:hidden').slideDown(350);
            });
        }
        else {
            // open current menu if it's closed
            $heading.find('ul:hidden').slideDown(350);
        }
    });
}

Mc360.slideshow = function(){
	var slideshow = $('.slideshow');
	var slides = $('.slides', slideshow);
    if(slides.length != 0){
        
        timeout = slideshow.data('delay') * 1000;
        slides.cycle({
                        fx: 'fade',
                        timeout: timeout,
                        speed: '1000'
            }
            );       
    }
}

$(document).ready(function(){
	Mc360.sideMenu();
	Mc360.slideshow();
});
