Array.prototype.max = function() {
	var max = this[0];
	var len = this.length;
	for (var i = 1; i < len; i++) if (this[i] > max) max = this[i];
	return max;
}

function strona(val,kat,desc)
{
	if(desc=='katalog') { self.location=('katalog-s\''+val); }
	else { self.location=('katalog-'+kat+','+val); }
}

function page(val,opt)
{
	if(opt)
	{
		if(opt=='usun')
		{
			if(confirm('Czy napewno chcesz usunąć tę pozycję z bazy?') ) 
			  { 
			  page(val); 
			  }
		}
	}
	else { self.location=(val); }
}