Index: pro-violet-viettel/sourcecode/system/libraries/Pagination.php
===================================================================
--- pro-violet-viettel/sourcecode/system/libraries/Pagination.php	(revision 289)
+++ pro-violet-viettel/sourcecode/system/libraries/Pagination.php	(revision 345)
@@ -35,4 +35,5 @@
 	var $num_links			=  2; // Number of "digit" links to show before/after the currently viewed page
 	var $cur_page			=  0; // The current page being viewed
+        var $current_page	        =  0;
 	var $use_page_numbers	= FALSE; // Use page number for segment instead of offset
 	var $first_link			= '&lsaquo; First';
@@ -59,4 +60,5 @@
 	var $query_string_segment = 'per_page';
 	var $display_pages		= TRUE;
+        var $ajax_class		= '';
 	var $anchor_class		= '';
 
@@ -100,4 +102,5 @@
 				{
 					$this->$key = $val;
+                                        
 				}
 			}
@@ -162,4 +165,11 @@
 				$this->cur_page = (int) $this->cur_page;
 			}
+                        
+                       
+                        if ($this->current_page)
+			{
+                		// Prep the current page - no funny business!
+				$this->cur_page = (int) $this->current_page;
+			}
 		}
 		
@@ -229,5 +239,5 @@
 		{
 			$first_url = ($this->first_url == '') ? $this->base_url : $this->first_url;
-			$output .= $this->first_tag_open.'<a '.$this->anchor_class.'href="'.$first_url.'">'.$this->first_link.'</a>'.$this->first_tag_close;
+			$output .= $this->first_tag_open.'<a class ="'.$this->ajax_class.'"'.$this->anchor_class.'href="'.$first_url.'">'.$this->first_link.'</a>'.$this->first_tag_close;
 		}
 
@@ -246,10 +256,10 @@
 			if ($i == 0 && $this->first_url != '')
 			{
-				$output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href="'.$this->first_url.'">'.$this->prev_link.'</a>'.$this->prev_tag_close;
+				$output .= $this->prev_tag_open.'<a class ="'.$this->ajax_class.'"'.$this->anchor_class.'href="'.$this->first_url.'">'.$this->prev_link.'</a>'.$this->prev_tag_close;
 			}
 			else
 			{
 				$i = ($i == 0) ? '' : $this->prefix.$i.$this->suffix;
-				$output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$i.'">'.$this->prev_link.'</a>'.$this->prev_tag_close;
+				$output .= $this->prev_tag_open.'<a class ="'.$this->ajax_class.'"'.$this->anchor_class.'href="'.$this->base_url.$i.'">'.$this->prev_link.'</a>'.$this->prev_tag_close;
 			}
 
@@ -283,5 +293,5 @@
 						if ($n == '' && $this->first_url != '')
 						{
-							$output .= $this->num_tag_open.'<a '.$this->anchor_class.'href="'.$this->first_url.'">'.$loop.'</a>'.$this->num_tag_close;
+							$output .= $this->num_tag_open.'<a class ="'.$this->ajax_class.'"'.$this->anchor_class.'href="'.$this->first_url.'">'.$loop.'</a>'.$this->num_tag_close;
 						}
 						else
@@ -289,5 +299,5 @@
 							$n = ($n == '') ? '' : $this->prefix.$n.$this->suffix;
 
-							$output .= $this->num_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$n.'">'.$loop.'</a>'.$this->num_tag_close;
+							$output .= $this->num_tag_open.'<a class ="'.$this->ajax_class.'"'.$this->anchor_class.'href="'.$this->base_url.$n.'">'.$loop.'</a>'.$this->num_tag_close;
 						}
 					}
@@ -296,5 +306,5 @@
 		}
 
-		// Render the "next" link
+			
 		if ($this->next_link !== FALSE AND $this->cur_page < $num_pages)
 		{
@@ -307,6 +317,6 @@
 				$i = ($this->cur_page * $this->per_page);
 			}
-
-			$output .= $this->next_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$this->prefix.$i.$this->suffix.'">'.$this->next_link.'</a>'.$this->next_tag_close;
+                        
+                        $output .= $this->next_tag_open.'<a  class ="'.$this->ajax_class.'"'.$this->anchor_class.'href="'.$this->base_url.$this->prefix.$i.$this->suffix.'">'.$this->next_link.'</a>'.$this->next_tag_close;
 		}
 
@@ -322,5 +332,5 @@
 				$i = (($num_pages * $this->per_page) - $this->per_page);
 			}
-			$output .= $this->last_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$this->prefix.$i.$this->suffix.'">'.$this->last_link.'</a>'.$this->last_tag_close;
+			$output .= $this->last_tag_open.'<a class ="'.$this->ajax_class.'"'.$this->anchor_class.'href="'.$this->base_url.$this->prefix.$i.$this->suffix.'">'.$this->last_link.'</a>'.$this->last_tag_close;
 		}
 
@@ -331,5 +341,4 @@
 		// Add the wrapper HTML if exists
 		$output = $this->full_tag_open.$output.$this->full_tag_close;
-
 		return $output;
 	}
