$(document).ready(function(){

    // Featured posts
	var position = 1;
	arrowCheck(position);
  	
	$("#featured-box-2").hide();
	$("#featured-box-3").hide();
	$("#featured-box-4").hide();
	$("#featured-box-5").hide();
	$("#featured-box-6").hide();
	
	//Show the next image when asked
	 $(".next").click(function(){
	  if(position < 6){
		$("#featured-box-1").hide();
		$("#featured-box-2").hide();
		$("#featured-box-3").hide();
		$("#featured-box-4").hide();
		$("#featured-box-5").hide();
		$("#featured-box-6").hide();
		//show the next
		$("#featured-box-"+(position+1)).show();
		position++;
		arrowCheck(position);
	  }
  	});

   //Show the previous image when asked
	$(".prev").click(function(){
    if(position > 1){
		$("#featured-box-1").hide();
		$("#featured-box-2").hide();
		$("#featured-box-3").hide();
		$("#featured-box-4").hide();
		$("#featured-box-5").hide();
		$("#featured-box-6").hide();
		//show the previous
		$("#featured-box-"+(position-1)).show();
		position--;
		arrowCheck(position);    
    }
  	});
	
	// Navigation drop downs
    $("#nav-top li").hover(
        function(){ $("ul", this).fadeIn("fast"); }, 
        function() { } 
    );
    if (document.all) {
        $("#nav-top li").hoverClass ("sfHover");
    }	
    
});

$.fn.hoverClass = function(c) {
    return this.each(function(){
        $(this).hover( 
            function() { $(this).addClass(c);  },
            function() { $(this).removeClass(c); }
        );
    });
};

function arrowCheck(position){
	if(position==6){
		$(".next").hide();
		}else{
		$(".next").show();
	}
	if(position==1){
		$(".prev").hide();
		}else{
		$(".prev").show();
	}
}

    



