
$(document).ready(function(){


////////////////////////////////////////////////fade btns
	$('.fadeThis').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	


	  $(this).hover(function () {
			$span.stop().fadeTo(500, 1);
	  }, function () {
		  if ($(this).hasClass('.active')){
		  } else{
			$span.stop().fadeTo(500, 0); 
		  }
	  }); 
	});
	
	startPos = $("#navBtns a.active").position().left
	 if ($('#quickQuote').hasClass('active')){
	 	startPos = 168
	 }
	widthP = $("#navBtns a.active").width()
	
        $("#navSlideBar").stop().animate({
            left: startPos
		});
    $("#navBtns a").hover(function() { //on hover move slider to hover element's position

		
		
		leftPos = $(this).position().left;
        $("#navSlideBar").stop().animate({
			width: $(this).width(),
            left: leftPos
		});
	  }, function () {
        $("#navSlideBar").stop().animate({
            left: startPos
		});
   
    });
	
    $(".AJXCSSMenuCeGKRNA li").hover(function() { //on hover move slider to hover element's position

		
		
		leftPos = $(this).position().left;
        $("#navSlideBar").stop().animate({
			width: $(this).width(),
            left: leftPos
		});
	  }, function () {
        $("#navSlideBar").stop().animate({
            left: startPos,
			width: widthP
		});
   
    });

    $(".AJXCSSMenuMQQCILC li").hover(function() { //on hover move slider to hover element's position

		
		
		leftPos = $(this).position().left;
        $("#navSlideBar").stop().animate({
			width: $(this).width(),
            left: 168
		});
	  }, function () {
        $("#navSlideBar").stop().animate({
            left: StartPos
		});
   
    });
	
	
	
	$(".scroll").click(function(event){
		//prevent the default action for the click event
		event.preventDefault();
		
		//get the full url - like mysitecom/index.htm#home
		var full_url = this.href;
		
		//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
		var parts = full_url.split("#");
		var trgt = parts[1];
		
		//get the top offset of the target anchor
		var target_offset = $("#"+trgt).offset();
		var target_top = target_offset.top;
		
		//goto that anchor by setting the body scroll top to anchor top
		$('html, body').animate({scrollTop:target_top}, 500);
	});





	//When page loads...
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});

	
});

