$(function() {
	// 連携キット、local時はexit
	if ($.LiVE.bdkit && location.protocol=="file:") return;
	
	var $navi = $.LiVE.Elements.WIDGETS.navi.find(".default_pagetop");
	$navi.each(function() {
		var $this = $(this);
		$this.find("a")
			.css({ width: $this.width(), height: $this.height() })
			.click(function(e) {
				$.LiVE.navi.pagetop();
			});
		
		function onNavigate(id) {
			if ($.LiVE.mode.name=="edit") return;
			var target = 0;
			if ($.LiVE.body.scroll=="vertical" && $.LiVE.Elements.SIDES.siteheader.length > 0
				&& $.LiVE.side['siteheader'].option.float == false) {
				target = -1;
			}
			if ($.LiVE.currentpanelorder <= target) {
				$this.stop().animate({opacity: 0}, 100);
			} else {
				$this.stop().animate({opacity: 1}, 100);
			}
		}
		
		if ($.LiVE.mobile.check == false) {
			// 表示コールバック
			$.LiVE.navicontrol.callbacks.push(
				onNavigate
			);
			onNavigate(location.hash);
		}
	});
});
