function Pagination(overall,from,step,numbers_in_pagination,count,onClick,targetFilter,ignoreMove,ignoreSearch1,ignoreSearch2,quadrantsearch){
	
	this.overall = parseInt(overall); //how many earthfaves found in the db for this search
	this.from = parseInt(from); // from ist beim erstem aufruf = 1
	this.step = parseInt(step); // how many efs on one page
	this.numbers_in_pagination = parseInt(numbers_in_pagination); // how many numbers in the pagination
	this.count = parseInt(count); // count the efs array size
	this.onClick = onClick; // welche  funktion soll spaeter ausgef�hrt werden
	this.targetFilter = targetFilter; // beschreibt genauer was bei der suche gemacht werden soll
	this.ignoreMove = ignoreMove; // wird das moveMap ereigniss bearbeitet
	this.ignoreSearch1 = ignoreSearch1; // wird eingabefeld 1 bei der suche beruecksichtigt
	this.ignoreSearch2 = ignoreSearch2; // wird eingabefeld 2 bei der suche beruecksichtigt
	this.quadrantsearch = quadrantsearch; // wird imquadrant gesucht

}
Pagination.prototype.createPagination = function(){
// funktionen die unterstuetzt werden muessen:
// function lookupPeople(param,name,address,from,to,paginationStep,order) -> einfache flache user-thumb-liste bei zb people
// function showUser( restriktionString, from, maxUser) -> zeigt die comments auf der efHome
// um zu entscheiden welche funktion hier aufgerufen wird hab ich der einfachheit haber ein variable this.onClick erzeugt
// bei einer pagination fuer efs wird sie auf "earthfave" gesetzt. hier mache ich dann ein switch(this.onClick) und 
// entscheide im case welche funktion ich aufrufe. Sicher nicht schoen aber erstmal eine schnelle loesung.
// function lookupEarthfaves(filter, from, maximum , ignoreMove, quadrantsearch): string,int,int,bool,bool
// nummer des letzten efs in der aktuellen page. 
// bsp: from ist 20 und myTo ist 40. Dann ist der letzte ef der 40. dieser page
//
 	info("pagination ########## pagination ############### pagination ############# pagination ##########");
	var myTo = 0;
	if( this.from + this.count < this.overall ) { myTo = this.from + this.count -1; } 	else { myTo = this.overall; }
	var pages = Math.ceil(this.overall / this.step); // so viele pages insgesammt
	var currentPage = Math.ceil(this.from / this.step); // da bin ich grade in der pagination
	var pagination = "";
	//info("Zeige " + this.count + " Treffer von " + this.from + " bis " + myTo + "; Gesamt: " + this.overall + " pages :" + pages + " currentpage:" + currentPage);
	var startPagination = currentPage - (( this.numbers_in_pagination - 1 ) / 2 ) ;
	//info("pagination zusammebau: SETZE START LINKS BEI: " + startPagination);
	if ( startPagination > pages - this.numbers_in_pagination) {
		startPagination  = pages - this.numbers_in_pagination;
		//info("pagination zusammebau: SETZE START LINKS BEI: " + startPagination);
	}	
	if ( startPagination < 1 ) {	startPagination  = 1; }	//info("pagination zusammebau: SETZE START LINKS BEI: " + startPagination);
	// wieviele zahlen wollen in der pagination gezeigt werden
	// nicht mehr als this.numbers_in_pagination
	var endPagination = pages;
	if ( this.numbers_in_pagination < endPagination ) { endPagination = startPagination + this.numbers_in_pagination ; }
	//info("pagination zusammebau: START LINKS BEI: " + startPagination + " ENDE: " + endPagination);
	if ( endPagination > startPagination ) { //daniel 2009 07 08 I dont show any pagination if there is only one page
		var pagination = '<ul><li class="label">Page:</li>';// Startpfeil
		if (this.from > this.step + 1) {
			//info("pagination case:" + this.onClick + " this.from > this.step + 1");
			pagination += '<li class="pagination-icon"><a href="#" ';
			switch(this.onClick){
				case 'earthfaves':	
				pagination += 'onClick="lookupEarthfaves(\'' + this.targetFilter + '\', 1, ' + this.step + ',' + this.ignoreMove + ',' + this.ignoreSearch1 + ',' + this.ignoreSearch2 + ',' + this.quadrantsearch + ');"';
				pagination += ' style="background-image:url(' + global.IMG_URL_NONTEXT + 'icons/start.gif);"';
				break;	
				case 'people':
				pagination += 'onClick="lookupPeople(\'' + this.targetFilter + '\',\'\',\'\',1,' + this.overall + ',' + this.step + ',\'byName\');"';
				pagination += ' style="background-image:url(' + global.IMG_URL_NONTEXT + 'icons/start.gif);"';
				break;
				case 'companies':
				pagination += 'onClick="lookupCompanies(\'' + this.targetFilter + '\',\'\',\'\',1,' + this.overall + ',' + this.step + ',\'byName\');"';
				pagination += ' style="background-image:url(' + global.IMG_URL_NONTEXT + 'icons/start.gif);"';
				break;
                case 'BusinessStats':
                pagination += 'onClick="openThisBusiEfOptionRequest(\'' + this.targetFilter + '\', 1,' + this.overall + ',' + this.step + ');"';
                pagination += ' style="background-image:url(' + global.IMG_URL_NONTEXT + 'icons/start.gif);"';
                break;
			}
			pagination += '>&nbsp;</a></li>';
		}
		if (this.from > 1) {//backpfeil
			//info("pagination case:" + this.onClick + " this.from > 1");
			var prevFrom = this.from - this.step;
			pagination += '<li class="pagination-icon"><a href="#" onClick="';
			switch(this.onClick){
				case 'earthfaves':
				pagination += 'lookupEarthfaves(\'' + this.targetFilter + '\','+ prevFrom + ',' + parseInt( prevFrom + this.step ) + ',' +  this.ignoreMove + ',' + this.ignoreSearch1 + ',' + this.ignoreSearch2 + ',' + this.quadrantsearch +');"';
				pagination += ' style="background-image:url('+ global.IMG_URL_NONTEXT + 'icons/back.gif);">&nbsp;</a></li>';
				break;					
				case 'people':						
				pagination += 'lookupPeople(\'' + this.targetFilter + '\',\'\',\'\',' +  prevFrom + ',' + this.overall + ',' + this.step + ',\'byName\');"';
				pagination += ' style="background-image:url('+  global.IMG_URL_NONTEXT + 'icons/back.gif);">&nbsp;</a></li>';
				break;
				case 'companies':						
				pagination += 'lookupCompanies(\'' + this.targetFilter + '\',\'\',\'\',' +  prevFrom + ',' + this.overall + ',' + this.step + ',\'byName\');"';
				pagination += ' style="background-image:url('+  global.IMG_URL_NONTEXT + 'icons/back.gif);">&nbsp;</a></li>';
				break;
                case 'BusinessStats':
                pagination += 'openThisBusiEfOptionRequest(\'' + this.targetFilter + '\',' +  prevFrom + ',' + this.overall + ',' + this.step + ');"';
                pagination += ' style="background-image:url('+  global.IMG_URL_NONTEXT + 'icons/back.gif);">&nbsp;</a></li>';
                break;
				
			}	
		}
		for (var i =  startPagination ; i <=  endPagination  ; i++) 
			if ((i-1) * this.step == this.from - 1) {	pagination += '<li class="selected">' + i + '</li>';}			//page 1 not clickable
			else {
				var nextFrom = (i-1) * this.step + 1;
				pagination += '<li><a href="#" ';
				switch(this.onClick){
					case 'earthfaves':
					pagination += 'onClick="lookupEarthfaves(\'' + this.targetFilter + '\',' + nextFrom	+ ',' + this.step + ',' + this.ignoreMove + ',' + this.ignoreSearch1 + ',' + this.ignoreSearch2 + ',' + this.quadrantsearch + ');">' + (i) + '</a></li>';
					break;			
					case 'people':
					pagination += 'onClick="lookupPeople(\'' + this.targetFilter + '\',\'\',\'\',' +  nextFrom + ',' + this.overall + ',' + this.step + ',\'byName\');">' +  (i) + '</a></li>';
					break;
					case 'companies':
					pagination += 'onClick="lookupCompanies(\'' + this.targetFilter + '\',\'\',\'\',' +  nextFrom + ',' + this.overall + ',' + this.step + ',\'byName\');">' +  (i) + '</a></li>';
					break;
                    case 'BusinessStats':
                    pagination += 'onClick="openThisBusiEfOptionRequest(\'' + this.targetFilter + '\',' +  nextFrom + ',' + this.overall + ',' + this.step + ');">' +  (i) + '</a></li>';
                    break;
				}	
			}
		
		if ((this.overall - 1) > myTo) { // next pfeil
			//info("pagination case:" + this.onClick + " this.overall - 1) > myTo");
			var nextFrom = parseInt(this.from + this.step);
			pagination += '<li class="pagination-icon"><a href="#" ';
			switch(this.onClick){
				case 'earthfaves':
				pagination += ' onClick="lookupEarthfaves(\'' + this.targetFilter + '\','	+ nextFrom + ',' 	+ this.step + ',' +  this.ignoreMove + ',' + this.ignoreSearch1 + ',' + this.ignoreSearch2 + ',' + this.quadrantsearch +');"';
				break;		
				case 'people':
					pagination += 'onClick="lookupPeople(\'' + this.targetFilter + '\',\'\',\'\',' +  nextFrom + ',' + this.overall + ',' + this.step + ',\'byName\');"';
				break;
				case 'companies':
					pagination += 'onClick="lookupCompanies(\'' + this.targetFilter + '\',\'\',\'\',' +  nextFrom + ',' + this.overall + ',' + this.step + ',\'byName\');"';
				break;
                case 'BusinessStats':
					pagination += 'onClick="openThisBusiEfOptionRequest(\'' + this.targetFilter + '\',' +  nextFrom + ',' + this.overall + ',' + this.step + ');"';
				break;
			}	
			pagination +=' style="background-image:url(\''+ global.IMG_URL_NONTEXT + 'icons/next.gif\')">&nbsp;</a></li>';
		}
		

	
	if ((this.overall - 1) > (myTo + this.step)) {// Ende Pfeil
			//info("pagination case:" + this.onClick + " (this.overall - 1) > (myTo + this.step)");
			var nextFrom = (Math.ceil(this.overall / this.step) - 1)	* this.step + 1;
			pagination += '<li class="pagination-icon"><a href="#" ';
			switch(this.onClick){
				case 'earthfaves':
				pagination += ' onClick="lookupEarthfaves(\'' + this.targetFilter + '\',' + nextFrom + ',' + parseInt(nextFrom + this.step) + ',' + this.ignoreMove + ',' + this.ignoreSearch1 + ',' + this.ignoreSearch2 + ',' + this.quadrantsearch +');"';
				break;			
				case 'people':
				pagination += 'onClick="lookupPeople(\'' + this.targetFilter + '\',\'\',\'\',' +  nextFrom + ',' + this.overall + ',' + this.step + ',\'byName\');"';
				break;
				case 'companies':
				pagination += 'onClick="lookupCompanies(\'' + this.targetFilter + '\',\'\',\'\',' +  nextFrom + ',' + this.overall + ',' + this.step + ',\'byName\');"';
				break;
                case 'BusinessStats':
				pagination += 'onClick="openThisBusiEfOptionRequest(\'' + this.targetFilter + '\',' +  nextFrom + ',' + this.overall + ',' + this.step + ');"';
				break;
			}	
			pagination +=' style="background-image:url(\''+ global.IMG_URL_NONTEXT + 'icons/end.gif\')">&nbsp;</a></li>';		
		}
		pagination +='</ul>';
	}
	

	
	if( document.getElementById('result-title-search') )
		document.getElementById('result-title-search').innerHTML = "Your search: " + global.search1 + " " + global.search2 ;
	if( document.getElementById('toolBarTop') )
		document.getElementById('toolBarTop').style.display = "block";
	if( document.getElementById('result-pagination') )
		document.getElementById('result-pagination').innerHTML = pagination;
	if( document.getElementById('result-title') )
		document.getElementById('result-title').innerHTML = 'Results ' + this.from + '-' + myTo + ' of ' + this.overall;
	
	
	if( document.getElementById('toolBarBottom') )
		document.getElementById('toolBarBottom').style.display = "block";
	if( document.getElementById('result-title-bottom') )
		document.getElementById('result-title-bottom').innerHTML = 'Results ' + this.from + '-' + myTo + ' of ' + this.overall;
	if( document.getElementById('result-pagination-bottom') )
		document.getElementById('result-pagination-bottom').innerHTML = pagination;
	pointTopLeft = null;
	pointDownRight = null;
	//info("pagination ende .. pagination ende ....... pagination ende ");
}