/*  
Theme Name: Neko
Theme URI: http://www.themespinner.com
Description: Neko - Premium ThemeSpinner.com theme.
Author: Theme Spinner
Author URI: http://www.themespinner.com
Share URI: http://themes.weboy.org
*/
body{
margin:0px;
padding:0px;
font: 12px/18px Verdana, Arial, Helvetica, sans-serif;
background-color:#f5f5f5;
color:#333333;
text-align:center;
background-image:url(img/bg2.gif);
background-repeat:no-repeat;
background-position:top;
background-attachment:fixed;
}
p {
line-height:22px;
}
img.right {
float: right;
margin:10px 0 0 10px;		
}
img.left {
float: left; 
margin:0 10px 10px 0;	
}
.clear {
clear:both;
height:20px;
}
fieldset { 
padding:8px;
margin:8px;
border:1px solid #cccccc;
line-height:23px;
text-align:justify;
}
.back-to-top{
margin:0px 0px 0px 0px; 
padding:0px;
}
legend{ 
color : #333333;
padding:0px 11px 0px 11px;
font-size:20px;
font-family:Geneva, Arial, Helvetica, sans-serif;
margin:0px;
}
blockquote{
border:1px solid #ccc;
padding:5px;
background-color:#eee;
}
blockquote blockquote{
border:1px solid #ccc;
padding:5px;
background-color:#fff;
}
a	{outline:none; text-decoration:none}
a:link {color:#272727;  text-decoration:underline;}
a:visited	{color:#272727;  text-decoration:underline;}
a:hover		{color:#000; text-decoration:underline;}
.addcomment,
.closecomment{
float:right;
text-transform:uppercase; 
padding:3px 18px 3px 0px;
font-size:10px;
margin:12px 0 0 0;
text-decoration:underline;}
a.addcomment{
background-image:url(img/icon_arrowdown.gif);
background-repeat:no-repeat;}
a.addcomment:link,
a.addcomment:visited{
background-position:100% 0px;}
a.addcomment:hover{
background-position:100% -20px;
}
ol.commentlist {
list-style:none;
margin:0;
padding:0;
text-align:justify;
}

ol.commentlist cite{
text-transform:uppercase;
font-style:normal;
}

ol.commentlist li{
border-bottom:1px solid #ccc;
padding:10px;
margin:5px;
list-style:none;
list-style-image:none;
list-style-position:none;
list-style-type:none;
}

ol.commentlist h5{
font-size:11px;
margin:0;
padding:0;
}	

ol.commentlist h5 small{
display:block;
}	
ol.commentlist li{border:1px solid #cccccc; background-color:#eeeeee;}
ol.commentlist li.alt{border:1px solid #cccccc; background-color:#e5e5e5;}
ol.commentlist li span.moderate{
background-image:url(img/icon_cursor.gif);
background-repeat:no-repeat;
background-position:0 0;
padding:2px 0px 2px 20px;
color:#FF3300;
}	
.nocomments,
.nocommentsadd{
padding:10px;
color:#333333;
font-size:11px;
font-weight:bold;
margin:10px;
}	
.entry h1, entry h2, entry h3, entry h4, entry h5, entry h6{
color:#272727;
font-size:22px;
font-weight:normal;
margin:7px 0px 7px 0px;
}
.no-image{
border:0px;
background-image:none;
padding:0px;
margin-right:5px;
}
.arrow {
float: left;
list-style-type: none;
text-align: left;
margin: 0px;
width:100%;
padding: 0px;
color:#333333;
}
.arrow li {
float: left;
text-align: left;
margin: 0px;
width:100%;
padding: 0px;
color:#333333;
}
.arrow li a:link, .arrow li a:visited {
width: 195px;
display: block;
padding:5px 5px 5px 19px;
text-decoration: none;
overflow:hidden;
text-align: left;
border-bottom: 1px solid #494848;
background-image:url(img/nav-bullet.gif);
background-position:left center ;
background-repeat:no-repeat;
color:#bdbd8c;
}
.arrow li a:hover, .arrow li a:active {
width: 195px;
text-decoration:underline;
display: block;
overflow:hidden;
text-align: left;
color:#fff;
border-bottom: 1px solid #494848;
padding:5px 5px 5px 19px;
background-image:url(img/nav-bullet-hov.gif);
background-position:left center ;
background-repeat:no-repeat;
background-color:#282828;
}
.arrow ul li {
text-align: left;
font-family: Geneva, Arial, Helvetica, sans-serif;
font-weight: 400;
color:#333333;
margin: 0px;
padding: 0px;
}
.arrow ul {
list-style-type: none;
text-align: left;
margin: 0px;
padding: 0px;
color:#333333;
}
.arrow ul li a:link, .arrow ul li a:visited {
width: 195px;
display: block;
padding:5px 5px 5px 19px;
text-decoration: none;
overflow:hidden;
text-align: left;
border-bottom: 1px solid #494848;
background-image:url(img/nav-bullet.gif);
background-position:left center ;
background-repeat:no-repeat;
color:#bdbd8c;
}
.arrow ul li a:hover, .arrow ul li a:active {
width: 195px;
display: block;
padding:5px 5px 5px 19px;
text-decoration: none;
overflow:hidden;
text-align: left;
border-bottom: 1px solid #494848;
background-image:url(img/nav-bullet-hov.gif);
background-position:left center ;
background-repeat:no-repeat;
color:#fff;
}
#wp-calendar {
empty-cells: show;
width: 100%;
font-size: 12px;
color: #333333;
text-decoration: none;
text-align: center;
float: left;
padding: 0px;
margin: 0px;
font-weight: normal;
border-bottom: 1px solid #494848;
}

#wp-calendar a:link, #wp-calendar a:visited {
text-decoration: none;
color: #333333;
}
#wp-calendar a:hover, #wp-calendar a:active {
text-decoration: underline;
color: #333333;
}
#wp-calendar caption {
text-align: left;
width: 90%;
margin: 0px;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 10px;
color:#333333;
font-size: 18px;
background-image: url(images/cats.gif);
background-repeat: no-repeat;
background-position: left;
height: 36px;
line-height: 36px;
}
#wp-calendar th {
margin: 0px;
padding: 0px;
text-align: center;
color:#333333;
}
#next a:link, #next a:visited {
text-align: center;
color: #000;
text-decoration: none;
font-weight: bold;
font-size: 12px;
float: right;
}
#next a:hover, #next a:active {
text-align: center;
color: #333333;
text-decoration: none;
font-weight: bold;
font-size: 12px;
float: right;
}
#prev a:link, #prev a:visited {
text-align: left;
color: #000;
text-decoration: none;
font-weight: bold;
font-size: 12px;
float: left;
}
#prev a:hover, #prev a:active {
text-align: left;
color: #000;
text-decoration: none;
font-weight: bold;
font-size: 12px;
float: left;
}
#wp-calendar td {
margin: 0px;
padding: 0px;
text-align: center;
}
#wp-calendar tf {
margin: 0px;
padding: 0px;
}
#style-switch-theme{
position:absolute;
visibility:visible;
z-index:95;
top:0px;
right:55px;
}
#style-switch{
position:absolute;
visibility:visible;
z-index:99;
top:0px;
right:10px;
display:inline;
}
#style-switch img{
border: 1px solid #cccccc;
padding:1px;
background-color:#000;
background-image:none;
}
#style-switch img:hover{
border: 1px solid #333333;
padding:1px;
background-color:#FFFFFF;
background-image:none;
}
#style-switch a,
style-switch a:active,
style-switch a:visited,
style-switch a:link
style-switch a:hover,{
border-bottom:0px;
margin-right: 0px;
background-image:none;
}

/********************************************/
div#header{
width:990px;
height:140px;
margin:0 auto;
background-image:url(img/BLACK/bg.gif);
background-repeat:repeat-x;
}
.top-Menu { 
padding-left:0px;
position:relative;
overflow:hidden;
height:30px;
margin:0 auto;
width:990px;
}
.top-Menu em { 
display: none
}
.top-Menu ul { 
list-style: none; 
margin: 0px; 
padding: 0;
}
.top-Menu ul li ul { 
display: none;
}
.top-Menu li { 
display: inline; 
font-size: 13px;
color:#ffffff;
text-decoration: none;
}
.top-Menu a { 
text-decoration:none;
display: block;
color:#ffffff;
font-size:14px;
float: left;
font-weight:bold;
background-image:url(img/BLACK/nav-sep.gif);
background-position:right center;
background-repeat:no-repeat;
padding:6px 13px 6px 13px;
}
.top-Menu a:hover {
color:#ffffff;
font-weight:bold;
text-decoration: none;
text-decoration:underline;
}
#nav-menu{
width:130px;
text-align:right;
margin:7px 5px 0px 0px;
float:right;
}
#nav-menu a, #nav-menu a:link, #nav-menu a:visited, #nav-menu a:active {
background-image:none;
padding:0px 5px 0px 5px;
}
#nav-menu a:hover{
background-image:none;
padding:0px 5px 0px 5px;
}
.float-none{
float:none;
margin:0;
border:0;
padding:0;
display:inline;
line-height:15px;
text-align:left;
vertical-align:middle;
}
.rss-feed{
line-height:15px;
display:inline;
border:0;
padding:0;
vertical-align: middle;
}
div.pagination {
padding:10px;
margin:0px;
text-align:center;
border: 1px solid #ffffff;
background-color:#ffffff;
}
div.pagination a {
padding: 6px;
margin-right: 2px;
border: 1px solid #ccc;
font-weight:bold;
font-size:11px;	
text-decoration: none; 
color: #272727;
background-color:#FFFFFF;
}
div.pagination a:hover, div.pagination a:active {
border:1px solid #cccccc;
color: #ffffff;
font-weight:bold;
font-size:11px;	
background-color: #333333;
}
div.pagination span.current {
padding: 6px;
margin-right: 2px;
border:1px solid #cccccc;
color: #fff;
font-weight:bold;
font-size:11px;	
background-color: #272727;
}
div.pagination span.disabled {
padding: 6px;
margin-right: 2px;
font-weight:bold;
font-size:11px;	
border: 1px solid #f3f3f3;
color: #ccc;
}
.cat-image{
float:left;
margin:7px 10px 0px 0px;
padding:0px;
width:152px;
height:152px;
text-align:center;
vertical-align:middle;
background-image:url(img/no-image.jpg);
background-repeat:no-repeat;
background-color:#FFFFFF;
}
.continue-reading a, .continue-reading a:link, .continue-reading:visited, .continue-reading a:active {
text-align:right; font-size:11px; display:block; padding:5px 0px 5px 0px;
}
.continue-reading a:hover {
text-align:right; font-size:11px; color:#000000; display:block; padding:5px 0px 5px 0px;
}
.footer-bg{
background-color:#272727; 
height:100px;
width:990px;
margin:0 auto;
color:#FFFFFF;
}
.bread a:link, .bread a:active, .bread a:visited{
font-size:11px;
color:#333333;
font-weight:bold;
text-decoration:none;
}
.bread a:hover{
font-size:11px;
color:#333333;
font-weight:bold;
text-decoration:underline;
}
.clickbg, clickbg a, clickbg a:visited, clickbg a:active, clickbg a:link{
background-color:#eeeeee;
border-bottom:1px solid #cccccc;
padding: 4px;
font-weight: normal;
font-family: verdana, Arial, sans-serif;
font-size: 11px;
color:#333333;
width:777px;
}
.titlebg{
background-color:#e1e1e1;
background-image:url(img/title-bg.gif);
background-position:top center;
background-repeat:repeat-x;
border-bottom:1px solid #cccccc;
padding: 8px;
font-weight: bold;
font-family: verdana, Arial, sans-serif;
font-size: 14px;
color:#ffffff;
}
.titlebg a, titlebg a:visited, titlebg a:active, titlebg a:link, titlebg a:hover{
color:#FFFFFF;
}
.more-link, .more-link a, .more-link a:active, .more-link a:visited, .more-link a:visited{
text-align:left;
padding-right:15px;
text-transform:uppercase;
font-size:11px;
background-image:url(img/arrow-rt.gif);
background-repeat:no-repeat;
background-position:right;
}
.nav-foot{
position: relative;
float: right;
margin-top:20px;
padding-left:0px;
margin-right:0px;
margin-bottom:0px;
}
.nav-foot em { 
display: none
}
.nav-foot ul { 
list-style: none; 
margin: 0px; 
padding: 0;
}
.nav-foot ul li ul { 
display: none;
}
.nav-foot li { 
display: inline; 
font-size: 12px;
color:#333333;
text-decoration: none;
}
.nav-foot a { 
padding:3px 15px 3px 15px;
display: block;
color:#ffffff;
font-size:12px;
float: left;
font-weight:bold;
border:1px solid #272727;
text-decoration:none;
background-color:#272727;
margin:0px 2px;
}
.nav-foot a:hover {
color:#ffffff;
font-weight:bold;
text-decoration: underline;
}
.cell-h{
text-align:justify;
background-image:url(img/cat-box-rep.png);
background-repeat:repeat-x;
background-position:top;
text-align:justify;
}
label{
font-weight:bold;
margin:0px;
text-align:left;
font-size:11px;
padding:0px;
}
.button{
font-size:11px;
font-weight:bold;
padding:6px;
background-image:none;
background-color:#272727;
border:1px solid #ffffff;
display:block;
color:#FFFFFF;
text-align:right;
}
.entry img{
border:1px solid #ccc;
padding:5px;
margin:5px;
}
.new-stuff{
padding:0px;
list-style:none;
list-style-image:none;
list-style-position:none;
list-style-type:none;
margin-top:5px;
}
.new-stuff a, .new-stuff a:link, .new-stuff a:visited, .new-stuff a:active{
margin:0px;
display:block;
padding:5px 5px 5px 20px;
text-decoration:none;
border-bottom:1px dashed #ccc;
color:#272727;
font-size:12px;
font-weight:bold;
background-image:url(img/nav-bullet.gif);
background-repeat:no-repeat;
background-position:left;
}
.new-stuff a:hover {
margin:0px;
display:block;
padding:5px 5px 5px 20px;
text-decoration:underline;
color:#333333;
font-size:12px;
border-bottom:1px dashed #ccc;
font-weight:bold;
background-image:url(img/nav-bullet-hov.gif);
background-repeat:no-repeat;
background-position:left;
}
.cell-t{
background-image:url(img/c-head.jpg);
border-bottom:1px solid #cccccc;
background-repeat:repeat-x;
background-position:center;
font-size:14px;
font-weight:bold;
padding:10px;
color:#333333;
}
.display-inline{
display:block;
text-align:center;
margin:7px 0px 7px 0px;
}
.r-image-home{
border:1px solid #ccc; padding:1px; float:left; margin:0px 5px 5px 0px;
}
.cat-image{
float:left;
margin:7px 10px 0px 0px;
padding:0px;
width:150px;
height:150px;
text-align:center;
vertical-align:middle;
background-image:url(img/no-image.jpg);
background-repeat:no-repeat;
background-color:#FFFFFF;
border:1px solid #333333;
}
.Landscape-image{
float:none;
margin:7px 0px 7px 0px;
padding:0px;
width:225px;
height:150px;
text-align:center;
vertical-align:middle;
background-image:url(../Maya/img/no-image-large.gif);
background-repeat:no-repeat;
border:1px solid #333333;
}
.Small-Landscape-image{
float:left;
margin:7px 10px 0px 0px;
padding:0px;
width:80px;
height:80px;
text-align:center;
vertical-align:middle;
background-image:url(img/no-image-small.gif);
background-repeat:no-repeat;
background-color:#FFFFFF;
border:1px solid #333333;
}
.entry img a, .entry img a:link, .entry img a:visited, .entry img a:active{
border:1px solid #ccc;
padding:5px;
margin:5px;
}
.entry{
width:777px;
}
.entry img a:hover{
border:1px solid #333333;
padding:5px;
margin:5px;
}
.post img a, .post img a:link, .post img a:visited, .post img a:active{
border:1px solid #ccc;
padding:5px;
margin:5px;
}
.post img a:hover{
border:1px solid #333333;
padding:5px;
margin:5px;
}
.cat-image a, .cat-image a:link, .cat-image a:visited, .cat-image a:active, .cat-image a:hover{
padding:0px;
background-color:#FFFFFF;
}
.right-nav ul{
width: 180px;
margin: 0px;
padding: 0px;
display: block;
overflow:hidden;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #333333;
}
.right-nav ol a, .right-nav ol a:active, .right-nav ol a:visited, .right-nav ol a:link{
background-image:url(img/BLACK/nav-ol.gif);
background-repeat:repeat-x;
background-position:left top;
font-weight:bold;
text-decoration:none;
padding: 8px;
font-size:14px;
color:#ffffff;
background-color:#272727;
border-bottom:1px solid #cccccc;
overflow:hidden;
margin:0px;
display:block;
}
.right-nav ol{
background-image:url(img/BLACK/nav-ol.gif);
background-repeat:repeat-x;
background-position:left top;
font-weight:bold;
text-decoration:none;
padding: 8px;
font-size:14px;
color:#ffffff;
background-color:#272727;
border-bottom:1px solid #cccccc;
overflow:hidden;
margin:0px;
display:block;
}
.right-nav li a, .right-nav li a:active, .right-nav li a:visited, .right-nav li a:link{
margin: 0px;
overflow:hidden;
display:block;
text-decoration:none;
padding:4px 4px 4px 22px;
background-color:#ffffff;
background-image:url(img/new.gif);
background-repeat:no-repeat;
background-position:left;
border-bottom:1px solid #cccccc;
color:#333333;
font-size:11px;
}
.right-nav li a:hover{
margin:0px;
display:block;
text-decoration:underline;
padding:4px 4px 4px 22px;
background-color:#eeeeee;
background-image:url(img/new-hover.gif);
background-repeat:no-repeat;
background-position:left;
border-bottom:1px solid #cccccc;
color:#272727;
overflow:hidden;
font-size:11px;
}
.comment-box-field{
width:200px;
border:1px solid #dddddd;
background-color:#ffffff;
font-family:Verdana, Arial, Helvetica, sans-serif;
padding:5px;
font-size:12px;
margin-bottom:8px;
}
textarea{
border:1px solid #dddddd;
background-color:#ffffff;
font-family:Verdana, Arial, Helvetica, sans-serif;
padding:5px;
}
textarea:focus{
border:1px solid #000000;
background-color:#FFFFCC;
}
input{
border:1px solid #dddddd;
background-color:#ffffff;
font-family:Verdana, Arial, Helvetica, sans-serif;
padding:5px;
}
input{
border:1px solid #000000;
background-color:#FFFFCC;
}
.comment-box-field:FOCUS{
width:200px;
border:1px solid #000000;
background-color:#FFFFCC;
font-family:Verdana, Arial, Helvetica, sans-serif;
padding:5px;
font-size:12px;
margin-bottom:8px;
}
.comment-box-text{
width:500px;
border:1px solid #dddddd;
background-color:#ffffff;
font-family:Verdana, Arial, Helvetica, sans-serif;
padding:5px;
font-size:12px;
margin-bottom:8px;
}
.comment-box-text:FOCUS{
width:500px;
border:1px solid #000000;
background-color:#FFFFCC;
font-family:Verdana, Arial, Helvetica, sans-serif;
padding:5px;
font-size:12px;
margin-bottom:8px;
}
.comment-box-submit{
font-weight:bold;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
padding:5px;
border:1px solid #cccccc;
color:#FFFFFF;
background-color:#272727;
}
.comment-box-submit:hover{
font-weight:bold;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
padding:5px;
border:1px solid #cccccc;
text-decoration:underline;
color:#FFFFFF;
background-color:#333333;
}
.search-top{
padding:8px 8px 8px 30px;
border:1px solid #dddddd;
background-color:#ffffff;
background-image:url(img/search.png);
background-repeat:no-repeat;
background-position:left center;
font-size:12px;
color:#272727;
font-weight:bold;
width:250px;
}
.search-top:focus{
padding:8px 8px 8px 30px;
border:1px solid #000000;
background-color:#FFFFCC;
background-image:url(img/search-hov.png);
background-repeat:no-repeat;
background-position:left center;
color:#333333;
font-size:12px;
font-weight:bold;
width:250px;
}
.foot-logo{
background-image:url(img/BLACK/logo-footer.gif);
background-repeat:no-repeat;
background-position:left top;
}
.main-logo{
background-image:url(img/BLACK/logo.gif);
background-repeat:no-repeat;
background-position:left top;
}
.c-txt{
padding:2px 10px 2px 10px; 
margin-top:15px; 
text-align:justify; 
background-color:#FFFFFF;
border-top:1px solid #b2b1b1; 
border-left:1px solid #b2b1b1;
border-right:1px solid #e1e1e1; 
border-bottom:1px solid #e1e1e1;
}
.theme-change{
border:1px solid #272727;
padding:1px;
background-color:#ffffff;
}
.theme-change:hover{
border:1px solid #ffffff;
padding:1px;
background-color:#272727;
}
.author-name{
font-size:14px; color:#272727; font-weight:bold;
}
.legend-single{ padding:3px 10px 3px 10px; color:#333333;
}
.foot{
background-color:#272727;
}
div#content{
width:777px;
float:right;
padding-bottom:5px;
border:1px solid #cccccc;
background-color:#FFFFFF;
background-image:none;
margin:0px 0px 10px 8px;
}
div#sidebar{
width:180px;
float:left;
margin-bottom:10px;
}
.right-nav{
width:180px;
float:left;
list-style:none;
list-style-type:none;
border-top:1px solid #cccccc;
border-left:1px solid #cccccc;
border-right:1px solid #cccccc;
margin:0px;
padding:0px;
overflow:hidden;
}
div#container{
text-align:left;
width:990px;
padding:0px;
margin:0 auto;
background-image:none;
background-color:#FFFFFF;
}	
div#wrapper {
width:970px;
overflow:auto;
margin:0 auto;
background-image:none;
}
.right-nav li{
margin:0px;
padding:0px;
overflow:hidden;
display:inline;
text-align:left;
width:100%;
}
.new-stuff li{
margin:0px;
padding:0px;
overflow:hidden;
display:inline;
text-align:left;
width:100%;
}
<?php
/*
Plugin Name: WP-Digg Style Paginator
Plugin URI: http://www.mis-algoritmos.com/2007/09/09/wp-digg-style-pagination-plugin-v-10/
Description: Adds a <strong>digg style pagination</strong> to Wordpress.
Version: 1.2.1
Author: Victor De la Rocha
Author URI: http://www.mis-algoritmos.com
*/
class pagination{
/*
Script Name: *Digg Style Paginator Class
Script URI: http://www.mis-algoritmos.com/2007/05/27/digg-style-pagination-class/
Description: Class in PHP that allows to use a pagination like a digg or sabrosus style.
Script Version: 0.3.3
Author: Victor De la Rocha
Author URI: http://www.mis-algoritmos.com
*/
		/*Default values*/
		var $total_pages = -1;//items
		var $limit = null;
		var $target = ""; 
		var $page = 1;
		var $adjacents = 2;
		var $showCounter = false;
		var $className = "pagination";
		var $parameterName = "post";
		var $urlF = false;//urlFriendly

		/*Buttons next and previous*/
		var $nextT = "Next";
		var $nextI = "&#187;"; //&#9658;
		var $prevT = "Previous";
		var $prevI = "&#171;"; //&#9668;

		/*****/
		var $calculate = false;
		
		#Total items
		function items($value){$this->total_pages = (int) $value;}
		
		#how many items to show per page
		function limit($value){$this->limit = (int) $value;}
		
		#Page to sent the page value
		function target($value){$this->target = $value;}
		
		#Current page
		function currentPage($value){$this->page = (int) $value;}
		
		#How many adjacent pages should be shown on each side of the current page?
		function adjacents($value){$this->adjacents = (int) $value;}
		
		#show counter?
		function showCounter($value=""){$this->showCounter=($value===true)?true:false;}

		#to change the class name of the pagination div
		function changeClass($value=""){$this->className=$value;}

		function nextLabel($value){$this->nextT = $value;}
		function nextIcon($value){$this->nextI = $value;}
		function prevLabel($value){$this->prevT = $value;}
		function prevIcon($value){$this->prevI = $value;}

		#to change the class name of the pagination div
		function parameterName($value=""){$this->parameterName=$value;}

		#to change urlFriendly
		function urlFriendly($value="%"){
				if(eregi('^ *$',$value)){
						$this->urlF=false;
						return false;
					}
				$this->urlF=$value;
			}
		
		var $pagination;

		function pagination(){}
		function show(){
				if(!$this->calculate)
					if($this->calculate())
						echo "<div class=\"$this->className\">$this->pagination</div>";
			}
		function get_pagenum_link($id){
				if(strpos($this->target,'?')===false)
						if($this->urlF)
								return str_replace($this->urlF,$id,$this->target);
							else
								return "$this->target?$this->parameterName=$id";
					else
						return "$this->target&$this->parameterName=$id";
			}
		
		function calculate(){
				$this->pagination = "";
				$this->calculate == true;
				$error = false;
				if($this->urlF and $this->urlF != '%' and strpos($this->target,$this->urlF)===false){
						//Es necesario especificar el comodin para sustituir
						echo "Especificaste un wildcard para sustituir, pero no existe en el target<br />";
						$error = true;
					}elseif($this->urlF and $this->urlF == '%' and strpos($this->target,$this->urlF)===false){
						echo "Es necesario especificar en el target el comodin % para sustituir el n�mero de p�gina<br />";
						$error = true;
					}

				if($this->total_pages < 0){
						echo "It is necessary to specify the <strong>number of pages</strong> (\$class->items(1000))<br />";
						$error = true;
					}
				if($this->limit == null){
						echo "It is necessary to specify the <strong>limit of items</strong> to show per page (\$class->limit(10))<br />";
						$error = true;
					}
				if($error)return false;
				
				$n = trim($this->nextT.' '.$this->nextI);
				$p = trim($this->prevI.' '.$this->prevT);
				
				/* Setup vars for query. */
				if($this->page) 
					$start = ($this->page - 1) * $this->limit;             //first item to display on this page
				else
					$start = 0;                                //if no page var is given, set start to 0
			
				/* Setup page vars for display. */
				$prev = $this->page - 1;                            //previous page is page - 1
				$next = $this->page + 1;                            //next page is page + 1
				$lastpage = ceil($this->total_pages/$this->limit);        //lastpage is = total pages / items per page, rounded up.
				$lpm1 = $lastpage - 1;                        //last page minus 1
				
				/* 
					Now we apply our rules and draw the pagination object. 
					We're actually saving the code to a variable in case we want to draw it more than once.
				*/
				
				if($lastpage > 1){
						if($this->page){
								//anterior button
								if($this->page > 1)
										$this->pagination .= "<a href=\"".$this->get_pagenum_link($prev)."\">$p</a>";
									else
										$this->pagination .= "<span class=\"disabled\">$p</span>";
							}
						//pages	
						if ($lastpage < 7 + ($this->adjacents * 2)){//not enough pages to bother breaking it up
								for ($counter = 1; $counter <= $lastpage; $counter++){
										if ($counter == $this->page)
												$this->pagination .= "<span class=\"current\">$counter</span>";
											else
												$this->pagination .= "<a href=\"".$this->get_pagenum_link($counter)."\">$counter</a>";
									}
							}
						elseif($lastpage > 5 + ($this->adjacents * 2)){//enough pages to hide some
								//close to beginning; only hide later pages
								if($this->page < 1 + ($this->adjacents * 2)){
										for ($counter = 1; $counter < 4 + ($this->adjacents * 2); $counter++){
												if ($counter == $this->page)
														$this->pagination .= "<span class=\"current\">$counter</span>";
													else
														$this->pagination .= "<a href=\"".$this->get_pagenum_link($counter)."\">$counter</a>";
											}
										$this->pagination .= "...";
										$this->pagination .= "<a href=\"".$this->get_pagenum_link($lpm1)."\">$lpm1</a>";
										$this->pagination .= "<a href=\"".$this->get_pagenum_link($lastpage)."\">$lastpage</a>";
									}
								//in middle; hide some front and some back
								elseif($lastpage - ($this->adjacents * 2) > $this->page && $this->page > ($this->adjacents * 2)){
										$this->pagination .= "<a href=\"".$this->get_pagenum_link(1)."\">1</a>";
										$this->pagination .= "<a href=\"".$this->get_pagenum_link(2)."\">2</a>";
										$this->pagination .= "...";
										for ($counter = $this->page - $this->adjacents; $counter <= $this->page + $this->adjacents; $counter++)
											if ($counter == $this->page)
													$this->pagination .= "<span class=\"current\">$counter</span>";
												else
													$this->pagination .= "<a href=\"".$this->get_pagenum_link($counter)."\">$counter</a>";
										$this->pagination .= "...";
										$this->pagination .= "<a href=\"".$this->get_pagenum_link($lpm1)."\">$lpm1</a>";
										$this->pagination .= "<a href=\"".$this->get_pagenum_link($lastpage)."\">$lastpage</a>";
									}
								//close to end; only hide early pages
								else{
										$this->pagination .= "<a href=\"".$this->get_pagenum_link(1)."\">1</a>";
										$this->pagination .= "<a href=\"".$this->get_pagenum_link(2)."\">2</a>";
										$this->pagination .= "...";
										for ($counter = $lastpage - (2 + ($this->adjacents * 2)); $counter <= $lastpage; $counter++)
											if ($counter == $this->page)
													$this->pagination .= "<span class=\"current\">$counter</span>";
												else
													$this->pagination .= "<a href=\"".$this->get_pagenum_link($counter)."\">$counter</a>";
									}
							}
						if($this->page){
								//siguiente button
								if ($this->page < $counter - 1)
										$this->pagination .= "<a href=\"".$this->get_pagenum_link($next)."\">$n</a>";
									else
										$this->pagination .= "<span class=\"disabled\">$n</span>";
									if($this->showCounter)$this->pagination .= "<div class=\"pagination_data\">($this->total_pages Pages)</div>";
							}
					}

				return true;
			}
	}

class wp_pagination_plugin extends pagination{
		function wp_pagination(){

			}

		function get_pagenum_link($pagenum = 1) {
			global $wp_rewrite;
		
			$pagenum = (int) $pagenum;

			if(!is_single())
					$request = remove_query_arg('p');
				else
					$request = '';

			$home_root = parse_url(get_option('home'));
			$home_root = $home_root['path'];
			$home_root = preg_quote( trailingslashit( $home_root ), '|' );

			$request = preg_replace('|^'. $home_root . '|', '', $request);
			$request = preg_replace('|^/+|', '', $request);

			if ( !$wp_rewrite->using_permalinks() || is_admin() ) {
				$base = trailingslashit( get_bloginfo( 'home' ) );
		
				if ( $pagenum > 1 ) {
					$result = add_query_arg( 'paged', $pagenum, $base . $request );
				} else {
					$result = $base . $request;
				}
			} else {
				$qs_regex = '|\?.*?$|';
				preg_match( $qs_regex, $request, $qs_match );

				if ( $qs_match[0] ) {
					$query_string = $qs_match[0];
					$request = preg_replace( $qs_regex, '', $request );
				} else {
					$query_string = '';
				}


				$request = preg_replace( '|page/(.+)/?$|', '', $request);
				$request = preg_replace( '|^index\.php|', '', $request);
				$request = ltrim($request, '/');

				$base = trailingslashit( get_bloginfo( 'url' ) );
		
				if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' != $request ) )
					$base .= 'index.php/';

				if ( $pagenum > 1 ) {
					$request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( 'page/' . $pagenum, 'paged' );
				}

				$result = $base . $request . $query_string;
			}
		
			return $result;
		}


		function show(){
				global $request, $posts_per_page, $wpdb, $paged;

				if(is_single() or is_page()){
						$request = "SELECT count(*) as total FROM wp_posts WHERE 1=1 AND post_type = 'post' AND (post_status = 'publish' OR post_status = 'private') ORDER BY post_date DESC";

						$items = $wpdb->get_results($request);

						$this->Items($items[0]->total);
						$this->limit($posts_per_page);
						$this->currentPage(0);
					}else{
						preg_match('{^(.*)\sLIMIT}siU', $request, $matches);

						$this->Items(count($wpdb->get_results($matches[1])));
						$this->limit($posts_per_page);

						if($paged)
								$this->currentPage($paged);
							else
								$this->currentPage(1);
					}

				if(!$this->calculate)
					if($this->calculate())
						echo "<div class=\"$this->className\">$this->pagination</div>";
			}
	}
?>