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(15.25, -61.2), 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(18.2, -71.1);map.addOverlay(createMarker(latlng, baseIcon, '29', 'Barahona
| Domingo 5 |  | Máx.:31ºC / Mín.: 19ºC |
| Lunes 6 |  | Máx.:31ºC / Mín.: 19ºC |
| Martes 7 |  | Máx.:31ºC / Mín.: 20ºC |
| Miércoles 8 |  | Máx.:30ºC / Mín.: 19ºC |
| Jueves 9 |  | Máx.:30ºC / Mín.: 20ºC |
'));var latlng = new GLatLng(18.9333, -70.4167);map.addOverlay(createMarker(latlng, baseIcon, '29', 'Bonao| Domingo 5 |  | Máx.:28ºC / Mín.: 17ºC |
| Lunes 6 |  | Máx.:30ºC / Mín.: 18ºC |
| Martes 7 |  | Máx.:30ºC / Mín.: 19ºC |
| Miércoles 8 |  | Máx.:29ºC / Mín.: 19ºC |
| Jueves 9 |  | Máx.:29ºC / Mín.: 19ºC |
'));var latlng = new GLatLng(18.4167, -68.9667);map.addOverlay(createMarker(latlng, baseIcon, '29', 'La Romana| Domingo 5 |  | Máx.:27ºC / Mín.: 20ºC |
| Lunes 6 |  | Máx.:28ºC / Mín.: 20ºC |
| Martes 7 |  | Máx.:28ºC / Mín.: 20ºC |
| Miércoles 8 |  | Máx.:27ºC / Mín.: 20ºC |
| Jueves 9 |  | Máx.:27ºC / Mín.: 20ºC |
'));var latlng = new GLatLng(19.2167, -70.5167);map.addOverlay(createMarker(latlng, baseIcon, '29', 'La Vega| Domingo 5 |  | Máx.:28ºC / Mín.: 18ºC |
| Lunes 6 |  | Máx.:31ºC / Mín.: 19ºC |
| Martes 7 |  | Máx.:31ºC / Mín.: 20ºC |
| Miércoles 8 |  | Máx.:29ºC / Mín.: 19ºC |
| Jueves 9 |  | Máx.:29ºC / Mín.: 19ºC |
'));var latlng = new GLatLng(19.8, -70.6833);map.addOverlay(createMarker(latlng, baseIcon, '45', 'Puerto Plata| Domingo 5 |  | Máx.:27ºC / Mín.: 19ºC |
| Lunes 6 |  | Máx.:29ºC / Mín.: 19ºC |
| Martes 7 |  | Máx.:31ºC / Mín.: 21ºC |
| Miércoles 8 |  | Máx.:29ºC / Mín.: 21ºC |
| Jueves 9 |  | Máx.:28ºC / Mín.: 21ºC |
'));var latlng = new GLatLng(18.45, -69.3);map.addOverlay(createMarker(latlng, baseIcon, '27', 'San Pedro de Macoris| Domingo 5 |  | Máx.:27ºC / Mín.: 22ºC |
| Lunes 6 |  | Máx.:28ºC / Mín.: 22ºC |
| Martes 7 |  | Máx.:28ºC / Mín.: 23ºC |
| Miércoles 8 |  | Máx.:27ºC / Mín.: 23ºC |
| Jueves 9 |  | Máx.:27ºC / Mín.: 23ºC |
'));var latlng = new GLatLng(19.45, -70.7);map.addOverlay(createMarker(latlng, baseIcon, '29', 'Santiago| Domingo 5 |  | Máx.:27ºC / Mín.: 17ºC |
| Lunes 6 |  | Máx.:29ºC / Mín.: 18ºC |
| Martes 7 |  | Máx.:31ºC / Mín.: 19ºC |
| Miércoles 8 |  | Máx.:29ºC / Mín.: 19ºC |
| Jueves 9 |  | Máx.:29ºC / Mín.: 19ºC |
'));var latlng = new GLatLng(18.4, -69.9);map.addOverlay(createMarker(latlng, baseIcon, '29', 'Santo Domingo de Guzmán| Domingo 5 |  | Máx.:29ºC / Mín.: 18ºC |
| Lunes 6 |  | Máx.:31ºC / Mín.: 18ºC |
| Martes 7 |  | Máx.:31ºC / Mín.: 19ºC |
| Miércoles 8 |  | Máx.:31ºC / Mín.: 19ºC |
| Jueves 9 |  | Máx.:29ºC / Mín.: 19ºC |
'));}