
//  SUBMENU NUDGE
$(function(){
     $("#sidebar  li a:not(#sidebar li.current_page_item a)").hover(function() {
                $(this).animate({paddingLeft:'23px'}, 'fast');
        },function() {
    $(this).animate({paddingLeft:'0px'}, 'fast');
        });
});

//  RETAINER CURRENT
$(function(){
     $("#list li").click(
		function(){
				$("#list li").removeClass('current');
				 $(this).addClass('current');
				 
		});
	 
	 
 $(".slidedata").find("li:not(:first)").each(function(i) {
     $(this).hide();
   });
	
 $('#options li:first').addClass('current');

	$('#options li a').click(function(evt) {
					$('#options .current').removeClass("current");
			 		$(this).parent().addClass('current');
					var clicked = $(this).attr('href');
					var clicked2 = clicked.replace('#','.')
					$('.slidedata li').fadeOut(1000).hide();
					$('.slidedata ' + clicked).fadeIn(1400); 
					$('.slidedata ' + clicked2).fadeIn(1400);  
					evt.preventDefault();


 
});

	 
	 
	 
	 
	 
});



// SUBMENU ANIMATION	
$(document).ready(function(){
	$('.sub-menu').hide();
	$('#nav li').hover(
		function () {
			
			$('.sub-menu', this).slideDown(300);
		},
 
        function () {
		$(this).stop();
 		 	$('.sub-menu', this).slideUp(300);
  
		});
});


// SMOOTH ANCHOR LINKING
$(document).ready(function(){
    $("a[href^='#']:not('#carousel a, #list a')").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);
	    });

	 $('.newspost:even').addClass('even')
$("#nav li:last('#nav li li')").addClass('lastchild');
$("#nav li:first('#nav li li')").addClass('firstchild');
	
	});


// MOUSEOVER IMAGE CHANGE

$(function () {
			
			var imgBefore =  $('.featured :first-child');
	 $(imgBefore).css({"z-index":2}).hover( function() {
			$(this).animate({opacity:0.0})				 
								 
								 
			},
				function() {
			$(this).stop().animate({opacity:1})				 
						 
								 
				})
	 
	 
	
		  
			});

// BOTTOM FOOTER ICONS NUDGE
$('#minifooter a').mouseover(function() {
  $(this).stop().animate({marginTop: '1px'},100);
}).mouseout(function() {
  $(this).stop().animate({marginTop: '0px'},100);
});




/*	$('#nav li:not("li.current-menu-item , li.current-page-ancestor ")')
		.css( {'backgroundPosition': "0 0"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(0px -45px)"}, {duration:300})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(0 0)"}, {duration:200, complete:function(){
				$(this).css({backgroundPosition: "0 0"})
			}})
		});
	*/
