$(document).ready(function() {
    
    $("body").css("display", "none");
    $("body").fadeIn(2000);
    
    $(".feature ul.main li.two").css("display", "none");
    $(".feature ul.main li.three").css("display", "none");
        
    $(".feature ul.sub li.one").click(function(){
        $(".feature ul.main li.two").css("display", "none");
        $(".feature ul.main li.three").css("display", "none");
        $(".feature ul.main li.one").css("display", "block");
    });

    $(".feature ul.sub li.two").click(function(){
        $(".feature ul.main li.one").css("display", "none");
        $(".feature ul.main li.three").css("display", "none");
        $(".feature ul.main li.two").css("display", "block");
    });

    $(".feature ul.sub li.three").click(function(){
        $(".feature ul.main li.two").css("display", "none");
        $(".feature ul.main li.one").css("display", "none");
        $(".feature ul.main li.three").css("display", "block");
    });


});

/*******

	***	Anchor Slider by Cedric Dugas   ***
	*** Http://www.position-absolute.com ***
	
	Never have an anchor jumping your content, slide it.

	Don't forget to put an id to your anchor !
	You can use and modify this script for any project you want, but please leave this comment as credit.
	
*****/
		


$(document).ready(function() {
	$("a.anchorLink").anchorAnimate();
        
	var full_url = window.location.href;
	var parts = full_url.split("#");
        if(window.location.hash != '') {
            var trgt = "."+ parts[1];
            var destination = $(trgt).offset().top;
            destination -= 185;
            $("html,body").animate({scrollTop:destination}, 1100);
            
        }
});

jQuery.fn.anchorAnimate = function(settings) {

 	settings = jQuery.extend({
		speed : 1100
	}, settings);	
	
	return this.each(function(){
		var caller = this
		$(caller).click(function (event) {	
			event.preventDefault();
			var elementClick = $(caller).attr("href");
                        var splitem = elementClick.split('#');
                        elementClick = "."+ splitem[1];
                      
			var destination = $(elementClick).offset().top;
                        elementTarget = splitem[1];
                        destination -= 185;
                        
			$("html:not(:animated),body:not(:animated)").animate({scrollTop: destination}, settings.speed, function() {
				window.location.hash = elementTarget
			});

                        $('.nav.sec li').removeClass('current');
                        
                        $(caller).parent().addClass('current');
                        
		  	return false;
		})
	})
}

