function popupdinamico (nombre) {
	var ruta='/publico/popupdinamico.pl?';
	windowHandle=window.open(ruta+nombre, '_Imagen', 'width=480,height=200,scrollbars=0,resizable=1,toolbar=0,personalbar=0,menubar=0,status=0' );
	windowHandle.focus();
	return(false)
}

function popup(enlace,ancho,alto){
	enlace=escape(enlace);
        windowHandle=window.open(enlace,'Imagen','scrollbars=1,width='+ancho+',height='+alto+',scrollbars=1,toolbar=0,personalbar=0,menubar=0,status=0,resizable=0');
        windowHandle.focus();
	return (false);
}



/* PARA LAS FILAS DE LA TABLA, APAREZCAN CON COLOR DE FONDO */

function hasClass(obj) {
     var result = false;
     if (obj.getAttributeNode("class") != null) {
         result = obj.getAttributeNode("class").value;
     }
     return result;
}



function stripe(id) {
    var even = false;
    var evenColor = arguments[1] ? arguments[1] : "#fff";
    var oddColor = arguments[2] ? arguments[2] : "#eee";
  	var table = document.getElementById(id);
    if (! table) { return; }
    var tbodies = table.getElementsByTagName("tbody");
    for (var h = 0; h < tbodies.length; h++) {
      var trs = tbodies[h].getElementsByTagName("tr");
      for (var i = 0; i < trs.length; i++) {
        if (! hasClass(trs[i]) && ! trs[i].style.backgroundColor) {
          var tds = trs[i].getElementsByTagName("td");
          for (var j = 0; j < tds.length; j++) {
            var mytd = tds[j];
            //if (! hasClass(mytd) && ! mytd.style.backgroundColor) {
              mytd.style.backgroundColor = even ? evenColor : oddColor;
              //mytd.style.border = 'outset 1 #bbbbbb';
            //}
          }
        }
        even =  ! even;
      }
    }
  }
//eliminar parpadeo en backgrounds en iExplorer
try {
document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}




    function load() {
	
		

      if (GBrowserIsCompatible()) {
	  //****************************************
	  var blueIcon = new GIcon();
      blueIcon.image = "/gps/iconohotel.png";
      blueIcon.shadow = "/gps/shadow.png";
      blueIcon.iconSize = new GSize(26, 41);
      blueIcon.shadowSize = new GSize(52, 29);
      blueIcon.iconAnchor = new GPoint(9, 34);
      blueIcon.infoWindowAnchor = new GPoint(9, 2);
      blueIcon.infoShadowAnchor = new GPoint(18, 25);
      
      var icons = [];
      icons[0] = blueIcon;	 
	  
	  
	  
	  //****************************************
	  
	
        var map = new GMap2(document.getElementById("map"));
		/*
		  map.addControl(new GZoomControl({sColor:'#FFF',nOpacity:.4,sBorder:'1px solid yellow'},
		
		{
			sButtonHTML:"<img src='/gps/zoom-button.gif' title='Selector de zona' />",
			sButtonZoomingHTML:"<img src='/gps/zoom-button-activated.gif' />",
			oButtonStartingStyle:{width:'24px',height:'24px'}
		}));
		
		*/
		
		map.addControl(new GLargeMapControl());
		map.addControl(new GZoomControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(42.88426, -8.51029), 14,G_NORMAL_MAP); //42.88426 //-8.51279
		map.enableDoubleClickZoom();
		map.enableContinuousZoom();
		
		//***************************************************
		var mapdiv =document.getElementById("map"); 
		var CopyrightDiv = mapdiv.firstChild.nextSibling; 
		var GoogleDiv=mapdiv.firstChild.nextSibling.nextSibling; 
				
		CopyrightDiv.innerHTML="<a href=http://www.puertadelcamino.com target=_blank><img src=/gps/logopeqhotel.jpg border=0 title='Hotel Puerta del Camino'>" ;
		CopyrightDiv.innerHTML +="&nbsp;&nbsp;<a href=http://www.nav2us.com target=_blank><img src='/gps/logonav2us.jpg' border=0 title='NAV2US.com'></a>";
		CopyrightDiv.style.bottom='0px';
		CopyrightDiv.style.margin='0px';
		//****************************************************
		
		 //***********************************
			 var html =   "<html /><head /></head /><body /><table/><tr><td height=5px></td></tr>";
			 	html +="<tr><td colspan=2>&nbsp;<img src='/gps/barrahotel.jpg' width=345 height=38></td></tr>"
			 	html +="<tr /><td /><img src='/gps/fachadaprincipal1.jpg' width=115 height=111 align='left' border='1' hspace='5' / /></td /><td /><p align='left' /><font face='Verdana' size=-2 color=#730B02 /><strong />Hotel Puerta del Camino </font /></strong /><br /><img src=/gps/estrellas.jpg><br /><br />";
			 	html += "<font face=Verdana size=-2 />C/ Miguel Ferro Caaveiro, s/n. <br>";
				html += "15703 Santiago de Compostela<br> ";
				html += "Telf.: 981 569 400 / Fax: 981 572 627</font /></td /></tr />";
				html +="<tr /><td  colspan=2 height=1px bgcolor='#C0C0C0' /></td /></tr />"; 
				html += "<tr /><td colspan=2 align=center /><table width=90%><tr><td width=25% align=center><a href=http://www.puertadelcamino.com/reservas/ target=_blank/><img src=/gps/reservahotel.jpg width=23 height=17 border=0 title='Formulario Reserva/Solicitud' /></a /></td>"
				html += "<td width=25% align=center><a href=http://www.nav2us.com/puertadelcamino/pois/descargas/hotel.kml target=_blank/><img src='/gps/globoearth.jpg'  width=20 height=20 border=0 title='Ver en Google Earth' /></a /></td>";
				html += "<td width=25% align=center><a href='http://www.puertadelcamino.com/elhotel/visitavirtual/' target=_blank><img src='/gps/visitavirtual.jpg'   width=20 height=20  border=0 title='Acceso Visita virtual' ></a /></td>";
				html +="<td width=25% align=center><a href='http://www.nav2us.com/puertadelcamino/pois/poi.html' target=_blank><img src='/gps/gps.jpg'   width=20 height=20  border=0 title='Enviar a mi GPS' ></a /></td></tr></table></td /></tr /></table /></body /><html />"
			 
  					var point = new GPoint(-8.51279,42.88426);  
					//var marker1 = new GxMarker(point1,icons[0],"<p><font face=Tahoma size=-2>GOLF DE EL PUERTO</font></p>"); 
		            var marker = new GMarker(point,icons[0]);
					map.addOverlay(marker); 

				 marker.tooltip = '<div class="tooltip">Hotel Puerta del Camino</div>';	  
  				GEvent.addListener(marker, "click", function() { 
				marker.openInfoWindowHtml(html); 
				
				});
				marker.openInfoWindowHtml(html);
				
				
  	 var gmarkers = [];
      var htmls = [];
      var i = 0;
	  
	GEvent.addListener(marker,"mouseover", function() {
          showTooltip(marker);
        });        
        GEvent.addListener(marker,"mouseout", function() {
		tooltip.style.visibility="hidden"
        });    
		
		// ====== This function displays the tooltip ======
      // it can be called from an icon mousover or a side_bar mouseover
      function showTooltip(marker) {
      	tooltip.innerHTML = marker.tooltip;
	var point=map.getCurrentMapType().getProjection().fromLatLngToPixel(map.getBounds().getSouthWest(),map.getZoom());
	var offset=map.getCurrentMapType().getProjection().fromLatLngToPixel(marker.getPoint(),map.getZoom());
	var anchor=marker.getIcon().iconAnchor;
	var width=marker.getIcon().iconSize.width;
	var pos = new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(offset.x - point.x - anchor.x + width,- offset.y + point.y +anchor.y)); 
	pos.apply(tooltip);
	tooltip.style.visibility="visible";
      }

      // ===== This function is invoked when the mouse goes over an entry in the side_bar =====
      // It launches the tooltip on the icon      
      function mymouseover(i) {
        showTooltip(gmarkers[i])
      }
      // ===== This function is invoked when the mouse leaves an entry in the side_bar =====
      // It hides the tooltip      
      function mymouseout() {
	tooltip.style.visibility="hidden";
      }

      // This function picks up the side_bar click and opens the corresponding info window
      function myclick(i) {
        gmarkers[i].openInfoWindowHtml(htmls[i]);
      }

  var tooltip = document.createElement("div");
      document.getElementById("map").appendChild(tooltip);
      tooltip.style.visibility="hidden";
	
//************************************
/*
		 var ovcontrol = new GOverviewMapControl(new GSize(100,100)); 
        map.addControl(ovcontrol);
      
     	//var escala=new GScaleControl();
     	//map.addControl(escala);
      //	map.addControl(new GLargeMapControl(),new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(10,10))); 
     ovmap = ovcontrol.getOverviewMap();
	 ovmap.setZoom(7);
	 
     setTimeout("ovmap.setMapType(G_HYBRID_TYPE);",1);  
		
*/
 ov = new GOverviewMapControl(null);
      map.addControl(ov);
      ovmap=ov.getOverviewMap();

      GEvent.addListener(ovmap, "zoomend", function() {
        ovmap.setZoom(3);
      }); 


		
		
		
      }
	

    }

