//Creado por Emilio Cobos Álvarez | http://emiliocoboscmc.blogspot.com
//Creative Commons 3.0 by-nc-nd
//Si quieres trabajar con el script sin comprimir ve a http://dl.dropbox.com/u/71679931/share/paginacion.js
function paginacion(a){var b=opcionesPaginacion||{},c=b.paginaActual||location.href,d=b.postPorPag||7,e=b.postsPrimeraPag||d,f=b.numerosDePag||null,g=b.claseActual||"activo",h=b.textoAnterior||"Anterior",i=b.textoSiguiente||"Siguiente",j=b.textoPrimera||"«",k=b.textoFin||"»",l=b.mostrarPuntos,m=b.plantillaPagLink||"{{num}}",n=b.plantillaPagPlain||"{{num}}",o=b.htmlBefore||'
'
,p=b.htmlAfter||'
({{total}})
',q=function(a,b,c){b=b!==u?"/search"+u+"?updated-max="+b+"&max-results="+d:b!=="/"?"/search"+u:b;return m.replace(/{{num}}/g,a).replace(/{{link}}/g,b).replace(/{{rel}}/g,c?'rel="'+c+'"':"")},r=function(a,b){if(b===undefined){return n.replace(/{{num}}/g,a).replace(/class=("|')([^"']*)/,"class=$1$2"+" "+g)}return n.replace(/{{num}}/g,a)},s=function(a,b){if(!b){b=a;a=0}y=y.slice(a,b)},t=c.match(/\/label\/[^?]*/),u=t===null?"/":t[0],v=a.feed.entry,w=v.length,x=[],y=[],z,A=e-1,B=0,C,D=0,E=[],F=[],G,H,I,J,K;for(;J=v[A];A+=d){K=J.published.$t;K=encodeURIComponent(K.substring(0,19)+K.substring(23,29));if(c.indexOf(K)!==-1){C=x.length}if(v[A+1]){x.push(K)}}D=x.length+1;if(C!==undefined){E.push(q(j,u),x[C-1]?q(h,x[C-1]):C===0?q(h,u,"prev"):"");y.push(q(1,u))}else{y.push(r(1));C=-1}for(;Bif(B===C){y.push(r(B+2))}else{y.push(q(B+2,z))}if(B===x.length-1&&B!==C){F.push(x[C+1]?q(i,x[C+1],"next"):"",q(k,z))}}if(f&&y.length>=f){C++;if(y[C-Math.floor(f/2)]&&y[C+Math.ceil(f/2)]){H=C-Math.floor(f/2)!==0;I=C+Math.ceil(f/2)!==y.length;s(C-Math.floor(f/2),C+Math.ceil(f/2))}else if(C<=f/2){s(f);I=true}else if(C>=y.length-f/2){s(y.length-f,y.length);H=true}}if(l){if(H){E.push(r("...",true))}if(I){F.unshift(r("...",true))}}y=E.concat(y,F);document.getElementById("blog-pager").innerHTML=o.replace(/{{total}}/g,D)+y.join("")+p.replace(/{{total}}/g,D)}