
function superfish_dropdown(){
	$("ul.main_menu").superfish();
	
}

function menu_background_effect(){
	 $('.main_menu li a').append('<div class="hover"></div>');  
	 $('.main_menu li a').hover(  
		 function() {
			$('ul li:last', this).css('background','none');
			$(this).children('div').fadeIn('500');   
		},function() {  
			$(this).children('div').fadeOut('500');      
		});
}


function slideSwitch() {
    var $active = $('#slideshow DIV.active');

    if ( $active.length == 0 ) $active = $('#slideshow DIV:last');

    // use this to pull the divs in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow DIV:first');

    // uncomment below to pull the divs randomly
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
    Cufon.replace('h2', {  fontFamily: 'Cambria', hover: true, fontSize:'20', color: '#78a7c5', textShadow: 'none'});
	Cufon.replace('h1', { fontFamily: 'Cambria',  fontSize:'22', color: '#4a94c3', textShadow: 'none'});
	Cufon.replace('h3', { fontFamily: 'Cambria', fontSize:'18', color: '#fff', textShadow: 'none'});
});


