var strConPath = "http://www.lu-ca.jp/returnItems/returnPosts.php";
jQuery(function()
{
	setLoad();
});

function setLoad()
{
	$("p.moreRead").hover(function()
	{
       $(this).stop().animate({ backgroundColor: "#cccccc"}, 800);
       },function()
       {
       $(this).stop().animate({ backgroundColor: "#ffffff" }, 800);
       return false;
    });
    
    $("p.moreRead").click(function(e)
    {
    	$('p.moreRead').unbind('click');
    	$('p.moreRead').fadeOut(300).queue( function(){ $(this).remove() });
    	//
    	e.preventDefault();
	    $.ajax({
			url: strConPath,
			type: 'POST',
			dataType: 'html',
			data: {
				"page" : returnPage(),
				"offset" : 1
	        },
	        cache: false,
			success: function(value)
			{
				writeMore($(value));
			}
		});
		return false;
    });
}

function writeMore(value)
{
	$('#content').append(value.fadeIn(1500));
	setAction();
	setLoad();
}

function returnPage()
{
	var returnCnt = 0;
	var currentCnt = $('.eachPostBox').length;
	var cueentPage = currentCnt / 10;
	returnCnt = cueentPage + 1;
	//
	return returnCnt;
}
