//Funcion que refresca en cada busqueda el area de destacados

function MiramapaDestacados(obj,contenedorHTML,metodo,url,imagen,intervalo){
	this.obj = obj;
	this.contenedorHTML = contenedorHTML;
	this.objContenedorHTML = document.getElementById(this.contenedorHTML);
	this.url = url;
	this.imagen = imagen;
	this.metodo = metodo;
	this.timer = null;
	this.intervalo = intervalo;
	this.primera = true;
	
}
MiramapaDestacados.prototype.play = function(){
	if(this.timer != null)this.stop();
	this.timer = setTimeout(this.obj + ".refrescar()",this.intervalo);
}
MiramapaDestacados.prototype.stop = function(){
	clearTimeout(this.timer);
}
MiramapaDestacados.prototype.cargando = function(sw){
}
MiramapaDestacados.prototype.refrescar = function(){
	if(!this.primera)fx(document.getElementById('contenedorHTMLDestacados'),[
		                                                {'inicio':1,'fin':0,'u':'','propCSS':'opacity'}
		                               	                 ],1000,true,desacelerado);
	this.cargando(true,this.contenedorHTML, this.imagen);
	FAjax(this.url, this.contenedorHTML, this.metodo,null,this.play() );
	this.primera = false;
}

function goDestacados(destacado){
		
	var lat = parseFloat(destacado.LATITUD);
	var lng = parseFloat(destacado.LONGITUD);
	var point = new GLatLng(lat,lng);
	
	//miramapaBusqueda.setPaginacion(null);
	
	var aux = GEvent.addListener(map, 'moveend', function() {
		//Cuando este posicionado la marka realizamos la busqueda de establecimientos
		miramapa.loadMarcaVideo(destacado, true);
		GEvent.removeListener(aux);
	  });

	map.setCenter(new GLatLng(lat,lng));
	
}
