var map;function createMarker(point, baseIcon, index, html) {var icono = new GIcon(baseIcon);icono.shadow = "http://d.tiempo.hvimg.com/img/shadow.png";icono.image = "http://d.tiempo.hvimg.com/img/" + index + ".png";markerOptions = { icon:icono };var marker = new GMarker(point, markerOptions);GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(html);});return marker;}function chinchetasCercanas(doc, flagZoom){var xmlDoc = GXml.parse(doc);var markers = xmlDoc.getElementsByTagName("marker");map.clearOverlays();for (var i = 0; i < markers.length; i++) {var lat = parseFloat(markers[i].getAttribute("lat"));var lng = parseFloat(markers[i].getAttribute("lng"));var point = new GLatLng(lat,lng);var indice = markers[i].getAttribute("name");var html = GXml.value(markers[i].getElementsByTagName("html")[0]);var baseIcon = new GIcon(G_DEFAULT_ICON);baseIcon.iconSize = new GSize(35, 35);var marker = createMarker(point,baseIcon,indice,html);map.addOverlay(marker);}}function initialize(){if (GBrowserIsCompatible()) {map = new GMap2(document.getElementById("mapa"));map.setCenter(new GLatLng(23, -102), 4, G_PHYSICAL_MAP);map.setUIToDefault();map.enableDoubleClickZoom();map.disableScrollWheelZoom();}GEvent.addListener(map, "dragend", function() {var center = map.getCenter();var coor= map.getBounds();url = "/mapajax.phtml?id=arrastrar&coor="+coor;GDownloadUrl(url, function(doc, responseCode) {if(responseCode == 200) {chinchetasCercanas(doc,0);}});});GEvent.addListener(map, "zoomend", function (){var center = map.getCenter();var coor= map.getBounds();url = "/mapajax.phtml?id=arrastrar&coor="+coor;GDownloadUrl(url, function(doc, responseCode) {if(responseCode == 200) {chinchetasCercanas(doc,0);}});});var baseIcon = new GIcon(G_DEFAULT_ICON);baseIcon.iconSize = new GSize(35, 35);var latlng = new GLatLng(16.85, -99.9167);map.addOverlay(createMarker(latlng, baseIcon, '29', 'Acapulco
Domingo 5nubes y clarosMáx.:29ºC / Mín.: 21ºC
Lunes 6nubes y clarosMáx.:30ºC / Mín.: 21ºC
Martes 7nubes y clarosMáx.:29ºC / Mín.: 22ºC
Miércoles 8rayosMáx.:29ºC / Mín.: 22ºC
Jueves 9rayosMáx.:30ºC / Mín.: 21ºC
'));var latlng = new GLatLng(21.8833, -102.3);map.addOverlay(createMarker(latlng, baseIcon, '29', 'Aguascalientes
Domingo 5nubes y clarosMáx.:23ºC / Mín.: 8ºC
Lunes 6nubes y clarosMáx.:22ºC / Mín.: 8ºC
Martes 7lluvia fuerteMáx.:19ºC / Mín.: 7ºC
Miércoles 8lluvia fuerteMáx.:17ºC / Mín.: 5ºC
Jueves 9nubes y clarosMáx.:18ºC / Mín.: 4ºC
'));var latlng = new GLatLng(33.23, 44.23);map.addOverlay(createMarker(latlng, baseIcon, '11', 'Bagdad
Domingo 5lluvia fuerteMáx.:26ºC / Mín.: 16ºC
Lunes 6lluvia fuerteMáx.:16ºC / Mín.: 10ºC
Martes 7rayosMáx.:16ºC / Mín.: 13ºC
Miércoles 8lluvia fuerteMáx.:19ºC / Mín.: 16ºC
Jueves 9lluvia fuerteMáx.:20ºC / Mín.: 16ºC
'));var latlng = new GLatLng(21.17, -86.83);map.addOverlay(createMarker(latlng, baseIcon, '45', 'Cancún
Domingo 5tormentaMáx.:26ºC / Mín.: 21ºC
Lunes 6rayosMáx.:26ºC / Mín.: 21ºC
Martes 7rayosMáx.:26ºC / Mín.: 21ºC
Miércoles 8rayosMáx.:26ºC / Mín.: 20ºC
Jueves 9rayosMáx.:26ºC / Mín.: 21ºC
'));var latlng = new GLatLng(28.6333, -106.083);map.addOverlay(createMarker(latlng, baseIcon, '29', 'Chihuahua
Domingo 5nubes y clarosMáx.:17ºC / Mín.: 5ºC
Lunes 6nubes y clarosMáx.:11ºC / Mín.: 4ºC
Martes 7nubes y clarosMáx.:17ºC / Mín.: 2ºC
Miércoles 8nubladoMáx.:22ºC / Mín.: 2ºC
Jueves 9nubladoMáx.:19ºC / Mín.: 3ºC
'));var latlng = new GLatLng(19.24, -99.12);map.addOverlay(createMarker(latlng, baseIcon, '29', 'Ciudad de México
Domingo 5nubes y clarosMáx.:23ºC / Mín.: 8ºC
Lunes 6lluvia fuerteMáx.:19ºC / Mín.: 7ºC
Martes 7lluvia fuerteMáx.:17ºC / Mín.: 8ºC
Miércoles 8lluvia fuerteMáx.:17ºC / Mín.: 8ºC
Jueves 9lluvia fuerteMáx.:20ºC / Mín.: 7ºC
'));var latlng = new GLatLng(31.63, -106.43);map.addOverlay(createMarker(latlng, baseIcon, '24', 'Ciudad Juárez
Domingo 5vientoMáx.:16ºC / Mín.: 2ºC
Lunes 6vientoMáx.:13ºC / Mín.: 1ºC
Martes 7nubes y clarosMáx.:15ºC / Mín.: 3ºC
Miércoles 8nubes y clarosMáx.:16ºC / Mín.: 3ºC
Jueves 9nubes y clarosMáx.:17ºC / Mín.: 4ºC
'));var latlng = new GLatLng(22.27, -97.83);map.addOverlay(createMarker(latlng, baseIcon, '11', 'Ciudad Madero
Domingo 5lluvia fuerteMáx.:24ºC / Mín.: 19ºC
Lunes 6lluvia fuerteMáx.:19ºC / Mín.: 13ºC
Martes 7lluvia fuerteMáx.:17ºC / Mín.: 15ºC
Miércoles 8lluvia fuerteMáx.:21ºC / Mín.: 17ºC
Jueves 9lluvia fuerteMáx.:20ºC / Mín.: 16ºC
'));var latlng = new GLatLng(-31.32, -64.22);map.addOverlay(createMarker(latlng, baseIcon, '29', 'Córdoba
Domingo 5nubes y clarosMáx.:22ºC / Mín.: 15ºC
Lunes 6lluvia fuerteMáx.:20ºC / Mín.: 14ºC
Martes 7lluvia fuerteMáx.:17ºC / Mín.: 13ºC
Miércoles 8lluvia fuerteMáx.:21ºC / Mín.: 14ºC
Jueves 9lluvia fuerteMáx.:22ºC / Mín.: 14ºC
'));var latlng = new GLatLng(20.6667, -103.333);map.addOverlay(createMarker(latlng, baseIcon, '29', 'Guadalajara
Domingo 5nubes y clarosMáx.:27ºC / Mín.: 8ºC
Lunes 6nubes y clarosMáx.:26ºC / Mín.: 6ºC
Martes 7nubes y clarosMáx.:21ºC / Mín.: 8ºC
Miércoles 8lluvia fuerteMáx.:21ºC / Mín.: 5ºC
Jueves 9rayosMáx.:23ºC / Mín.: 6ºC
'));var latlng = new GLatLng(17.6, -101.47);map.addOverlay(createMarker(latlng, baseIcon, '29', 'Ixtapa
Domingo 5nubes y clarosMáx.:29ºC / Mín.: 22ºC
Lunes 6nubes y clarosMáx.:30ºC / Mín.: 22ºC
Martes 7nubes y clarosMáx.:29ºC / Mín.: 22ºC
Miércoles 8rayosMáx.:30ºC / Mín.: 21ºC
Jueves 9rayosMáx.:31ºC / Mín.: 21ºC
'));var latlng = new GLatLng(24.1667, -110.3);map.addOverlay(createMarker(latlng, baseIcon, '29', 'La Paz
Domingo 5nubes y clarosMáx.:23ºC / Mín.: 11ºC
Lunes 6nubes y clarosMáx.:24ºC / Mín.: 13ºC
Martes 7nubes y clarosMáx.:23ºC / Mín.: 10ºC
Miércoles 8nubes y clarosMáx.:26ºC / Mín.: 10ºC
Jueves 9nubes y clarosMáx.:23ºC / Mín.: 9ºC
'));var latlng = new GLatLng(25.6667, -100.317);map.addOverlay(createMarker(latlng, baseIcon, '11', 'Monterrey
Domingo 5lluvia fuerteMáx.:22ºC / Mín.: 10ºC
Lunes 6lluvia fuerteMáx.:12ºC / Mín.: 6ºC
Martes 7lluvia fuerteMáx.:16ºC / Mín.: 7ºC
Miércoles 8lluvia fuerteMáx.:17ºC / Mín.: 11ºC
Jueves 9lluvia fuerteMáx.:16ºC / Mín.: 11ºC
'));var latlng = new GLatLng(19.05, -98.2);map.addOverlay(createMarker(latlng, baseIcon, '29', 'Puebla
Domingo 5nubes y clarosMáx.:23ºC / Mín.: 7ºC
Lunes 6lluvia fuerteMáx.:21ºC / Mín.: 6ºC
Martes 7lluvia fuerteMáx.:19ºC / Mín.: 7ºC
Miércoles 8lluvia fuerteMáx.:20ºC / Mín.: 8ºC
Jueves 9lluvia fuerteMáx.:20ºC / Mín.: 7ºC
'));var latlng = new GLatLng(20.3, -100.2);map.addOverlay(createMarker(latlng, baseIcon, '29', 'Santiago de Querétaro
Domingo 5nubes y clarosMáx.:25ºC / Mín.: 7ºC
Lunes 6lluvia fuerteMáx.:20ºC / Mín.: 6ºC
Martes 7lluvia fuerteMáx.:18ºC / Mín.: 6ºC
Miércoles 8lluvia fuerteMáx.:18ºC / Mín.: 6ºC
Jueves 9lluvia fuerteMáx.:21ºC / Mín.: 6ºC
'));var latlng = new GLatLng(32.5333, -117.017);map.addOverlay(createMarker(latlng, baseIcon, '33', 'Tijuana
Domingo 5solMáx.:21ºC / Mín.: 8ºC
Lunes 6nubes y clarosMáx.:22ºC / Mín.: 8ºC
Martes 7nubes y clarosMáx.:18ºC / Mín.: 10ºC
Miércoles 8nubladoMáx.:18ºC / Mín.: 8ºC
Jueves 9lluvia fuerteMáx.:18ºC / Mín.: 8ºC
'));var latlng = new GLatLng(20.7167, -103.4);map.addOverlay(createMarker(latlng, baseIcon, '29', 'Zapopan
Domingo 5nubes y clarosMáx.:26ºC / Mín.: 8ºC
Lunes 6nubes y clarosMáx.:24ºC / Mín.: 7ºC
Martes 7nubes y clarosMáx.:21ºC / Mín.: 8ºC
Miércoles 8lluvia fuerteMáx.:20ºC / Mín.: 5ºC
Jueves 9rayosMáx.:22ºC / Mín.: 5ºC
'));}