$(document).ready(function(){
	$("#trigger").toggle(function(){
				
		$("#trigger").animate({
                marginLeft: "246px"
                }, 500 );
		
		$("#extra-content").animate({
                marginLeft: "0px"
                }, 500 );
		$(this).find("a").text("Quick Close")
	}, function(){
		$("#trigger").animate({
                marginLeft: "0px"
                }, 500 );
		
		$("#extra-content").animate({
                marginLeft: "-246px"
                }, 500 );
		$(this).find("a").text("Quick Quote")
	});
	
	return false;
});
$(document).ready(function(){
	$('.dive, .top').hover(function(){
		$(this).find('span').stop().animate({'background-position':'0px 0px'}, 400, 'easeOutCirc');
	},function(){
		$(this).find('span').stop().animate({'background-position':'0px -100px'}, 400, 'easeInCirc')				  
	})	
	fl=true;
	$('.dive').click(function(){
		fl=false;
		destination = $('#content').offset().top;						  
		div= 'html';
		if ($.browser.webkit) {div='body'}
		$(div).animate({ scrollTop: destination+20}, 1000, function(){ fl=true});
	})
	$('.top').click(function(){					  
		div= 'html';
		if ($.browser.webkit) {div='body'}
		$(div).animate({ scrollTop: 0}, 2000);
	})
	$('#menu li:not(.active) a').hover(function(){
		$(this).stop().animate({paddingRight:'70'},600,'easeOutBack')									  
	}, function(){
		$(this).stop().animate({paddingRight:'15'},600,'easeInBack')									  
	})
	$('.button1, .button2, .button3, .nav a').hover(function(){
		$(this).find('strong').stop().animate({'background-position':'0px 0px'}, 400, 'easeOutCirc');
	},function(){	  
		$(this).find('strong').stop().animate({'background-position':'0px -40px'}, 400, 'easeInCirc')		
	})
	$('.icons .img_active').css({opacity:'0'});
	$('.icons a').hover(function(){
		$(this).find('.img_active').stop().animate({opacity:'1'}, function(){$(this).css({opacity:'none'})})						 
	}, function(){
		$(this).find('.img_active').stop().animate({opacity:'0'})						 
	})
	// tool tip
	$('.normaltip').aToolTip({
    	toolTipClass: 'aToolTip'});
	s=0;
	setInterval(scroll_menu,100)
	function scroll_menu(){
		div= 'html';
		if ($.browser.webkit) {div='body'}
		var new_s=$(div).prop('scrollTop');
		if ((s!=new_s)&&(fl)) {
			$('.relative').stop().animate({ top: new_s}, 1000, 'easeOutCirc');
			s=new_s;
		}
	}
	scroll_menu()
})


$(document).ready(function() {
	function formatText(index, panel) {
	  return index + "";
	}
  $(function () {

		$('.anythingSlider').anythingSlider({
			 easing: "easeInOutCirc",                // Anything other than "linear" or "swing" requires the easing plugin
			 autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
			 delay: 4000,                    // How long between slide transitions in AutoPlay mode
			 startStopped: false,            // If autoPlay is on, this can force it to start stopped
			 animationTime: 1000,             // How long the slide transition takes
			 hashTags: true,                 // Should links change the hashtag in the URL?
			 buildNavigation: false,         // If true, builds and list of anchor links to link to each slide
			 pauseOnHover: false,             // If true, and autoPlay is enabled, the show will pause on hover
			 startText: "",              // Start text
			 stopText: "",               // Stop text
		  navigationFormatter: formatText   // Details at the top of the file on this use (advanced use)
		});

		$("#slide-jump").click(function(){
			 $('.anythingSlider').anythingSlider(6);
		});

  });

   
 });

