jQuery(function($) {

// CHECK NAVI
var cat = location.href.split('#')[0].split('/').reverse()[1];
var href = cat+'/'+(location.href.split('#')[0].split('/').reverse()[0]);
$('#gnavi a , #fnavi a').each(function() {
		var theId = $(this).parent().attr('title');
		var theCat = this.href.split('#')[0].split('/').reverse()[1];
		var theHref = theCat+'/'+(this.href.split('#')[0].split('/').reverse()[0]);
    if (href == theHref){
		$(this)
		 .wrap("<span class='active'></span>")
		 .before(this.childNodes)
		 .remove();
	}else if(theId == cat) {
		$(this).addClass('current');
	}
});




// HOVER
$(".hover a img,#header a img,#font_changer img,#formbtns img").hover(
	function(){   // マウスオーバー
	$(this).fadeTo(1, 0.7);
	},
	function(){   // マウスアウト
	$(this).fadeTo(1, 1);
	}
);


// CHANGE FONT-SIZE  put title attr. on <li>
$("body").css("font-size",$.cookie('fsize'));

$("#font_changer li").hover(
  function(){
	$(this).css('cursor','pointer');
  }
);

$("#font_changer li").click(function(){
	var s=$(this).attr('title');  
	switch (s) {
		case "s":size='62.5%';break;
		case "l":size='87.5%';break;
		default:size='75%';
	};
	$("body").css("font-size",size);
	$.cookie("fsize",size,{expires:30,path:'/'});
});





// POPUP WINDOW  put .popup on <a>
$(".popup").click(function(){
		window.open(this.href,"pop","width=680,height=560,resizable=yes,scrollbars=yes");
		return false;
});
	
	
	
	
	
});





