$(document).ready(function(){

	$('h3.cateID').each(function (i) {
		i = i+1;
		classNum= 'cate' + i;
		cateID = '<a name="' + classNum + '"></a>';
		$(this).addClass(classNum).before(cateID);
	});

	$('a.pageID').each(function (i) {
		i = i+1;
		n= i+1;
		p= i-1;
		itemNum= 'no' + i;
		prevNum= 'no' + p;
		nextNum= 'no' + n;
		prevItem= '<a href="#'+prevNum+'" class="prevBtn scroll">前の記事</a>';
		nextItem= '<a href="#'+nextNum+'" class="nextBtn scroll">次の記事</a>';
			$(this).attr('name',itemNum).append(prevItem+nextItem);
	});
	
	$('table.postage tr').hover(function() {
		$(this).find('dl.area dd').show('700');
		$(this).find('td:gt(0)').css('background','#d9d9d9');
	},
  function () {
		$(this).find('dl.area dd').hide('700');
		$(this).find('td:gt(0)').css('background','#ffffff')
  }
	);
	
	$('.box').hover(function() {
		$(this).closest('.box').css('background','#d9d9d9');
	},
  function () {
		$(this).closest('.box').css('background','#ffffff');
  }
	);
});
