/* --------------------------------------------------
common
-------------------------------------------------- */

var ua = browserIdentification();

/* navigation */
$(document).ready(function() {
	$("div.accordion").hover(function(){
		$(this).css("cursor","pointer");
	},function(){
		$(this).css("cursor","default");
	});
	
	$("div.accordion").click(function(){
		$(this).next().slideToggle("fast");
	});
	
	function onSetNavigation(e){
		var wh = window.document.documentElement.clientHeight;
		/* navigation_area */
		var lh = $("#navigation_area").height() + 80;
		if (lh <= wh && ua != "chrome") { $("#navigation_area").addClass("windowFloating"); }
		else{ $("#navigation_area").removeClass("windowFloating"); }
		/* pagetop navi */
		var rh = $("#navigation_area").height() + 150;
		if (rh <= wh) { $("#contents_footer").addClass("displayNone"); }
		else{ $("#contents_footer").removeClass("displayNone"); }
	}
	$(window).bind("resize", onSetNavigation);
	$(window).bind("load", onSetNavigation);
	
	var ch = $("#contents_area").height();
	var nh = $("#navigation_area").height();
	if(ch < nh){
		$("#contents_area").height(nh);
	}
	
	
});

/* ブラウザ判定 */
function browserIdentification(){   
	var ua = "";
	if(/opera/i.test(navigator.userAgent)) ua="opera";
	else if(/msie/i.test(navigator.userAgent)) ua="ie";
	else if(/chrome/i.test(navigator.userAgent)) ua="chrome";
	else if(/safari/i.test(navigator.userAgent)) ua="safari";
	else if(/firefox/i.test(navigator.userAgent)) ua="ff";
	else if(/gecko/i.test(navigator.userAgent)) ua="gecko";
	return ua;
}   


/* read more */
function slideToggle(id){ $("#" + id).slideToggle("slow"); }
function hideMore(id){ $("#" + id).hide(); }

/* page top */
function scrollPageTop(){
	Scroller.interval=setInterval('Scroller.scroll(0)',6);
}
/* page anchor */
function anchorScroll(tag){
	$("#"+tag).ScrollTo(600);
}

/* lightBox */
$(function() { $('.entry_image a').lightBox(); });
$(function() { $('#contents_inner a').lightBox(); });

//$(function() { $('.entry_body a').lightBox(); });
//$(function() { $('.entry_more a').lightBox(); });




