function showSearchingHTML(){
if(document.getElementById('wrapper')){
document.getElementById('wrapper').style.display = 'none';
}
if(document.getElementById('SearchingPage')){
document.getElementById('SearchingPage').style.display = 'block';
}
document.body.style.background = "url(images/bg_search.gif) repeat-x top left #157E94";
var searchSummary = '';
if(document.getElementById('SelectLSDepartureAirports')) {
if (document.getElementById('SelectLSDepartureAirports').options[document.getElementById('SelectLSDepartureAirports').selectedIndex].text == '') {
} else {
if (document.getElementById('HO').checked == true) {
document.getElementById("displayTagLine").innerHTML = "Please wait while we perform your search. As Travel247 are searching the best hotel options available your search may take up to 30 seconds"
searchSummary = searchSummary + 'Hotels in '
} else {
if (document.getElementById('FO').checked == true) {
document.getElementById("displayTagLine").innerHTML = "Please wait while we perform your search. As Travel247 are searching thousands of flight options your search may take up to 30 seconds."
} else {
document.getElementById("displayTagLine").innerHTML = "Please wait while we perform your search. As Travel247 are searching thousands of flight options and the best hotels available your search may take up to 30 seconds."
}
searchSummary = searchSummary + document.getElementById('SelectLSDepartureAirports').options[document.getElementById('SelectLSDepartureAirports').selectedIndex].text + ' to ';
}
}
}
if (document.getElementById('TextLSDestinationAirports')){
if (document.getElementById('TextLSDestinationAirports').value != "") {
searchSummary = searchSummary + document.getElementById('TextLSDestinationAirports').value + ', ';
}
}
if (document.getElementById('TextLSDestinationLocation')){
if (document.getElementById('TextLSDestinationLocation').value != "All Locations") {
searchSummary = searchSummary + document.getElementById('TextLSDestinationLocation').value + ', ';
}
}
if (document.getElementById('TextLSDestinationAreas')){
if (document.getElementById('TextLSDestinationAreas').value != "") {
searchSummary = searchSummary + document.getElementById('TextLSDestinationAreas').value + ', ';
}
}
if(document.getElementById('cboDepartDate')){
searchSummary = searchSummary + document.getElementById('cboDepartDate').options[document.getElementById('cboDepartDate').selectedIndex].text + ' ';
searchSummary = searchSummary + document.getElementById('cboDepartMonthYear').options[document.getElementById('cboDepartMonthYear').selectedIndex].text;
}
if(document.getElementById('JourneyType')){
if (document.getElementById('JourneyType').checked == true) {
searchSummary = searchSummary + ' - ';
searchSummary = searchSummary + document.getElementById('cboReturnDate').options[document.getElementById('cboReturnDate').selectedIndex].text + ' ';
searchSummary = searchSummary + document.getElementById('cboReturnMonthYear').options[document.getElementById('cboReturnMonthYear').selectedIndex].text;
}
} else {
if(document.getElementById('HO')){
if(document.getElementById('HO').checked==true){
searchSummary = searchSummary + ' - ';
searchSummary = searchSummary + document.getElementById('cboReturnDate').options[document.getElementById('cboReturnDate').selectedIndex].text + ' ';
searchSummary = searchSummary + document.getElementById('cboReturnMonthYear').options[document.getElementById('cboReturnMonthYear').selectedIndex].text;
}
}
}
if(document.getElementById("displaySummary")){
document.getElementById("displaySummary").innerHTML = "" + searchSummary + "";
}
window.name = 'enquiry_quick';
}
function CheckEForm(){
var ckContinue = true;
var ckDepart = document.getElementById('SelectLSDepartureAirports').options[document.getElementById('SelectLSDepartureAirports').selectedIndex].text;
if (document.getElementById('FO').checked == true) {
var ckDestination = document.getElementById('SelectLSDestinationAirports').value;
var shDestination = document.getElementById('TextLSDestinationAirports').value;
if ((shDestination == '') || (shDestination == '')){
alert('Please enter a destination to seach!');
document.getElementById('TextLSDestinationAirports').focus();
ckContinue = false;
}
if ((ckDestination == '') && (ckContinue)) {
ShowDiv('divLSDestinationAirports');
if (document.getElementById('AlertDivLSDestinationAreas')) {
document.getElementById('AlertDivLSDestinationAreas').style.display = "block";
}
alert('Please select a destination !');
ckContinue = false;
}
}
if (document.getElementById('HO').checked == true) {
var ckDestination = document.getElementById('SelectLSDestinationAreas').value;
var shDestination = document.getElementById('TextLSDestinationAreas').value;
if ((shDestination == '') || (shDestination == '')){
alert('Please enter a destination to seach!');
document.getElementById('TextLSDestinationAreas').focus();
ckContinue = false;
}
if ((ckDestination == '') && (ckContinue)) {
ShowDiv('divLSDestinationAreas');
if (document.getElementById('AlertDivLSDestinationAreas')) {
document.getElementById('AlertDivLSDestinationAreas').style.display = "block";
}
alert('Please select a destination !');
ckContinue = false;
}
}
if (document.getElementById('FH').checked == true) {
var ckDestination = document.getElementById('SelectLSDestinationAreas').value;
var shDestination = document.getElementById('TextLSDestinationAreas').value;
if ((shDestination == '') || (shDestination == '')){
alert('Please enter a destination to seach!');
document.getElementById('TextLSDestinationAreas').focus();
ckContinue = false;
}
if ((ckDestination == '') && (ckContinue)) {
ShowDiv('divLSDestinationAreas');
if (document.getElementById('AlertDivLSDestinationAreas')) {
document.getElementById('AlertDivLSDestinationAreas').style.display = "block";
}
alert('Please select a destination !');
ckContinue = false;
}
}
var validDate = false;
if (document.getElementById('Adults').value == 0){
ckContinue = false;
alert('Your booking must include at least one Adult !');
}
if(document.getElementById('JourneyType')){
var jType = document.getElementById('JourneyType').value;
}else{
var jType = "R";
}
if (document.getElementById("txtDepartureDate")) {
validDate=validTextBoxDates(document.getElementById('txtDepartureDate'),document.getElementById('txtReturnDate'), gvDefaultDepartureDays, jType);
} else if(document.getElementById("cboDepartMonthYear")) {
validDate=validDropdownDates('cboDepartDate', 'cboDepartMonthYear', 'cboDepartMonthYear', 'cboReturnDate', 'cboReturnMonthYear', 'cboReturnMonthYear', gvDefaultDepartureDays, jType);
} else if(document.getElementById("cboDepartDate")) {
validDate=validDropdownDates('cboDepartDate', 'cboDepartMonth', 'cboDepartYear', 'cboReturnDate', 'cboReturnMonth', 'cboReturnYear', gvDefaultDepartureDays, jType);
}
if (!validDate) {
ckContinue = false;
}
if (ckContinue && validDate) {
showSearchingHTML();
}
return ckContinue;
}
function CheckEnquiryForm(){
var ckCountry = document.getElementById('TextLSCountry').value;
var ckDCountry = document.getElementById('DefaultLSCountry').value;
var ckArea = document.getElementById('TextLSArea').value;
var ckDArea = document.getElementById('DefaultLSArea').value;
var ckAdults = document.getElementById('Adults').value;
var ckChildren = document.getElementById('Children').value;
var ckInfants = document.getElementById('Infants').value;
var ckCheckIn = document.getElementById('ArrivalDate').value;
var ckCheckOut = document.getElementById('DepartureDate').value;
var ckContinue = true;
if (ckCountry == 'Select . . .') {
ckCountry = 'N/A';
if (ckContinue) {
alert('Please select a Country!');
}
document.getElementById('ExplCountry').style.display = "block";
ckContinue = false;
} else {
document.getElementById('ExplCountry').style.display = "none";
}
if (ckArea == 'Select . . .') {
ckArea = 'N/A';
if (ckContinue) {
alert('Please select an Area!');
}
document.getElementById('ExplArea').style.display = "block";
ckContinue = false;
} else {
document.getElementById('ExplArea').style.display = "none";
}
if (ckContinue) {
SetSearchingImage(ckDCountry,ckDArea);
document.getElementById('EnquiryScreen').style.display = 'none';
document.getElementById('SearchingScreen').style.display = 'block';
document.getElementById('JSCountry').innerHTML = ckCountry;
document.getElementById('JSArea').innerHTML = ckArea;
document.getElementById('JSCheckIn').innerHTML = ckCheckIn;
document.getElementById('JSCheckOut').innerHTML = ckCheckOut;
document.getElementById('JSAdults').innerHTML = ckAdults;
document.getElementById('JSChildren').innerHTML = ckChildren;
document.getElementById('JSInfants').innerHTML = ckInfants;
//HotelEnquiryForm.submit();
} else {
document.getElementById('ExplMessage').style.display = "block";
}
}
function makeImageRequest(url, parameters) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Cannot create XMLHTTP instance');
return false;
}
http_request.onreadystatechange = ImageContents;
http_request.open('GET', url + parameters, true);
http_request.send(null);
}
function ImageContents() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
var doc = http_request.responseText;
document.getElementById('SearchingImage').src = '/AreaImages/' + doc;
} else {
alert('There was a problem with the request.');
}
}
}
function SetSearchingImage(lCountry, lArea){
makeImageRequest('ajax/ajax-images.asp','?ft=searching&fc='+ lCountry + '&fa=' + lArea)
}