$(function(){
	$window = $(window);
	$grid = $("#grid");
	$footer = $("#ft_footer");
	
	
	
	/*resize*/
	$window.bind("resize",onResize);
	onResize();
	
	function onResize() {
		var width = Math.max(990,$window.width());
		var column = 6;//Math.floor(width/160);
		//column = column>=8 ? 8 : column;
		//column = column<=6 ? 6 : column;
		var offset = Math.round((width-column*160)/2);
		$grid.css("background-position",offset+"px");
		$footer.css("background-position",offset+"px");
	};
	
	$("#hd_header").css("visibility","visible");
	$("#ft_footer").css("visibility","visible");
	$("#main").css("visibility","visible");
	
	$("a#ft_go_top").click(function(){
		$('html,body').animate({ scrollTop: 0 }, {duration:700,easing:"easeOutExpo"});
	});
	
	$("a.hd_gnavi_btn").each(function(index,element){
		if($(this).children("del").length){
			$(this).removeAttr("href");
			$(this).addClass("hd_gnavi_btn_del");
		}
	});
		
	$("a.subnavi_btn").each(function(index,element){
		if($(this).children("del").length){
			$(this).removeAttr("href");
			$(this).addClass("subnavi_btn_del");
		}
	});

	$("#ft_nav ul.ft_gnavi a").each(function(index,element){
		if($(this).children("del").length){
			$(this).replaceWith($(this).html());
//			$(this).removeAttr("href");
//			$(this).addClass("ft_gnavi_del");
		}
	});
}); 
