/*-------------------------------

	Custom JS
	
---------------------------------*/
	
$(document).ready(function() {
/*Rotating Banner Images*/
	$('.slideshow').each(function() {
    var $this = $(this), $ss = $this.closest('.inside');
    var mapper = $ss.find('.map');
   		$this.cycle({
        	fx:     'fade', 
    		speed:  1000, 
    		timeout: 0, 
    		pager:  mapper
		})
	});
	$('#featuredpager').cycle({ 
    	fx:     'scrollHorz', 
    	timeout: 0, 
    	speed: 500, 
    	prev:    '.prev',
        next:    '.next'
 	});
 	
/*scroll*/
	$("a#sidebartop").click(function() {
  		$("html, body").animate({ scrollTop: 0 }, "slow");
  		return false;
	});
	
/*Modal*/
	$("a.do_modal").click(function()
    {
		var yOffset = $(window).scrollTop() + 'px';
		$('div#modal').css('top', yOffset);
		$('div#modal').fadeIn('fast');
		return false;
	});
	$('a#close').click(function() {
		$("div#modal").fadeOut('fast');
		return false;
	});
	
/* Share Fade in */
	
	$("ul.photos > li > span.image").hover(function () 
		{
   			$(this).closest('li').find('a.sharepic').fadeIn('fast');
		}, 
 		function () {
    		$(this).closest('li').find('a.sharepic').fadeOut('fast');
 		}
  	);
  	
/* Tabs */
    $("#tabs").tabs();
    
/* Accordion */
	$("#accordion").accordion({
		active: false,
		collapsible: true,
		autoHeight: false,
		navigation: true
	});
	
/*Side Bar tools scroll */
	$(window).scroll(function () {
    	var scrollTop = $(window).scrollTop();
    	if(scrollTop > 425) {
    		$('#sidebartools').fadeIn('1000');
    	}
    	else if(scrollTop < 425) { 
    		$('#sidebartools').fadeOut('1000')
    	}
    }); 
});
