function dosizeSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  var contentHeight = $('container').offsetHeight;
  var contents = contentHeight;
  
 if(contents > myHeight){
 	var footerHeight = contents;
 } else {
	if($('element_5')){
		var footerHeight = contents;
	} else {
		if(myHeight > 605){
 			var footerHeight = myHeight - $('footer').offsetHeight;
 		} else {
 			var footerHeight = myHeight - $('footer').offsetHeight+45;
 		}
	}
 }

 $('footer').style.top = footerHeight+'px';

}



function dosizeSizemap() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  var contentHeight = $('container').offsetHeight;
  var contents = contentHeight;

 if(contents > myHeight){
 	var footerHeight = contents;
 } else {
	if($('element_5')){
		var footerHeight = contents;
	} else {
		if(myHeight > 605){
 			var footerHeight = myHeight - $('footer').offsetHeight;
 		} else {
 			var footerHeight = myHeight - $('footer').offsetHeight+45;
 		}
	}
 }

 $('footer').style.top = footerHeight+'px';

 loadmaps();
}





function dosizeSize2() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  var contentHeight = $('container').offsetHeight;
  var contents = contentHeight;
  
 if(contents > myHeight){
 	var footerHeight = contents;
 } else {
		if(myHeight > 605){
 			var footerHeight = myHeight - $('footer').offsetHeight;
 		} else {
 			var footerHeight = myHeight - $('footer').offsetHeight+45;
 		}
 }

 $('footer').style.top = footerHeight+'px';
}



function dosizeSize3() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  var contentHeight = $('container').offsetHeight;
  var contents = contentHeight;

 if(contents > myHeight){
 	var footerHeight = contents;
 } else {
	if($('element_5')){
		var footerHeight = contents;
	} else {
		if(myHeight > 605){
 			var footerHeight = myHeight - $('footer').offsetHeight;
 		} else {
 			var footerHeight = myHeight - $('footer').offsetHeight+45;
 		}
	}
 }

 $('footer').style.top = footerHeight+'px';

interstitial();
}


function interstitial(){
	
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }

var windowWidth = myWidth/2;
var containnerWidth = $('interstitial').offsetWidth/2;
var largura = windowWidth - containnerWidth;

$('interstitial').style.left = largura+'px';
$('interstitial2').style.left = largura+'px';

}



function loadmaps() {
      if (GBrowserIsCompatible()) {

		var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(40.488750,-7.862800), 14);
		map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());

		tinyIcon = new GIcon();
		tinyIcon.image = "http://mcmarkers.googlepages.com/iimm1-red.png";
		tinyIcon.shadow = "http://mcmarkers.googlepages.com/iimm1-shadow.png ";
		tinyIcon.iconSize = new GSize(32, 32);
		tinyIcon.shadowSize = new GSize(49, 32);
		tinyIcon.iconAnchor = new GPoint(15, 27);
		tinyIcon.infoWindowAnchor = new GPoint(16, 0);
		
		var htmlText = "<div><b>Termas da Felgueira // Grande Hotel da Felgueira</b><br/>Av. António Marques - Caldas da Felgueira<br/>3525-210 CANAS DE SENHORIM<br/>PORTUGAL<br/></div>";
		var eqpoint = new GLatLng(40.488750,-7.862800);
		var marker=createMarker(eqpoint, htmlText, tinyIcon );
		map.addOverlay(marker);

        GEvent.trigger(marker, "click"); //comentar se n?o for para abrir qdo abre o mapa
		
      }
    }
	
	function createMarker(spoint, text, icon) {
	  var marker = new GMarker(spoint, icon);

	  GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(text);
	  });
	  
	  return marker;
	}