function Pagination(overall,from,name,address,step,numbers_in_pagination,count,onClick,targetFilter,ignoreMove,ignoreSearch1,ignoreSearch2,quadrantsearch){
	// numbers of parameter = 13
	this.overall = parseInt(overall); //how many earthfaves found in the db for this search WITHOUT LIMIT
	this.from = parseInt(from); // from ist beim erstem aufruf = 1
	this.name = name; // in people search if you need the name
	this.address = address; // use in people search if needed
	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 are the countet results from the ajax request WITH LIMIT
	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
//
 	console.log("pagination ########## pagination ############### pagination ############# pagination ##########");
	console.log("...............................................................................................");
	
	
	var cLog = true;
	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 = "";	var params="";
	var startPagination = currentPage - (( this.numbers_in_pagination - 1 ) / 2 ) ;
	if ( startPagination > pages - this.numbers_in_pagination) {	startPagination  = pages - this.numbers_in_pagination;}	
	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
	console.log("...onClick: " + this.onClick + " ...from " + this.from + " ....to " + myTo + " ....step " + this.step + " ...numbers_in_pagination " + this.numbers_in_pagination + " ... overall " + this.overall + " ... pages " + pages + " ...");
	
	var endPagination = pages;
	if ( this.numbers_in_pagination < endPagination ) { endPagination = startPagination + this.numbers_in_pagination ; }
	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) {
			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 + ');return false;"';
				break;	
				case 'people':
				pagination += 'onClick="lookupPeople(\'' + this.targetFilter + '\',\'' + this.name+ '\',\'' + this.address + '\',1,' + this.overall + ',' + this.step + ',\'byName\');return false;"';
				break;
				case 'companies':
				pagination += 'onClick="lookupCompanies(\'' + this.targetFilter + '\',\'\',\'\',1,' + this.overall + ',' + this.step + ',\'byName\');return false;"';
				break;
				case 'BusinessStats':
				var optA = this.targetFilter.split("---");
				var opt = optA[1];
        var div = 'result_list_' + opt;
				pagination += 'onClick="getDiv(\'' + div + '\').innerHTML=\'\';openThisBusiEfOptionRequest(\'' + this.targetFilter + '\', 1,' + this.overall + ',' + this.step + ');return false;"';
				break;
				case 'places':
				pagination += 'onClick="lookupPlaces2(1,' + this.ignoreMove + ',' + this.quadrantsearch + ',1);return false;"';
				break;
				case 'showUserKickbacks':					
				pagination += 'onClick="showUserKickbacks('+this.targetFilter+', ' + 1 + ', ' + this.step + ');return false;"';
				break;
				case 'MyContributions':					
				pagination += 'onClick="MyContributions('+ this.targetFilter +', ' + 1 + ', ' + 1 + ');return false;"';
				break;
			}
			pagination += ' style="background-image:url(' + global.IMG_URL_NONTEXT + 'icons/start.gif);">&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 +');return false;"';
				break;					
				case 'people':						
				pagination += 'lookupPeople(\'' + this.targetFilter + '\',\'' + this.name + '\',\'' + this.address + '\',' +  prevFrom + ',' + this.overall + ',' + this.step + ',\'byName\');return false;"';
				break;
				case 'companies':						
				pagination += 'lookupCompanies(\'' + this.targetFilter + '\',\'\',\'\',' +  prevFrom + ',' + this.overall + ',' + this.step + ',\'byName\');return false;"';
				break;
				case 'BusinessStats':
				var optA = this.targetFilter.split("---");
				var opt = optA[1];
				var div = 'result_list_' + opt;
				pagination += ' getDiv(\'' + div + '\').innerHTML=\'\'; openThisBusiEfOptionRequest(\'' + this.targetFilter + '\',' +  prevFrom + ',' + this.overall + ',' + this.step + ');return false;"';
				break;
				case 'places':
				pagination += 'lookupPlaces2(' + prevFrom + ',' + this.ignoreMove + ',' + this.quadrantsearch + ',1);return false;"';
				break;
				case 'showUserKickbacks':			
				pagination += 'showUserKickbacks('+this.targetFilter+', ' + prevFrom + ', ' + this.step + ');return false;"';
				break;	
				case 'MyContributions':					
				pagination += 'MyContributions('+ this.targetFilter +', ' + prevFrom + ', ' + prevFrom + ');return false;"';
				break;
			}	
			pagination += ' style="background-image:url(' + global.IMG_URL_NONTEXT + 'icons/back.gif);">&nbsp;</a></li>';
		}
		console.log("...position 3");
		var cssClass;
		//console.log("pagination.js filter : " + this.targetFilter.substring(0,4));
		for (var i =  startPagination ; i <=  endPagination  ; i++) 
				if ((i-1) * this.step == this.from - 1) {
					// nur wenn user eingeloggt und NICHT auf einer userHome
					if(cLog){console.log("....Pagination.prototype.createPagination  targetFilter : " + this.targetFilter + " .... ");}
					if(this.targetFilter.substring(0,4) == "MINE" && global.user_id != 1 && get.page_id != "user" && !myEarthfavesLeftMenu){ cssClass = "selected_white"; }
					else { cssClass = "selected"; }
					pagination += '<li class="' + cssClass + '">' + i + '</li>';		
				}			//page 1 not clickable
				else {
					var nextFrom = (i-1) * this.step + 1;
					if(this.targetFilter.substring(0,4) == "MINE" && global.user_id != 1 && get.page_id != "user" && !myEarthfavesLeftMenu){ cssClass = "liRListeNonActive_white"; } // nur wenn user eingeloggt !!
					else { cssClass = "liRListeNonActive"; }
					//console.log("......li-classe "+cssClass);
					pagination += '<li class="' + cssClass + '" ><a href="#!/people" ';
					//console.info("nextFrom "+nextFrom);
					switch(this.onClick){
						case 'earthfaves':
						pagination += 'onClick="consoleClear();lookupEarthfaves(\'' + this.targetFilter + '\',' + nextFrom	+ ',' + this.step + ',' + this.ignoreMove + ',' + this.ignoreSearch1 + ',' + this.ignoreSearch2 + ',' + this.quadrantsearch + ');return false;">' + (i) + '</a></li>';
						break;			
						
						case 'people':
						pagination += 'onClick="'; 
						pagination += 'consoleClear();lookupPeople(\'' + this.targetFilter + '\',\''+ this.name +'\',\''+this.address+'\',' +  nextFrom + ',' + this.overall + ',' + this.step + ',\'byName\');';
					
						//function lookupPeople(param,name,address,from,to,paginationStep,order)
						params = '&targetFilter=' +  this.targetFilter + '&name= &addresse= &fom=' + nextFrom + '&to=' + this.overall + '&paginationStep=' + this.step + '&order=byName';
						pagination += ' bookmarks.sethash(\'#page=people&ajax=lookupPeople' + params + '\',false);return false;';
						// false = nicht beim setzen direkt checken !!!
						pagination +='">' +  (i) + '</a></li>';
						break;
						
						case 'companies':
						pagination += 'onClick="lookupCompanies(\'' + this.targetFilter + '\',\'\',\'\',' +  nextFrom + ',' + this.overall + ',' + this.step + ',\'byName\');return false;">' +  (i) + '</a></li>';
						break;
					 
						case 'BusinessStats':
						//daniel mach div leer, damit in openThisBusiEfOptionRequest direkt geladen wird und nicht nach der Zeit geschaut wird !!!
						var optA = this.targetFilter.split("---");
						var opt = optA[1];
						var div = 'result_list_' + opt;
						pagination += 'onClick="getDiv(\'' + div + '\').innerHTML=\'\';openThisBusiEfOptionRequest(\'' + this.targetFilter + '\',' +  nextFrom + ',' + this.overall + ',' + this.step + ');return false;">' +  (i) + '</a></li>';
						break;
						
						case 'places':
						pagination += 'onClick="lookupPlaces2('+nextFrom+','+this.ignoreMove+','+this.quadrantsearch+ ',1);return false;">' + (i) + '</a></li>';
						break;
						
						case 'showUserKickbacks':					
						pagination += 'onClick="showUserKickbacks('+this.targetFilter+', ' +nextFrom + ', ' + this.step + ');return false;">' + (i) + '</a></li>';
						break;
						
						case 'MyContributions':					
						pagination += 'onClick="MyContributions('+ this.targetFilter +',1,' + nextFrom + ');return false;">' + (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 +');return false;"';
					break;		
					case 'people':
						pagination += 'onClick="lookupPeople(\'' + this.targetFilter + '\',\'' + this.name + '\',\''+ this.address +'\',' +  nextFrom + ',' + this.overall + ',' + this.step + ',\'byName\');return false;"';
					break;
					case 'companies':
						pagination += 'onClick="lookupCompanies(\'' + this.targetFilter + '\',\'\',\'\',' +  nextFrom + ',' + this.overall + ',' + this.step + ',\'byName\');return false;"';
					break;
						case 'BusinessStats':
						var optA = this.targetFilter.split("---");
						var opt = optA[1];
						var div = 'result_list_' + opt;
						pagination += 'onClick="getDiv(\'' + div + '\').innerHTML=\'\';openThisBusiEfOptionRequest(\'' + this.targetFilter + '\',' +  nextFrom + ',' + this.overall + ',' + this.step + ');return false;"';
					break;
					case 'places':
					pagination += 'onClick="lookupPlaces2('+nextFrom+','+this.ignoreMove+','+this.quadrantsearch+ ',1);return false;"';
					break;
					case 'showUserKickbacks':
					pagination += 'onClick="showUserKickbacks('+this.targetFilter+', ' +nextFrom + ', ' + this.step + ');return false;"';
					break;
						
					case 'MyContributions':					
					pagination += 'onClick="MyContributions('+ this.targetFilter +', ' + nextFrom + ', ' + nextFrom + ');return false;"';
					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 +');return false;"';
					break;			
					case 'people':
					pagination += 'onClick="lookupPeople(\'' + this.targetFilter + '\',\'' + this.name + '\',\''+ this.address + '\',' +  nextFrom + ',' + this.overall + ',' + this.step + ',\'byName\');return false;"';
					break;
					case 'companies':
					pagination += 'onClick="lookupCompanies(\'' + this.targetFilter + '\',\'\',\'\',' +  nextFrom + ',' + this.overall + ',' + this.step + ',\'byName\');return false;"';
					break;
					case 'BusinessStats':
					var optA = this.targetFilter.split("---");
					var opt = optA[1];
					var div = 'result_list_' + opt;
					pagination += 'onClick="getDiv(\'' + div + '\').innerHTML=\'\';openThisBusiEfOptionRequest(\'' + this.targetFilter + '\',' +  nextFrom + ',' + this.overall + ',' + this.step + ');return false;"';
					break;
					case 'places':
					pagination += 'onClick="lookupPlaces2('+nextFrom+','+this.ignoreMove+','+this.quadrantsearch+',1);return false;"';
					break;
					case 'showUserKickbacks':
					pagination += 'onClick="showUserKickbacks('+this.targetFilter+', ' +nextFrom + ', ' + this.step + ');return false;"';
					break;
						
					case 'MyContributions':					
					pagination += 'onClick="MyContributions('+ this.targetFilter +', ' + nextFrom + ', ' + nextFrom + ');return false;"';
					break;
				}	
				pagination +=' style="background-image:url(\''+ global.IMG_URL_NONTEXT + 'icons/end.gif\');">&nbsp;</a></li>';		
			}
			pagination +='</ul>';
	} else {
				//console.log("NO PAGINATION !");
	}
  
	if(getDiv("toolBarBottom")){showDiv('toolBarBottom');}
	
	//console.log("pag pos 1");
	
	if( getDiv('result-title-search') ){
				if (!(global.search1=='' && global.search2=='' )){
					getDiv('result-title-search').innerHTML = "" ; //YOU SEARCH ist nicht mehr nötig!! 4.08.2010 Anna
			//		document.getElementById('result-title-search').innerHTML = "Your search: " + global.search1 + " " + global.search2 ;
				} else { getDiv('result-title-search').innerHTML = " ";}
				
				if( this.count <= 0) {getDiv('result-title-search').innerHTML = " ";}
	};
	if( getDiv('toolBarTop') ){showDiv('toolBarTop');}
	if( getDiv('result-pagination') ){		getDiv('result-pagination').innerHTML = pagination;}
		
	if( getDiv('result-title') ){
			if(this.overall > 0){		getDiv('result-title').innerHTML = 'Results ' + this.from + '-' + myTo + ' of ' + this.overall;}
			else { 
				getDiv('result-title').innerHTML = '';
				getDiv('result-pagination-bottom').innerHTML = '';
			}
	};
		
		//	console.log("pag pos 2 !");
		
		if( getDiv('toolBarBottom')){ 
				if( getDiv('result-title-bottom')){ 
						if( this.count > 0) {	getDiv('result-title-bottom').innerHTML = 'Results ' + this.from + '-' + myTo + ' of ' + this.overall;}
						else { getDiv('result-title-bottom').innerHTML = " ";}
				}
		}
		//	console.log("pag pos 3 !");
		if( pages > 1){
			  if( getDiv('toolBarBottom')){ 
						showDiv('toolBarBottom');
						if( getDiv('result-pagination-bottom')){ getDiv('result-pagination-bottom').innerHTML = pagination;}
				}
		} else {
			//	console.log("pag pos 4 !");
				if( getDiv('result-pagination-bottom')){ getDiv('result-pagination-bottom').innerHTML = "";}
			//	console.log("pag pos 4.0 !");
				/* auskommentiert da Daniel nicht versteht was das soll
				if(myEarthfavesLeftMenu){
					console.log("pag pos 4.0.1 !");
					if(getDiv("toolBarTop")){hideDiv('toolBarTop');}
					if(getDiv("toolBarBottom")){hideDiv('toolBarBottom');}
				}*/
				//console.log("pag pos 4.1 !");
		}
			//console.log("pag pos 5 !");
	
		
		pointTopLeft = null;
		pointDownRight = null;
		console.log("pagination ende");
}
