// JavaScript Document whz20150630
//nav scroll
$(function(){
	var toTopHeight = $(".nav").offset().top;
	$(window).scroll(function() {
		if( $(document).scrollTop() > toTopHeight ){
			if ('undefined' == typeof(document.body.style.maxHeight)) {	
				var scrollTop = $(document).scrollTop();
				$(".nav").css({'position':'absolute','top':scrollTop+'px'});
			}else{
				$(".nav").addClass("nav_fixed");
			}
		}else{
			if ('undefined' == typeof(document.body.style.maxHeight)) {
				$(".nav").css({'position':'absolute','top':toTopHeight+'px'});
			}else{
				$(".nav").removeClass("nav_fixed");
			}
		}
	});
	
});
