    // ######################## MENU START 
    var timeout         = 500;
    var closetimer		= 0;
    var ddmenuitem      = 0;

    function jsddm_open()
    {	jsddm_canceltimer();
	    jsddm_close();
	    ddmenuitem = $(this).find('ul').eq(0).css('visibility', 'visible');}

    function jsddm_close()
    {	if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}

    function jsddm_timer()
    {	closetimer = window.setTimeout(jsddm_close, timeout);}

    function jsddm_canceltimer()
    {	if(closetimer)
	    {	window.clearTimeout(closetimer);
		    closetimer = null;}}

    $(document).ready(function()
    {	$('#jsddm > li').bind('mouseover', jsddm_open);
	    $('#jsddm > li').bind('mouseout',  jsddm_timer);});

    document.onclick = jsddm_close;
    // ######################## MENU END 


    // ######################## JQUERY AUTO IMAGE ROTATER START
    function theRotator() {
	    //Set the opacity of all images to 0
	    $('div#rotator ul li').css({opacity: 0.0});
    	
	    //Get the first image and display it (gets set to full opacity)
	    $('div#rotator ul li:first').css({opacity: 1.0});

	    //Set the opacity of all images to 0
	    $('div#rotator2 ul li').css({opacity: 0.0});
    	
	    //Get the first image and display it (gets set to full opacity)
	    $('div#rotator2 ul li:first').css({opacity: 1.0});
    		
	    //Set the opacity of all images to 0
	    $('div#rotator3 ul li').css({opacity: 0.0});
    	
	    //Get the first image and display it (gets set to full opacity)
	    $('div#rotator3 ul li:first').css({opacity: 1.0});
    	
	    //Set the opacity of all images to 0
	    $('div#rotator4 ul li').css({opacity: 0.0});
    	
	    //Get the first image and display it (gets set to full opacity)
	    $('div#rotator4 ul li:first').css({opacity: 1.0});
    	
	    //Call the rotator function to run the slideshow, 6000 = change to next image after 6 seconds
	    setInterval('rotate()',6000);
    	
    }

    function rotate() {	
	    //Get the first image
	    var current = ($('div#rotator ul li.show')?  $('div#rotator ul li.show') : $('div#rotator ul li:first'));
	    var current2 = ($('div#rotator2 ul li.show')?  $('div#rotator2 ul li.show') : $('div#rotator2 ul li:first'));
	    var current3 = ($('div#rotator3 ul li.show')?  $('div#rotator3 ul li.show') : $('div#rotator3 ul li:first'));
	    var current4 = ($('div#rotator4 ul li.show')?  $('div#rotator4 ul li.show') : $('div#rotator4 ul li:first'));

	    //Get next image, when it reaches the end, rotate it back to the first image
	    var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div#rotator ul li:first') :current.next()) : $('div#rotator ul li:first'));	
	    var next2 = ((current2.next().length) ? ((current2.next().hasClass('show')) ? $('div#rotator2 ul li:first') :current2.next()) : $('div#rotator2 ul li:first'));	
	    var next3 = ((current3.next().length) ? ((current3.next().hasClass('show')) ? $('div#rotator3 ul li:first') :current3.next()) : $('div#rotator3 ul li:first'));	
	    var next4 = ((current4.next().length) ? ((current4.next().hasClass('show')) ? $('div#rotator4 ul li:first') :current4.next()) : $('div#rotator4 ul li:first'));	
    	
	    //Set the fade in effect for the next image, the show class has higher z-index
	    next.css({opacity: 0.0})
	    .addClass('show')
	    .animate({opacity: 1.0}, 1000);

	    next2.css({opacity: 0.0})
	    .addClass('show')
	    .animate({opacity: 1.0}, 1000);

	    next3.css({opacity: 0.0})
	    .addClass('show')
	    .animate({opacity: 1.0}, 1000);

	    next4.css({opacity: 0.0})
	    .addClass('show')
	    .animate({opacity: 1.0}, 1000);

	    //Hide the current image
	    current.animate({opacity: 0.0}, 1000)
	    .removeClass('show');
    	
	    current2.animate({opacity: 0.0}, 1000)
	    .removeClass('show');
    	
	    current3.animate({opacity: 0.0}, 1000)
	    .removeClass('show');
    	
	    current4.animate({opacity: 0.0}, 1000)
	    .removeClass('show');
    	
    };

    $(document).ready(function() {		
	    //Load the slideshow
	    theRotator();
    });
    // ######################## JQUERY AUTO IMAGE ROTATER END
