XimaMap = function(id,idr,id4p,idl,idbar,idpan,iddraw,idpoly,idclear,idmaxmin){
	this.idDiv=id;
	this.idLatlong=idl;
	this.idBar=idbar;
	this.idPan=idpan;
	this.idDraw=iddraw;
	this.idPoly=idpoly;
	this.idClear=idclear;
	this.idMaxMin=idmaxmin;
	this.barType='full';
	this._curLatLonShape = 0;
	this.curBoton="OFF";
	this.search_map=true;
	this.mini_map=true;
	this._curTool='_pan';
	this._mapTool='';
	this.map = null;
	this.slDrawing = new VEShapeLayer();
	this.slDrawingBorder = new VEShapeLayer();
	this.myGeomType = "polygon";
	this.myCurrentShape = null;
	this.myPoints = new Array();
	this.myDistance = 0;
	this.tempShape = null;
	this.tempPoints = null;
	this.tempDistance = 0;
	this.posx=0;
	this.posy=0;
	var that = this;
	this.fun2=this.fun3=this.fun4=this.fun5=this.fun6=this.fun7=this.fun8=null;
	this.filter_map= false;
	this.filter_type= '';
	
	//Shape
	this.fun2=function(e){that.DrawShapeMouseMove(e)};
	this.fun3=function(e){that.MouseMove(e)};
	this.fun4=function(e){that.DrawShapeMouseClick(e)};
	//Poly
	this.fun5=function(e){that.DrawPolyMouseClick(e)};
	this.fun6=function(e){that.MouseMove(e)};
	this.fun7=function(e){that.DrawPolyMouseMove(e)};
	this.fun8=function(e){that.KeyPressedMap(e)};
	
	this.filterONOFF = function (type){
		this.filter_map=!this.filter_map;
		this.filter_type= type;
	}
	
	this.mapFilter =function(mapa){
		var type = this.filter_type;
		Ext.Ajax.request( 
		{  
			waitMsg: 'Filtering...',
			url: 'properties_filter.php', 
			method: 'POST',
			timeout :600000,
			params: { 
				type: this.filter_type,
				mapa: mapa
			},
			
			failure:function(response,options){
				Ext.MessageBox.alert('Warning','ERROR');
			},
			success:function(response,options){
				if(type=="COMP-MAP") storeComp.load({params:{start:0, limit:limitComp}});
				else if(type=="ACTI-MAP") storeActive.load({params:{start:0, limit:limitActive}});
				else if(type=="DISS-MAP") storeDistress.load({params:{start:0, limit:limitDistress}});
				else if(type=="RENT-MAP") storeRental.load({params:{start:0, limit:limitRental}});
			}                                
		});
	}
	
	this.on_off = function ()
	{	
		this.DetachALL();
		var mapa=document.getElementById(this.idDiv);
	
		if( this._curTool=="_draw" )
		{
			if (this.myCurrentShape) this.map.DeleteShape(this.myCurrentShape);
			this.myCurrentShape=null;
	
			this.map.vemapcontrol.EnableGeoCommunity(true);	
			this.map.AttachEvent("onmousemove", this.fun3);
			this.map.AttachEvent("onclick", this.fun4);
			document.getElementById(this.idPan).className = 'd_pan';
			document.getElementById(this.idPoly).className = 'd_poly';
			if(this.mini_map==true && document.getElementById(this.idMaxMin)){
				if(document.getElementById(this.idMaxMin).className == 'd_maxmin')
					document.getElementById(this.idMaxMin).className = 'd_maxmin';
				else
					document.getElementById(this.idMaxMin).className = 'a_maxmin';
			}
			document.getElementById(this.idDiv).childNodes[0].style.cursor='crosshair';
			
		}
		
		if( this._curTool=="_poly" )
		{
			alert("Close the polygon by pressing the 'Escape' key.")
			if (this.myCurrentShape) this.map.DeleteShape(this.myCurrentShape);
			this.myCurrentShape=null;
			
			this.map.AttachEvent("onclick", this.fun5);
			this.map.AttachEvent("onmousemove", this.fun6);
			document.getElementById(this.idDiv).childNodes[0].style.cursor='crosshair';
			document.getElementById(this.idPan).className = 'd_pan';
			document.getElementById(this.idDraw).className = 'd_draw';
			if(this.mini_map==true && document.getElementById(this.idMaxMin)){
				if(document.getElementById(this.idMaxMin).className == 'd_maxmin')
					document.getElementById(this.idMaxMin).className = 'd_maxmin';
				else
					document.getElementById(this.idMaxMin).className = 'a_maxmin';
			}
			this.map.vemapcontrol.EnableGeoCommunity(true);
	
		}	
	
		if( this._curTool=="_clear" )
		{
			if (this.myCurrentShape) this.map.DeleteShape(this.myCurrentShape);
			this.myCurrentShape=null;
			document.getElementById(this.idLatlong).value='-1';
			this._curLatLonShape='-1';
			this._curTool="_pan";
			if(document.getElementById(this.idPan))
				document.getElementById(this.idPan).className = 'a_pan';
			if(this.mini_map==true){
				if(document.getElementById(this.idBar)){
					this.map.Resize(null,350);
					document.getElementById(this.idBar).style.margin ="320px 0px 0px 10px";
				}
				if(document.getElementById(this.idMaxMin))
				document.getElementById(this.idMaxMin).className = 'd_maxmin';
			}
			if(this.filter_map) this.mapFilter("0");
		}
	
		if( this._curTool=="_pan" )
		{	
			this.map.vemapcontrol.EnableGeoCommunity(false);	
			if(document.getElementById(this.idDiv))
				document.getElementById(this.idDiv).childNodes[0].style.cursor='';
			if(document.getElementById(this.idDraw))
				document.getElementById(this.idDraw).className = 'd_draw';
			if(document.getElementById(this.idPoly))
				document.getElementById(this.idPoly).className = 'd_poly';
			if(this.mini_map==true && document.getElementById(this.idMaxMin)){
				if(document.getElementById(this.idMaxMin).className == 'd_maxmin')
					document.getElementById(this.idMaxMin).className = 'd_maxmin';
				else
					document.getElementById(this.idMaxMin).className = 'a_maxmin';
			}
		}
		
		if( this._curTool=="_maxmin" )
		{
			if(this.search_map==true && this.barType=='full'){
				document.getElementById(this.idPan).className = 'a_pan';
				document.getElementById(this.idDraw).className = 'd_draw';
				document.getElementById(this.idPoly).className = 'd_poly';
			}
			
			if(document.getElementById(this.idMaxMin).className == 'd_maxmin'){ 
				document.getElementById(this.idMaxMin).className = 'a_maxmin';
				
				this.map.Resize(null,600);
				document.getElementById(this.idBar).style.margin ="570px 0px 0px 10px";
	
			}else{
				document.getElementById(this.idMaxMin).className = 'd_maxmin';
				this.map.Resize(null,350);
				document.getElementById(this.idBar).style.margin ="320px 0px 0px 10px";
			
			}
		}
	}
	
	this.DrawPolyMouseClick = function (e)
	{
		var x = e.mapX;
		var y = e.mapY;
		pixel = new VEPixel(x, y);
		var LL = this.map.PixelToLatLong(pixel);    
		
		if (this.myPoints.length == 0 && this.myGeomType != "point") 
		{
			this.map.DetachEvent("onmousemove", this.fun6);
			this.map.AttachEvent("onmousemove", this.fun7);
			this.map.AttachEvent("onkeypress", this.fun8);
			if(document.getElementById("divDistance"))
				document.getElementById("divDistance").style.visibility = "visible";
		}    
	
			this.myPoints.push(LL);
			this.myDistance +=  this.tempDistance;    
	
			document.getElementById(this.idDiv).style.cursor='crosshair';
			try{
				this.slDrawing.DeleteShape(this.myCurrentShape);
			}catch(err){}
	   
	}
	
	this.DrawShapeMouseClick = function (e)
	{
		var x = e.mapX;
		var y = e.mapY;    
		
		if (this.myPoints.length == 0) 
		{
			pixel = new VEPixel(x, y);
			var LL = this.map.PixelToLatLong(pixel);
			
			this.map.DetachEvent("onmousemove", this.fun3);
			this.map.AttachEvent("onmousemove", this.fun2);
			
			document.getElementById(this.idDiv).style.cursor='crosshair';
			try{
				this.slDrawing.DeleteShape(this.myCurrentShape);
			}catch(err){}
			
			this.myPoints.push(LL);
			this.myDistance +=  this.tempDistance;
		}else{
			pixel = new VEPixel(x-6, y-6);
			var LL = this.map.PixelToLatLong(pixel);
			
			this.myPoints.push(LL);
			try{
				this.map.DetachEvent("onmousemove", this.fun2);
				this.slDrawing.DeleteShape(this.tempShape);
			}catch (err){}
			
			this.points2shape(this.myPoints);
			
			var s="",_i=0;
			for( var data in this.myPoints ) 
			{
				if(Ext.isNumber(parseInt(data))){
					if(_i>0) s+="/";
					s+=this.myPoints[data].Latitude +",";
					s+=this.myPoints[data].Longitude;
					_i++;
				}
			}
			this._curLatLonShape=s;
			document.getElementById(this.idLatlong).value=s;
					
			this.myGeomType = null;
			this.myPoints = new Array();
			this.myDistance = 0;
			this.tempShape = null;
			this.tempPoints = null;
	
			document.getElementById(this.idDiv).style.cursor = 'http://maps.live.com/cursors/grab.cur';
			if(this.filter_map) this.mapFilter(s);
		}
	}
	
	this.KeyPressedMap = function (e){
		var kC  = (window.event) ?    // MSIE or Firefox?
			event.keyCode : e.keyCode;
		var Esc = (window.event) ?   
			27 : e.DOM_VK_ESCAPE // MSIE : Firefox
			
		if(kC==Esc && this.myPoints.length>2){
			try
			{
				this.map.DetachEvent("onmousemove", this.fun7);
				this.slDrawing.DeleteShape(this.tempShape);
	
			}
			catch (err)
			{
			}        
	
			this.myDistance = Math.round(this.myDistance * 1000) / 1000; //in KM
	
			this.points2shape(this.myPoints);
	
			//buscar en mysql esto
				var s="",_i=0;
				for( var data in this.myPoints ) 
				{
					if(Ext.isNumber(parseInt(data))){
						if(_i>0) s+="/"; //siguiente lote
						s+=this.myPoints[data].Latitude +",";
						s+=this.myPoints[data].Longitude;
						_i++;
					}
				}
				this._curLatLonShape=s;
				document.getElementById(this.idLatlong).value=s;
			//			
				this.myGeomType = null;
				//myCurrentShape = null;
				this.myPoints = new Array();
				this.myDistance = 0;
				this.tempShape = null;
				this.tempPoints = null;
				//
	
			document.getElementById(this.idDiv).style.cursor = 'http://maps.live.com/cursors/grab.cur';
			if(this.filter_map) this.mapFilter(s);
		}
	
	}
	
	this.DetachALL = function ()
	{
			this.map.DetachEvent("onmousemove",this.fun2);	
			this.map.DetachEvent("onmousemove",this.fun3);
			this.map.DetachEvent("onclick",this.fun4);
			
			this.map.DetachEvent("onclick", this.fun5);
			this.map.DetachEvent("onmousemove", this.fun6);	
			this.map.DetachEvent("onmousemove", this.fun7);
	}
}

XimaMap.prototype.points2shape = function (vector)
{

	var newPoints=vector;
	//alert(vector);
	var lat=0,long=0;
	
	if (vector.length==2)//si es de 2 dimensiones hablamos de un rectangulo, hay q buscarlos los 4 puntos
	{
		newPoints=[new VELatLong(vector[0].Latitude,vector[0].Longitude),
				new VELatLong(vector[1].Latitude,vector[0].Longitude),
				new VELatLong(vector[1].Latitude,vector[1].Longitude),        
				new VELatLong(vector[0].Latitude,vector[1].Longitude)]

	}
	
	try{
		this.slDrawing.DeleteShape(this.tempShape);
		this.slDrawing.DeleteShape(this.myCurrentShape);
	}catch(err){}
	
	this.myCurrentShape = new VEShape(VEShapeType.Polygon, newPoints);
	this.myCurrentShape.Id="theShape";

	if(this.myCurrentShape.Latitude==0 && this.myCurrentShape.Longitude==0){
		for(var i=0; i<vector.length; i++){
			lat+=parseFloat(vector[i].Latitude);
			long+=parseFloat(vector[i].Longitude);
		}
		this.myCurrentShape.Latitude=lat/vector.length;
		this.myCurrentShape.Longitude=long/vector.length;
	}

	try{
		this.slDrawing.AddShape(this.myCurrentShape);
	}catch(err){}
	//alert('paso');
	this.myCurrentShape.HideIcon();
	
}

XimaMap.prototype.ins_toolbar = function (adjust,tipo)
{
	var botones='';

	this._mapTool = document.createElement("div"); 
	this._mapTool.id = this.idBar;
	this._mapTool.style.position = "absolute";
	this._mapTool.style.margin =adjust+" 0px 0px 10px"; 
	
	botones = "<div id=\"pan_shape\">"+
	"<TABLE bgcolor=\"orange\" >  "+
	"<TR>"+
	"<TD id=\""+this.idPan+"\" class=\"a_pan\" onClick=\"this.className ='a_pan';"+this.idDiv+"._curTool='_pan';"+this.idDiv+".on_off();\" align=middle width=80> </TD>"+
	"<TD  align=middle>&nbsp;</TD>";
	
	if(this.barType=='full'){
		botones+="<TD id=\""+this.idDraw+"\" class=\"d_draw\" onClick=\"this.className ='a_draw';"+this.idDiv+'.'+"_curTool='_draw';"+this.idDiv+'.'+"on_off()\" align=middle width=80></TD>"+
		"<TD  align=middle>&nbsp;</TD>"+
		"<TD id=\""+this.idPoly+"\" class=\"d_poly\" onClick=\"this.className ='a_poly'; "+this.idDiv+'.'+"_curTool='_poly';"+this.idDiv+'.'+"on_off()\" align=middle ></TD>"+
		"<TD  align=middle>&nbsp;</TD>"+
		"<TD id=\""+this.idClear+"\" style='width:80px;height:18px;cursor:pointer;cursor:hand;' onClick=\""+this.idDiv+'.'+"_curTool='_clear';"+this.idDiv+'.'+"on_off()\" align=middle ><img src='img/reset_map.jpg' ></TD>";
	}
	
	if(this.mini_map==true)
		botones+="<TD id=\""+this.idMaxMin+"\" class=\"d_maxmin\" onClick=\""+this.idDiv+"._curTool='_maxmin';"+this.idDiv+".on_off()\" align=middle ></TD>";

	botones+="</TR>"+
	"</TABLE>"+
	"</div>";

	this._mapTool.innerHTML = botones;
	this.map.AddControl(this._mapTool);		
	
}

XimaMap.prototype.MouseMove = function (e)
{
    var x = e.mapX;
    var y = e.mapY;
    pixel = new VEPixel(x, y);
    var LL = this.map.PixelToLatLong(pixel);
	window.status="Latitude->"+LL.Latitude+" | Longitude->"+LL.Longitude;
}
//==============================================================

XimaMap.prototype.DrawPolyMouseMove = function(e)
{
    var x = e.mapX;
    var y = e.mapY;
    pixel = new VEPixel(x-2, y+2);
    var LL = this.map.PixelToLatLong(pixel);


	this.tempPoints = this.myPoints.slice(0, this.myPoints.length);


   	this.tempPoints.push(LL);
   	this.tempDistance = this.getDistanceKM(this.tempPoints[this.myPoints.length-1], LL);

	try
    {
        this.slDrawing.DeleteShape(this.tempShape);
    }
    catch (err)
    {
    }
    
    if (this.tempPoints.length == 2)
    {
        this.tempShape = new VEShape(VEShapeType.Polyline, this.tempPoints);
        this.tempShape.HideIcon();
        this.slDrawing.AddShape(this.tempShape);
    }
    
    if (this.tempPoints.length > 2)
    {
        this.tempShape = new VEShape(VEShapeType.Polygon, this.tempPoints);
        this.tempShape.HideIcon();
        this.slDrawing.AddShape(this.tempShape);
    }
}

XimaMap.prototype.DrawShapeMouseMove = function(e)
{
    var x = e.mapX;
    var y = e.mapY;
    pixel = new VEPixel(x-6, y-6);
    var LL = this.map.PixelToLatLong(pixel);
    var LLaux = this.myPoints[0];

	this.tempPoints = [new VELatLong(LL.Latitude,LL.Longitude),
						new VELatLong(LLaux.Latitude,LL.Longitude),
						new VELatLong(LLaux.Latitude,LLaux.Longitude),        
						new VELatLong(LL.Latitude,LLaux.Longitude)]
   	
	this.tempDistance = this.getDistanceKM(this.tempPoints[this.myPoints.length-1], LL);

	try
    {
        this.slDrawing.DeleteShape(this.tempShape);
    }
    catch (err)
    {
    }
    
    this.tempShape = new VEShape(VEShapeType.Polygon, this.tempPoints);
    this.tempShape.HideIcon();
    this.slDrawing.AddShape(this.tempShape);
}

XimaMap.prototype.DrawPolySaved = function ()
{     
	
	var mapa=document.getElementById(this.idDiv);
	warning.style.display="none";

	cntGps=0;
	cntSearch++;
	var county=curCounty;
	this._allocateCounty(county);
	this.map.DeleteAllPushpins();
	
	
	
	if  (mapa.className!="mapon") {
		mapa.className="mapon"
		this.curBoton="AVG"
		this.ins_toolbar("320px","search");
	}
	
	//borramos poligonos existentes
	try
    {
        this.slDrawing.DeleteShape(this.myCurrentShape);
    }
    catch (err)
    {
		try
		{
			this.slDrawing.DeleteShape(this.tempShape);
		}
		catch (err)
		{
		}
    }

	if ( (this.curBoton=='AVG') && (this._curLatLonShape!=0) ) 
	{
		var _xpoints=new Array();
		for(x=0;x<this._curLatLonShape.split("/").length;x++)
		{								//latitude	longitude
			_xpoints.push(new VELatLong(this._curLatLonShape.split("/")[x].split(",")[0],this._curLatLonShape.split("/")[x].split(",")[1]));
		}
		this.points2shape(_xpoints)
	}
}

XimaMap.prototype.borrarTodoMap = function (){
	this.map.DeleteAllShapes();
}

XimaMap.prototype.getDistanceKM = function (p1, p2) 
{
    this.p1Lat = this.latLonToRadians(p1.Latitude);
	this.p1Lon = this.latLonToRadians(p1.Longitude);
	
	this.p2Lat = this.latLonToRadians(p2.Latitude);
	this.p2Lon = this.latLonToRadians(p2.Longitude);	
	
	var R = 6371; // earth's mean radius in km
	var dLat  = this.p2Lat - this.p1Lat;
	var dLong = this.p2Lon - this.p1Lon;
	var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(this.p1Lat) * Math.cos(this.p2Lat) * Math.sin(dLong/2) * Math.sin(dLong/2);
	var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
	var disKm = R * c;
	//var disMiles = disKm * 0.6214;	
	return (disKm);
}

XimaMap.prototype.MouseCatch = function (e) {
	this.posx =  e.clientX-2;			
	this.posy = e.clientY-2;
	window.status='X: '+this.posx+' Y: '+this.posy;
}

XimaMap.prototype._IniMAP = function ()
{
	if(this.map != null){ 
		this.map.Dispose();
		document.getElementById(this.idLatlong).value='-1';
	}

	this.map = new VEMap(this.idDiv);
	this.map.SetCredentials("AjwrMXiyPYDTfOHE_cUQVu24OlnIQo1mklM6ydrJEK_JRoOHZVJ7uPrNoUn_Btlq");
	this.map.LoadMap();
	if(user_loged)
		this.map.Resize((system_width-5),350);
	else
		this.map.Resize(655,350);

	this.slDrawing = new VEShapeLayer();
	this.map.AddShapeLayer(this.slDrawing);
	this.slDrawingBorder = new VEShapeLayer();
	this.map.AddShapeLayer(this.slDrawingBorder);
	this.centerMapCounty(document.getElementById(search_type+'_county_search').value,true);
}

XimaMap.prototype.latLonToRadians = function ( point ) {
	return point * Math.PI / 180;	
}


XimaMap.prototype._getDistance = function (p1, p2) 
{
    this.p1Lat = this.latLonToRadians(p1.Latitude);
	this.p1Lon = this.latLonToRadians(p1.Longitude);
	
	this.p2Lat = this.latLonToRadians(p2.Latitude);
	this.p2Lon = this.latLonToRadians(p2.Longitude);	
	
	var R = 6371; // earth's mean radius in km
	var dLat  = this.p2Lat - this.p1Lat;
	var dLong = this.p2Lon - this.p1Lon;
	var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(this.p1Lat) * Math.cos(this.p2Lat) * Math.sin(dLong/2) * Math.sin(dLong/2);
	var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
	var disKm = R * c;
	//var disMiles = disKm * 0.6214;	
	return (disKm);
}

XimaMap.prototype.doNothing = function (){}

XimaMap.prototype.control_map = function (resete)
{
	var mapa=document.getElementById(this.idDiv);

	if(mapa.style.display=='' || resete==true){
		mapa.style.display='none';
		this.curBoton="OFF"
		this._curTool='_clear';
		this.on_off();
		if(this._mapTool!='') this.map.DeleteControl(this._mapTool);
	}else{
		mapa.style.display='';
		this.curBoton="AVG";
		this.ins_toolbar("320px","search");
	}     
}

XimaMap.prototype.cleaner = function ()
{
	var mapa=document.getElementById(this.idDiv);

	if(mapa.style.display!='none')
	{
		mapa.style.display='none';
		this.curBoton="OFF"
		this._curTool='_clear';
		this.on_off();
		if(this._mapTool!='') this.map.DeleteControl(this._mapTool);	     
	}
}

XimaMap.prototype.centerMapCounty = function (id,press){
	if(press && this.map!=null){
		var esto = this;
		if(id!=-1){
			Ext.Ajax.request( 
			{  
				waitMsg: 'Validating...',
				url: '../../../../../properties_averageCounty.php',
				method: 'POST',
				timeout :600000,
				params: { 
					idcounty: id
				},
				
				failure:function(response,options){
					Ext.MessageBox.alert('Warning','ERROR');
				},
				success:function(response,options){
					var latlong = response.responseText.split('^');
					esto.map.SetCenterAndZoom(new VELatLong(latlong[0], latlong[1]), 9);
					if(esto.myCurrentShape!=null){ 
						esto.map.SetMapView(esto.myCurrentShape.GetPoints());
					}
				}                                
			});
		}else
			this.map.SetCenterAndZoom(new VELatLong(29.0, -80.0), 6);
	}
}
XimaMap.prototype.setBarType = function(type){
	this.barType=type;
}

function setFirstImage(pid,imgID,bdcounty){
	Ext.Ajax.request( 
	{  
		waitMsg: 'Setting...',
		url: 'http://www.ximausa.com/properties_setFirstImage.php', 
		method: 'POST',
		timeout :600000,
		params: { 
			pid: pid,
			bd: bdcounty
		},
		
		failure:function(response,options){
			Ext.MessageBox.alert('Warning','ERROR');
		},
		success:function(response,options){
			
			var results=response.responseText;
			if(document.getElementById(imgID))
				document.getElementById(imgID).src=results;
		}                                
	});
}

VEPushpin.prototype.GetContent= function()
{
	var tmp=this.ID.split("_");
	var pid=tmp[2];
	var county= tmp[3];
	var numero=parseInt(tmp[1]);
	if(numero==0) numero='&nbsp;';
	var pinId=this.ID+"_"+this.m_vemap.GUID;
	var imgID=this.ID.replace('Pin','Image');
	//alert(imgID);
	//alert(this.m_vemap.GUID+'  '+this.ID);
	
	var content="<span class='pin_css' id='"+pinId+"' style='cursor:hand;background:url("+this.Iconurl+");background-repeat:no-repeat;background-position:center top;display:block; padding-left: 5px; width:20px;' ";
	
	var isTitleValid=this.Title!=null&&this.Title!="undefined"&&this.Title.length>0;
	
	var isDetailsValid=this.Details!=null&&this.Details!="undefined"&&this.Details.length>0;
	
	if(isTitleValid||isDetailsValid)
	{
	content+=" onmouseover='setFirstImage(\""+pid+"\",\""+imgID+"\",\""+county+"\");VEPushpin.Show(\""
	+this.m_vemap.GUID
	+"\",\""
	+this.ID
	+"\","
	+this.LatLong.Latitude
	+","+this.LatLong.Longitude;
	
	if(isTitleValid)content+=", \""+escape(this.Title)+"\"";
	else content+=",\"\"";
	
	if(isDetailsValid)content+=", \""+escape(this.Details)+"\"";
	else content+=",\"\"";
	
	content+=",\""+this.TitleStyle+"\"";
	content+=",\""+this.DetailsStyle+"\"";
	content+=");' ";
	
	content+="onmouseout=VEPushpin.Hide(); ";
	} 
	
	content+=">"+numero+"</span>";
	return content;
}
