// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
var MiSituacion = null;
var Directions = null;
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
var Icono_1 = new GIcon();
Icono_1.image = "http://www.festivaldecandelaria.com/esp/img/google_icons/1.png";
Icono_1.iconSize = new GSize(39, 39);
Icono_1.iconAnchor = new GPoint(12, 39);
Icono_1.infoWindowAnchor = new GPoint(12, 1);
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
var Icono_2 = new GIcon();
Icono_2.image = "http://www.festivaldecandelaria.com/esp/img/google_icons/2.png";
Icono_2.iconSize = new GSize(39, 39);
Icono_2.iconAnchor = new GPoint(12, 39);
Icono_2.infoWindowAnchor = new GPoint(12, 1);
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
var Icono_3 = new GIcon();
Icono_3.image = "http://www.festivaldecandelaria.com/esp/img/google_icons/3.png";
Icono_3.iconSize = new GSize(39, 39);
Icono_3.iconAnchor = new GPoint(12, 39);
Icono_3.infoWindowAnchor = new GPoint(12, 1);
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
var Icono_4 = new GIcon();
Icono_4.image = "http://www.festivaldecandelaria.com/esp/img/google_icons/4.png";
Icono_4.iconSize = new GSize(39, 39);
Icono_4.iconAnchor = new GPoint(12, 39);
Icono_4.infoWindowAnchor = new GPoint(12, 1);
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
var Icono_5 = new GIcon();
Icono_5.image = "http://www.festivaldecandelaria.com/esp/img/google_icons/5.png";
Icono_5.iconSize = new GSize(39, 39);
Icono_5.iconAnchor = new GPoint(12, 39);
Icono_5.infoWindowAnchor = new GPoint(12, 1);
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
var Icono_6 = new GIcon();
Icono_6.image = "http://www.festivaldecandelaria.com/esp/img/google_icons/6.png";
Icono_6.iconSize = new GSize(39, 39);
Icono_6.iconAnchor = new GPoint(12, 39);
Icono_6.infoWindowAnchor = new GPoint(12, 1);
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
var Icono_7 = new GIcon();
Icono_7.image = "http://www.festivaldecandelaria.com/esp/img/google_icons/7.png";
Icono_7.iconSize = new GSize(39, 39);
Icono_7.iconAnchor = new GPoint(12, 39);
Icono_7.infoWindowAnchor = new GPoint(12, 1);
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
var Icono_8 = new GIcon();
Icono_8.image = "http://www.festivaldecandelaria.com/esp/img/google_icons/8.png";
Icono_8.iconSize = new GSize(39, 39);
Icono_8.iconAnchor = new GPoint(12, 39);
Icono_8.infoWindowAnchor = new GPoint(12, 1);
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
var Icono_9 = new GIcon();
Icono_9.image = "http://www.festivaldecandelaria.com/esp/img/google_icons/9.png";
Icono_9.iconSize = new GSize(39, 39);
Icono_9.iconAnchor = new GPoint(12, 39);
Icono_9.infoWindowAnchor = new GPoint(12, 1);
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
var Icono_10 = new GIcon();
Icono_10.image = "http://www.festivaldecandelaria.com/esp/img/google_icons/10.png";
Icono_10.iconSize = new GSize(39, 39);
Icono_10.iconAnchor = new GPoint(12, 39);
Icono_10.infoWindowAnchor = new GPoint(12, 1);
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
var Icono_11 = new GIcon();
Icono_11.image = "http://www.festivaldecandelaria.com/esp/img/google_icons/11.png";
Icono_11.iconSize = new GSize(39, 39);
Icono_11.iconAnchor = new GPoint(12, 39);
Icono_11.infoWindowAnchor = new GPoint(12, 1);
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
var capa_panoramio = new GLayer("com.panoramio.all"); 
var capa_wikipedia = new GLayer("org.wikipedia.es"); 
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
function MostrarPanoramio(){
	var thisMap = Mapifies.MapObjects.Get('#map');
	thisMap.addOverlay(capa_panoramio); 
}
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
function OcultarPanoramio(){
	var thisMap = Mapifies.MapObjects.Get('#map');
	thisMap.removeOverlay(capa_panoramio); 
}
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
function MostrarWikipedia(){
	var thisMap = Mapifies.MapObjects.Get('#map');
	thisMap.addOverlay(capa_wikipedia); 
}
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
function OcultarWikipedia(){
	var thisMap = Mapifies.MapObjects.Get('#map');
	thisMap.removeOverlay(capa_wikipedia); 
}
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
function OcultarLoc(){
	var thisMap = Mapifies.MapObjects.Get('#map');	
	thisMap.clearOverlays();
}
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
function MostrarLoc(idcat){
	OcultarLoc();
	
	if (idcat != ''){
		$.getScript('ajax/ajax_localizaciones_en_callejero.asp?idcat=' + idcat);
	}
}
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
function UbicarMiSituacion(){
	var thisMap = Mapifies.MapObjects.Get('#map');
	
	if (MiSituacion != null){		
		thisMap.removeOverlay(MiSituacion);
		MiSituacion = null;
	}
	
	MiSituacion = new GMarker(thisMap.getCenter(), {icon:IconoMiSituacion, draggable: true});	
	thisMap.addOverlay(MiSituacion);
	
	Directions = new GDirections(thisMap);
	var txt = 'from: ' + MiSituacion.getLatLng() + ' to: 28.122752,-16.724217';
	txt = txt.replace('(', '');
	txt = txt.replace(')', '');
	alert(txt);
    Directions.load(txt);

}
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
function MostrarSedeFestival(){
	$('#map').jmap('AddMarker',{'pointLatLng':[28.367877, -16.363465],'pointHTML':'<div><div style="float:left;width:100px;margin-right:20px;"><img src="" width="100" /></div><div style="float:left;width:300px;padding-left:20px;"><h2 style="margin-top:0px;">Concejalía de Cultura Ayuntamiento de Candelaria</h2><strong></strong><br />Sede del Festival de Candelaria<br /><br /></div><div style="clear:both;"></div></div>','centerMap':true,'centerMoveMethod':'pan','pointIcon': Icono_5});							
}
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function MostrarPlazaLaPatrona(){
	$('#map').jmap('AddMarker',{'pointLatLng':[28.351562969124995, -16.369972229003906],'pointHTML':'<div><div style="float:left;width:100px;margin-right:20px;"><img src="http://www.festivaldecandelaria.com/pub/candelaria_plaza.jpg" width="100" /></div><div style="float:left;width:300px;padding-left:20px;"><h2 style="margin-top:0px;">Plaza de  La Patrona de Canarias</h2><strong></strong><br /><br /><br /></div><div style="clear:both;"></div></div>','centerMap':true,'centerMoveMethod':'pan','pointIcon': Icono_1});
}
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function MostrarAyuntamiento(){
	$('#map').jmap('AddMarker',{'pointLatLng':[28.355281, -16.370136],'pointHTML':'<div><div style="float:left;width:100px;margin-right:20px;"><img src="" width="100" /></div><div style="float:left;width:300px;padding-left:20px;"><h2 style="margin-top:0px;">Ayuntamiento de Candelaria</h2><strong></strong><br />Ayuntamiento de Candelaria<br /><br /></div><div style="clear:both;"></div></div>','centerMap':true,'centerMoveMethod':'pan','pointIcon': Icono_2});
}
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
