// JavaScript Document

// Submenu

$(document).ready(function () {    
       
    $('#nav li').hover(   
        function () {   
            //show its submenu   
            $('ul', this).fadeIn(1000);   
  
        },    
        function () {   
            //hide its submenu   
            $('ul', this).fadeOut(1000);            
        }   
    );   
       
});   


// Fadein

$(document).ready(function(){
                $('.fadein').css({ display: 'none'}).fadeIn(4000);
});


$(document).ready(function(){
                $('.fadein2').css({ display: 'none'}).fadeIn(2000);
});



	$(document).ready(function(){
$(".fade").fadeTo("slow", 1.0); // This sets the opacity of the thumbs to fade down to 60% when the page loads

$(".fade").hover(function(){
$(this).fadeTo("slow", 0.4); // This should set the opacity to 100% on hover
},function(){
$(this).fadeTo("slow", 1.0); // This should set the opacity back to 60% on mouseout
});
});
	
// Accordian


$(function() {
setInterval ("rotateImages()", 5000);
});


// Photoshow

function rotateImages() {
var oCurPhoto = $("#photoshow div.current");
var oNxtPhoto = oCurPhoto.next();
if (oNxtPhoto.length == 0)
	oNxtPhoto = $("#photoshow div:first");	
	
oCurPhoto.removeClass('current').addClass('previous');

oNxtPhoto.css({ opacity:0.0 } ).addClass('current').animate({ opacity: 1.0 }, 2000,
	function() {
	oCurPhoto.removeClass('previous');
});

}

//tooltip

$("a[title]").tooltip({ tip: '#demotip', effect: 'fade', fadeOutSpeed: 100, predelay: 400, position: "bottom right",                 offset: [-50, -80] });


