//<![CDATA[

    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(42.339857, 1.950598), 11);
        
        // Create our "tiny" marker icon
		var blueIcon = new GIcon(G_DEFAULT_ICON);
		blueIcon.image = "http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png";
		blueIcon.iconSize = new GSize(30, 30);
		blueIcon.shadowSize = new GSize(42, 30);
		
		// Set up our GMarkerOptions object
		markerOptions = { icon:blueIcon };
        
        var point = new GPoint (1.950598, 42.339857);
      	var marker = new GMarker(point, markerOptions);
      	map.addOverlay(marker);
      	
      	GEvent.addListener(marker, "click", function() {
   		 	marker.openInfoWindowHtml("<p style='font-size:12px; line-height:1.5'px;'><b>Hotel Adserà</b><br />c/ P. Adsera &#8226; 17537 La Molina <br />Tel. 972 892001 &#8226; Fax.972 892025<br /><a href='mailto:hotel@hoteladsera.com'>hotel@hoteladsera.com</a> &#8226; <a href='http://www.hoteladsera.com'>http://www.hoteladsera.com</a></p>");
 		 	});
  		return marker;
      }
    }

    //]]>
    
 	function getWindowHeight() {
			var windowHeight = 0;
			if (typeof(window.innerHeight) == 'number') {
				windowHeight = window.innerHeight;
			}
			else {
				if (document.documentElement && document.documentElement.clientHeight) {
					windowHeight = document.documentElement.clientHeight;
				}
				else {
					if (document.body && document.body.clientHeight) {
						windowHeight = document.body.clientHeight;
					}
				}
			}
			return windowHeight;
		}
		function setFooter() {
			if (document.getElementById) {
				var windowHeight = getWindowHeight();
				if (windowHeight > 0) {
					var contentHeight = document.getElementById('principal').offsetHeight;
					var footerElement = document.getElementById('bottom');
					var footerHeight  = footerElement.offsetHeight;
					if (windowHeight - (contentHeight + footerHeight) >= 0) {
						footerElement.style.position = 'relative';
						footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
					}
					else {
						footerElement.style.position = 'static';
					}
				}
			}
		}
		window.onload = function() {
			setFooter();
			load();
		}
		window.onresize = function() {
			setFooter();
		}