/**
	@name GoogleMapsClass
	@version 0.02
	@copyright 2011 EURIP.com
**/
var GoogleMapsClass = Class.create({
	Version:'0.0.2',

	Config: $H({
		divmapname:'googlemapcontainer',divmap:false,
		divmarkername:'googlemapmarkercontainer',divmarker:false,
		divdebugname:'googlemapdebugcontainer',divdebug:false,
		divmsgname:'googlemapmsgcontainer',divmsg:false,
		divlistname:'googlemaplistcontainer',
		divroutingname:'googlemaproutingcontainer',
		fieldl:'updateposl',fieldb:'updateposb',
		language:'de',
		funcinit:false,
		urlicon:'http://images.eurip.com/googlemaps/',
		urlautosave:'/ajaxlib/eurip/autosave.html',

		mapposl:11.575008,
		mapposb:48.137135,
		mapzoom:12,
		maptype:'hybrid',
		mapcenter:false

		}),
	obj:false,

	Controls: $H({'cornermap':false,'nav-big':false,'nav-small':false,'zoom-small':false,'scale':false,'maptype':false}),
	Bounce: $H({}),
	Icons: $H({}),
	Markers: [],
	MarkersID: 0,
	MarkersWalkID: 0,
	BlockedMarkerIDs: {},
	MarkerDefault: $H({'title':false,'desc':false,'listener':'click','icon':'default','min_zoom':false,'max_zoom':false}),
	MarkerDynDefault: $H({'title':'Dynamic Marker','desc':false,'listener':false,'icon':'dynamic'}),
	DynMarker: false,
	Manager: false,
	Geocoder:false,
	Directions:false,
	Templates: $H({
		markerlist:'I am marker nb #{nb}',

datacitydiv: new Template('<div class="border css3radius" style="width:300px;height:100px;overflow:hidden;text-align:center"><div class="box_title"><img src="http://images.eurip.com/flags/#{country}.gif"> #{name}</div><div><b>#{name_complete}#{extra} in #{state}</b><br>Einwohner: #{inhabitants}<br><br><a class="box" href="http://eurip.com/-c#{id}.html">zur Stadt</a></div>'),

dataypdivimg: new Template('<div style="width:300px;height:200px;overflow:hidden;text-align:center"><div class="small" style="text-align:right">#{category} in #{city_name}</div><div class="box_title">#{name}</div><div class="small">#{name_extra}</div><div style="width:auto;height:100px;background:url(#{image_0_pfad}) #ffffff center no-repeat">&nbsp;</div>#{street} #{street_number}<br><b><img src="http://images.eurip.com/flags/#{country}.gif"> #{zip} #{city_name}</b><br><a class="box" href="http://cities.eurip.com/yp/entry/#{country}-#{type}/#{city_print}/#{name_print}-id-#{id}.html">zum Eintrag</a></div>'),
dataypdiv: new Template('<div style="width:300px;height:100px;overflow:hidden;text-align:center"><div class="small" style="text-align:right">#{category} in #{city_name}</div><div class="box_title">#{name}</div><div class="small">#{name_extra}</div>#{street} #{street_number}<br><b><img src="http://images.eurip.com/flags/#{country}.gif"> #{zip} #{city_name}</b><br><a class="box" href="http://cities.eurip.com/yp/entry/#{country}-#{type}/#{city_print}/#{name_print}-id-#{id}.html">zum Eintrag</a></div>'),
		datauserdivimg: new Template('<div style="width:300px;height:200px;overflow:hidden;text-align:center">&nbsp;<br><div class="box_title">#{login_name}</div><div style="width:auto;height:100px;background:url(#{avatar}) #ffffff center no-repeat">&nbsp;</div>&nbsp;<br><b><img src="http://images.eurip.com/flags/#{country}.gif"> #{zip} #{city_name}</b><br><a class="box" href="#{profile}">zum Profil</a></div>'),
		datauserdiv: new Template('<div style="width:300px;height:100px;overflow:hidden;text-align:center">&nbsp;<br><div class="box_title">#{login_name}</div>&nbsp;<br><b><img src="http://images.eurip.com/flags/#{country}.gif"> #{zip} #{city_name}</b><br><a class="box" href="#{profile}">zum Profil</a></div>')
		}),


//	Constructor
	initialize: function(mapcfg) {
		this.updateCFG(mapcfg);
		try  {this.divmap = $(this.Config.get('divmapname'));}
		catch(e)  {}
		if (!this.divmap) {
			FORCERWindow.OpenAlert('Map-Error - Cannot find map-container '+this.Config.get('divmapname'),'error','ok');
			}
	  },


//	initMap()
	  initMap: function() {
		if (!this.divmap || typeof(google.maps) != 'object') {return false;}
		this.obj = new google.maps.Map2(this.divmap);
		this.Config.set('mapcenter',new GLatLng(this.Config.get('mapposb'),this.Config.get('mapposl')));
		this.obj.setCenter(this.Config.get('mapcenter'),this.Config.get('mapzoom'));
//		this.obj.setUIToDefault();
		this.setMapType(this.Config.get('maptype'));
		this.getBounce();
		this.Manager = new GMarkerManager(this.obj);
		Event.observe(window, 'unload', GUnload);
		return true;
		},


//	GM1.markerAddAdress(maddress,mcfg,insertlist,autosave,funcok,funcfalse)
	markerAddAdress: function(maddress,mcfg,insertlist,autosave,funcok,funcfalse) {
		if (typeof(GM1)=='undefined')  {return;}
		if (!this.Geocoder)  {this.Geocoder = new GClientGeocoder();}
		this.Geocoder.getLatLng(maddress,function(point) { 
			if (point) {
				if (mcfg)  {GM1.markerAdd(point.lng(),point.lat(),mcfg);}
				if (typeof(insertlist)=="string")  {
					try  {$(GM1.Config.get('divlistname')).insert({'top':GM1.replaceLB(point,insertlist)});}
					catch(e)  {}
					}
				if (typeof(autosave)=="object")  {
					autosave.l = point.lng();autosave.b = point.lat();
					FORCERAjax.RequestData(false,GM1.Config.get('urlautosave'),{'parameters' : $H(autosave)},false,false,false);
					}
				if (funcok)  {eval(GM1.replaceLB(point,funcok));}
				return true;
				}
			else {
				if (funcfalse)  {eval(funcfalse);}
				return false;
				}
			});
		},


//	GM.markerAdd(pos_l,pos_b,mcfg)
	markerAdd: function(pos_l,pos_b,mcfg) {
		if (typeof(pos_l) != 'number')	pos_l = parseFloat(pos_l);
		if (typeof(pos_b) != 'number')	pos_b = parseFloat(pos_b);
		if (pos_l == 0 || pos_b == 0)	return false;
		mcfg = this.markerCFG(mcfg);
		var newmarker = this.markerCreate(pos_l, pos_b, mcfg);
		if (typeof(newmarker) == "object")  {
			this.Manager.addMarker(newmarker,mcfg.get('min_zoom'),mcfg.get('max_zoom'));
			this.Markers[this.MarkersID] = {'obj':newmarker,'title':mcfg.get('title'),'desc':mcfg.get('desc'),'l':pos_l,'b':pos_b,'icon':mcfg.get('icon')};
			this.MarkersID ++;
//			this.Manager.refresh();
			return true;
			}
		return false;
		},


//	GM.markerCreate(pos_l, pos_b, mcfg)
	markerCreate: function(pos_l, pos_b, mcfg) {
		var point = new GLatLng(pos_b,pos_l);
		if (point) {  
			if (typeof(this.Icons.get(mcfg.get('icon')))=="object") {var newmarker = new GMarker(point,{icon:this.Icons.get(mcfg.get('icon')),title:mcfg.get('title')});}
			else {var newmarker = new GMarker(point,{icon:this.Icons.get('default'),title:mcfg.get('title')});}
			if (typeof(mcfg.get('desc'))=="string")  {
				GEvent.addListener(newmarker,mcfg.get('listener'),function() {  
						newmarker.openInfoWindowHtml(mcfg.get('desc'));  
						});  
					}
			return newmarker;
			}
		return false;
		},


//	GM1.markerAddressForm(inputfield)
	markerAddressForm: function(streetfield,cityfield,countryfield) {
		if (!this.DynMarker)
		var searchdata = '';
		var printdata = '';
		try  {var temp = $F(streetfield);}
		catch(e)  {var temp = false;}
		if (typeof(temp)=='string' && temp!='')  {searchdata += temp+', ';printdata += temp+', ';}
		try  {var temp = $F(cityfield);}
		catch(e)  {var temp = false;}
		if (typeof(temp)=='string' && temp!='')  {searchdata += temp+', ';printdata += temp;}
		try  {var temp = $F(countryfield);}
		catch(e)  {var temp = false;}
		if (typeof(temp)=='string' && temp!='')  {searchdata += temp;}
		if (typeof(searchdata)=='string' && searchdata!='')  {
			this.markerAddAdress(searchdata,{'title':'Adresssuche','desc':searchdata,'listener':'click','icon':'default','min_zoom':0,'max_zoom':17},"<a class='box' href='javascript:void(0)' onClick='GM1.setCenter(#l#,#b#)'>"+printdata+"</a>",false,'GM1.markerAddressFormOK(#l#,#b#)','GM1.markerAddressFormERROR()');
			}
		return false;
		},

//	GM1.markerAddAdress(inputfield)
	markerAddressFormOK: function(l,b) {
		this.setCenter(l,b);
		},

//	GM1.markerAddAdress(inputfield)
	markerAddressFormERROR: function(inputfield) {
		FORCERWindow.OpenAlert('Address not found -  Adresse nicht gefunden','error','ok');
		},


//	GM.dynamicMarkerSet(marker,funcstart,funcend)
	dynamicMarkerSet: function(marker,funcstart,funcend) {
		if (!this.obj)  {return false;}
		var mcfg = this.MarkerDynDefault;
		if (typeof(marker)=="object")	mcfg = mcfg.merge(marker);
		if (typeof(mcfg.get('title')) != "string")	mcfg.set('title','Dynamic Marker');
		if (typeof(this.Icons.get(mcfg.get('icon')))=="object") {this.DynMarker = new GMarker(this.Config.get('mapcenter'),{icon:this.Icons.get(mcfg.get('icon')),title:mcfg.get('title'),draggable:true});}
		else {this.DynMarker = new GMarker(this.Config.get('mapcenter'),{icon:this.Icons.get('default'),title:mcfg.get('title'),draggable:true});}
		if (funcstart)  {
			GEvent.addListener(this.DynMarker, "dragstart", function() {
				eval(funcstart);
				});
			}
		if (funcend)  {
			GEvent.addListener(this.DynMarker, "dragend", function() {
				eval(funcend);
				});
			}
		this.obj.addOverlay(this.DynMarker);
		},


//	GM1.dynamicMarkerMove(l,b)
	dynamicMarkerMove: function(l,b) {
		var point = new GLatLng(b,l);
		if (this.DynMarker && point) {
			this.DynMarker.setLatLng(point);
			this.setCenter(l,b);
			this.dynamicMarkerUpdateForm();
			return true;
			}
		return false;
		},


//	GM1.dynamicMarkerForm(inputfield)
	dynamicMarkerForm: function(inputfield) {
		if (!this.DynMarker)
		try  {var searchdata = $F(inputfield);}
		catch(e)  {var searchdata = false;}
		if (typeof(searchdata)=='string' && searchdata!='')  {
			this.markerAddAdress(searchdata,false,"<a class='box' href='javascript:void(0)' onClick='GM1.dynamicMarkerMove(#l#,#b#)'>"+searchdata+"</a>",false,'GM1.dynamicMarkerFormOK(#l#,#b#)','GM1.dynamicMarkerERROR()');
			}
		return false;
		},


//	GM1.markerAddAdress(inputfield)
	dynamicMarkerFormOK: function(l,b) {
		this.dynamicMarkerMove(l,b);
		},


//	GM1.markerAddAdress(inputfield)
	dynamicMarkerFormERROR: function(inputfield) {
		FORCERWindow.OpenAlert('Address not found -  Adresse nicht gefunden','error','ok');
		},


//	GM1.dynamicMarkerUpdateForm()
	dynamicMarkerUpdateForm: function() {
		var point = this.DynMarker.getLatLng();
		if (point)  {
			try  {$(this.Config.get('fieldl')).value = point.lng();}
			catch(e)  {}
			try  {$(this.Config.get('fieldb')).value = point.lat();}
			catch(e)  {}
			}
		},


//	GM.markerWalkthrough()
	markerWalkthrough: function() {
		try  {var cm =this.Markers[this.MarkersWalkID];}
		catch(e)  {
			this.MarkersWalkID ++;
			if (this.MarkersWalkID >= this.Markers.length)  {this.MarkersWalkID = 0;}
			return;
			}
		this.obj.closeInfoWindow();
		this.setZoom(10);
		window.setTimeout('GM1.setZoom(6)',4000);
		window.setTimeout('GM1.setCenter('+cm.l+','+cm.b+')', 6000);
		window.setTimeout('GM1.setZoom(8)', 8000);
		window.setTimeout('GM1.setZoom(10)', 10000);
		window.setTimeout('GM1.setZoom(12)', 12000);
		window.setTimeout('GM1.markerShow('+this.MarkersWalkID+')', 14000);
		this.MarkersWalkID ++;
		if (this.MarkersWalkID >= this.Markers.length)  {this.MarkersWalkID = 0;}
		},


//	GM1.markerShow(nb)
	markerShow: function(nb) {
		try  {
			var cm =this.Markers[nb];
			cm.obj.openInfoWindowHtml(cm.desc);
			}
		catch(e)  {}
		},


//	GM.markerMove(marker,l,b)
	markerMove: function(marker,l,b) {
		alert('markerMove');
		alert(typeof 'marker');
		alert('marker');
		var point = new GLatLng(b,l);
		if (marker && point) {
			marker.setLatLng(point);
			return true;
			}
		return false;
		},

//	GM.markerGetL(marker)
	markerGetL: function(marker) {
		alert('markerGetL');
		alert(typeof 'marker');
		alert('marker');
		try  {var temp = this.dynamicmarker.getLatLng();}
		catch(e)  {return 0;}
		return temp.lng();
		},

//	GM.markerGetB(marker)
	markerGetB: function(marker) {
		alert('markerGetB');
		alert(typeof 'marker');
		alert('marker');
		try  {var temp = this.dynamicmarker.getLatLng();}
		catch(e)  {return 0;}
		return temp.lat();
		},


//	GM1.directionsParse(inputfield)
	directionsParse: function(locfrom,locto) {
		if (!this.Directions)  {
			this.Directions = new GDirections(this.obj,$(this.Config.get('divroutingname')));
			GEvent.addListener(this.Directions, "load", GM1.directionsLOAD);
			GEvent.addListener(this.Directions, "error", GM1.directionsERROR);
			}
		$(this.Config.get('divroutingname')).update('<div class="sloading"></div>');
		$(this.Config.get('divroutingname')).show();
		$(this.Config.get('divroutingname')).scrollTo();
		this.Directions.load("from: "+locfrom+" to: "+locto,{'locale':this.Config.get('language')});
		},


//	GM1.directionsForm(streetfield1,cityfield1,countryfield1,streetfield2,cityfield2,countryfield2)
	directionsForm: function(streetfield1,cityfield1,countryfield1,streetfield2,cityfield2,countryfield2) {
		var searchdatafrom = '';var searchdatato = '';
		try  {var temp = $F(streetfield1);}		catch(e)  {var temp = false;}
		if (typeof(temp)=='string' && temp!='')  {searchdatafrom += temp+', ';}
		try  {var temp = $F(cityfield1);}		catch(e)  {var temp = false;}
		if (typeof(temp)=='string' && temp!='')  {searchdatafrom += temp+', ';}
		try  {var temp = $F(countryfield1);}	catch(e)  {var temp = false;}
		if (typeof(temp)=='string' && temp!='')  {searchdatafrom += temp;}
		try  {var temp = $F(streetfield2);}		catch(e)  {var temp = false;}
		if (typeof(temp)=='string' && temp!='')  {searchdatato += temp+', ';}
		try  {var temp = $F(cityfield2);}		catch(e)  {var temp = false;}
		if (typeof(temp)=='string' && temp!='')  {searchdatato += temp+', ';}
		try  {var temp = $F(countryfield2);}	catch(e)  {var temp = false;}
		if (typeof(temp)=='string' && temp!='')  {searchdatato += temp;}
		if (typeof(searchdatafrom)=='string' && searchdatafrom!='' && typeof(searchdatato)=='string' && searchdatato!='')  {
			this.directionsParse(searchdatafrom,searchdatato);
			}
		return false;
		},


//	GM1.directionsLOAD()
	directionsLOAD: function() {
		},


//		GM1.directionsERROR()
	directionsERROR: function() {
		if (GM1.Directions.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
			var errormsg = 'Eine der Adressen ist unbekannt - One one the adresses is unknown';
	   else if (GM1.Directions.getStatus().code == G_GEO_SERVER_ERROR)
			var errormsg = 'Ein Fehler bei der Lokalisierung ist aufgetreten - Localisation error';
	   else if (GM1.Directions.getStatus().code == G_GEO_MISSING_QUERY)
			var errormsg = 'Bitte Start und Ziel eingeben - Please insert start und end';
	   else if (GM1.Directions.getStatus().code == G_GEO_BAD_KEY)
			var errormsg = 'Unbekannter Schlüssel - Unknown key';
	   else if (GM1.Directions.getStatus().code == G_GEO_BAD_REQUEST)
			var errormsg = 'Anfrage unbekannt - Request unknown';
	   else
		   var errormsg = 'Allgemeiner Fehler - Error occured';
		FORCERWindow.OpenAlert(errormsg,'error','ok');
		},


//	GM.setMapType(maptype)
	setMapType: function(maptype) {
		if (maptype != this.Config.get('maptype')) {return false;}
		switch (maptype) {
		  case "satellite":
		    this.obj.setMapType(G_SATELLITE_MAP);
		    break;
		  case "hybrid":
		    this.obj.setMapType(G_HYBRID_MAP);
		    break;
		  case "physical":
		    this.obj.setMapType(G_PHYSICAL_MAP);
		    break;
		  default:
		    this.obj.setMapType(G_NORMAL_MAP);
		    break;
			}
		this.Config.set('maptype',maptype);
		return false;
		},


//	GM.setCenter(l,b)
	setCenter: function(l,b) {
		var point = new GLatLng(b, l);
		if (point)  {
			this.obj.panTo(point);
			this.getBounce();
			this.updateCFG({'mapcenter':point,'mapposl':l,'mapposb':b});
			}
		},

//	GM.setZoom(zoom)
	setZoom: function(zoom) {
		if (typeof(zoom)=="number" && this.Config.get('mapzoom')!=zoom)  {
			this.obj.setZoom(zoom);
			this.Config.set('mapzoom',zoom);
			}
		},


//	GM.doZoom(direction)
	doZoom: function(direction) {
		switch (direction) {
		  case "-":
		    this.obj.zoomOut();
				this.Config.set('mapzoom',((this.Config.get('mapzoom')-1)));
		    break;
		  default:
		    this.obj.zoomIn();
				this.Config.set('mapzoom',((this.Config.get('mapzoom')+1)));
		    break;
			}
		},


//	GM.setOverlayColor(color,opacity)
	setOverlayColor: function(color,opacity) {
		this.obj.addOverlay(new GPolygon([new GLatLng(-85,0),new GLatLng(85,0),new GLatLng(85,90),new GLatLng(-85,90)],null,0,0,color,opacity));
		this.obj.addOverlay(new GPolygon([new GLatLng(-85,90),new GLatLng(85,90),new GLatLng(85,180),new GLatLng(-85,180)],null,0,0,color,opacity));
		this.obj.addOverlay(new GPolygon([new GLatLng(-85,180.000001),new GLatLng(85,180.000001),new GLatLng(85,270),new GLatLng(-85,270)],null,0,0,color,opacity));
		this.obj.addOverlay(new GPolygon([new GLatLng(-85,270),new GLatLng(85,270),new GLatLng(85,360),new GLatLng(-85,360)],null,0,0,color,opacity));
		},


//	GM.setControls(controls)
	setControls: function(controls) {
		if (typeof(controls)=="object")	this.Controls = this.Controls.merge(controls);
		if (this.Controls.get('cornermap') == true) {
 		  this.obj.addControl(new GOverviewMapControl());
			}
		if (this.Controls.get('nav-big') == true) {
 		  this.obj.addControl(new GLargeMapControl());
			}
		if (this.Controls.get('nav-small') == true) {
 		  this.obj.addControl(new GSmallMapControl());
			}
		if (this.Controls.get('zoom-small') == true) {
 		  this.obj.addControl(new GSmallZoomControl());
			}
		if (this.Controls.get('scale') == true) {
 		  this.obj.addControl(new GScaleControl());
			}
		if (this.Controls.get('maptype') == true) {
 		  this.obj.addControl(new GMapTypeControl());
			}
		},


//	GM.loadIcon(iconname,iconurl)
	loadIcon: function(iconname,iconurl) {
		this.Icons.set(iconname,new GIcon(G_DEFAULT_ICON, this.Config.get('urlicon')+iconurl));
		},


//	GM.showInfo(inputmsg,sec)
	showInfo: function(inputmsg,sec) {
		if (typeof(inputmsg)!="string")	inputmsg = '';		
		if (typeof(sec)!="number") sec = 0;
		if (this.obj) {
			var cpos = new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7,30));
			cpos.apply(this.divmsg);
			this.obj.getContainer().appendChild(this.divmsg);
			if (inputmsg.length > 0) {
				this.divmsg.innerHTML = inputmsg;
				this.divmsg.show();
				}
			else  {
				this.divmsg.hide();
				return;
				}
			if (sec > 0) {
				window.setTimeout("$('"+this.Config.get('divmsgname')+"').hide();",(sec*1000));
				}
			}
		},


//	GM.setTemplate(name,data)
	setTemplate: function(name,data) {
		this.Templates.set(name,new Template(data));
		},


//	loadIconSet(type)
	loadIconSet: function(iconset) {
		if (iconset=="yp")  {
			this.loadIcon("hotels","hotel.png");
			this.loadIcon("restaurants","restaurant.png");
			this.loadIcon("aerzte","arzt.png");
			this.loadIcon("parks","park.png");
			this.loadIcon("schwimmbad","schwimmbad.png");
			this.loadIcon("schulen","schulen.png");
			this.loadIcon("cafes","cafe.png");
			this.loadIcon("discos","disco.png");
			this.loadIcon("supermarket","supermarket.png");
			this.loadIcon("autohaeuser","auto.png");
			this.loadIcon("musik","music.png");
			this.loadIcon("elektronik","electronic.png");
			this.loadIcon("handwerker","handwerker.png");
			this.loadIcon("baumarkt","baumarkt.png");
			this.loadIcon("kosmetik","kosmetik.png");
			this.loadIcon("apotheken","apotheke.png");
			this.loadIcon("sport","sport.png");
			this.loadIcon("blumenlaeden","flower.png");
			this.loadIcon("reisebueros","travel.png");
			this.loadIcon("drogerien","drogerie.png");
			}
		else  {
			this.loadIcon("default","default.png");
			this.loadIcon("city","city.png");
			this.loadIcon("yp","yp.png");
			this.loadIcon("image","image.png");
			this.loadIcon("event","event.png");
			this.loadIcon("user","user.png");
			this.loadIcon("article","article.png");
			}
		},


//	GM.replaceLB(newcfg)
	replaceLB: function(lb, text) {
		text = text.replace(/#l#/g,lb.lng());
		text = text.replace(/#b#/g,lb.lat());
		text = text.replace(/#id#/g,this.MarkersID);
		return text;
		},


//	GM.updateCFG(newcfg)
	updateCFG: function(newcfg) {
		if (typeof(newcfg)=="object")	this.Config = this.Config.merge(newcfg);
		},


//	GM.markerCFG(newcfg)
	markerCFG: function(newcfg) {
		var temp = this.MarkerDefault;
		if (typeof(newcfg)=="object")	temp = temp.merge(newcfg);
		return temp;
		},


//	GM.getBounce()
	getBounce: function() {
		var temp = this.obj.getBounds();var sw = temp.getSouthWest();var ne = temp.getNorthEast();
		this.Bounce = this.Bounce.merge({lmin:sw.lng(),lmax:ne.lng(),lspan:(ne.lng()-sw.lng()),l:((ne.lng()+sw.lng())/2),bmin:sw.lat(),bmax:ne.lat(),bspan:(ne.lat()-sw.lat()),b:((ne.lat()+sw.lat())/2)});
		},


// GM.dataAjaxYP2Point()
	dataAjaxYP2Point: function(data,zoommin,zoommax) {
		if (typeof(data) != "object" || typeof(zoommin) != "number" || typeof(zoommax) != "number")  {return false;}
		for (var i = 0; i < data.length; i++) {
			if (this.BlockedMarkerIDs['yp'+data[i]['id']]===true)	{continue;}
			if (typeof(data[i]['street'])=="undefined")		data[i]['street'] = "";
			if (typeof(data[i]['name_extra'])=="undefined")	data[i]['name_extra'] = "";
			if (typeof(data[i]['street_number'])=="undefined")	data[i]['street_number'] = "";
			if (typeof(data[i]['zip'])=="undefined")			data[i]['zip'] = "";
			if (data[i]['imagedata']!=0)  {
				var divbox = this.Templates.get('dataypdivimg').evaluate(data[i]);
				}
			else  {
				var divbox = this.Templates.get('dataypdiv').evaluate(data[i]);
				}
			if (data[i]['pos_l']!=0 && data[i]['pos_b']!=0)  {
				this.markerAdd(data[i]['pos_l'], data[i]['pos_b'],{'title':data[i]['name'],'desc':divbox,'listener':'click','icon':data[i]['type'],'min_zoom':zoommin,'max_zoom':zoommax});
				}
			else  {
				this.markerAddAdress(data[i]['street']+' '+data[i]['street_number']+', '+data[i]['zip']+' '+data[i]['city_name']+', '+data[i]['country'],{'title':data[i]['name'],'desc':divbox,'listener':'click','icon':data[i]['type'],'min_zoom':zoommin,'max_zoom':zoommax},false,{'modus': 'yp','entry': data[i]['id']},false,false);
				}
			this.BlockedMarkerIDs['yp'+data[i]['id']] = true;
			}
		return true;
		},

// GM.dataAjaxCity2Point()
	dataAjaxCity2Point: function(data,zoommin,zoommax) {
		if (typeof(data) != "object" || typeof(zoommin) != "number" || typeof(zoommax) != "number")  {return false;}
		for (var i = 0; i < data.length; i++) {
			if (this.BlockedMarkerIDs['city'+data[i]['id']]===true)	{continue;}
			var divbox = this.Templates.get('datacitydiv').evaluate(data[i]);
			if (data[i]['pos_l']!=0 && data[i]['pos_b']!=0)  {
				this.markerAdd(data[i]['pos_l'], data[i]['pos_b'],{'title':data[i]['name'],'desc':divbox,'listener':'click','icon':'city','min_zoom':zoommin,'max_zoom':zoommax});
				}
			else  {
				this.markerAddAdress(data[i]['name']+', '+data[i]['country'],{'title':data[i]['name'],'desc':divbox,'listener':'click','icon':'city','min_zoom':zoommin,'max_zoom':zoommax},false,{'modus': 'city','entry': data[i]['id']},false,false);
				}
			this.BlockedMarkerIDs['city'+data[i]['id']] = true;
			}
		return true;
		},


// GM.dataAjaxUser2Point()
	dataAjaxUser2Point: function(data,zoommin,zoommax) {
		if (typeof(data) != "object" || typeof(zoommin) != "number" || typeof(zoommax) != "number")  {return false;}
		for (var i = 0; i < data.length; i++) {
			if (this.BlockedMarkerIDs['user'+data[i]['id']]===true)	{continue;}
			if (typeof(data[i]['zip'])=="undefined")						data[i]['zip'] = "";
			if (data[i]['avatar'])  {
				var divbox = this.Templates.get('datauserdivimg').evaluate(data[i]);
				}
			else  {
				var divbox = this.Templates.get('datauserdiv').evaluate(data[i]);
				}
			if (data[i]['pos_l']!=0 && data[i]['pos_b']!=0)  {
				this.markerAdd(data[i]['pos_l'], data[i]['pos_b'],{'title':data[i]['name'],'desc':divbox,'listener':'click','icon':'user','min_zoom':zoommin,'max_zoom':zoommax});
				}
			this.BlockedMarkerIDs['user'+data[i]['id']] = true;
			}
		return true;
		}
	});


/**
	@LOAD MAPS API
**/
try {google.load("maps", "2",{"other_params":"hl=de"});}
catch (e) {alert('Cannot find GoogleMaps-API: '+e);} 

