/**
 *	Die Klasse Earthfave und ihre Methoden
 *
 */
EarthfaveEFHomeBookingProcess = function(object) //Bookmarken von ef ausgehend von efHome klappt mit dem AddWizard nicht
{
	this.id = object.id; // id
	this.lat = object.lat; // latitude	
	this.lng = object.lng; // longitude	
	this.name = object.name; // ef name
	this.internName = object.iName; // ef intern name
	this.overview = object.wO; // neuer name der Spalte in DB
	
	this.comment = ""; // faelt raus wegen neuer DB struktur !!!
	this.suggestions = "";  // faelt raus wegen neuer DB struktur !!!
	
	this.address1 = object.addr1; // addresse 1
	if(object.street){this.address1 = object.street;} // das object kann auch ein place sein und dort heist es street !!!
	
	this.city = object.city; // insel Name
	this.postalCode = object.zip; // plz
	this.countryName = object.couN; // country name
	this.countryId = object.couId; //country id
	this.continentName = object.conN; // continent name
	
	this.continentId = object.conId; // continent id
	this.admin1Name = object.adm1N; // admin 1 Name
	this.admin1Id = object.adm1Id; // admin 1 id
	this.islandName = object.isN; // insel Name
	this.discovererName = object.diN; // DISC Name
	this.discovererId = object.diId; // DISC id
	this.discovererRank = object.diRank; // der Rank des DISC
	this.levelOfExpertise = object.lOfExp; // der level of expertise
	this.relationship = object.rel; // user erthfave realtionsshiop zb user can bookmark, is owner, or is nothing
	this.catId0 = object.catId0; // die erste Kat0 id
	this.catId1 = object.catId1; // die erste Kat0 id
	this.catId2 = object.catId2; // die erste Kat0 id
	this.catId3 = object.catId3; // die erste Kat0 id
	this.catName0 = object.catName0; // die erste Kat0 id	
	this.catName1 = object.catName1; // die erste Kat0 id
	this.catName2 = object.catName2; // die erste Kat0 id
	this.catName3 = object.catName3; // die erste Kat0 id
		
	this.properties = object.prop; // ein string mit komma getrennten propertys
	this.tags = "";
	this.media = object.media; // das Bild fuer RListe
	this.numberOfBooker = object.nOfB; // die anzahl der booker
	this.numberBookmarkingFriends = object.nofBF; // bookmarker die freunde sind
	this.numberBookmarkingFF = object.nofBFF; // bookmarker die freundes freunde  sind
	this.numberBookmarkingOthers = object.nofBO; // other Booker
	this.status = object.status; // other Booker
	this.clusterId = object.clid;
}
 
 

/**
 * Konstruktor
 */
Earthfave = function(object)
{
	// Markus: Daniel, laß doch hier bitte für das Objekt erthfave vernünftige Namen, übergeben werden doch die Membernamen von **object**!!!
	// Die hab ich teilweise schon gekürzt (in ajax/lookupEarthfaves.php). Da kannst Du gerne kürzen, aber bitte nicht hier ;-)
	this.id = object.id; // id
	this.lat = object.lat; // latitude	
	this.lng = object.lng; // longitude	
	this.name = object.name; // ef name
	this.internName = object.iName; // ef intern name
	this.overview = object.wO; // neuer name der Spalte in DB
	
	this.comment = ""; // faelt raus wegen neuer DB struktur !!!
	this.suggestions = "";  // faelt raus wegen neuer DB struktur !!!
	
	this.address1 = object.addr1; // addresse 1
	if(object.street){this.address1 = object.street;} // das object kann auch ein place sein und dort heist es street !!!
	
	this.city = object.city; // insel Name
	this.postalCode = object.zip; // plz
	this.countryName = object.couN; // country name
	this.countryId = object.couId; //country id
	this.continentName = object.conN; // continent name
	
	this.continentId = object.conId; // continent id
	this.admin1Name = object.adm1N; // admin 1 Name
	this.admin1Id = object.adm1Id; // admin 1 id
	this.islandName = object.isN; // insel Name
	this.discovererName = object.diN; // DISC Name
	this.discovererId = object.diId; // DISC id
	this.discovererRank = object.diRank; // der Rank des DISC
	this.levelOfExpertise = object.lOfExp; // der level of expertise
	this.relationship = object.rel; // user erthfave realtionsshiop zb user can bookmark, is owner, or is nothing
	this.catId0 = object.catId0; // die erste Kat0 id
	this.catId1 = object.catId1; // die erste Kat0 id
	this.catId2 = object.catId2; // die erste Kat0 id
	this.catId3 = object.catId3; // die erste Kat0 id
	this.catName0 = object.catName0; // die erste Kat0 id	
	this.catName1 = object.catName1; // die erste Kat0 id
	this.catName2 = object.catName2; // die erste Kat0 id
	this.catName3 = object.catName3; // die erste Kat0 id
		
	this.properties = object.prop; // ein string mit komma getrennten propertys
	this.tags = "";
	this.media = object.media; // das Bild fuer RListe
	this.numberOfBooker = object.nOfB; // die anzahl der booker
	this.numberBookmarkingFriends = object.nofBF; // bookmarker die freunde sind
	this.numberBookmarkingFF = object.nofBFF; // bookmarker die freundes freunde  sind
	this.numberBookmarkingOthers = object.nofBO; // other Booker
	this.status = object.status; // other Booker
	this.clusterId = object.clid;
	//27

}



/**
 * Erzeugt den HTML-Code f?r den earthfave-Marker auf der Karte
 */
Earthfave.prototype.asMarker = function (markerId)
{
	var text = '<p><b>' + this.name + '</b></p><br>';

	if (global.userGroup == 1 && global.showAdminInformation == true){
		text += '<b>admininfo:</b><br><font style="font-size:10px;">';
		text +=  ' lat:' + this.lat + ' lng:' + this.lng +  '#id: ' + this.id + '</font>';
	}

	var tableBegin = "<table border=\"0\">";
	var linkToMyEF = "";

	var zoomToEF = "<tr>"+
	"<td align=\"center\" valign=\"middle\"><a href=\"javascript:Map.centerMarker(" + markerId + "); closeFilter();\"><img src=" + zoomCenterImage + " /></a></td>"+
	"<td align=\"left\" valign=\"middle\"><a href=\"javascript:Map.centerMarker(" + markerId + "); closeFilter();\">Zoom & Center</a></td>"+
	"</tr>";

	if (user != 'Guest') {
		if (get.page_id != "access_extern") {
			if (this.hasBookedDisc == 1) {
				linkToMyEF = "<tr>"
				+	"<td align=\"center\" valign=\"middle\"><a href=\"javascript:showBookmarkWizard(" + this.id + ", EFBookmarked);\"><img src=" + addToMyEF + " /></a></td>"
				+	"<td align=\"left\" valign=\"middle\"><a href=\"javascript:showBookmarkWizard(" + this.id + ", EFBookmarked);\">add to my earthfaves</a></td>"
				+	"</tr>";
			}
		}
	}
	else {
		linkToMyEF = "<tr>"
		+	"<td align=\"center\" valign=\"middle\"><img src=" + addToMyEF + " /></td>"
		+	"<td align=\"left\" valign=\"middle\"><a href=\"javascript:showLogin();\">" + global.resultlistLoginToGeobookmark + "</a></td>"
		+	"</tr>";
	}
	var linkShowDetail = "<tr>";
	if (get.page_id != "access_extern") {
		linkShowDetail += "<td align=\"center\" valign=\"middle\"><a href=\"" + global.URL + "page.php?page_id=efhome&ef_id=" + this.id + "\"><img src=" + showDetailsImage + " /></a></td>"
		+	"<td align=\"left\" valign=\"middle\"><a href=\"" + global.URL +"page.php?page_id=efhome&ef_id=" + this.id + "\">view details</a></td>";
	}
	else {
		linkShowDetail += "<td align=\"center\" valign=\"middle\"><a href=\"" + global.URL +"page.php?page_id=efhome&ef_id=" + this.id + " \" target=\"_blank\">"
		+	"<img src=" + showDetailsImage + " /></a></td>"
		+	"<td align=\"left\" valign=\"middle\"><a href=\"" + global.URL + "page.php?page_id=efhome&ef_id=" + this.id + "\" target=\"_blank\">view details</a></td>";
	}
	linkShowDetail += "</tr>";

	var name_city = this.name + " " + this.city;
	var quickLinks = "<tr>"
		+	"<td colspan=\"2\"><br>"
		+	"<img src=\"" + global.IMG_URL + "icons/earthfaves_icon.jpg\">";

	cse = global.URL + 'page.php?page_id=cse&cref=http%3A%2F%2Fwww.earthfaves.com%2Fcse%2Fcontextefs6.xml&cof=FORID%3A' + global.fordid + '&q=' + name_city;
	quickLinks += '<a id="link1" name="link1" href="javascript:openSearchWindow(\'' + cse + '\');">'
		+	"&nbsp;Find more information"
		+	"</a><br>"
		+	"<img src=\"" + global.IMG_URL + "icons/google_icon.jpg\">"
		+	"<a id=\"link2\" name=\"link2\" href=\"javascript:openSearchWindow(\'http://images.google.com/images?hl=en&q=" + name_city + "\');\">"
		+	"&nbsp;Find images"
		+	"</a><br>"
		+	"</td>"
		+	"</tr>";

	var tableEnd = "</table><br>";
	if (global.externzugriff) {
		quickLinks = "";
	}

	return EF_STYLE + text + tableBegin + linkShowDetail + zoomToEF + linkToMyEF +  quickLinks + tableEnd + EF_STYLE;
}


Earthfave.prototype.asAddWizardResultListEntry = function() 
{
	info("earthfave.js Earthfave.prototype.asAddWizardResultListEntry id:" + this.id);
	var result = ""; //'<tr> <td colspan="4" align="center" style="margin-bottom:2px; color:#F05A22; font-size:14px; font-weight:bold;">' + global.CHOICE + '</td> </tr>';

	var overviewBegin = this.overview.substr(0, 70) + '...';
	
	var arrayKatName =  new Array();
	
	arrayKatName["0"] = "no_category";
	arrayKatName["1"] = "hotel";
	arrayKatName["17"] = "restaurant";
	arrayKatName["96"] = "nature";
	arrayKatName["136"] = "culture";
	arrayKatName["185"] = "shopping";
	arrayKatName["257"] = "nightlife";
	arrayKatName["207"] = "sports";	
	var target = "_self";
	
	var efurl = createEarthfaveURL(this);
	
	result += '<tr style="height:55px;">';
	result += '<td style="width:100px;" align="center"> <img src="img_sort/img-nontext/icons/efToLoveEf.jpg" alt="Earthfave" /> </td>';
	result += '<td style="width:50px;" align="center"> <a href="' + efurl + '"';
	result += ' target="' + target + '"><img src="' + this.media + '" alt="' + this.name + '" style="height:50px;" /></a> </td>';
	result += '<td style="width:450px;"> <h4><a href="' + efurl + '" target="' + target + '">' + this.name + '</a></h1>';
	result += '<span style="font-size:10px; color:#B0A9A7"> ' + this.countryName + ' > ' + this.city + ' > ' + this.address1 + ' &nbsp;</span> <br/>';
	result += '<span style="font-size:11px; color:#B0A9A7"> ' + overviewBegin + ' </span> </td>';
	
	switch (this.relationship) 
	{
	case 1:
		result += '<td style="width:160px;" align="center"><img src="img_sort/img-text/en/buttons/addToYourEf.jpg" alt="Add to your earthfaces" onmouseover="this.style.cursor=\'pointer\'; myTip(\'Add to your earthfaces\');" onmouseout="this.style.cursor=\'auto\'; UnTip();" onClick="changePageinOverlay(1, 3, \'Index\', ' + this.id + ', \'no\', \'no\', \'ef\');" /> </td>';
		break;

	case 2: // earthfaved
		result += '<td style="width:160px;" align="center"> <img src="img_sort/img-nontext/menue_icons/earthfaved-by-me_active.gif" alt="Earthfaved" /> </td>';
		break;

	case 3: // discovered
		result += '<td style="width:160px;" align="center"> <img src="img_sort/img-nontext/menue_icons/discovered-by-me_active.gif" alt="Discovered" /> </td>';
		break;

	default:
		result += '<td style="width:160px;" align="center"></td>';
	}
	
	result += '</tr>';
	
	//info("Earthfave.js  asAddWizardResultListEntry result " + result);
	
	return result;
}

Earthfave.prototype.asBusinessSignUpResultListEntry = function() {
	info("earthfave.js Earthfave.prototype.asBusinessSignUpResultListEntry id:" + this.id);
	var result = "";
	
	var overviewBegin = this.overview.substr(0, 55);
	if (this.overview.length > 55) {	overviewBegin += '...';	}
	
	var arrayKatName =  new Array();
	
	arrayKatName["0"] = "no_category";
	arrayKatName["1"] = "hotel";
	arrayKatName["17"] = "restaurant";
	arrayKatName["96"] = "nature";
	arrayKatName["136"] = "culture";
	arrayKatName["185"] = "shopping";
	arrayKatName["257"] = "nightlife";
	arrayKatName["207"] = "sports";	
	var target = "_self";
	
	var efurl = createEarthfaveURL(this);
	
	result += '<tr style="height:55px;">';
	result += '<td style="width:50px;" align="center"> <a href="'  + efurl + '/';
	result += this.name + '" target="' + target + '"><img src="' + this.media + '" alt="' + this.name + '" style="height:50px;" /></a> </td>';
	result += '<td style="width:420px;"> <h3><a href="' + efurl + '" target="' + target + '">' + this.name + '</a></h1>';
	result += '<span style="font-size:10px; color:#B0A9A7"> ' + this.countryName + ' > ' + this.city + ' > ' + this.address1 + ' &nbsp;</span> <br/>';
	result += '<span style="font-size:11px; color:#B0A9A7"> ' + overviewBegin + ' </span> </td>';
	result += '<td style="width:30px; align="center"> <input type="radio" name="earthfave_radio" checked="checked" value="'+  this.id +'" /> </td>  ';
	result += '</tr>';
	
	return result;
}

// Daniel: die alte funktion bekam:
// (
//		id, lat, lng, name, overview, continentName, continentId, countryName, countryId, adm1Name, 
//    adm1Id , inselName, city, address1, woLink, discovererInfo, discovererId, hasBookedDisc, counterBookmarker, 
//    catLink, media, allCount,status, i
// )
Earthfave.prototype.asResultListEntry = function (markerId)
{
	//info("Earthfave.prototype.asResultListEntry: " + markerId  + " lat lng " + this.lat + " " + this.lng);
	var def = "";
	var undef = "";
	var r; // Fuer die Rueckgabe des HTML-Codes
	var classname = "";
	var hasBookedDisc = 0;
	
	var li_bookmark = "";
	var bookmarkOnClick = "";
	var bookmarkTitle = "";
	var prozent =  0;
	var geobookmarker = "";
	var stati;
	var target = "_self";
	var catLink = "";
	var efLocation = "";
	var media = "";
	var categoryImage = "";

//	info("Earthfave.prototype.asResultListEntry marker 0");

	for( prop in this ){
		if( prop == "asMarker" ){ break; } 
		if( this[prop] == undefined ){ undef += prop + ' value :' + this[prop]+ ' '; }
		else{ def += prop + ' value :' + this[prop]+ ' ';}
	}
//	if( undef != "" ){ info(undef); }
	//info("earthfaves.js Earthfave.prototype.asResultListEntry -- prop " + def);	

	//info("earthfaves.js Earthfave.prototype.asResultListEntry -- erzeuge Listeneintrag");	
//	info(this.name);

	var arrayKat =  new Array()
	arrayKat["0"] = "";// gibt es nicht !!!
	arrayKat["1"] = "hotels-gray-large.gif";
	arrayKat["17"] = "restaurants-gray-large.gif";
	arrayKat["96"] = "nature-gray-large.gif";
	arrayKat["136"] = "culture-gray-large.gif";
	arrayKat["185"] = "shopping-gray-large.gif";
	arrayKat["257"] = "nightlife-gray-large.gif";
	arrayKat["207"] = "sports-gray-large.gif";

	var arrayKatName =  new Array();
	arrayKatName["0"] = "no_category";
	arrayKatName["1"] = "hotel";
	arrayKatName["17"] = "restaurant";
	arrayKatName["96"] = "nature";
	arrayKatName["136"] = "culture";
	arrayKatName["185"] = "shopping";
	arrayKatName["257"] = "nightlife";
	arrayKatName["207"] = "sports";


	// Daniel: If the Map is a external Map the Link to the efHome is not relativ and the target should be "_blank"
//	info("earthfaves.js Earthfave.prototype.asResultListEntry -- marker 1");	
	if (get.page_id == "access_extern"){
		/*
		target = "_blank";
		inAnker1 = woLink.substr((woLink.indexOf("<a") + 2),(woLink.indexOf("</") - (woLink.indexOf("<a") + 2)));
		nachAnker1 = woLink.substr(woLink.indexOf("</") + 4);

		inAnker2 = nachAnker1.substr((nachAnker1.indexOf("<a") + 2),( nachAnker1.indexOf("</") - (nachAnker1.indexOf("<a") + 2)));

		woLink = '<a target="' + target + '"' +  inAnker1 + '</a>&nbsp;><a target="' + target + '"' +  inAnker2 + '</a>';
	 */
	} 
	else {
//		efLocation = this.continentName + ' > ' + this.countryName ;
		efLocation = this.countryName ;
		//if ( this.admin1Name != "" ) {  efLocation += ' > ' + this.admin1Name; }
		if ( this.city != "" ) { efLocation += ' > ' + this.city; }
	}

	//info("earthfaves.js Earthfave.prototype.asResultListEntry -- my relationship:" + this.relationship );	
	switch (this.relationship)
	{
		case 0: //user is not loged in
			if (get.page_id == "extern_map"){
				bookmarkOnClick = 'openPopupSpreader2(' + this.id + ');';
			}
			else
			{
				bookmarkOnClick = 'showLogin();';
			}
				bookmarkTitle = 'Login to add to your list of earthfaves';
				li_bookmark = '<li onmouseover="myTip(\'' + bookmarkTitle + '\');" onmouseout="UnTip();" class="action-label-add" title="' + bookmarkTitle + '" onclick="' + bookmarkOnClick + '"></li>';
				break;
				
		case 1: //user is loged in
			//info("earthfaves.js Earthfave.prototype.asResultListEntry -- my relationship case 1 ");	
			if (get.page_id != "extern_map"){
				bookmarkOnClick = 'showAddEarthFaveOverlay(' + this.id + ', \'no\', \'no\'); jumpAnchor()';
				bookmarkTitle = 'Add to your list of earthfaves';
				li_bookmark = '<li onmouseover="myTip(\'' + bookmarkTitle + '\');" onmouseout="UnTip();" class="action-label-add" title="' + bookmarkTitle + '" onclick="' + bookmarkOnClick + '"></li>';
				global.action = "";
			}
			else
			{
				bookmarkOnClick = 'openPopupSpreader2(' + this.id + ');';
				bookmarkTitle = 'Add to your list of earthfaves';
				li_bookmark = '<li onmouseover="myTip(\'' + bookmarkTitle + '\');" onmouseout="UnTip();" class="action-label-add" title="' + bookmarkTitle + '" onclick="' + bookmarkOnClick + '"></li>';
				global.action = "";
			}
			
			break;
		case 2:
			classname = "bookmarked";
			break; //user us booker
		case 3:
			classname = "discovered";
			break; // user ist nur DISC
		case 4:
			classname = "owner";
			break; // nur owner
		case 5:
			classname = "discovered";
			break; // user ist DISC and Owner
		case 7:
			classname = "discovered";
			break; // nur DISC und es gibt booker
		case 8:
			classname = "discovered";
			break;  // Owner und DISC und es gibt booker
	
	}
	// info("earthfaves.js Earthfave.prototype.asResultListEntry -- marker 3");	

	var statiText = 'Discovered by';
	if( this.status == "undiscovered" ) { var statiText = 'Undiscovered by'; }
	stati = '(' + this.status + ')';
	stati = '';

	// Show a Cat-Icon if the categorie is defined
	if (this.catId0) {categoryImage =  '<img onmouseover="myTip(\'' + arrayKatName[this.catId0] + '\');" onmouseout="UnTip();" style="width:20px; height:auto;" src="' + global.IMG_URL_NONTEXT + 'icons/' + arrayKat[this.catId0] + '"/>';	}
	if (this.catId1) {categoryImage += '<img onmouseover="myTip(\'' + arrayKatName[this.catId1] + '\');" onmouseout="UnTip();" style="width:20px; height:auto;" src="' + global.IMG_URL_NONTEXT + 'icons/' + arrayKat[this.catId1] + '"/>';	}
	if (this.catId2) {categoryImage += '<img onmouseover="myTip(\'' + arrayKatName[this.catId2] + '\');" onmouseout="UnTip();" style="width:20px; height:auto;" src="' + global.IMG_URL_NONTEXT + 'icons/' + arrayKat[this.catId2] + '"/>';	}
	if (this.catId3) {categoryImage += '<img onmouseover="myTip(\'' + arrayKatName[this.catId3] + '\');" onmouseout="UnTip();" style="width:20px; height:auto;" src="' + global.IMG_URL_NONTEXT + 'icons/' + arrayKat[this.catId3] + '"/>';	}


	var liShowEf = '<li onmouseover="myTip(\'Go to the earthfave page to get more details\');" onmouseout="UnTip();" class="action-label-details" title="Go to the earthfave page to get more details"';
	
	var efurl = createEarthfaveURL(this);
	
	if (get.page_id == "extern_map") {
		
		liShowEf += ' onclick="window.open(\'' + efurl + '\');">';
	}
	else { // the normal view on the earthfave page

		
		liShowEf += ' onclick="document.location.href=\''
			//+ global.URL + this.catName + '/'	+ this.city	+ '/' + this.id	+ '/' + this.name
			+ efurl
			+ '\'; addHistoryBack(\''
			+ global.URL
			+ 'earthfaves.html\');" />';
	}

	var liCenterMap = '<li onmouseover="myTip(\'show this earthfave centered on the map\');" onmouseout="UnTip();" class="action-label-show-map" title="Show this earthfave centered on the map"';
		  liCenterMap +=' onclick="Map.show(); Map.centerMarker(' + this.lat + ', ' + this.lng + '); markDiv(' + markerId + '); closeFilter();" />';
	
	var trStart =	'<tr class="result-list-entry" id="trRLE_' + this.id + '">';
	
	var efName = this.name;
	if(efName.length > 42){
		efName = efName.substring(0,42) + "...";
	}
	
	var myTip = this.name;
	var found = myTip.indexOf("'");
	if(found != -1){
		myTip = myTip.substring(0,found) + "`" + myTip.substring(found + 1); //Oli, schnelle Lösung für das myTip Problem mit dem Sonderzeichen '
	}
	
	if (get.page_id == "extern_map")
	{
	
		var tdImage = '<td rowspan="2" class="image">'
		+		'<img onmouseover="myTip(\'Go to ' + myTip + '\');" onmouseout="UnTip();" onclick="window.open(\'' + efurl + '\');" class="keine"  style="width:50px; height:50px; overflow: hidden; cursor: pointer; padding-top: 15px;" name="efBild_' + this.id + '" alt="'+ this.name + '" src="' + this.media + '"/>'
		+		'</td>';
	}
	
	else
	{
		var tdImage = '<td rowspan="2" class="image">'
		+		'<a onmouseover="myTip(\'Go to ' + myTip + '\');" onmouseout="UnTip();" href="' + efurl +'" target="' + target + '">'
		+		'<img class="keine" name="efBild_' + this.id + '" alt="'+ this.name + '" src="' + this.media + '"/>'
		+		'</a>'
		+		'</td>';
	}
	//var tdDescText= '<td class="description-text"></td>';
	var tdCatIcon = '<td rowspan="2" class="category-icon">&nbsp;' + categoryImage	+ '</td>';
	
	if (get.page_id == "extern_map")
	{
		
		var tdDesc =	  '<td class="description">'
			+		'<h1 style="color:#4E80C7; cursor: pointer; padding-top: 15px;" onmouseover="myTip(\'Go to ' + myTip + '\');" onmouseout="UnTip();" onclick="window.open(\'' + efurl + '\');">'
			+			efName
			+ 			'<span class="no-of-bookmarkers" style="font-size:10px;">' + geobookmarker + '</span>'
			+ 		'</h1>'
			+		'<p class="path">' + efLocation  + '</p>'
			+		'<p class="short-text">' + this.overview + '</p>'
			+	'</td>';		
	}
	
	else
	{
		var tdDesc =	  '<td class="description">'
			+		'<h1>'
			+			'<a onmouseover="myTip(\'Go to ' + myTip + '\');" onmouseout="UnTip();"  href="' + efurl + '" target="' + target + '">' + efName + '</a>'
			+ 			'<span class="no-of-bookmarkers" style="font-size:10px;">' + geobookmarker + '</span>'
			+ 		'</h1>'
			+		'<p class="path">' + efLocation  + '</p>'
			+		'<p class="short-text">' + this.overview + '</p>'
			+	'</td>';
	}
  		
	// info("earthfaves.js Earthfave.prototype.asResultListEntry -- marker 4");		
  var liDeleteOrDiscover = "";
		if(get.page_id != "extern_map"){
			if(this.relationship == 2 ){//der bookmarker kann den Bookmark loeschen
				//info("earthfaves.js Earthfave.prototype.asResultListEntry -- marker 5");
				liDeleteOrDiscover = '<li onmouseover="myTip(\'Remove from your list of earthfaves?\');"';
				liDeleteOrDiscover +='onmouseout="UnTip();" class="action-label-deleteBookmark" title="Remove from your list of earthfaves?" onclick="showDeleteEfForm(' + global.user_id + ' , ' + this.id + ',\'book\');"></li>';
				if(this.status == "undiscovered"){
					liDeleteOrDiscover += '<li onmouseover="myTip(\'I want become discoverer\');" onmouseout="UnTip();"';
					liDeleteOrDiscover +=' class="action-label-add" title="I want become discoverer" onclick="discoverUndiscoveredEf(' + global.user_id + ' , ' + this.id + ');"></li>';
				}
			}
			else if(this.relationship == 3 || this.relationship == 5  || this.relationship == 7 || this.relationship == 8)
			{	
			//	info("earthfaves.js Earthfave.prototype.asResultListEntry -- marker 5");		
				var 	recommender = "";
				if ( this.status != "undiscovered" ){
					if( this.numberOfBooker > 0 ){ recommender =' (' + this.numberOfBooker + ' recommender)'; }
					liDeleteOrDiscover += '<li onmouseover="myTip(\'Remove from your list of earthfaves?\');" onmouseout="UnTip();"';
					liDeleteOrDiscover += ' class="action-label-deleteBookmark" title="Remove from your list of earthfaves?' + recommender + '" onclick="showDeleteEfForm(' + global.user_id + ' , ' + this.id + ',\'disc\');"></li>';
				}
				else {
					liDeleteOrDiscover += '<li onmouseover="myTip(\'Become discoverer again\');" onmouseout="UnTip();"';
					liDeleteOrDiscover += ' class="action-label-add" title="Become discoverer again" onclick="discoverUndiscoveredEf(' + global.user_id + ' , ' + this.id + ');"></li>';
				}
			}
		}
		
	if (get.page_id == "extern_map")
	{
		var tdAction = '<td class="actions" rowspan="2">'
  		+ '<ul>'
  		+	liShowEf 			
			+	liCenterMap
			+ liDeleteOrDiscover
			+	li_bookmark
 			+ '</ul>'
			+	'</td>';
	}
	
	else
	{
		var tdAction = '<td class="actions">'
  		+ '<ul>'
  		+	liShowEf 			
			+	liCenterMap
			+ liDeleteOrDiscover
			+	li_bookmark
 			+ '</ul>'
			+	'</td>';
	}

		//info("earthfaves.js Earthfave.prototype.asResultListEntry -- marker 7");	
	if (get.page_id == "extern_map")
	{
		var trFooter = '<tr><td colspan="2">';
		var divFooter = '<div class="result-status" id="divRS_' + this.id + '">';
	}
	
	else
	{
		var trFooter = '<tr><td colspan="2" style="height:30px;">';
		var divFooter = '<div style="height:30px;" class="result-status" id="divRS_' + this.id + '">';
	}
		//info("earthfaves.js Earthfave.prototype.asResultListEntry -- marker 7.0");	
		var discName = this.discovererName;
		if(discName.length > 12){
			discName = discName.substring(0,12) + "...";
		}
		
		if (get.page_id != "extern_map")
		{
			divFooter += ' <div class="discovered-by-result"><a style="color:#4F81CF;" onmouseOver="myTip(\'' + discName + ' Rank: ' + this.discovererRank + '\');"';
			divFooter += ' onmouseout="UnTip();" href="' + global.URL + 'user/' + this.discovererName + '.html" target="' + target + '">' +  discName + ' (' + this.levelOfExpertise + ')</a>';
			divFooter += '</div>';
		}
		
		var total = this.numberBookmarkingFriends + this.numberBookmarkingOthers + this.numberBookmarkingFF + 1 ;

		//	info("earthfaves.js Earthfave.prototype.asResultListEntry -- marker 7.1");	
			if( this.relationship != 0 && get.page_id != "extern_map"){
			
				var allLove = parseInt(this.numberBookmarkingFriends) + parseInt(this.numberBookmarkingFF) + parseInt(this.numberBookmarkingOthers);
				if(allLove > 0 || this.relationship == 3 || this.relationship == 2){
				
//					divFooter += '<div class="loved-result-start">Loved by</div>';
					//divFooter += '<div class="loved-result-start"></div>';
				}
					//info("earthfaves.js Earthfave.prototype.asResultListEntry -- marker 7.2");	
				if( this.relationship == 3 ||  this.relationship == 5  ||  this.relationship == 7 ||  this.relationship == 8 ||  this.relationship == 2){
						
					divFooter += '<div class="loved-result-my" style="">'; // you
					if(allLove > 0){	
					//komma oder kein Komma
					divFooter += '';
					//divFooter += ',';
					} 
					divFooter += '</div>';
				}
				pluralS = 's';
				
				//info("earthfaves.js Earthfave.prototype.asResultListEntry -- marker 8");	
				if( this.numberBookmarkingFriends == 1 ){ pluralS = ''; }
				if( this.numberBookmarkingFriends > 0  ){
					if(global.user_name == "Rick" || global.user_id == "42"){ //travelmaster
						divFooter += '<div class="loved-result-friends" onmouseover="myTip(\'click to show the friends\'); showMouseHand();" onmouseout="UnTip(); hideMouseHand();"';
						divFooter += ' onClick="global.overlayNetwork = true; lookupPeople(\'task:showBookmarkerFriendsPopup---farbe:blue---ef_id:' +  this.id + '---\',\'\',\'\',1,10,10,\'byName\');">'; // showForm2(\'friendsRListe\',\'divRS_' + this.id + '\',\'modal\')
					}
					else{
						divFooter += '<div class="loved-result-friends"';
						divFooter += ' onmouseout="global.overlayNetwork = false; hideForm(\'friendsRListe\');" onmouseover="global.overlayNetwork = true; showForm3(\'friendsRListe\');lookupPeople(\'task:showBookmarkerFriendsPopup---farbe:blue---ef_id:' +  this.id + '---\',\'\',\'\',1,10,10,\'byName\');">'; // showForm2(\'friendsRListe\',\'divRS_' + this.id + '\',\'modal\')
					}
					
					divFooter += this.numberBookmarkingFriends;// + ' friend' + pluralS + 
					divFooter += '</div>';
					}
				//info("earthfaves.js Earthfave.prototype.asResultListEntry -- marker 8.1");		
				if( this.numberBookmarkingFF > 0 ) {
						if(global.user_name == "Rick" || global.user_id == "42"){
							divFooter += '<div class="loved-result-friends-friends" onmouseover="showMouseHand(); myTip(\'click to show the friends friends\');" onmouseout="hideMouseHand();UnTip();" ';
							divFooter += 'onClick=';
							divFooter += '"global.overlayNetwork = true; lookupPeople(\'task:showBookmarkerFriendsFriendsPopup---farbe:blue---ef_id:' +  this.id + '---\',\'\',\'\',1,10,10,\'byName\');"';
						}
						else {
							divFooter += '<div class="loved-result-friends-friends" onmouseout="global.overlayNetwork = false; hideForm(\'friendsRListe\');" ';
							divFooter += 'onmouseover=';
							divFooter += '"showForm3(\'friendsRListe\'); global.overlayNetwork = true; lookupPeople(\'task:showBookmarkerFriendsFriendsPopup---farbe:blue---ef_id:' +  this.id + '---\',\'\',\'\',1,10,10,\'byName\');"';
						}
						
					divFooter += '>';
					divFooter += this.numberBookmarkingFF;//  + ' friends\' friends
					divFooter +='</div>';
				}
			//	info("earthfaves.js Earthfave.prototype.asResultListEntry -- marker 8.2");		
				if( this.numberBookmarkingOthers > 0 ){ 
					 divFooter += '<div class="loved-result-others">' +  this.numberBookmarkingOthers + '</div>';
				}
				//r+='<a href="#">' + userFriendsLove + ' friends</a>,<a href="#">' + userFriendsFriendsLove + ' friends\' friends</a>and<a href="">120 others</a>';
		}
		else {
			
			if (get.page_id == "extern_map")
			{
				divFooter += '<div class="loved-result-others" >' +  total + ' people love this place</div>';	
			}
			else
			{
			//if( this.numberBookmarkingOthers > 0 ){ 
				 divFooter += '<div class="loved-result-others" >' +  ( this.numberBookmarkingOthers + 1 ) + ' people love this place</div>';
			}
			//}
		}
		//info("earthfaves.js Earthfave.prototype.asResultListEntry -- marker 9");	
		divFooter +='</div>';
		//r+='</div>';
		//alert("divFooter" + divFooter);
		trFooter += divFooter;
		trFooter += '</td></tr>';



	r  = trStart;
	r += tdImage;
	//r += tdDescText;
	r += tdCatIcon;
	r += tdDesc;
	r += tdAction
	r += '</tr>';
	r += trFooter;
	
	if (get.page_id == "extern_map")
	{
		r += '<tr><td colspan="3" style="height:15px; border-style: none none solid; border-width: 1px; border-color: rgb(78, 128, 199);"></td></tr>';
	}
	
	else
	{
		r += '<tr colspan="3"><td style="height:6px;"></td></tr>';
	}
	
	//info("earthfave.js asResultListEntry = " + r);
	
	return r;
}


/**
 * Gibt den Typ zur?ck, wird z.B. f?r Namenskonvention bei den Icon auf der Karte verwendet
 */
Earthfave.prototype.getType = function ()
{
	return "ef";
}



Earthfave.prototype.discover = function(user_id, listOfCategories, listOfProperties)
{
	info("Trage earthfave f?r Entdecker mit ID = " + user_id + " ein");
	Ajax.send(global.AJAX_URL + 'discoverRequest.php', 
			'userId=' + user_id
			+ '&id=' + this.id 
			+ '&latitude=' + this.lat 
			+ '&longitude=' + this.lng 
			+ '&name=' + this.name 
			+ '&countryId=' + this.countryId
			+ '&city=' + this.city 
			+ '&address1=' + this.address1
			+ '&continentId=' + this.continentId
			+ '&overview=' + this.overview 
			+ '&comment=' + this.comment 
			+ '&suggestions=' + this.suggestions 
			+ '&internName=' + this.internalName
			+ '&relationship=' + this.relationship 
			+ '&categories=' + listOfCategories 
			+ '&properties=' + listOfProperties 
			+ '&tags=' + this.tags 
			+ '&visitMonth=' + this.visitMonth 
			+ '&visitYear=' + this.visitYear, 
			discoverCallback,
			null, 
			null,
			global.EARTHFAVES_TIMEOUT); 

}

function discoverCallback (response)
{
	info ("earthfave entdeckt: " + response);
}


Earthfave.prototype.bookmark = function(user_id)
{
	info("Bookmarke earthfave fuer Benutzer mit ID = " + user_id);
	info("Bookmarkedaten.. id:" + this.id + " overview " + this.overview + " comment " + this.comment + " rel " + this.relationship);
	Ajax.send(global.AJAX_URL + 'bookmarkRequest.php', 
			'userId=' + user_id
			+ '&id=' + this.id 
			+ '&overview=' + this.overview 
			+ '&comment=' + this.comment 
			+ '&suggestions=' + this.suggestions 
			+ '&relationship=' + this.relationship 
			//+ '&tags=' + this.tags 
			+ '&visitMonth=' + this.visitMonth 
			+ '&experience=' + this.levelOfExpertise 
			+ '&visitYear=' + this.visitYear, 
			bookmarkCallback,
			null, 
			null,
			global.EARTHFAVES_TIMEOUT); 
	
	if(document.getElementById("page3")){
		var doc = document.getElementById("page3");
		var str = '<div class="progress-white" style="height:400px;">	</div>';
		doc.style.textAlign = "center";
		doc.style.marginTop = "20%";
		doc.style.backgroundColor = "#ffffff";
		doc.innerHTML = str;
	}
}

function bookmarkCallback (response)
{
	var data = response.split ( '\|' );
	var task = data[0];
	var id = data[1];
	var url = data[2];
	
	info ("earthfave gebookmarked: " + response);
		if(global.user_id == "42"){
			//travelamaster
			if(document.getElementById("page3")){
				var str = '<a href"#" onmousedown="location.reload();"/>chancel</a><br><br>';
				str += '<a href="' + url +'" >goto earthave page</a>';
				document.getElementById("page3").innerHTML = str;
			}
		} else {
			
			document.location.href = url;
		}
}
//Arno Anfang===============================
Earthfave.prototype.asPopupEntry = function (markerId, task)
{
	console.log("Ich bin in Fonction asPopupEntry" + get.page_id);
	console.log("Earthfave.prototype.asPopupEntry: " + markerId  + " lat lng " + this.lat + " " + this.lng);
	var def = "";
	var undef = "";
	var z; // Fuer die Rueckgabe des HTML-Codes
	var classname = "";
	var hasBookedDisc = 0;
	
	var li_bookmark = "";
	var bookmarkOnClick = "";
	var bookmarkTitle = "";
	var prozent =  0;
	var geobookmarker = "";
	var stati;
	var target = "_self";
	var catLink = "";
	var efLocation = "";
	var media = "";
	var categoryImage = "";

//	info("Earthfave.prototype.asResultListEntry marker 0");

	for( prop in this ){
		if( prop == "asMarker" ){ break; } 
		if( this[prop] == undefined ){ undef += prop + ' value :' + this[prop]+ ' '; }
		else{ def += prop + ' value :' + this[prop]+ ' ';}
	}

	var arrayKat =  new Array()
	arrayKat["0"] = "";// gibt es nicht !!!
	arrayKat["1"] = "hotels-gray-large.gif";
	arrayKat["17"] = "restaurants-gray-large.gif";
	arrayKat["96"] = "nature-gray-large.gif";
	arrayKat["136"] = "culture-gray-large.gif";
	arrayKat["185"] = "shopping-gray-large.gif";
	arrayKat["257"] = "nightlife-gray-large.gif";
	arrayKat["207"] = "sports-gray-large.gif";

	var arrayKatName =  new Array();
	arrayKatName["0"] = "no_category";
	arrayKatName["1"] = "hotel";
	arrayKatName["17"] = "restaurant";
	arrayKatName["96"] = "nature";
	arrayKatName["136"] = "culture";
	arrayKatName["185"] = "shopping";
	arrayKatName["257"] = "nightlife";
	arrayKatName["207"] = "sports";

 	efLocation = this.countryName ;
	if ( this.city != "" ) { efLocation += ' > ' + this.city; }
	
	console.log("Ich bin in Fonction asPopupEntry 1" + get.page_id);
	
	li_bookmark = "" ;
	
	if (task != "pagination")
	{
	
		switch (this.relationship)
		{
			case 0: //user is not loged in
			
				bookmarkOnClick = '' ;
			
				if (get.page_id == "extern_map"){
					bookmarkOnClick = 'openPopupSpreader2(' + this.id + ');';
				}
				else{
					bookmarkOnClick = 'showLogin();';
				}
				bookmarkTitle = 'Login to add to your list of earthfaves';
				li_bookmark = '<li id="li-labAdd2" style="height:24px; width:24px; padding-top:5px; magin:0px;" onmouseover="myTip(\'' + bookmarkTitle + '\');" onmouseout="UnTip();" title="' + bookmarkTitle + '" onclick= "setEarthfaveOverlayVisible(false); setEarthfaveOverlayInvisibleTimer(); ' + bookmarkOnClick + '"></li>';
				
				break;
			case 1: //user is loged in
				
				bookmarkOnClick = '' ;
				console.log("looooooooooooooooool");
				if (get.page_id == "extern_map"){
					console.log("looooooooooooooooool");
					bookmarkOnClick = 'openPopupSpreader2(' + this.id + ');';
				}
				else
				{
					console.log("loooooooooooooooooooooool-not-extern");
					bookmarkOnClick = 'showAddEarthFaveOverlay(' + this.id + ', \'no\', \'no\')';
				}
				bookmarkTitle = 'Add to your list of earthfaves';
				li_bookmark = '<li id="li-labAdd2" style="height:24px; width:24px; padding-top:5px; margin:0px;"onmouseover="myTip(\'' + bookmarkTitle + '\');" onmouseout="UnTip();"  title="' + bookmarkTitle + '" onclick= "' + bookmarkOnClick + '"></li>';
				global.action = "";
				
				break;
			case 2:
				classname = "bookmarked";
				break; //user us booker
			case 3:
				classname = "discovered";
				break; // user ist nur DISC
			case 4:
				classname = "owner";
				break; // nur owner
			case 5:
				classname = "discovered";
				break; // user ist DISC and Owner
			case 7:
				classname = "discovered";
				break; // nur DISC und es gibt booker
			case 8:
				classname = "discovered";
				break;  // Owner und DISC und es gibt booker
		
		}
	}
	
	console.log(li_bookmark);
	
	console.log("Ich bin in Fonction asPopupEntry 2" + get.page_id);
	
	var statiText = 'Discovered by';
	if( this.status == "undiscovered" ) { var statiText = 'Undiscovered by'; }
	stati = '(' + this.status + ')';
	stati = '';

	// Show a Cat-Icon if the categorie is defined
	if (this.catId0) {categoryImage =  '<img style="padding-top:10px; height:25px; width:25px;" onmouseover="myTip(\'' + arrayKatName[this.catId0] + '\');" onmouseout="UnTip();" style="width:20px; height:20px;" src="' + global.IMG_URL_NONTEXT + 'icons/' + arrayKat[this.catId0] + '"/>';	}
	if (this.catId1) {categoryImage += '<img style="padding-top:10px; height:25px; width:25px;" onmouseover="myTip(\'' + arrayKatName[this.catId1] + '\');" onmouseout="UnTip();" style="width:20px; height:20px;" src="' + global.IMG_URL_NONTEXT + 'icons/' + arrayKat[this.catId1] + '"/>';	}
	if (this.catId2) {categoryImage += '<img style="padding-top:10px; height:25px; width:25px;" onmouseover="myTip(\'' + arrayKatName[this.catId2] + '\');" onmouseout="UnTip();" style="width:20px; height:20px;" src="' + global.IMG_URL_NONTEXT + 'icons/' + arrayKat[this.catId2] + '"/>';	}
	if (this.catId3) {categoryImage += '<img style="padding-top:10px; height:25px; width:25px;" onmouseover="myTip(\'' + arrayKatName[this.catId3] + '\');" onmouseout="UnTip();" style="width:20px; height:20px;" src="' + global.IMG_URL_NONTEXT + 'icons/' + arrayKat[this.catId3] + '"/>';	}
	
	var efurl = createEarthfaveURL(this);
	
	console.log("Ich bin in Fonction asPopupEntry 3" + get.page_id);

	var liShowEf = '<li id="li-details"; style="height:20px; width:20px; padding-top:5px;" onmouseover="myTip(\'Go to the earthfave page to get more details\');" onmouseout="UnTip();" title="Go to the earthfave page to get more details"';
	if (get.page_id == "extern_map") {
		liShowEf += 'onclick="window.open(\'' + efurl + '\');">';
	}
	else { // the normal view on the earthfave page
		liShowEf += ' onclick="document.location.href=\''
			//+ global.URL + this.catName + '/'	+ this.city	+ '/' + this.id	+ '/' + this.name
			+ global.URL + this.catName0 + '_'	+ this.city	+ '/' + this.id	+ '/' + this.name
			+ '\'; addHistoryBack(\''
			+ global.URL
			+ 'earthfaves.html\');" />';
	}
	
	console.log("Ich bin in Fonction asPopupEntry 4" + get.page_id);
	
	var liCenterMap = '<li id="li-centerMap"; style="height:20px; width:20px; magin:0px; padding-top:5px;" onmouseover="myTip(\'Show this earthfave centered on the map\');"'+markerId+' '+this.id+');" onmouseout="UnTip();"  title="Show this earthfave centered on the map"';
		  liCenterMap +=' onclick="setEarthfaveOverlayVisible(false); setEarthfaveOverlayInvisibleTimer(); Map.show(); Map.centerMarker(' + this.lat + ', ' + this.lng+'); markDiv(' + markerId + '); closeFilter(); " />';
		  
	var trStart =	'<tr id="trRLE_' + this.id + '">';
	
	var efName = this.name;
	if(efName.length > 42){
		efName = efName.substring(0,42) + "...";
	}
	
	console.log("Ich bin in Fonction asPopupEntry 5" + get.page_id);
	
	var myTip = this.name;
	
	if (get.page_id == "extern_map") 
	{
		var tdImage = '<td rowspan=4 style="height:130px; width:80px; vertical-align:top;">'
					+		'<a onmouseover="myTip(\'' + myTip + '\');" onmouseout="UnTip();" href="' + efurl + '" target="_blank">'
			+		'<img style="height:80px; width:80px; padding-top:0px; margin:0px;" name="efBild_' + this.id + '" alt="'+ this.name + '" src="' + this.media + '"/>'
			+		'</a>'
			+		'</td>';

	}
	
	else
	{
		var tdImage = '<td style="height:80px; overflow:hidden; width:80px; padding:0px; magin:0px;">'
					+		'<a onmouseover="myTip(\'' + myTip + '\');" onmouseout="UnTip();" href="' + global.URL + this.city + '/' +  this.id + '/' + this.name +'\'" target="' + target + '">'
			+		'<img style="height:80px; width:80px; padding-top:0px; margin:0px;" name="efBild_' + this.id + '" alt="'+ this.name + '" src="' + this.media + '"/>'
			+		'</a>'
			+		'</td>';
	}
	
	console.log("Ich bin in Fonction asPopupEntry 6" + get.page_id);
	//var tdDescText= '<td class="description-text"></td>';
	var tdCatIcon = '<td rowspan="2" style="height:100px; width:20px; magin:0px;">&nbsp;' + categoryImage	+ '</td>';
	
	if (get.page_id == "extern_map")
	{
		console.log("description");
		var tdDesc =	 '<td colspan=3 style="height:30px; width:250px; vertical-align:top;"'
		+		'<h1 style="margin:0px; position:top; overflow:hidden; height:18px;";>'
		+			'<a style="padding-top:2px; color: #F15B26;text-decoration: none; text-underline: none; font-size: 14px; height:30px; width:205px;" onmouseover="myTip(\'' + myTip + '\');" onmouseout="UnTip();"  href="' + efurl + '" target="_blank">' + efName + '</a>'
		+ 			'<span  style="padding-bottom:40px; font-size:10px;">' + geobookmarker + '</span>'
		+ 		'</h1>'
		+ 	'<p class="path" style="font-size:10px;">' + efLocation  + '</p>'
	}
	
	else
	{
		var tdDesc =	  '<td >'
		+		'<h1 style="margin:0px; position:top;";>'
		+			'<a style="padding-top:2px; color: #F15B26;text-decoration: none; text-underline: none; font-size: 14px; height:30px; width:205px;" onmouseover="myTip(\'' + myTip + '\');" onmouseout="UnTip();"  href="' + global.URL + this.catName0 + '_' + this.city + '/' +  this.id + '/' + this.name + '" target="' + target + '">' + efName + '</a>'
		+ 			'<span  style="padding-bottom:40px; font-size:10px;">' + geobookmarker + '</span>'
		+ 		'</h1>'
		+		'<p  style="width:205px;">' + efLocation  + '</p>'
		+		'<p style="height:30px; width:205px;">' + this.overview + '</p>'
		+	'</td>';
	}
	
	console.log("Ich bin in Fonction asPopupEntry 7" + get.page_id);
  		
	// info("earthfaves.js Earthfave.prototype.asResultListEntry -- marker 4");		
  var liDeleteOrDiscover = "";
		if(get.page_id != "extern_map"){
			if(this.relationship == 2 ){//der bookmarker kann den Bookmark loeschen
				liDeleteOrDiscover = '<li id="li-delBookmark"; style="height:20px; width:20px; magin:0px; padding-top:5px;" onmouseover="myTip(\'Remove from your list of earthfaves?\');"';
				liDeleteOrDiscover +='onmouseout="UnTip();" title="Remove from your list of earthfaves?" onclick="showDeleteEfForm(' + global.user_id + ' , ' + this.id + ',\'book\');"></li>';
				if(this.status == "undiscovered"){
					liDeleteOrDiscover += '<li id="li-labAdd"; style="height:20px; width:20px; magin:0px; padding-top:5px;" onmouseover="myTip(\'I want become discoverer\');" onmouseout="UnTip();"';
					liDeleteOrDiscover +='  title="I want become discoverer" onclick="discoverUndiscoveredEf(' + global.user_id + ' , ' + this.id + ');"></li>';
				}
			}
			else if(this.relationship == 3 || this.relationship == 5  || this.relationship == 7 || this.relationship == 8)
			{	
			//	info("earthfaves.js Earthfave.prototype.asResultListEntry -- marker 5");		
				var 	recommender = "";
				if ( this.status != "undiscovered" ){
					if( this.numberOfBooker > 0 ){ recommender =' (' + this.numberOfBooker + ' recommender)'; }
					liDeleteOrDiscover += '<li id="li-delBookmark2"; style="height:20px; width:20px; magin:0px; padding-top:5px;" onmouseover="myTip(\'Remove from your list of earthfaves?\');" onmouseout="UnTip();"';
					liDeleteOrDiscover += ' title="Remove from your list of earthfaves?' + recommender + '" onclick="showDeleteEfForm(' + global.user_id + ' , ' + this.id + ',\'disc\');"></li>';
				}
				else {
					liDeleteOrDiscover += '<li id="li-labAdd2"; style="height:20px; width:20px; magin:0px; padding-top:5px;" onmouseover="myTip(\'Become discoverer again\');" onmouseout="UnTip();"';
					liDeleteOrDiscover += 'title="Become discoverer again" onclick="discoverUndiscoveredEf(' + global.user_id + ' , ' + this.id + ');"></li>';
				}
			}
		}
		
	console.log("Ich bin in Fonction asPopupEntry 8" + get.page_id);
	
	var tdAction = '<td style="width: 0px; height:140px;">'
  	+ '<ul>'
  	+	liShowEf 			
		+	liCenterMap
		+ liDeleteOrDiscover
		+	li_bookmark
 		+ '</ul>'
		+	'</td>';

		var trFooter = '<tr><td colspan="4" style="height:20px;">';
		var divFooter = '<div style="width: 245px; height: 20px;"  id="divRS_' + this.id + '">';
		
		var total = this.numberBookmarkingFriends +  this.numberBookmarkingFF + this.numberBookmarkingOthers + 1 ;
			
		var discName = this.discovererName;
		if(discName.length > 12){
			discName = discName.substring(0,12) + "...";
		}
		
		if (get.page_id == "extern_map")
		{
			divFooter += ' <div><a style="height:20px; color:#4F81CF;" onmouseOver="myTip(\'' + discName + ' Rank: ' + this.discovererRank + '\');"';
			divFooter += ' onmouseout="UnTip();" href="' + global.URL + 'user/' + this.discovererName + '.html" target="_blank">' +  discName + ' (' + this.levelOfExpertise + ')</a>';
			divFooter += '</div>';
		}
		
		else
		{
			divFooter += ' <div><a style="height:20px; color:#4F81CF;" onmouseOver="myTip(\'' + discName + ' Rank: ' + this.discovererRank + '\');"';
			divFooter += ' onmouseout="UnTip();" href="' + global.URL + 'user/' + this.discovererName + '.html" target="' + target + '">' +  discName + ' (' + this.levelOfExpertise + ')</a>';
			divFooter += '</div>';
		}

			if( this.relationship != 0 && (get.page_id != "extern_map")){
			
				var allLove = parseInt(this.numberBookmarkingFriends) + parseInt(this.numberBookmarkingFF) + parseInt(this.numberBookmarkingOthers);
				if(allLove > 0 || this.relationship == 3 || this.relationship == 2){
				}

				if( this.relationship == 3 ||  this.relationship == 5  ||  this.relationship == 7 ||  this.relationship == 8 ||  this.relationship == 2){
						
					divFooter += '<div class="loved-result-my" style="">'; // you
					if(allLove > 0){	
					//komma oder kein Komma
					divFooter += '';
					//divFooter += ',';
					} 
					divFooter += 'you </div>';
				}
				pluralS = 's';
				
				if( this.numberBookmarkingFriends == 1 ){ pluralS = ''; }
				if( this.numberBookmarkingFriends > 0  ){
					if(global.user_name == "Rick" || global.user_id == "42"){ // travelmaster
						divFooter += '<div  class="loved-result-friends" onmouseover="myTip(\'click to show the friends\'); showMouseHand();" onmouseout="UnTip(); hideMouseHand();"';
						divFooter += ' onClick="lookupPeople(\'task:showBookmarkerFriendsPopup---farbe:blue---ef_id:' +  this.id + '---\',\'\',\'\',1,10,10,\'byName\');">'; // showForm2(\'friendsRListe\',\'divRS_' + this.id + '\',\'modal\')
					}
					else{
						divFooter += '<div class="loved-result-friends"';
						divFooter += ' onmouseout="hideForm(\'friendsRListe\');" onmouseover="showForm(\'friendsRListe\');lookupPeople(\'task:showBookmarkerFriendsPopup---farbe:blue---ef_id:' +  this.id + '---\',\'\',\'\',1,10,10,\'byName\');">'; // showForm2(\'friendsRListe\',\'divRS_' + this.id + '\',\'modal\')
					}
					
					divFooter += this.numberBookmarkingFriends;// + ' friend' + pluralS + 
					divFooter += '</div>';
					}	
				if( this.numberBookmarkingFF > 0 ) {
						if(global.user_name == "Rick" || global.user_id == "42"){ //travelmaster
							divFooter += '<div "class="loved-result-friends-friends" onmouseover="showMouseHand(); myTip(\'click to show the friends friends\');" onmouseout="hideMouseHand();UnTip();" ';
							divFooter += 'onClick=';
							divFooter += '"lookupPeople(\'task:showBookmarkerFriendsFriendsPopup---farbe:blue---ef_id:' +  this.id + '---\',\'\',\'\',1,10,10,\'byName\');"';
						}
						else {
							divFooter += '<div  class="loved-result-friends-friends" onmouseout="hideForm(\'friendsRListe\');" ';
							divFooter += 'onmouseover=';
							divFooter += '"showForm(\'friendsRListe\'); lookupPeople(\'task:showBookmarkerFriendsFriendsPopup---farbe:blue---ef_id:' +  this.id + '---\',\'\',\'\',1,10,10,\'byName\');"';
						}
						
					divFooter += '>';
					divFooter += this.numberBookmarkingFF;//  + ' friends\' friends
					divFooter +='</div>';
				}
				if( this.numberBookmarkingOthers > 0 ){ 
					 divFooter += '<div class="loved-result-others">' +  this.numberBookmarkingOthers + '</div>';
				}
		}
		
		else
		{
			if (get.page_id == "extern_map")
			{
				divFooter += '<div class="loved-result-others" >' +  total + ' people love this place</div>';	
			}
		}
			
		divFooter +='</div>';
		trFooter += divFooter;
		trFooter += '</td></tr>';
	
	console.log("Ich bin in Fonction asPopupEntry 9" + get.page_id);
	
	if (get.page_id == "extern_map")
	{
		r =	"<tr>"
		+		'<td rowspan=4 style="height:130px; width:80px; vertical-align:top;" >'
		+		'<a onmouseover="myTip(\'' + myTip + '\');" onmouseout="UnTip();"  href="' + efurl + '" target="_blank">'
		+		'<img style="height:80px; width:80px;" name="efBild_' + this.id + '" alt="'+ this.name + '" src="' + this.media + '"/>'
		+		'</a>'
		+ categoryImage
		+	'</td>'
		+	"</tr>"
		+	"<tr>"
		+		'<td colspan=3 style="height:30px; width:250px; vertical-align:top;"'
		+		'<h1 style="margin:0px; position:top; overflow:hidden; height:18px;";>'
		+			'<a style="padding-top:2px; color: #F15B26;text-decoration: none; text-underline: none; font-size: 14px; height:30px; width:205px;" onmouseover="myTip(\'' + myTip + '\');" onmouseout="UnTip();"   href="' + efurl + '" target="_blank">' + efName + '</a>'
		+ 			'<span  style="padding-bottom:40px; font-size:10px;">' + geobookmarker + '</span>'
		+ 		'</h1>'
		+ '<p class="path" style="font-size:10px;">' + efLocation  + '</p>'
		+	"</td>"
		+		'<td rowspan=3 style="height:130px; width:20px; vertical-align:top;">'
			+ '<ul>'
		+	liShowEf 			
			+	liCenterMap
			+ liDeleteOrDiscover
			+	li_bookmark
			+ '</ul>'
		+'</td>'
		+	"</tr>"
		+	"<tr>"
		+		'<td style="height:70px; overflow:hidden;">'
		+ '<p class="short-text">' + this.overview + '</p>'
		+'</td>'
		+	"</tr>"
		+	"<tr>"
		+		'<td rowspan=4 style="width:245px; height: 50px; margin-bottom: 2px; font-size:11px; color: #F15B26;text-decoration: none; text-underline: none;">'+divFooter+'</td>'
		+	"</tr>";
	}
		
		
	else
	{
			r =	"<tr>"
		+		'<td rowspan=4 style="height:130px; width:80px; vertical-align:top;" >'
		+		'<a onmouseover="myTip(\'' + myTip + '\');" onmouseout="UnTip();" href="' + global.URL + this.city + '/' +  this.id + '/' + this.name +'\'" target="' + target + '">'
		+		'<img style="height:80px; width:80px;" name="efBild_' + this.id + '" alt="'+ this.name + '" src="' + this.media + '"/>'
		+		'</a>'
		+ categoryImage
		+	'</td>'
		+	"</tr>"
		+	"<tr>"
		+		'<td colspan=3 style="height:30px; width:250px; vertical-align:top;"'
		+		'<h1 style="margin:0px; position:top; overflow:hidden; height:18px;";>'
		+			'<a style="padding-top:2px; color: #F15B26;text-decoration: none; text-underline: none; font-size: 14px; height:30px; width:205px;" onmouseover="myTip(\'' + myTip + '\');" onmouseout="UnTip();"  href="' + global.URL + this.catName0 + '_' + this.city + '/' +  this.id + '/' + this.name + '" target="' + target + '">' + efName + '</a>'
		+ 			'<span  style="padding-bottom:40px; font-size:10px;">' + geobookmarker + '</span>'
		+ 		'</h1>'
		+ '<p class="path" style="font-size:10px;">' + efLocation  + '</p>'
		+	"</td>"
		+		'<td rowspan=3 style="height:130px; width:20px; vertical-align:top;">'
			+ '<ul>'
		+	liShowEf 			
			+	liCenterMap
			+ liDeleteOrDiscover
			+	li_bookmark
			+ '</ul>'
		+'</td>'
		+	"</tr>"
		+	"<tr>"
		+		'<td style="height:70px; overflow:hidden;">'
		+ '<p class="short-text">' + this.overview + '</p>'
		+'</td>'
		+	"</tr>"
		+	"<tr>"
		+		'<td rowspan=4 style="width:245px; height: 50px; margin-bottom: 2px; font-size:11px; color: #F15B26;text-decoration: none; text-underline: none;">'+divFooter+'</td>'
		+	"</tr>";
	
	}

	console.log("Ich bin in Fonction asPopupEntry 10" + get.page_id);
	
	return r;
}
//Arno ENDE===============================