$(function(){

/*
Options disponibles
{
		items:'div',
		nbElemsPerPage: 4,
		nbPagesMax:false,
		classSelected:'selected',
		classPaginate :'paginate',
		bShowBefore:false,
		bShowAfter:true,
		paginateBox:null,
		classNumber:'Number',
		classNext:'Next',
		classPrev:'Prev',
		classFirst:'First',
		classLast:'Last',
		strNext: ' > ',
		strPrev:' < ',
		strFirst:'<< ',
		strLast:' >>'
	}				
*/

/*
	$('#results').paginate({
		nbElemsPerPage:6, 
		items:'<div>', 
		strPrev:'prev ', 
		strNext:'next',
		bShowBefore:false,
		bShowAfter:false,
		classSelected:'selected',
		paginateBox:$("#mypaginate"),
		nbPagesMax:4
	});
	
	$('#results2').paginate({
		items:'<p>', 
		nbElemsPerPage:2, 
		bShowBefore:false,
		strPrev:'[Précédent]&nbsp;&nbsp;', 
		strNext:'&nbsp;&nbsp;[Suivant]'
	});
*/

	$('table','#blockContent').paginate({
		items:'td',
		nbElemsPerPage: 4,
		nbPagesMax:false,
		classSelected:'selected',
		classPaginate :'paginate',
		bShowBefore:false,
		bShowAfter:false,
		paginateBox:$('.paginateBox'),
		classNumber:'Number',
		classNext:'Next',
		classPrev:'Prev',
		classFirst:'First',
		classLast:'Last',
		strNext: ' > ',
		strPrev:' < ',
		strFirst:'<< ',
		strLast:' >>'
	});	
	
	nextPrev();
	$('a','.paginateBox').bind('click', function(){
		nextPrev();
	});
	
	$("a.fancyzoom2","#blockContent").click(function(){
		$(this).parents("td").find("a.fancyzoom").trigger('click');
		//console.log($(this).parents("td").prev().find("a.fancyzoom").html());
		return false;
	});
	
});

function nextPrev(){

	$('div.paginateBox:first').css({
		position:"absolute",
		top:"380px",
		left:"295px"
	})
	.find(".Number, .Next, .Last, .First").css({display:"none"});
	
	$('div.paginateBox:first')
	.find(".Prev").html("").css({
		display:"block",
		width:"35px",
		height:"35px"
	});
	
	$('div.paginateBox:last').css({
		position:"absolute",
		top:"380px",
		right:"10px"
	})
	.find(".Number, .First, .Prev, .Last").css({display:"none"});
	
	$('div.paginateBox:last')
	.find(".Next").html("").css({
		display:"block",
		width:"35px",
		height:"35px"
	});
	
}

