function openCenteredWindow(url, name, width, height, features) {
  if(screen.width){
	  var winl = (screen.width-width)/2;
	  var wint = (screen.height-height)/2;
  } else {
		winl = 0;
		wint =0;
  }
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + height + ',';
  settings += 'width=' + width + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(url, name, settings);
  win.window.focus();
}

function openCircuitosPopup(id) {
	openCenteredWindow('popup.php?id=' + id, 'circuitos_popup', 400, 250, 'scrollbars=no')
}

function openRecreacionPopup(id) {
	openCenteredWindow('popup.php?id=' + id, 'recreacion_popup', 400, 250, 'scrollbars=no')
}

function openGaleriaDeFotosPopup(order) {
	openCenteredWindow('popup.php?order=' + order, 'gallery_popup', 502, 390, 'scrollbars=no')
}

function openSuitesPopup(id) {
	openCenteredWindow('popup.php?id=' + id, 'suites_popup', 400, 250, 'scrollbars=no')
}

function openRecomiendenosPopup(context_path) {
	openCenteredWindow(context_path + '/recomiendenos/popup.php', 'recomiendemos_popup', 400, 280, 'scrollbars=no')
}

function openLegalPopup(context_path) {
	openCenteredWindow(context_path + '/legal/legal.php', 'legal_popup', 400, 400, 'scrollbars=no')
}

function openPoliticaPopup(context_path) {
	openCenteredWindow(context_path + '/legal/politica.php', 'politicas_popup', 400, 400, 'scrollbars=no')
}

function nopt() {
	alert("Pagina em construção, brevemente disponível.");
}

function noen() {
	alert("Coming soon!");
}