$(document).ready(function() {
	// Dropdown
	$('.lowerdiv').hide();
	$('#footer .locations').click(function() {
		$('.lowerdiv').fadeToggle('fast', function() {
			$('html, body').animate({
	            scrollTop: $(document).height()
	        },
	        500);
	        
		});
		        return false;
	});
	
	// PRINT PAGE
	$('a.print').click(function(){
		if (window.print) { window.print(); } else { alert("Sorry, your browser doesn't support this feature."); }
		return false;
	});
	
	/* EXPAND/COLLAPSE SIDEBAR */
	//Set default open/close settings
	$('.acc_container').hide(); //Hide/close all containers
	$('.acc_trigger').append('<div id="see_more"><a href="#" class="expand"></a></div>');
	$('.acc_trigger').click(function(){
		$(this).toggleClass('active').next().slideUp(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
		$(this).find('#see_more').html('<a href="#" class="expand"></a>');
		return false; //Prevent the browser jump to the link anchor
	});
	//On Click
	$('.acc_trigger').click(function(){
		if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
		$('.acc_trigger').removeClass('active').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container
		$(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
		$('.acc_trigger').find('#see_more').html('<a href="#" class="expand"></a>');
		$(this).find('#see_more').html('<a href="#" class="collapse"></a>');
	}
	return false; //Prevent the browser jump to the link anchor
	});
	
	
	/* EXPAND/COLLAPSE ATTORNEY PROFILE */
	//Set default open/close settings
	$('.bcc_container').hide(); //Hide/close all containers
	$('.bcc_trigger').append('<div id="read_more"><a href="#">Expand</a></div>');
	$('.bcc_trigger').click(function(){
		$(this).toggleClass('active').next().slideUp(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
		$(this).find('#read_more').html('<a href="#">Expand</a>');
		return false; //Prevent the browser jump to the link anchor
	});
	//On Click
	$('.bcc_trigger').click(function(){
		if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
		$('.bcc_trigger').removeClass('active').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container
		$(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
		$('.bcc_trigger').find('#read_more').html('<a href="#">Expand</a>');
		$(this).find('#read_more').html('<a href="#">Collapse</a>');
	}
	return false; //Prevent the browser jump to the link anchor
	});
	
	
	
	
	/* EXPAND/COLLAPSE ATTORNEY PROFILE */
	//Set default open/close settings
	$('.bcc_container2').hide(); //Hide/close all containers
	$('.bcc_trigger2').append('<div id="read_more"><a href="#">Expand</a></div>');
	$('.bcc_trigger2').click(function(){
		$(this).toggleClass('active').next().slideUp(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
		$(this).find('#read_more').html('<a href="#">Expand</a>');
		return false; //Prevent the browser jump to the link anchor
	});
	//On Click
	$('.bcc_trigger2').click(function(){
		if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
		$('.bcc_trigger2').removeClass('active').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container
		$(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
		$('.bcc_trigger2').find('#read_more').html('<a href="#">Expand</a>');
		$(this).find('#read_more').html('<a href="#">Collapse</a>');
	}
	return false; //Prevent the browser jump to the link anchor
	});
	
	
	
	
	
	
	$('.home .graphic').innerfade({
		speed: 1000,
		timeout: 6000,
		type: 'sequence',
		containerheight: '353px'
	});
	$('.page-3106 .graphic').innerfade({
		speed: 1000,
		timeout: 6000,
		type: 'sequence',
		containerheight: '353px'
	});
	$('.page-3107 .graphic').innerfade({
		speed: 1000,
		timeout: 6000,
		type: 'sequence',
		containerheight: '353px'
	});
	$('.page-3112 .graphic').innerfade({
		speed: 1000,
		timeout: 6000,
		type: 'sequence',
		containerheight: '353px'
	});
	
	// Blog rotate
	$('.page-2861 .special').innerfade({
		speed: 1000,
		timeout: 4000,
		type: 'sequence',
		containerheight: '158px'
	});
	
	jQuery(".googlemap").fancybox({
		'width'				: '75%',
		'height'			: '75%',
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});

	jQuery(".disclaimer-link").fancybox({
		'width'				: '40%',
		'height'			: '75%',
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});

	$("#scroller").simplyScroll({
		autoMode: 'loop',
		pauseOnHover: false
	});
});
