/////////////////////////////////////
//Dropdowns//////////////////////////
/////////////////////////////////////
 $(function(){
    $("ul.dropdown li").hover(function(){    
        $(this).addClass("hover");
        $('ul:first',this).css('visibility', 'visible');
    }, function(){
        $(this).removeClass("hover");
        $('ul:first',this).css('visibility', 'hidden');
    });
    $("ul.dropdown li ul li:has(ul)").find("a:first").append(" &raquo; ");
});

/////////////////////////////////////
//Slider/////////////////////////////
/////////////////////////////////////
function theRotator() {
	$('div#slides ul li').css({opacity: 0.0});
	$('div#slides ul li:first').css({opacity: 1.0});
	setInterval('rotate()',8000);
}

function rotate() {	
	var current = ($('div#slides ul li.show')?  $('div#slides ul li.show') : $('div#slides ul li:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div#slides ul li:first') :current.next()) : $('div#slides ul li:first'));	
	
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 1000);

	current.animate({opacity: 0.0}, 1000)
	.removeClass('show');
};

$(document).ready(function() {		
	theRotator();
});

/////////////////////////////////////
//List Items Clickable //////////////
/////////////////////////////////////
$(document).ready(function(){
	$(".service-grouping li").click(function(){
	  window.location=$(this).find("a").attr("href"); return false;
	});

});

/////////////////////////////////////
//Accordion Menu ////////////////////
/////////////////////////////////////
$(document).ready(function(){

	$(".expand div.true").prev(".expand p").addClass("active-p");
	
    $(".expand p").click(function(){
		$(this).next("div").slideToggle("slow")
		.siblings("div:visible").slideUp("slow");
		$(this).toggleClass("active-p");
		$(this).siblings("p").removeClass("active-p");
	});

});

