function createRequest() {
  var request = null;
  try {
    request = new XMLHttpRequest();
  } catch (trymicrosoft) {
    try {
      request = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (othermicrosoft) {
      try {
        request = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (failed) {
        request = null;
      }
    }
  }

  if (request == null) {
    alert("Error creating request object!");
  } else {
    return request;
  }
}

// var request1 = createRequest();
// var request2 = createRequest();
var request = createRequest();

// universal mandatory field marker
function manDisplay(){
	asterix = document.createTextNode("*");
	mandatoryMarker = document.createElement("span");
	mandatoryMarker.setAttribute("class","mandatory");
	mandatoryMarker.setAttribute("className","mandatory");		
	mandatoryMarker.appendChild(asterix);
}

function goBack(stage){
	var msg;
	var goto;
	if (stage == 'Start'){
		msg = "Are you sure you want to go back to the start of the booking process?";
		goto = "index.php";
	}else if (stage == 'Dates'){
		msg = "Are you sure you want to go back to the date selection page?";
		goto = "dates.php";
	}else if (stage == 'Further info'){
		msg = "Are you sure you want to go back to the \'Further info\' pages?";
		goto = "further_info.php";
	}
	if (confirm(msg)){
		window.location.href = (goto);
	}
}