<!--

var nav = function(count, query, div, limit, list_limit)
{
	this.limit = limit || 10;
	this.list_limit = list_limit || 20;
	this.count = count;
	this.query = query;
	this.div = div;
	
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	
	this.gethtml = function(from)
	{
		var out ='<div class="nav_all">';
		
		var akt_list = Math.ceil(((from/this.limit)+1)/this.list_limit);
		var start = 1 + ((akt_list-1) * this.list_limit);
		
		var end = start + this.list_limit - 1;
		end = (end > Math.ceil(count/this.limit))? Math.ceil(this.count/this.limit) : end ;
		
		var _L = this.strreplace("#", from - this.limit, this.query);
		var _R = this.strreplace("#", from + this.limit, this.query);
		var _abs_L = this.strreplace("#", ((start - 1) * this.limit) - (this.limit * this.list_limit), this.query);
		var _abs_R = this.strreplace("#", ((start - 1) * this.limit) + (this.limit * this.list_limit), this.query);
		
		if(akt_list != 1)
			out += '<a href="'+_abs_L+'" class="nav">&laquo;&laquo;</a>';
		
		out += '&nbsp;';
	
		if(from != 0)
			out += '<a href="'+_L+'" class="nav">&laquo;</a>';		

		var nrs = new Array();
		var nrone = '';
	
		for(i=start; i <= end; i++)
		{
			nrone = ((i - 1) * this.limit == from)? '<span class="nav_act">'+i+'</span>' : '<a href="'+this.strreplace("#", (i - 1) * this.limit, this.query)+'" class="nav">'+i+'</a>' ;
			nrs.push(nrone);
		}
		
		//out += '&nbsp;&nbsp;';
		out += nrs.join("");
		//out += '&nbsp;&nbsp;';

		if(from + this.limit < this.count)
			out += '<a href="'+_R+'" class="nav">&raquo;</a>';
	
		out += '&nbsp;';
		
		if(end * this.limit < this.count)
			out += '<a href="'+_abs_R+'" class="nav">&raquo;&raquo;</a>';
	
		out += '</div>';
	
		return (start == end)? false : out;		
	}
	
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	
	this.strreplace = function(s1, s2, s3)
	{
		while(s3.indexOf(s1) != -1)
			s3 = s3.replace(s1, s2);
		
		return s3;	
	}
	
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	
	this.write = function(from)
	{
		var str = this.gethtml(from);
		
		if(str)
			document.getElementById(this.div).innerHTML = str;
		else
			document.getElementById(this.div).style.display = 'none';
	}
	
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	
	this.clear = function()
	{
		document.getElementById(this.div).innerHTML = '&nbsp;';
	}	
}

//-->
