var urlBE = "http://www.solmelia.com/microAPP/micro/jsp/C_Home.jsp?idPrm=MICROSITES&idONg=L88&presentacion=melia";
var urlCancel = "http://www.solmelia.com/microAPP/micro/jsp/C_Booking_Cancel_Step1.jsp?presentacion=melia";

function showProgress(indicatorName) {
  var indicator = document.getElementById(indicatorName);
  if (indicator) {
    indicator.style.display = "";
	showFrame(indicatorName);
  }
}  

function hideProgress(indicatorName) {
  var indicator = document.getElementById(indicatorName);
  if (indicator) {
    indicator.style.display = "none";
	hideFrame(indicatorName);
  }
}  

function showFrame(indicatorName) {
	var browser = navigator.userAgent.toLowerCase();
	if (browser.indexOf("msie") != -1) {
		var indicator = document.getElementById(indicatorName);
		var frameName = "frame" + indicatorName;
		var frame = document.getElementById(frameName);
		if (frame == null) 
			indicator.insertAdjacentHTML("afterEnd", '<iframe id="' + frameName + '" class="loading_layer_frame" style="display:none;z-index:4999;"></iframe>');
		frame = document.getElementById(frameName);
		frame.style.display = "";
	}
}

function hideFrame(indicatorName) {
	var browser = navigator.userAgent.toLowerCase();
	if (browser.indexOf("msie") != -1) {
		var frame=document.getElementById("frame" + indicatorName);
		if (frame!=null)
			frame.style.display = "none";
	}
}
  
function loadParams(frameName, hotel, idioma) {
  var frameReservas = document.getElementById(frameName);
  if  (urlBE.indexOf('?') != -1) {
    var url = urlBE + "&";
  }
  else {
    var url = urlBE + "?";
  }
  var url = url + "codigoHotel=" + hotel + "&lang=" + idioma;
  var idx = location.href.indexOf('?');
  if (idx != -1) {
    var params = location.href.substring(idx + 1);
    url += "&" + params;
  }
  frameReservas.src = url;
}

function loadParamsCancel(frameName, hotel, idioma) {
  var frameReservas = document.getElementById(frameName);
  if  (urlCancel.indexOf('?') != -1) {
    var url = urlCancel + "&";
  }
  else {
    var url = urlCancel + "?";
  }
  var url = url + "codigoHotel=" + hotel + "&lang=" + idioma;
  var idx = location.href.indexOf('?');
  if (idx != -1) {
    var params = location.href.substring(idx + 1);
    url += "&" + params;
  }
  frameReservas.src = url;
}
