map1188 = function(type){	this.isLoaded = false;	this.mapType = type;	this.curentElement = null;	this.currentElementId = null;	//like map1188.gmapObject == map	this.gmapObject = null;	this.Lat = 56.947479;	this.Lng = 24.106278;	this.Zoom = 15;	this.jmapObject = null;	this.Markers = new Array();	this.iconType = 'default'; // default | dus | wifi | much	this.iconImg = 'mappoint.png';	this.MarkersAreRenderedWhenMapLoaded = false;	this.eventEndCallBackFn = null;	this.mapSwitchCallBackFn = null;	this.isSatellite = false;	this.groupMarkers = true;	this.enableRightClick = false;	this.enableLBSUserPoint = false;	this.enableMyPoint = false;	this.lbsMarker = null;	this.lbsMarkerXY = new Array();	this.lbsLastAddress = '';	this.enableTraffic = true;	this.showMapSwitchButtons = true;	this.lbsMarkerStreetName = '';	this.MyPointMarkerIndex = null;	this.MyPointChangeCallBackFn = null;	this.MarkerClickCallBackFn = null;	this.patchLoaded = false;	// gmap | jmap	this.ZoomDiff = new Array();	this.ZoomDiff[6] = 11;	this.ZoomDiff[7] = 10;	this.ZoomDiff[8] = 9;	this.ZoomDiff[9] = 8;	this.ZoomDiff[10] = 7;	this.ZoomDiff[11] = 6;	this.ZoomDiff[12] = 5;	this.ZoomDiff[13] = 4;	this.ZoomDiff[14] = 3;	this.ZoomDiff[15] = 2;	this.ZoomDiff[16] = 1;	this.ZoomDiff[17] = 0;	this.ZoomDiff[18] = -1;	this.ZoomDiff[19] = -2;	this.gmapOptions = {            	googleBarOptions:{             	style : "new"            }	}	this.eventEndCallBack = function( fn ){		if( typeof(fn) == 'function' ){			this.eventEndCallBackFn = fn;		}	}	this.mapSwitchCallBack = function( fn ){		if( typeof(fn) == 'function' ){			this.mapSwitchCallBackFn = fn;		}	}	this.GroupMarkers = function(MarkerHeight, MarkerWidth){		var MarkersInPixels = this.getMarkersCorrdsInPixels();		var MarkersInPixels2 = this.getMarkersCorrdsInPixels();		if( !MarkerHeight ) MarkerHeight = 25;		if( !MarkerWidth ) MarkerWidth = 21;		max = MarkersInPixels.length;		var Groups = new Array();		var group_counter = 0;		//Tur kur krustojas divi markeri, tur veidojas grupa		for(i = 0; i< max; i++){			for(j=0; j< max; j++){			if( MarkersInPixels[j] && MarkersInPixels[i] ){				//Nesalidzinam markeri ar markeri				if( i != j ){					starp_x = Math.abs(MarkersInPixels[i][0] - MarkersInPixels[j][0]);					starp_y = Math.abs(MarkersInPixels[i][1] - MarkersInPixels[j][1]);					krusto_x = ( MarkerWidth > starp_x );					krusto_y = ( MarkerHeight > starp_y );					if( krusto_x && krusto_y){						GrupasWidth = MarkerWidth*2 - starp_x;						GrupasHeight = MarkerHeight*2 - starp_y;						xmin = MarkersInPixels[i][0];						xmax = MarkersInPixels[j][0];						if( MarkersInPixels[j][0] < xmin){						 	xmin =  MarkersInPixels[j][0];						 	xmax =  MarkersInPixels[i][0];						 }						xmin = xmin - 14; //puse no platuma						xmax = xmax + 14; //puse no platuma+1 (platums 28)						ymin = MarkersInPixels[i][1];						ymax = MarkersInPixels[j][1];						if( MarkersInPixels[j][1] < ymin){						 	ymin =  MarkersInPixels[j][1];						 	ymax =  MarkersInPixels[i][1];						 }						ymin = ymin - 31;						ymax = ymax + 0;						Groups[group_counter] = new Array();						Groups[group_counter]['xmin'] = xmin;						Groups[group_counter]['xmax'] = xmax;						Groups[group_counter]['ymin'] = ymin;						Groups[group_counter]['ymax'] = ymax;						group_counter++;						delete(MarkersInPixels[j]);						delete(MarkersInPixels[i]);						}					}				  }				}			}	maxGroups = Groups.length;	for(i=0; i<=maxGroups; i++){		for(j=0; j<=maxGroups; j++){			if( (Groups[i] && Groups[j]) && (i!=j) ){				x_is_in = false;				y_is_in = false;				if( (Groups[i]['xmin'] <= Groups[j]['xmin']) && (Groups[i]['xmax'] >= Groups[j]['xmax']) ) x_is_in = true;				if( (Groups[i]['ymin'] <= Groups[j]['ymin']) && (Groups[i]['ymax'] >= Groups[j]['ymax']) ) y_is_in = true;				if( x_is_in && y_is_in){				 Groups.splice(i,1);				 }				//Ja x_is_in, bet y ir iekļauts daļēji				else if( x_is_in && ( (Groups[i]['ymin'] < Groups[j]['ymax']) || (Groups[i]['ymax'] > Groups[j]['ymin'])  ) ){					Groups[i]['ymin'] = Math.min(Groups[i]['ymin'],Groups[j]['ymin']);					Groups[i]['ymax'] = Math.max(Groups[i]['ymax'],Groups[j]['ymax']);					Groups.splice(j,1);				}				//Ja y_is_in, bet y ir iekļauts daļēji				else if( y_is_in && ( (Groups[i]['xmin'] < Groups[j]['xmax']) || (Groups[i]['xmax'] > Groups[j]['xmin'])  ) ){					Groups[i]['xmin'] = Math.min(Groups[i]['xmin'],Groups[j]['xmin']);					Groups[i]['xmax'] = Math.max(Groups[i]['xmax'],Groups[j]['xmax']);					Groups.splice(j,1);				}			}		}	}	maxGroups = Groups.length;	maxMarkers = MarkersInPixels2.length;	for(i=0; i < maxGroups; i++){		var group_elem_counter = 0;		Groups[i]['elem'] = new Array();		for(j=0; j<=maxMarkers; j++){		if( MarkersInPixels2[j] ){			if( (Groups[i]['xmin'] <= MarkersInPixels2[j][0]) && ( MarkersInPixels2[j][0] <= Groups[i]['xmax'] )){				if( (Groups[i]['ymin'] <= MarkersInPixels2[j][1]) && ( MarkersInPixels2[j][1] <= Groups[i]['ymax'] )){					Groups[i]['elem'].push(MarkersInPixels2[j][2]);					delete(MarkersInPixels2[j]);				}			}		}		}		if(  Groups[i]['elem'].length > 0){		str = '';		for( val in Groups[i]['elem'] ){			if( this.Markers[Groups[i]['elem'][val]] ){				str = str+this.Markers[Groups[i]['elem'][val]]['name']+'<hr />';			}			this.deleteMarker(Groups[i]['elem'][val],true);		}		xwidth = Groups[i]['xmax'] -  Groups[i]['xmin'];		X = Groups[i]['xmin'] + Math.ceil(xwidth/2);		yheight = Groups[i]['ymax'] -  Groups[i]['ymin'];		Y = Groups[i]['ymin'] + yheight;		coords = this.gmapObject.fromContainerPixelToLatLng( new GPoint(X,Y) );		this.addMarker(coords.lat(),coords.lng(), str ,'much',false,true);		}	}	}	this.getMarkersCorrdsInPixels = function(){	var MarkersInPixels = new Array();		if( this.mapType == 'gmap'){			max = this.Markers.length;			for(i=0; i<=max;i++){				if( this.Markers[i] ){					if( this.Markers[i]['lat'] > 0){					px = this.gmapObject.fromLatLngToContainerPixel( new GLatLng( this.Markers[i]['lat'], this.Markers[i]['lng'] ) );					MarkersInPixels[i]=new Array(px.x, px.y, i);					}				}			}		return MarkersInPixels;		}	}	this.getFindMarkHtml = function(){		var addJS = "";		var addJS2 = "";		whatp = "kur";		/*if (jsMap != null && jsMap == true) {			addJS = '<input type="hidden" name="js"/>';			addJS2 = '&js';		}*/		nosaukumsEvents = 'onfocus="onfocusChange(this, \'Nosaukums...\', \'onclick\')" onclick="onclickRemoveTxt(this, \'Nosaukums...\')"';		piezimesEvents = 'onfocus="onfocusChange(this, \'Piezīmes...\', \'onclick\')" onclick="onclickRemoveTxt(this, \'Piezīmes...\')"';		return '<div class="map_popup">'+				'<div class="SearchRes">'+					'<ul class="Options">'+						'<li class="Searcher_head">Meklēt tuvāko objektu:</li>'+//Meklēt tuvāko objektu						'<li class="Searcher">'+							'<form action="#" method="get" onSubmit="findMarkClick()">'+								'<input id="findMarkWhat" class="" type="text" value="'+whatp+'" name="whatp"/>'+addJS+								'<input class="submit lv" type="submit" value="Meklēt"/>'+							'</form>'+						'</li>'+						'<li class="MyPlaces_head">Pievienot manām vietām:</li>'+						'<li class="MyPlaces">'+							'<form action="?manas'+addJS2+'" method="post" onSubmit="saveManuVietuClick()">'+								'<input id="pievienotNosaukums" class="" type="text" value="Nosaukums..." '+nosaukumsEvents+' name="pievienotNosaukums"/>'+								'<textarea id="pievienotPiezimes" class="" onfocus="this.className=\'onclick\'" '+piezimesEvents+' name="pievienotPiezimes">Piezīmes...</textarea>'+								'<input class="submit lv" type="submit" value="Meklēt"/>'+							'</form>'+						'</li>'+					'</ul>'+				'</div></div>';	}	this.MapCorners = function(coords_type, thisObj){		//coords_type: geo | lks		if( !coords_type ){			coords_type = 'lks';		}		if( this.mapType == 'jmap'){			 corners = this.jmapObject.MapCorners();			 if( coords_type=='lks' ){			 	return corners;			 }else{			 	geo_min = Kijs_Lks_2_LatLon(corners.x_min, corners.y_min);			 	geo_max = Kijs_Lks_2_LatLon(corners.x_max, corners.y_max);			 	corners = new Object();			 	corners.x_min = geo_min.lat;			 	corners.x_max = geo_max.lat;			 	corners.y_min = geo_min.lon;			 	corners.y_max = geo_max.lon;			 	return corners;			 }		}		if( this.mapType=='gmap'){			thisObject = thisObj || this;			if( thisObject.gmapObject == null ){				var thisObj = this;				//setTimeout(function(){ thisObj.MapCorners(coords_type,thisObj) }, 1500 );				 thisObj.MapCorners(coords_type,thisObj);			}else{				corners =  thisObject.gmapObject.getBounds();				if( coords_type == 'lks'){					ret = new Object();					max = corners.getNorthEast();					min = corners.getSouthWest();					lks_max = Kijs_LatLon_2_Lks(max.lat(), max.lng());					ret.x_max = lks_max.x;					ret.y_max = lks_max.y;					lks_min = Kijs_LatLon_2_Lks(min.lat(), min.lng());					ret.x_min = lks_min.x;					ret.y_min = lks_min.y;					return ret;				}				if( coords_type == 'geo'){					ret = new Object();					max = corners.getNorthEast();					min = corners.getSouthWest();					ret.x_max = max.lat();					ret.y_max = max.lng();					ret.x_min = min.lat();					ret.y_min = min.lng();					return ret;				}			}		}	}	this.getLbsMarkerCoords = function(){		if( typeof(this.lbsMarker) == 'object' ){			if( this.lbsMarker  ){			var geo = this.lbsMarker.getLatLng();			var lks = Kijs_LatLon_2_Lks( geo.lat(), geo.lng() );			return new Array(lks.x, lks.y);			}		}else{			return new Array(this.lbsMarkerXY['X'], this.lbsMarkerXY['Y']);		}		return false;	}	this.addLbsMarker = function(lat,lng ){	if( (lat > 80 ) && (lng > 80) ){			var geo = Kijs_Lks_2_LatLon( lat, lng);			lat = geo.lat;			lng = geo.lon;	}	if( this.mapType =='gmap'){		if( this.gmapObject ){				if( this.lbsMarker == null ){					Marker = this.getGMarker('lbs');					point = new GLatLng(lat, lng);					marker = new GMarker(point, {icon: Marker, draggable: true});					this.gmapObject.addOverlay(marker);					this.lbsMarker = marker;				}else{					this.lbsMarker.setLatLng(new GLatLng(lat, lng));				}				var lbsMarkerGlobal = this.lbsMarker;				thisObj = this;				GEvent.addListener(lbsMarkerGlobal, "click", function() {					var geo = this.getLatLng();				    thisObj.infoWinStreetName(lbsMarkerGlobal, geo);	    		});	    		/*GEvent.addListener(marker, "dragend", function() {	    			setTimeout( function(){	      			var geo = this.getLatLng();				    thisObj.infoWinStreetName(lbsMarkerGlobal, geo);				    },500);	    		});*/				}	}	if( this.mapType == 'jmap' ){			if( this.lbsMarker == null ){					var thisObject = this;					var lks = Kijs_LatLon_2_Lks(lat, lng);					im_url = this.getIconImg('lbs');					var image = this.jmapObject.image_layer.Add("/img/"+im_url, lks.x, lks.y, 10, 10, 21, 25);					this.lbsMarker = image;					this.lbsMarkerXY['X'] = lks.x;					this.lbsMarkerXY['Y'] = lks.y;			}else{				//'update coords'				try{				this.jmapObject.image_layer.Remove(this.lbsMarker);				var lks = Kijs_LatLon_2_Lks(lat, lng);				im_url = this.getIconImg('lbs');				var image = this.jmapObject.image_layer.Add("/img/"+im_url, lks.x, lks.y, 10, 10, 21, 25);				this.lbsMarker = image;				this.lbsMarkerXY['X'] = lks.x;				this.lbsMarkerXY['Y'] = lks.y;				}catch(e){}			}	}	//end addLbsMarker	}	this.searchAddressByString = function(str, callBackFn){		if( this.mapType == 'gmap' ){			data = new Array();			data_counter = 0;			function formatResults()			{				if( kijs_address != 'undefined' ){					if( kijs_streets ){						if( kijs_streets.lv.total > 0){						data = -100;						callBackFn(data);						}					}				}				if( kijs_address ){					if( kijs_address.length > 0 ){						max = kijs_address.length;						for(i=0; i<max; i++ ){								data[data_counter] = new Array( kijs_address[i].n, kijs_address[i].x, kijs_address[i].y  );								data_counter++;						}					}				callBackFn(data);				}			}			call_back.LoadJson("http://maps.kartes.lv/kijs/server_scripts/search.php?q="+str+"&kijs=2RTB", function(){formatResults()});		}		if( this.mapType == 'jmap' ){			this.jmapObject.ShowSearchControls();			this.jmapObject.search_control.HideSearchButton();			jmapObjRef = this.jmapObject;			this.jmapObject.search_control.SearchAddress(str,				function(){					var data = new Array();					var data_counter = 0;					if( kijs_streets.lv.data.length > 0 ){						jmapObjRef.search_control.ShowAndCenterStreet(kijs_streets.lv.data[0].id, kijs_streets.lv.data[0].t);					}					if( kijs_address ){						if( kijs_address.length > 0){							max = kijs_address.length;							for(i=0; i<max; i++ ){								data[data_counter] = new Array( kijs_address[i].n, kijs_address[i].x, kijs_address[i].y  );								data_counter++;							}						}					}					if( data.length > 0){						callBackFn(data);					}				}			);		}	}	this.infoWinStreetName = function(marker, geo){		if( this.mapType == 'gmap' ){			var geocoder = new GClientGeocoder();		      if (geocoder){		        geocoder.getLocations(geo,		        function(x){		        	if( x.Status.code == 200 ){		        		var accuracy = x.Placemark[0].Accuracy;		        		var fullAdress = x.Placemark[0].address		        		var countryCode = x.Placemark[0].AddressDetails.Country.CountryNameCode;		        		var countryName = x.Placemark[0].AddressDetails.Country.CountryName;		        		if( x.Placemark[0].AddressDetails.Country.SubAdministrativeArea ){		        			area = x.Placemark[0].AddressDetails.Country.SubAdministrativeArea;		        			var areaName = area.SubAdministrativeAreaName;		        			if( area.Locality ){		        				var localityName = area.Locality.LocalityName;		        				if( area.Locality.Thoroughfare ){		        					var Thoroughfare = area.Locality.Thoroughfare.ThoroughfareName;		        				}		        				if( area.Locality.PostalCode ){		        					var postCode = area.Locality.PostalCode.PostalCodeNumber;		        				}		        			}		        		}		        		var addr = new Array();		        		if( areaName ) addr.push(areaName);		        		if( localityName && (areaName!=localityName) ) addr.push(localityName);		        		if( Thoroughfare ) addr.push(Thoroughfare);		        		if( postCode && (countryCode='LV') ) addr.push('LV-'+postCode);		        		marker.openInfoWindowHtml( addr.join(', ') );		        	}		        }		        );		        //lbsLastAddress		     }		}	}	this.addUserMarker = function(lat,lng, name){		if( (lat > 80 ) && (lng > 80) ){			var geo = Kijs_Lks_2_LatLon( lat, lng);			lat = geo.lat;			lng = geo.lon;		}		index = this.Markers.length;		this.Markers[index] = new Array();		this.Markers[index]['lat'] = lat;		this.Markers[index]['lng'] = lng;		this.Markers[index]['name'] = this.getFindMarkHtml();		this.Markers[index]['type'] = 'lbs';		if( this.lastAddedUserMarker ){			if( this.lastAddedUserMarker.addStatus == -1 ){				try{					this.gmapObject.removeOverlay(this.lastAddedUserMarker);				}				catch(e){}				if( this.Markers[index-1]['type'] == 'user' ){					delete(this.Markers[index-1]);				}			}		}		if( this.mapType =='jmap'){		NewMarker = this.Markers[index];				if( NewMarker ){					var thisObject = this;					var lks = Kijs_LatLon_2_Lks(NewMarker['lat'], NewMarker['lng']);					im_url = this.getIconImg(NewMarker['type']);					var image = this.jmapObject.image_layer.Add("/img/"+im_url, lks.x, lks.y, 10, 10, 21, 25);					NewMarker['ref2'] = image;					this.ToolTipNames[image] = NewMarker['name'];					this.jmapObject.image_layer.EventMouseOverCallback(image,						function(id){					 		thisObject.jmapObject.tooltip.Show(thisObject.ToolTipNames[id] );					 	}					 );					this.jmapObject.image_layer.EventMouseOutCallback(image, function(id){ thisObject.jmapObject.tooltip.Hide();} );			}		}		if( this.mapType == 'gmap' ){			Marker = this.getGMarker('user');			point = new GLatLng(lat, lng);			marker = new GMarker(point, {icon: Marker, draggable: true});			var html = this.getFindMarkHtml();			try{				marker.openInfoWindowHtml(html);			}			catch(e){			}			marker.HTMLForAdding = this.getFindMarkHtml();			GEvent.addListener(marker, "dragstart", function() {      			this.closeInfoWindow();    		});    		var thisObj = this;    		GEvent.addListener(marker, "dragend", function() {      			this.openInfoWindowHtml(thisObj.getFindMarkHtml());    		});			GEvent.addListener(marker, 'click', function() {				this.openInfoWindowHtml(this.HTMLForAdding);				this			});			try{				this.gmapObject.addOverlay(marker);				this.lastAddedUserMarker = marker;				this.lastAddedUserMarker.addStatus = -1;			}			catch(e){}		}		return this.Markers[index];	}	this.reDrawMarkers = function(){		//kluda f-jas definejuma		this.reDrawMarkrs();	}	this.addNumberToMarker = function(MarkerIndex, Number){	}	this.addMarker = function(lat,lng, name, type, openInfoWinOnceOnLoad,deleteWhenShowed, markerNumber){		//deleteWhenShowed - parada tikai uz kartes, bet reali ka markers neeksiste		// nepiecieshams prieksh grupeshanas		if( !deleteWhenShowed ){			deleteWhenShowed = false;		}		if( !openInfoWinOnceOnLoad ){			openInfoWinOnceOnLoad  = false;		}		if( (lat > 80 ) && (lng > 80) ){			if( typeof(Kijs_Lks_2_LatLon) == 'function' ){				var geo = Kijs_Lks_2_LatLon( lat, lng);				lat = geo.lat;				lng = geo.lon;			}else{				lat = this.Lat;				lng = this.Lng;			}		}		index = this.Markers.length;		this.Markers[index] = new Array();		this.Markers[index]['lat'] = lat;		this.Markers[index]['lng'] = lng;		this.Markers[index]['name'] = name;		this.Markers[index]['type'] = type;		this.Markers[index]['open'] = openInfoWinOnceOnLoad;		this.Markers[index]['index'] = index;		if( markerNumber ){			this.Markers[index]['number'] = markerNumber;		}		var map1188Object = this;		if( this.MarkersAreRenderedWhenMapLoaded ){			//this.gmapObject.clearOverlays();			//setTimeout(function(){map1188Object.reDrawMarkrs()},200);		}		this.addOneMarkerToMapAndShow(this.Markers[index], deleteWhenShowed);		if( deleteWhenShowed ){			delete(this.Markers[index]);		}		return index;	}	this.IsNumeric = function(input)	{	   return (input - 0) == input && input.length > 0;	}	this.deleteMarker = function(i,removeOnlyFromMap){	if( !removeOnlyFromMap ){		removeOnlyFromMap = false;	}		if( this.mapType == 'gmap'){			if( this.Markers[i] ){				if( this.Markers[i]['ref'] ){					this.gmapObject.removeOverlay(this.Markers[i]['ref']);					if( removeOnlyFromMap == false ){						delete(this.Markers[i]);					}				}else{					if( removeOnlyFromMap == false ){						delete(this.Markers[i]);					}				}			}		}		if( this.mapType ==  'jmap' ){			//console.log('Call map.deleteMarker('+i+') '+ typeof(i) );			//try{			if( typeof(i) == 'number'){				if( this.Markers[i] ){					//console.log( this.Markers[i] );					x = this.jmapObject.image_layer.Remove(this.Markers[i]['ref2']);					//console.log('Dzests: '+x);					//this.Markers[i]['ref2_info'].Remove();				}			}			//}			//catch(e){			//alert(e);			//}			if( removeOnlyFromMap == false ){				delete(this.Markers[i]);			}			//this.reDrawMarkers();		}	}	this.updateMarkerInfo = function(i, value){		if( i >= 0){			if( typeof(value)!='undefined'){				this.Markers[i]['name'] = value;			}		}	}	this.showMarkerInfo = function(i){		if( this.mapType == 'gmap'){			if( this.Markers[i] ){				if( this.Markers[i]['ref'] ){					marker = this.Markers[i]['ref'];					//alert( this.Markers[i]['name'].tabs );					if( typeof(this.Markers[i]['name']) == 'function' ){						ExecFunction = this.Markers[i]['name'];						ExecFunction();						return;					}					if( this.Markers[i]['name'].tabs == true ){						marker.openInfoWindow('Notiek ielāde...');						var map1188ObjectRef = this;						if( this.Markers[i]['name'].tabs_content_url ){							$.get( this.Markers[i]['name'].tabs_content_url, function(data){								//var new_tabs = [ new GInfoWindowTab( 'updated Tab' , 'saturs' ), new GInfoWindowTab( 'updated Tab2' , 'saturs2' ) ];								if( data.ok == true ){									maxTabs = data.tabs.length;									if( maxTabs > 0){										var new_tabs = new Array();										for( var i=0; i < maxTabs; i++ ){											new_tabs[ new_tabs.length ] =  new GInfoWindowTab( data.tabs[i].title , data.tabs[i].html );										}									}								}								//new_tabs = new Array();								//new_tabs								map1188ObjectRef.gmapObject.updateInfoWindow( new_tabs );								marker.openInfoWindowTabsHtml( new_tabs );							}, 'json' );						}					}else{						marker.openInfoWindowHtml( this.Markers[i]['name'] );					}				}			}		}		if( this.mapType == 'jmap' ){			if( this.Markers[i] ){;				if( this.Markers[i]['lat'] ){					var lks = Kijs_LatLon_2_Lks(this.Markers[i]['lat'], this.Markers[i]['lng']);					if( this.MarkerInfo ) this.MarkerInfo.Remove();					this.MarkerInfo = new StaticInfoBox(this.jmapObject, lks.x, lks.y, this.renderInfoBoxJmap(this.Markers[i]['name'],''), 15, -5);				}			}		}	}	this.getGMarker = function(MarkerType){		if(typeof GIcon == 'undefined'){			var map1188Object = this;			return -1;		}else{			if( MarkerType=='much' ){				markerBigIcon = new GIcon();				markerBigIcon.image = "/img/mappoint3.png";				markerBigIcon.iconSize = new GSize(28, 31);				markerBigIcon.shadow = "/img/shadow50.png";				markerBigIcon.shadowSize = new GSize(37, 25);				markerBigIcon.iconAnchor = new GPoint(14, 31);				markerBigIcon.infoWindowAnchor = new GPoint(19, 3);				return markerBigIcon;			}			else if(MarkerType=='dzd'){				markerIcon = new GIcon();				markerIcon.image = "/img/"+this.getIconImg(MarkerType);				markerIcon.iconSize = new GSize(25, 24);				markerIcon.iconAnchor = new GPoint(12, 39);				markerIcon.infoWindowAnchor = new GPoint(19, 3);				return markerIcon;			}			else if(MarkerType=='rs'){				markerIcon = new GIcon();				markerIcon.image = "/img/"+this.getIconImg(MarkerType);				markerIcon.iconSize = new GSize(27, 25);				markerIcon.iconAnchor = new GPoint(13, 12);				markerIcon.infoWindowAnchor = new GPoint(13, 12);				return markerIcon;			}			else if(MarkerType=='rs2'){				markerIcon = new GIcon();				markerIcon.image = "/img/"+this.getIconImg(MarkerType);				markerIcon.iconSize = new GSize(20, 45);				markerIcon.iconAnchor = new GPoint(10, 25);				markerIcon.infoWindowAnchor = new GPoint(10, 22);				return markerIcon;			}			else if(MarkerType=='mypoint'){				markerIcon = new GIcon();				markerIcon.image = "/img/"+this.getIconImg(MarkerType);				markerIcon.iconSize = new GSize(18, 39);				markerIcon.iconAnchor = new GPoint(7, 39);				markerIcon.infoWindowAnchor = new GPoint(19, 3);				return markerIcon;			}			else if(MarkerType=='md'){				markerIcon = new GIcon();				markerIcon.image = "/img/"+this.getIconImg(MarkerType);				markerIcon.iconSize = new GSize(29, 28);				markerIcon.shadow = "/img/shadow50.png";				markerIcon.shadowSize = new GSize(37, 25);				markerIcon.iconAnchor = new GPoint(10, 25);				markerIcon.infoWindowAnchor = new GPoint(19, 3);				return markerIcon;			}			else if( MarkerType=='m4'){				markerIcon = new GIcon();				markerIcon.image = "/img/"+this.getIconImg(MarkerType);				markerIcon.iconSize = new GSize(28, 26);				markerIcon.iconAnchor = new GPoint(0, 0);				markerIcon.infoWindowAnchor = new GPoint(5, 3);				return markerIcon;			}			else if( MarkerType=='mn'){				markerIcon = new GIcon();				markerIcon.image = "/img/"+this.getIconImg(MarkerType);				markerIcon.iconSize = new GSize(23, 25);				markerIcon.iconAnchor = new GPoint(0, 0);				markerIcon.infoWindowAnchor = new GPoint(10, 3);				return markerIcon;			}			else if(MarkerType=='dott'){				markerIcon = new GIcon();				markerIcon.image = "/img/"+this.getIconImg(MarkerType);				markerIcon.iconSize = new GSize(18, 18);				markerIcon.iconAnchor = new GPoint(9, 9);				markerIcon.infoWindowAnchor = new GPoint( 8 , 2);				return markerIcon;			}			else if(MarkerType=='dots'){				markerIcon = new GIcon();				markerIcon.image = "/img/"+this.getIconImg(MarkerType);				markerIcon.iconSize = new GSize(25, 25);				markerIcon.iconAnchor = new GPoint(12, 12);				markerIcon.infoWindowAnchor = new GPoint(12, 2);				return markerIcon;			}			else if(MarkerType=='bvn'){				markerIcon = new GIcon();				markerIcon.image = "/img/"+this.getIconImg(MarkerType);				markerIcon.iconSize = new GSize(23, 23);				markerIcon.iconAnchor = new GPoint(12, 12);				markerIcon.infoWindowAnchor = new GPoint(12, 2);				return markerIcon;			}			else if(MarkerType=='ligo'){				markerIcon = new GIcon();				markerIcon.image = "/img/"+this.getIconImg(MarkerType);				markerIcon.iconSize = new GSize(17, 25);				markerIcon.iconAnchor = new GPoint(12, 12);				markerIcon.infoWindowAnchor = new GPoint(12, 2);				return markerIcon;			}			else if(MarkerType=='zp'){				markerIcon = new GIcon();				markerIcon.image = "/img/"+this.getIconImg(MarkerType);				markerIcon.iconSize = new GSize(24, 24);				markerIcon.iconAnchor = new GPoint(12, 12);				markerIcon.infoWindowAnchor = new GPoint(12, 12);				return markerIcon;			}			else if(MarkerType=='bn'){				markerIcon = new GIcon();				markerIcon.image = "/img/"+this.getIconImg(MarkerType);				markerIcon.iconSize = new GSize(32, 32);				markerIcon.iconAnchor = new GPoint(16, 16);				markerIcon.infoWindowAnchor = new GPoint(16, 16);				return markerIcon;			}else if(MarkerType=='nr'){				markerIcon = new GIcon();				markerIcon.image = "/img/"+this.getIconImg(MarkerType);				markerIcon.iconSize = new GSize(27, 24);				markerIcon.iconAnchor = new GPoint(13, 12);				markerIcon.infoWindowAnchor = new GPoint(13, 12);				return markerIcon;			}else if(MarkerType=='cvk'){				markerIcon = new GIcon();				markerIcon.image = "/img/"+this.getIconImg(MarkerType);				markerIcon.iconSize = new GSize(24, 29);				markerIcon.iconAnchor = new GPoint(12, 14);				markerIcon.infoWindowAnchor = new GPoint(12, 14);				return markerIcon;			}			else{				markerIcon = new GIcon();				markerIcon.image = "/img/"+this.getIconImg(MarkerType);				markerIcon.iconSize = new GSize(21, 25);				markerIcon.shadow = "/img/shadow50.png";				markerIcon.shadowSize = new GSize(37, 25);				markerIcon.iconAnchor = new GPoint(10, 25);				markerIcon.infoWindowAnchor = new GPoint(19, 3);				return markerIcon;			}		}	}	this.getIconImg = function(iconType){		switch(iconType){			case 'bn':{				img = 'mappoint-star.png';			}			break;			case 'nr':{				img = 'mappoint-fitness.png';			}			break;			case 'cvk':{				img = 'mappoint-CVK.png';			}			break;			case 'zp':{				img = 'mappoint-zalais.png';			}			break;			case 'rs':{				img = 'mappoint-Riga.png';			}			break;			case 'rs2':{				img = 'mappoint-RigaSWH.png';			}			break;			case 'dzd':{				img = 'mappoint-dzd.png';			}			break;			case 'bvn':{				img = 'mappoint-ball.png';			}			break;			case 'ligo':{				img = 'mappoint-ligo.png';			}			break;			case 'mn':{				img = 'mappoint-mn.png';			}			break;			case 'm4':{				img = 'mappoint-4.m.gif';			}			break;			case 'dots':{				img = 'dots.png';			}			break;			case 'eye':{				img = 'mappoint-eye.png';			}			break;			case 'dott':{				img = 'dott.png';			}			break;			case 'mypoint':{				img = 'mypoint.gif';			}			break;			case 'md':{				img = 'mappoint-md.png';			}			break;			case 'easter':{				img = 'mappoint_egg.png';			}			break;			case 'mappoint-y':{				img = 'mappoint2-y.png';			}			break;			case 'lbs':{				img = 'mappoint-myplace.png';			}			break;			case 'user':{				img = 'search.png';			}			break;			case 'much':{				img = 'mappoint3.png';			}			break;			case 'atm':{				img = 'mappoint-atm.png';			}			break;			case 'dus':{				img = 'mappoint-dus.png';			}			break;			case 'wifi':{				img = 'mappoint-wifi.png';			}			break;			default : {				if( this.mapType=='gmap' ){					img = 'mappoint2.png';				}				if( this.mapType=='jmap' ){					img = 'mappoint2.png';				}			}		}	return img;	}	this.setIconType = function(iconType){		this.iconType = iconType;		this.iconImg = this.getIconImg(iconType);	}	this.addOneMarkerToMapAndShow = function(NewMarker, deleteWhenShowed){	var map1188ObjectRef = this;	//reali uzliek uz kartes punktu	if( this.mapType =='gmap'){		if( this.gmapObject ){			if( NewMarker ){				Marker = this.getGMarker(NewMarker['type']);				point = new GLatLng(NewMarker['lat'], NewMarker['lng']);							if( NewMarker['type'] == 'user' ){								marker = new GMarker(point, {icon: Marker, draggable: true});								GEvent.addListener(marker, "dragend", function() {					      			this.openInfoWindowHtml(thisObj.getFindMarkHtml());					    		});							}							else if(NewMarker['type'] == 'mypoint'){								this.MyPointMarkerIndex =  NewMarker['index'];								marker = new GMarker(point, {icon: Marker, draggable: true});								GEvent.addListener(marker, "dragstart", function() {					      			this.closeInfoWindow();					    		});					    		GEvent.addListener(marker, "dragend", function() {					    			latlang = this.getPoint();					    			if( typeof(map1188ObjectRef.MyPointChangeCallBackFn) == 'function' ){					    				setTimeout( function(){  map1188ObjectRef.MyPointChangeCallBackFn( latlang.lat(), latlang.lng() ) }, 0);					    			}					      			//coords = this.fromContainerPixelToLatLng(xyPoint);					    		});							}							else{								opts = {										"icon": Marker,										"clickable": true,										"draggable": false								};								if( NewMarker['number'] ){									opts = {										"icon": Marker,										"clickable": true,										"draggable": false,										"labelText": NewMarker['number'],										"labelOffset": new GSize(-16, -32)									};									marker = new this.LabeledMarker(point, opts );								}else{									marker = new GMarker(point, opts );								}							}							marker.InfoName = NewMarker['name'];							marker.number = NewMarker['number'];							if( NewMarker['open'] == true ){								try{									marker.openInfoWindowHtml(marker.InfoName);								}								catch(e){}							}							GEvent.addListener(marker, 'click', function() {								if( typeof(this.InfoName) == 'function' ){									this.InfoName();								}else{									this.openInfoWindowHtml(this.InfoName);								}								if( typeof(map1188ObjectRef.MarkerClickCallBackFn) == 'function' ){					    				map1188ObjectRef.MarkerClickCallBackFn(this.number);					    		}							});							try{								NewMarker['ref'] = marker;								this.gmapObject.addOverlay(marker);							}							catch(e){							 }				}			}		}	if( this.mapType == 'jmap' ){		if( NewMarker ){					var thisObject = this;					var lks = Kijs_LatLon_2_Lks(NewMarker['lat'], NewMarker['lng']);					im_url = this.getIconImg(NewMarker['type']);					if( NewMarker['type']=='much'){						var image = this.jmapObject.image_layer.Add("/img/"+im_url, lks.x, lks.y, 10, 10, 28, 31);						NewMarker['ref2'] = image;						if( NewMarker['number'] ){						var static_info = new StaticInfoBox(this.jmapObject, lks.x, lks.y, '<div class="markerLabelJS" onMousedown="ShowInfo('+i+');">'+NewMarker['number']+'</div>', -2, -2, "transparent", "0px");						NewMarker['ref2_info'] = static_info;						}					}					else{						var image = this.jmapObject.image_layer.Add("/img/"+im_url, lks.x, lks.y, 10, 10, 21, 25);						//var image = this.jmapObject.image_layer.Add("/img/"+im_url, lks.x, lks.y, 0, 0, 21, 25);						if( NewMarker['number'] ){						var static_info = new StaticInfoBox(this.jmapObject, lks.x, lks.y, '<div class="markerLabelJS" onMousedown="ShowInfo('+i+');">'+NewMarker['number']+'</div>', -5, -8, "transparent", "0px");						NewMarker['ref2_info'] = static_info;						}						NewMarker['ref2'] = image;					}					if( this.ToolTipNames ){						this.ToolTipNames[image] = NewMarker['name'];					}					//EventClickCallback					this.jmapObject.image_layer.EventClickCallback(image,					function(id){						//thisObject.jmapObject.tooltip.Hide();						//thisObject.jmapObject.tooltip.Show( thisObject.renderInfoBoxJmap( thisObject.ToolTipNames[id] ,'',thisObject ) );					} );					//this.jmapObject.image_layer.EventMouseOutCallback(image, function(id){ thisObject.jmapObject.tooltip.Hide();} );			}		}	if( deleteWhenShowed == true ){		delete(NewMarker);	}	}	this.JScloseToolTip = function(){		$('#JSToolTip').remove();		this.jmapObject.tooltip.Hide();	}	this.renderInfoBoxJmap = function(name,addr,obj){	var boxhtml = '';		//boxhtml += '<div class="map_popup" style="position:absolute;top:150px;left:600px">';		boxhtml += '<div id="JSToolTip" class="map_popup" style="position:absolute;top:0px;left:0px">';		boxhtml += '<div class="c1"></div><div class="c2"></div><div class="c3"></div><div class="c4"></div>';			boxhtml += '<a href="javascript:void(0)" title="Aizvērt!" onclick="map.JScloseToolTip()" class="close"/>';			boxhtml += '<div class="content SearchRes">';				boxhtml += '<ul class="SearchRes">';					boxhtml += '<li class="first">';						if( name.length > 0)							boxhtml += '<h1><a href="">'+name+'</a></h1>';						if( addr.length > 0)							boxhtml += '<p><a href="">'+addr+'</a></p>';					boxhtml += '</li>';				boxhtml += '</ul>';		boxhtml += '</div>';	boxhtml += '</div>';	return boxhtml;	}	this.reDrawMarkrs = function(){		if( this.mapType == 'jmap' ){			var thisObject = this;			this.ToolTipNames = new Array();			max = this.Markers.length;			i=0;			while(i <= max){				if( this.Markers[i] ){					this.addOneMarkerToMapAndShow(this.Markers[i]);				}			i++;			}		}		if( this.mapType == 'gmap' ){			Marker = this.getGMarker();			if( Marker== -1){				return;			}			else{				var GInfoNames = new Array();				var thisObj = this;				if( this.Markers ){				max = this.Markers.length;				i=0;				k=0;					while(i <= max ){						if( this.Markers[i] ){							this.addOneMarkerToMapAndShow(this.Markers[i]);						}						i++;					}				}			}		}	}	//Zoom Level google maps. JS map zoom: y=17-x, where x is google zoom	this.setZoom = function(zoomLevel, setOnMap){		if( typeof zoomLevel == 'number'){			this.Zoom = zoomLevel;			if( setOnMap ){				try{				this.gmapObject.setCenter(new GLatLng( this.Lat, this.Lng ), this.Zoom );				}catch(e){				}			}		}else{			return;		}		if( this.isLoaded == true ){			if( this.mapType == 'gmap' ){				//this.gmapObject.setZoom(zoomLevel);			}			if( this.mapType == 'jmap' ){				zoom = 17 - zoomLevel;				this.jmapObject.ChangeLevel(zoom);			}		}	}	this.setCenter = function(lat, lng){		//Ja nu gadijuma padotas LKS kooredinates		if( (lat > 80 ) && (lng > 80) ){			lksx = lat;			lksy = lng;			if( typeof(Kijs_Lks_2_LatLon) == 'function' ){				var geo = Kijs_Lks_2_LatLon( lat, lng);				lat = geo.lat;				lng = geo.lon;			}else{				lat = this.Lat;				lng = this.Lng;			}		}		lat = parseFloat(lat);		lng = parseFloat(lng);		this.Lat = lat;		this.Lng = lng;		if( this.isLoaded == true ){			if( this.mapType == 'gmap' ){				try{					this.gmapObject.setCenter(new GLatLng( lat, lng ), this.Zoom);				}				catch(e){				}			}			if( this.mapType == 'jmap' ){				this.jmapObject.ChangeLevel(zoom);				if( lksx ){				this.jmapObject.SetCenter(lksx,lksy);				}			}		}	}	this.loadIn = function(elem){	try{		if( (typeof elem)  != 'object' ){			elem = document.getElementById(elem);		}		this.curentElement = elem;		this.currentElementId = elem.id;		if( this.mapType=='gmap'){			this.GMapClassLoad(this);		}		if( this.mapType == 'jmap' ){			this.initJMap(this);		}		this.isLoaded = true;	}catch(e){}	}	this.initGmap = function(map1188ObjectRef){		try{			this.jmapObject.tooltip.Hide();			delete(map1188ObjectRef.jsmapObject);		}		catch(e){}		var jsmapObject;		if( this.mapType=='jmap'){			this.mapType = 'gmap';			this.GMapClassLoad(map1188ObjectRef);			return;		}		if( this.enableLBSUserPoint ){			if( this.lbsMarker ){				if( (this.lbsMarkerXY['X'] > 0) && (this.lbsMarkerXY['Y'] > 0) ){					var thisObj = this;					//lai gmap redzetu, ka japievieno jauns markers nevis jaupdeito coords = null					this.lbsMarker = null;					setTimeout(					function(){					thisObj.addLbsMarker( thisObj.lbsMarkerXY['X'] , thisObj.lbsMarkerXY['Y']);					},1000);				}			}		}		if( typeof( this.mapSwitchCallBackFn)=='function' ){			this.mapSwitchCallBackFn();		}		this.LabeledMarker = function(latlng, options){		    this.latlng = latlng;		    this.labelText = options.labelText || "";		    this.labelClass = options.labelClass || "markerLabel";		    this.labelOffset = options.labelOffset || new GSize(0, 0);		    this.clickable = options.clickable || true;		    if (options.draggable) {		        options.draggable = false;		    }		    GMarker.apply(this, arguments);		}		this.LabeledMarker.prototype = new GMarker(new GLatLng(0, 0));		this.LabeledMarker.prototype.initialize = function(map) {			GMarker.prototype.initialize.apply(this, arguments);			var div = document.createElement("div");			div.className = this.labelClass;			div.innerHTML = this.labelText;			div.style.position = "absolute";			map.getPane(G_MAP_MARKER_PANE).appendChild(div);			if (this.clickable) {				var eventPassthrus = ['click', 'dblclick', 'mousedown', 'mouseup', 'mouseover', 'mouseout'];				for(var i = 0; i < eventPassthrus.length; i++) {					var name = eventPassthrus[i];					GEvent.addDomListener(div, name, newEventPassthru(this, name));				}				div.style.cursor = "pointer";			}			this.map = map;			this.div = div;		}		newEventPassthru = function(obj, event) {			return function() {				GEvent.trigger(obj, event);			};		}		this.LabeledMarker.prototype.redraw = function(force) {			GMarker.prototype.redraw.apply(this, arguments);			if (!force) return;			var p = this.map.fromLatLngToDivPixel(this.latlng);			var z = GOverlay.getZIndex(this.latlng.lat());			this.div.style.left = (p.x + this.labelOffset.width) + "px";			this.div.style.top = (p.y + this.labelOffset.height) + "px";			this.div.style.zIndex = z + 1;		}		this.LabeledMarker.prototype.remove = function() {			GEvent.clearInstanceListeners(this.div);			this.div.parentNode.removeChild(this.div);			this.div = null;			GMarker.prototype.remove.apply(this, arguments);		}		function JSButton(map1188ObjectRef) {			jsmapObject = map1188ObjectRef;		}		JSButton.prototype = new GControl();		JSButton.prototype.initialize = function(map) {			var container = document.createElement("div");			var gmapButtonImg = document.createElement("img");			gmapButtonImg.src = "/img/maps_g_.png";			gmapButtonImg.style.cursor = "pointer";			container.appendChild(gmapButtonImg);			map.getContainer().appendChild(container);			var jsButtonImg = document.createElement("img");			jsButtonImg.src = "/img/maps_js.png";			jsButtonImg.style.cursor = "pointer";			jsButtonImg.title = 'Pārslēgties uz "Jāņa sēta" karti';//Pārslēgties uz "Jāņa sēta" karti			container.appendChild(jsButtonImg);			GEvent.addDomListener(jsButtonImg, "click", function() {				jsButtonImg.src = "/img/maps_js_.png";				gmapButtonImg.src = "/img/maps_g.png";				var sw = map.getBounds().getSouthWest();				var ne = map.getBounds().getNorthEast();				jsmapObject.Zoom = map.getZoom();				geo = map.getCenter();				jsmapObject.Lat = geo.lat();				jsmapObject.Lng = geo.lng();				x = jsmapObject.gmapObject.getCurrentMapType().getName(true);				map1188ObjectRef.isSatellite = false;				if( x == 'Satelīts' ){					map1188ObjectRef.isSatellite = true;				}				jsmapObject.initJMap(jsmapObject);			});			GEvent.addDomListener(jsButtonImg, "mousedown", function() {				jsButtonImg.src = "/img/maps_js_.png";				gmapButtonImg.src = "/img/maps_g.png";			});			GEvent.addDomListener(jsButtonImg, "mouseup", function() {				jsButtonImg.src = "/img/maps_js.png";				gmapButtonImg.src = "/img/maps_g_.png";			});			GEvent.addDomListener(jsButtonImg, "mouseout", function() {				jsButtonImg.src = "/img/maps_js.png";				gmapButtonImg.src = "/img/maps_g_.png";			});			/*			if( typeof( map1188ObjectRef.callBackFnOnZoomEnd ) == 'function'  ){				GEvent.addListener(map1188ObjectRef.gmapObject, 'zoomend', function(oldzoom,newzoom){					var meters = map1188ObjectRef.gmapObject.getBounds().getSouthWest().distanceFrom(  map1188ObjectRef.gmapObject.getBounds().getNorthEast() );					var center = map1188ObjectRef.gmapObject.getBounds().getCenter();					lks = Kijs_LatLon_2_Lks( center.lat() , center.lng() );					map1188ObjectRef.callBackFnOnZoomEnd(meters, lks.x, lks.y);				});			}*/			if( map1188ObjectRef.enableRightClick ){				GEvent.addListener(map1188ObjectRef.gmapObject, 'singlerightclick', function(xyPoint,overlay){					coords = this.fromContainerPixelToLatLng(xyPoint);					map1188ObjectRef.MarkersAreRenderedWhenMapLoaded = false; //parametrs, kas nosaka, ka nav japarzime visi elementi					map1188ObjectRef.addUserMarker(coords.lat(), coords.lng(), 'Mans lietotaja markeris');				});			}			if( map1188ObjectRef.enableLBSUserPoint ){				GEvent.addListener(map1188ObjectRef.gmapObject, 'singlerightclick', function(xyPoint,overlay){					coords = this.fromContainerPixelToLatLng(xyPoint);					map1188ObjectRef.MarkersAreRenderedWhenMapLoaded = false; //parametrs, kas nosaka, ka nav japarzime visi elementi					map1188ObjectRef.addLbsMarker(coords.lat(), coords.lng());				});			}			map.getContainer().appendChild(container);			return container;		}		JSButton.prototype.getDefaultPosition = function() {			return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(95, 7));		}		if( typeof(map1188ObjectRef.mapOptions) == 'undefined' ){			map1188ObjectRef.gmapObject = new GMap2( map1188ObjectRef.curentElement );		}else{			map1188ObjectRef.gmapObject = new GMap2( map1188ObjectRef.curentElement , map1188ObjectRef.mapOptions );		}		if( map1188ObjectRef.enableMyPoint ){				GPolygon.prototype.containsLatLng = function(latLng) {			    var bounds = this.getBounds();			    if(!bounds.containsLatLng(latLng)) {			        return false;			    }			    var numPoints = this.getVertexCount();			    var inPoly = false;			    var i;			    var j = numPoints-1;			    for(var i=0; i < numPoints; i++) {				        var vertex1 = this.getVertex(i);				        var vertex2 = this.getVertex(j);				        if (vertex1.lng() < latLng.lng() && vertex2.lng() >= latLng.lng() || vertex2.lng() < latLng.lng() && vertex1.lng() >= latLng.lng())  {				            if (vertex1.lat() + (latLng.lng() - vertex1.lng()) / (vertex2.lng() - vertex1.lng()) * (vertex2.lat() - vertex1.lat()) < latLng.lat()) {				                inPoly = !inPoly;				            }				        }				        j = i;				    }				    return inPoly;				};				map1188ObjectRef.streetPolygon1 = new GPolygon([				  	 new GLatLng(56.9229759474975,23.9796781539917),				  	 new GLatLng(56.92078595099923,23.97916316986084),				  	 new GLatLng(56.92073910475047,23.981738090515137),				  	 new GLatLng(56.92165259599512,23.983068466186523),				  	 new GLatLng(56.921371524147496,23.99341106414795),				  	 new GLatLng(56.92294081487815,23.99834632873535),				  	 new GLatLng(56.931067279668454,24.00937557220459),				  	 new GLatLng(56.92809324574033,24.018173217773438),				  	 new GLatLng(56.92692230119879,24.031004905700684),				  	 new GLatLng(56.927015978114426,24.059243202209473),				  	 new GLatLng(56.917998496857315,24.08555030822754),				  	 new GLatLng(56.918021921709055,24.089970588684082),				  	 new GLatLng(56.92076252788219,24.10177230834961),				  	 new GLatLng(56.92076252788219,24.102072715759277),				  	 new GLatLng(56.92336240412729,24.106450080871582),				  	 new GLatLng(56.92291739311356,24.108123779296875),				  	 new GLatLng(56.92486134955159,24.11074161529541),				  	 new GLatLng(56.92638365436971,24.111428260803223),				  	 new GLatLng(56.93027110484739,24.122886657714844),				  	 new GLatLng(56.9212778330612,24.141082763671875),				  	 new GLatLng(56.92324529648027,24.14520263671875),				  	 new GLatLng(56.93336204143795,24.126319885253906),				  	 new GLatLng(56.93649954845769,24.128894805908203),				  	 new GLatLng(56.92371372486332,24.162111282348633),				  	 new GLatLng(56.923385825612606,24.17266845703125),				  	 new GLatLng(56.926664688468065,24.17713165283203),				  	 new GLatLng(56.93233175769657,24.170737266540527),				  	 new GLatLng(56.93551617913039,24.16065216064453),				  	 new GLatLng(56.93907491668674,24.14897918701172),				  	 new GLatLng(56.93429863832879,24.144001007080078),				  	 new GLatLng(56.93743606657103,24.131126403808594),				  	 new GLatLng(56.938747152424675,24.130868911743164),				  	 new GLatLng(56.938548151288785,24.128808975219727),				  	 new GLatLng(56.93918026887354,24.12797212600708),				  	 new GLatLng(56.938952005426025,24.126598834991455),				  	 new GLatLng(56.93855985726734,24.1259765625),				  	 new GLatLng(56.94113508323407,24.120140075683594),				  	 new GLatLng(56.946214780332305,24.14249897003174),				  	 new GLatLng(56.95213631847865,24.15970802307129),				  	 new GLatLng(56.96346185784049,24.152755737304688),				  	 new GLatLng(56.96423392837838,24.165372848510742),				  	 new GLatLng(56.95882909863991,24.176273345947266),				  	 new GLatLng(56.96652664961597,24.17837619781494),				  	 new GLatLng(56.97062044377374,24.16494369506836),				  	 new GLatLng(56.978947002374326,24.190692901611328),				  	 new GLatLng(56.97988245442784,24.20558452606201),				  	 new GLatLng(56.98591555558323,24.219746589660645),				  	 new GLatLng(56.98867455512248,24.248027801513672),				  	 new GLatLng(56.992041192794154,24.244422912597656),				  	 new GLatLng(56.981379128834654,24.18743133544922),				  	 new GLatLng(56.9925087572769,24.191036224365234),				  	 new GLatLng(57.00101740464871,24.173870086669922),				  	 new GLatLng(57.0038220268445,24.181251525878906),				  	 new GLatLng(57.00849592736033,24.163742065429688),				  	 new GLatLng(56.99465947824455,24.121685028076172),				 	new GLatLng(56.993996157722805,24.124603271484375),				 	new GLatLng(56.994846491585534,24.150824546813965),				 	 new GLatLng(56.993443868621206,24.161767959594727),				 	 new GLatLng(56.9890720212555,24.16494369506836),				 	 new GLatLng(56.9921347061606,24.174213409423828),				 	 new GLatLng(56.98998383928932,24.183483123779297),				 	 new GLatLng(56.98315635155885,24.182281494140625),				 	 new GLatLng(56.979134094665014,24.18339729309082),				 	 new GLatLng(56.96874905083693,24.147605895996094),				 	 new GLatLng(56.97539207024972,24.137649536132812),				 	 new GLatLng(56.98479319217819,24.138507843017578),				 	 new GLatLng(56.99241524485024,24.12795066833496),				 	 new GLatLng(56.99398739129314,24.124560356140137),				  	new GLatLng(56.994627335231904,24.121679663658142),				  	 new GLatLng(56.976327611604354,24.129581451416016),				  	 new GLatLng(56.9702461727074,24.11224365234375),				  	 new GLatLng(56.96388298920805,24.11224365234375),				  	 new GLatLng(56.96360223549189,24.104175567626953),				  	 new GLatLng(56.95939067588571,24.10400390625),				  	 new GLatLng(56.95922688339653,24.104089736938477),				  	 new GLatLng(56.96201125780745,24.091644287109375),				  	 new GLatLng(56.95208951158859,24.09773826599121),				  	 new GLatLng(56.95152782432359,24.094390869140625),				  	 new GLatLng(56.95060336227226,24.0950345993042),				  	 new GLatLng(56.95096612859506,24.098339080810547),				  	 new GLatLng(56.946402037045715,24.10353183746338),				  	 new GLatLng(56.94472839681021,24.10024881362915),				  	 new GLatLng(56.94402029563374,24.101332426071167),				  	 new GLatLng(56.945606189518564,24.10447597503662),				  	 new GLatLng(56.94129895523206,24.113574028015137),				  	 new GLatLng(56.93757654225984,24.126319885253906),				  	 new GLatLng(56.93370156052811,24.12095546722412),				  	 new GLatLng(56.937014636330034,24.114089012145996),				  	 new GLatLng(56.936780506360805,24.11372423171997),				  	 new GLatLng(56.934544491115936,24.11827325820923),				  	 new GLatLng(56.932296633885635,24.118680953979492),				  	 new GLatLng(56.9246037225918,24.106364250183105),				  	 new GLatLng(56.92638365436971,24.107651710510254),				  	 new GLatLng(56.93200393417512,24.10778045654297),				  	 new GLatLng(56.94087756863949,24.099326133728027),				  	 new GLatLng(56.940526409508415,24.097180366516113),				  	 new GLatLng(56.94134577567064,24.095592498779297),				  	 new GLatLng(56.94399103496524,24.10121440887451),				  	 new GLatLng(56.94464646843641,24.100055694580078),				  	 new GLatLng(56.94265672408504,24.096322059631348),				  	 new GLatLng(56.94537211348361,24.093317985534668),				  	 new GLatLng(56.942820589396426,24.0875244140625),				  	 new GLatLng(56.945067812441195,24.085335731506348),				  	 new GLatLng(56.94895331606579,24.0895414352417),				  	 new GLatLng(56.95049804235604,24.09473419189453),				  	 new GLatLng(56.951504420503895,24.094090461730957),				  	 new GLatLng(56.95045123340887,24.08778190612793),				  	 new GLatLng(56.957448518603925,24.086623191833496),				  	 new GLatLng(56.963368272445756,24.08078670501709),				  	 new GLatLng(56.96566104695138,24.08130168914795),				  	 new GLatLng(56.96594178515424,24.082846641540527),				  	 new GLatLng(56.96676059282988,24.082417488098145),				  	 new GLatLng(56.96708811086137,24.081430435180664),				  	 new GLatLng(56.96666701572058,24.080443382263184),				  	 new GLatLng(56.9648656105553,24.07902717590332),				  	 new GLatLng(56.96081797996362,24.07876968383789),				  	 new GLatLng(56.95662950627825,24.080357551574707),				  	 new GLatLng(56.957074115202566,24.07705307006836),				  	 new GLatLng(56.95248736828061,24.07701015472412),				  	 new GLatLng(56.948321364134934,24.079113006591797),				  	 new GLatLng(56.94256308644094,24.064221382141113),				  	 new GLatLng(56.939824081326336,24.052977561950684),				  	 new GLatLng(56.93319813456427,24.038944244384766),				  	 new GLatLng(56.92812251888304,24.029738903045654),				  	 new GLatLng(56.927982007588554,24.03059720993042),				  	 new GLatLng(56.93264787050678,24.040231704711914),				  	 new GLatLng(56.93900468173022,24.054136276245117),				  	 new GLatLng(56.94207148495181,24.06705379486084),				  	 new GLatLng(56.94766599526235,24.080357551574707),				  	 new GLatLng(56.945793449288516,24.082717895507812),				  	 new GLatLng(56.9455827819812,24.0800142288208),				  	 new GLatLng(56.94340581677318,24.083876609802246),				  	 new GLatLng(56.940385944930114,24.090399742126465),				  	 new GLatLng(56.94352286114635,24.0779972076416),				  	 new GLatLng(56.94530189038655,24.074939489364624),				  	 new GLatLng(56.945114628147834,24.074488878250122),				  	 new GLatLng(56.94278547546175,24.077203273773193),				  	 new GLatLng(56.9391217399176,24.092159271240234),				  	 new GLatLng(56.94072540008865,24.09501314163208),				  	 new GLatLng(56.94003478116975,24.09625768661499),				  	 new GLatLng(56.9394026780683,24.095828533172607),				  	 new GLatLng(56.93898127004867,24.096601009368896),				  	 new GLatLng(56.939999664611854,24.098360538482666),				  	 new GLatLng(56.93162927519452,24.10576343536377),				  	 new GLatLng(56.925821579822866,24.105634689331055),				  	 new GLatLng(56.92165259599512,24.101343154907227),				  	 new GLatLng(56.920012980375056,24.095678329467773),				  	 new GLatLng(56.91870123601469,24.088339805603027),				  	 new GLatLng(56.92720333124014,24.063706398010254),					 new GLatLng(56.92804640866421,24.058856964111328),					 new GLatLng(56.92821033817336,24.054865837097168),					 new GLatLng(56.92785905977181,24.0311336517334),					 new GLatLng(56.93113752957221,24.011778831481934),					 new GLatLng(56.932308341826285,24.01212215423584),					 new GLatLng(56.932612746993485,24.010448455810547),					 new GLatLng(56.93326838045547,24.01014804840088),					 new GLatLng(56.93345570218527,24.009032249450684),					 new GLatLng(56.9332449651731,24.00765895843506),					 new GLatLng(56.93354936269741,24.006693363189697),					 new GLatLng(56.93659320132721,24.003582000732422),					 new GLatLng(56.936277121950155,24.002788066864014),					 new GLatLng(56.931734648413126,24.008495807647705),					 new GLatLng(56.92678178538433,24.001779556274414),					 new GLatLng(56.923385825612606,23.996543884277344),					 new GLatLng(56.92233184422089,23.99216651916504),					 new GLatLng(56.92256606488048,23.983755111694336),					 new GLatLng(56.92326871803909,23.981223106384277),					 new GLatLng(56.9229759474975,23.9796781539917)				  ], "#f33f00", 1, 1, "#ff0000", 0.2);				if( map1188ObjectRef.mypointSinglerightclickListener  ){					GEvent.removeListener(map1188ObjectRef.mypointSinglerightclickListener);				}				map1188ObjectRef.mypointSinglerightclickListener = GEvent.addListener(map1188ObjectRef.gmapObject, 'singlerightclick', function(xyPoint,overlay){					if( map1188ObjectRef.mapType == 'gmap' ){						map1188ObjectRef.deleteMarker(map1188ObjectRef.MyPointMarkerIndex);						coords = this.fromContainerPixelToLatLng(xyPoint);						var markerInfoHowTo = '';						if( typeof(mapLang)!='undefined' ) markerInfoHowTo = mapLang['whereami']+"<br />"+mapLang['whereami2'];						map1188ObjectRef.addMarker(coords.lat() ,coords.lng(), markerInfoHowTo ,'mypoint', false, false );						if( typeof(map1188ObjectRef.MyPointChangeCallBackFn) == 'function' ){								map1188ObjectRef.MyPointChangeCallBackFn(coords.lat() ,coords.lng());						}					}				});		}		map1188ObjectRef.gmapObject.setCenter( new GLatLng( map1188ObjectRef.Lat, map1188ObjectRef.Lng ), map1188ObjectRef.Zoom);		if( map1188ObjectRef.showMapSwitchButtons == true ){			map1188ObjectRef.gmapObject.addControl(new JSButton(map1188ObjectRef));		}		map1188ObjectRef.gmapObject.addControl(new GLargeMapControl3D());		map1188ObjectRef.gmapObject.addControl(new GMenuMapTypeControl());		map1188ObjectRef.gmapObject.addControl(new GScaleControl());		map1188ObjectRef.gmapObject.enableScrollWheelZoom();		if( typeof(map1188ObjectRef.disableDienvidTilts) == 'undefined' ){		var timeOutPause = 0;		//alert( map1188ObjectRef.gmapObject.getName() );		setTimeout(				function(){					var myCopyright = new GCopyrightCollection("(c) ");				        myCopyright.addCopyright(new GCopyright('2010',				          new GLatLngBounds(new GLatLng(-90,-180), new GLatLng(90,180)),0,'©2010'));				        var tilelayer = new GTileLayer(myCopyright);				        tilelayer.getTileUrl = function(a,b){				        	var z = 17 - b;				        	//Makslas muzejs				        	if( b==16 && a.x==37157 && a.y==20092  ){				        		return "/img/map/patch3/37157x20092z16.png";				        	}				        	if( b==17 && a.x==74315 && a.y==40184  ){				        		return "/img/map/patch3/74315x40184z17.png";				        	}				        	if( b==18 && a.x==148630 && a.y==80369  ){				        		return "/img/map/patch3/148630x80369z18.png";				        	}				        	//Brivibas piemineklis				        	/*				        	if( b==19 && a.x==297261 && a.y==160751  ){				        		return "/img/map/patch2/6b.png";				        	}				        	if( b==19 && a.x==297260 && a.y==160751  ){				        		return "/img/map/patch2/6a.png";				        	}				        	if( b==18 && a.x==148630 && a.y==80375  ){				        		return "/img/map/patch2/5.png";				        	}				        	if( b==17 && a.x==74315 && a.y==40187  ){				        		return "/img/map/patch2/4.png";				        	}				        	if( b==16 && a.x==37157 && a.y==20094  ){				        		return "/img/map/patch2/3b.png";				        	}				        	if( b==16 && a.x==37157 && a.y==20093  ){				        		return "/img/map/patch2/3a.png";				        	}				        	if( b==15 && a.x==18578 && a.y==10047  ){				        		return "/img/map/patch2/2b.png";				        	}				        	if( b==15 && a.x==18578 && a.y==10046  ){				        		return "/img/map/patch2/2a.png";				        	}				        	if( b==14 && a.x==9289 && a.y==5023 ){				        		return "/img/map/patch2/1.png";				        	}*/				        	//Dienvidu tilts				        	if( b==10 && a.x==580 && a.y==314 ){				        		return "/img/map/580x314z10.gif";				        	}				        	if( b==11 && a.x==1161 && a.y==628 ){				        		return "/img/map/1161x628z11.gif";				        	}				        	if( b==12 && a.x==2322 && a.y==1256 ){				        		return "/img/map/2322x1256z12.gif";				        	}				        	if( b==12 && a.x==2322 && a.y==1257 ){				        		return "/img/map/2322x1257z12.gif";				        	}				        	if( b==13 && a.x==4645 && a.y==2512 ){				        		return "/img/map/4645x2512z13.gif";				        	}				        	if( b==13 && a.x==4645 && a.y==2513 ){				        		return "/img/map/4645x2513z13.gif";				        	}				        	if( b==14 && a.x==9290 && a.y==5026 ){				        		return "/img/map/9290x5026z14.gif";				        	}				        	if( b==14 && a.x==9290 && a.y==5027 ){				        		return "/img/map/9290x5027z14.gif";				        	}				        	if( b==14 && a.x==9291 && a.y==5025 ){				        		return "/img/map/9291x5025z14.gif";				        	}				        	if( b==14 && a.x==9291 && a.y==5026 ){				        		return "/img/map/9291x5026z14.gif";				        	}				        	if( b==15 && a.x==18580 && a.y==10054 ){				        		return "/img/map/18580x10054z15.gif";				        	}				        	if( b==15 && a.x==18580 && a.y==10055 ){				        		return "/img/map/18580x10055z15.gif";				        	}				        	if( b==15 && a.x==18581 && a.y==10053 ){				        		return "/img/map/18581x10053z15.gif";				        	}				        	if( b==15 && a.x==18581 && a.y==10054 ){				        		return "/img/map/18581x10054z15.gif";				        	}				        	if( b==15 && a.x==18582 && a.y==10052 ){				        		return "/img/map/18582x10052z15.gif";				        	}				        	if( b==15 && a.x==18582 && a.y==10053 ){				        		return "/img/map/18582x10053z15.gif";				        	}				        	if( b==15 && a.x==18583 && a.y==10051 ){				        		return "/img/map/18583x10051z15.gif";				        	}				        	if( b==15 && a.x==18583 && a.y==10052 ){				        		return "/img/map/18583x10052z15.gif";				        	}				        	return false;				         };				        var myTileLayer = new GTileLayerOverlay(tilelayer);				        try{				        map1188ObjectRef.gmapObject.addOverlay(myTileLayer);				        }catch(e){}				        map1188ObjectRef.patchLoaded = true;				      }		,timeOutPause); //end of set time out		}		if( map1188ObjectRef.isSatellite == true ){			map1188ObjectRef.gmapObject.setMapType(G_SATELLITE_MAP);		}		//setMapType(type:GMapType)		x = map1188ObjectRef.gmapObject.getCurrentMapType().getName(true);		map1188ObjectRef.isSatellite = false;		if( x == 'Satelīts' ){			map1188ObjectRef.isSatellite = true;		}		if( map1188ObjectRef.Markers.length > 0 ){			map1188ObjectRef.gmapObject.clearOverlays()			map1188ObjectRef.reDrawMarkrs();			map1188ObjectRef.MarkersAreRenderedWhenMapLoaded = true;		}		if( typeof(map1188ObjectRef.eventEndCallBackFn)== 'function' || (map1188ObjectRef.groupMarkers == true) ){		//Ja bija definets tikai groupMarkers		if( typeof(map1188ObjectRef.eventEndCallBackFn)!= 'function' ) map1188ObjectRef.eventEndCallBackFn = function(){}		GEvent.addListener(map1188ObjectRef.gmapObject, 'dragend', function(position) {			map1188ObjectRef.eventEndCallBackFn();			if( map1188ObjectRef.groupMarkers == true ){				//setTimeout(function(){ map1188ObjectRef.gmapObject.clearOverlays(); map1188ObjectRef.reDrawMarkers(); map1188ObjectRef.GroupMarkers(); }, 1000 );				//map1188ObjectRef.GroupMarkers();			}		});		GEvent.addListener(map1188ObjectRef.gmapObject, 'zoomend', function(startLevel,endLevel) {			map1188ObjectRef.Zoom = endLevel;			map1188ObjectRef.eventEndCallBackFn();			if( map1188ObjectRef.groupMarkers == true ){				//map1188ObjectRef.GroupMarkers();			}		});		}	}	this.GMapClassLoad = function(map1188Object){		google.load('maps', '2',{ 'language' : 'en', 'callback':			function(){				map1188Object.initGmap(map1188Object);			}			}		);	}	this.switchMap = function(mapType){	if( !mapType){		if( this.mapType == 'jmap' ) mapType = 'gmap';		if( this.mapType == 'gmap' ) mapType = 'jmap';	}		if( mapType == 'gmap'){			this.initGmap(this);		}		if( mapType == 'jmap'){			this.initJMap(this);		}	}	this.initJMap = function(map1188ObjectRef){		this.mapType = 'jmap';		if( map1188ObjectRef.lbsMarker != null ){			var lbsCoords = map1188ObjectRef.getLbsMarkerCoords();			setTimeout(function(){				map1188ObjectRef.addLbsMarker(lbsCoords['X'],lbsCoords['Y']);			}, 500);		}		if( typeof( this.mapSwitchCallBackFn)=='function' ){			this.mapSwitchCallBackFn();		}		map1188ObjectRef.jmapObject = 	new JanaSetaMap(map1188ObjectRef.currentElementId,'lv');		if( map1188ObjectRef.isSatellite == true ){			map1188ObjectRef.jmapObject.switch_map.ShowMapButton();		}else{			map1188ObjectRef.jmapObject.switch_map.ShowOrtoButton();		}		if( map1188ObjectRef.enableTraffic == true ){			//map1188ObjectRef.jmapObject.ShowTraffic();		}		if( map1188ObjectRef.isSatellite == true ){			map1188ObjectRef.jmapObject.switch_map.ActivateOrto();		}		lks = Kijs_LatLon_2_Lks(this.Lat, this.Lng);		//Convert gmap zoom to jmap zoom		zoom = 11;		if( zoom > 17 ){			zoom = 0;		}		for( val in map1188ObjectRef.ZoomDiff){			if( this.Zoom == val){				zoom =  map1188ObjectRef.ZoomDiff[val];			}		}		map1188ObjectRef.jmapObject.Load(zoom, lks.x, lks.y );		map1188ObjectRef.redrawJSwitcher(map1188ObjectRef);		map1188ObjectRef.jmapObject.event_start_panning.AddCallback(		function(){			if( map1188ObjectRef.jmapObject.switchToGmapClickEventOn ) return;			map1188ObjectRef.jmapObject.image_layer.Remove(map1188ObjectRef.jmapObject.jsmap_image_id);			map1188ObjectRef.jmapObject.image_layer.Remove(map1188ObjectRef.jmapObject.gmap_image_id);		}		);		map1188ObjectRef.jmapObject.event_stoped_paning_map_moved.AddCallback(		function(){				map1188ObjectRef.redrawJSwitcher(map1188ObjectRef);				map1188ObjectRef.jmapObject.image_layer.EventClickCallback(map1188ObjectRef.jmapObject.gmap_image_id,					function(){						map1188ObjectRef.initGmap(map1188ObjectRef);						map1188ObjectRef.jmapObject.tooltip.Hide();					}				);				if( typeof(map1188ObjectRef.eventEndCallBackFn) == 'function' ){					map1188ObjectRef.eventEndCallBackFn();				}			}		);		map1188ObjectRef.jmapObject.switchToGmapClickEventOn = false;		map1188ObjectRef.jmapObject.image_layer.EventClickCallback( map1188ObjectRef.jmapObject.gmap_image_id , function(id){			map1188ObjectRef.redrawJSwitcher(map1188ObjectRef);			map1188ObjectRef.initGmap(map1188ObjectRef);			var coo1 = Kijs_Lks_2_LatLon(corners.x_min, corners.y_min);			var coo2 = Kijs_Lks_2_LatLon(corners.x_max, corners.y_max);		});		if( map1188ObjectRef.enableRightClick ){		map1188ObjectRef.jmapObject.event_right_click.AddCallback(			function( coords ){				coords_lks = map1188ObjectRef.jmapObject.svg.LayerCoords(coords.pointer_x, coords.pointer_y);				map1188ObjectRef.addUserMarker(coords_lks.x_meter,coords_lks.y_meter);			}		);		}		//LBS marker		if(  map1188ObjectRef.enableLBSUserPoint ){			map1188ObjectRef.jmapObject.event_right_click.AddCallback(				function( coords ){					coords_lks = map1188ObjectRef.jmapObject.svg.LayerCoords(coords.pointer_x, coords.pointer_y);					map1188ObjectRef.addLbsMarker(coords_lks.x_meter,coords_lks.y_meter);				}			)			map1188ObjectRef.jmapObject.event_double_click.AddCallback(				function( coords ){					coords_lks = map1188ObjectRef.jmapObject.svg.LayerCoords(coords.pointer_x, coords.pointer_y);					map1188ObjectRef.addLbsMarker(coords_lks.x_meter,coords_lks.y_meter);				}			)			map1188ObjectRef.jmapObject.event_click.AddCallback(				function( coords ){					coords_lks = map1188ObjectRef.jmapObject.svg.LayerCoords(coords.pointer_x, coords.pointer_y);					map1188ObjectRef.addLbsMarker(coords_lks.x_meter,coords_lks.y_meter);					map1188ObjectRef.redrawJSwitcher(map1188ObjectRef);				}			)		}		//map1188ObjectRef.jmapObject.event_right_click.AddCallback = function(){};		if( typeof(map1188ObjectRef.MyPointChangeCallBackFn) == 'function' ){			map1188ObjectRef.jmapObject.event_right_click.AddCallback(				function(coords){					map1188ObjectRef.deleteMarker(map1188ObjectRef.MyPointMarkerIndex);					coords_lks = map1188ObjectRef.jmapObject.svg.LayerCoords(coords.pointer_x, coords.pointer_y);					map1188ObjectRef.addMarker(coords.pointer_x, coords.pointer_y, '' ,'mypoint', false, false );					map1188ObjectRef.MyPointChangeCallBackFn(coords_lks.x_meter,coords_lks.y_meter);					map1188ObjectRef.redrawJSwitcher(map1188ObjectRef);				}			);			map1188ObjectRef.jmapObject.event_double_click.AddCallback(					function( coords ){						map1188ObjectRef.deleteMarker(map1188ObjectRef.MyPointMarkerIndex);						coords_lks = map1188ObjectRef.jmapObject.svg.LayerCoords(coords.pointer_x, coords.pointer_y);						map1188ObjectRef.addMarker(coords.pointer_x, coords.pointer_y, '' ,'mypoint', false, false );						map1188ObjectRef.MyPointChangeCallBackFn(coords_lks.x_meter,coords_lks.y_meter);						map1188ObjectRef.redrawJSwitcher(map1188ObjectRef);					}			);		}		map1188ObjectRef.jmapObject.event_after_level_changed.AddCallback(			function(){				map1188ObjectRef.redrawJSwitcher(map1188ObjectRef);				if( typeof(map1188ObjectRef.eventEndCallBackFn) == 'function' ){					map1188ObjectRef.eventEndCallBackFn();				}			}		);		map1188ObjectRef.reDrawMarkers();	}	this.redrawJSwitcher = function(map1188ObjectRef){		if( map1188ObjectRef.showMapSwitchButtons == false ) return;		if( typeof(map1188ObjectRef.jmapObject.zoom_level)=='number' ){			this.Zoom = ( 17 - map1188ObjectRef.jmapObject.zoom_level );		}		center = map1188ObjectRef.jmapObject.GetCenter();		geo = Kijs_Lks_2_LatLon( center.x , center.y );		this.Lat = geo.lat;		this.Lng = geo.lon;		map1188ObjectRef.jmapObject.tooltip.Hide();		corners = map1188ObjectRef.jmapObject.MapCorners();		if( typeof(map1188ObjectRef.jmapObject.jsmap_image_id)!="undefined" ){			map1188ObjectRef.jmapObject.image_layer.Remove( map1188ObjectRef.jmapObject.jsmap_image_id );			map1188ObjectRef.jmapObject.image_layer.Remove( map1188ObjectRef.jmapObject.gmap_image_id );		}		map1188ObjectRef.jmapObject.jsmap_image_id = map1188ObjectRef.jmapObject.image_layer.Add("/img/maps_js_.png", corners.x_max, corners.y_max, 210, -8);		map1188ObjectRef.jmapObject.gmap_image_id = map1188ObjectRef.jmapObject.image_layer.Add("/img/maps_g.png", corners.x_max, corners.y_max, 325, -8);		map1188ObjectRef.jmapObject.image_layer.EventMouseOverCallback(map1188ObjectRef.jmapObject.gmap_image_id , function(id){			map1188ObjectRef.jmapObject.switchToGmapClickEventOn = true;			map1188ObjectRef.jmapObject.tooltip.Show("<b>Pārslēgties uz Google karti</b>");		});		map1188ObjectRef.jmapObject.image_layer.EventMouseOutCallback(map1188ObjectRef.jmapObject.gmap_image_id , function(id){			map1188ObjectRef.jmapObject.switchToGmapClickEventOn = false;			map1188ObjectRef.jmapObject.tooltip.Hide();		});		map1188ObjectRef.jmapObject.image_layer.EventClickCallback( map1188ObjectRef.jmapObject.gmap_image_id , function(id){			map1188ObjectRef.jmapObject.tooltip.Hide();			map1188ObjectRef.initGmap(map1188ObjectRef);		});		try{		$( '#'+map1188ObjectRef.currentElementId+' img[src="/img/maps_g.png"]').css('z-index','3');		$( '#'+map1188ObjectRef.currentElementId+' img[src="/img/maps_js_.png"]').css('z-index','3');		}catch(e){}	}}
