/*
 * Constants for all variations of the Internet booking engine.
 *
 * $Id: constants.js 2984 2010-01-20 05:48:45Z jeffery.to@wwwins.com $
 */

ibe.constants = {
	domain: 'emirateshotelsresorts.com',

	wbeHost: 'res',
	wbeIframe: '/requesterlive.html',
	wbeASMX: '/ekhs_ws.asmx',
	wbeNS: 'http://EKHS.Gateway.ServiceContracts/2008/01',

	utilHost: 'www',
	utilIframe: '/common/booking/js/jlib/RemoteXHR/Requester.html',
	utilASMX: '/util/EmailService.asmx',
	utilNS: 'http://tempuri.org/',

	lwmIframe: '/common/booking/js/jlib/hessian/LocationWatcherModuleExplorerHelper.html',
	storageContainerId: 'store',
	messengerContainerId: 'centerColumn',
	moduleSourcePrefix: '/common/booking/js/lib/mod_',

	// defaults
	airportTransferMessage: [
				_('For up to three guests and four pieces of luggage.'), '<br />',
				_('Each airport pick-up/drop-off costs AED 250 for Dubai airport, and AED 400 for Abu Dhabi or Sharjah airports.')
			].join(''),
	airportTransferConfirmMessage: [
			'<p><strong>', _('Airport Transfers'), '</strong></p>',
			'<p>', _('Your airport transfer should be confirmed by our concierge. For all airport pick-ups please proceed to the Arabian Adventures Desk which is the last counter in the Airport Arrivals hall.'), '</p>',
			'<p>', _('Should there be any delays, guests are requested to inform the hotel directly. Our drivers are instructed to wait for one hour at the airport before the guest is considered a no-show.'), '</p>',
			'<p>',
				_('Concierge Direct Line: +971 4 319 4618'), '<br />',
				_('Hotel Telephone: +971 4 319 4000'),
			'</p>'
		].join('')
};

ibe.WBE.HOTEL_VALUES = {
	// the harbour
	'1': {
		travelTradeUrl: '/the-harbour/en/travel-and-trade/',
		bookingUrl: '/the-harbour/en/reservations/booking/online-booking/',
		termsUrl: '/the-harbour/en/terms-and-conditions/',
		cancelUrl: '/the-harbour/en/reservations/booking/online-booking/reservation-details/',
		numGuestsMessage: [
				'<strong>', _('Maximum Occupancy'), '</strong><br />',
				_('Studio Suites: 2 guests'), '<br />',
				_('1 Bedroom Suites: 2 guests + 1 additional guest free of charge'), '<br />',
				_('2 Bedroom Suites: 4 guests + 1 additional guest free of charge'), '<br />',
				_('3 Bedroom Suites: 6 guests + 1 additional guest free of charge')
			].join(''),
		numExtraBedsMessage: _('One extra bed is provided free of charge'),
		airportTransferMessage: ibe.constants.airportTransferMessage,
		airportTransferConfirmMessage: ibe.constants.airportTransferConfirmMessage
	},

	// green lakes
	'5': {
		travelTradeUrl: '/green-lakes/en/travel-and-trade/',
		bookingUrl: '/green-lakes/en/reservations/booking/online-booking/',
		termsUrl: '/green-lakes/en/terms-and-conditions/',
		cancelUrl: '/green-lakes/en/reservations/booking/online-booking/reservation-details/',
		numGuestsMessage: [
				'<strong>', _('Maximum Occupancy'), '</strong><br />',
				_('1 Bedroom Apartments: 2 guests'), '<br />',
				_('2 Bedroom Apartments: 4 guests'), '<br />',
				_('3 Bedroom Apartments: 6 guests')
			].join(''),
		airportTransferMessage: ibe.constants.airportTransferMessage,
		airportTransferConfirmMessage: ibe.constants.airportTransferConfirmMessage
	},

	// al maha
	'7': {
		travelTradeUrl: '/group/en/travel-and-trade/',
		bookingUrl: '/al-maha/en/reservations/booking/online-booking/',
		termsUrl: '/al-maha/en/terms/',
		cancelUrl: '/al-maha/en/reservations/booking/online-booking/reservation-details/',
		numGuestsMessage: [
				'<strong>', _('Maximum Occupancy'), '</strong><br />',
				_('Bedouin Suites: 2 guests'), '<br />',
				_('Royal Suites: 4 guests'), '<br />',
				_('Emirates Suites: 4 guests'), '<br />',
				_('Presidential Suite: 6 guests'), '<br /><br />',
				_('We regret that children under the age of 12 are not permitted at Al Maha.')
			].join(''),
		airportTransferMessage: [
				_('For up to three guests and four pieces of luggage. Return transfers are charged as follows:'), '<br /><br />',
				_('Dubai Airport to Al Maha	AED	828.00'), '<br />',
				_('Sharjah Airport to Al Maha	AED	1,340.00'), '<br />',
				_('Abu Dhabi Airport to Al Maha	AED	1,690.00'), '<br /><br />',
				_('Our drivers are instructed to wait for one hour at the airport before the guest is considered a no-show and the full transfer fee will be charged to their credit card. '), '<br />',
				_('First and Business Class passengers with Emirates Airline may be entitled to complimentary transfer service between the airport and Al Maha; please confirm with Emirates Airline if this service is applicable to you.'), '<br />',
				_('Your airport transfer will be confirmed by our Guest Relations Coordinator.')
			].join(''),
		landTransferMessage: [
				_('For up to three guests and four pieces of luggage. Return transfers are charged as follows:'), '<br /><br />',
				_('Dubai City to Al Maha 	AED	828.00'), '<br />',
				_('Jebel Ali to Al Maha AED	1,200.00'), '<br />',
				_('Sharjah / Ajman to Al Maha AED	1,340.00'), '<br />',
				_('Ras Al Khaimah/Fujairah/Hatta to Al Maha AED	2,180.00'), '<br /><br />',
				_('Our drivers are instructed to wait for one hour at the airport before the guest is considered a no-show and the full transfer fee will be charged to their credit card. '), '<br />',
				_('Your land transfer will be confirmed by our Guest Relations Coordinator.')
			].join(''),
		hotelArrivalMessage: _('Private vehicles may not enter the reserve and must be left at the secure parking area at the main entrance gate. Guests will be collected from this point and transferred to the resort by their dedicated Field Guide. To avoid any delays it is therefore essential you advise Al Maha of your arrival time. Check in time is from 1400 hours and check out time is 1200 noon. Earlier check in or later check out may result in additional fees or an additional night being charged.'),
		confirmMessage: [
				_('We recommend you book any Timeless Spa treatments in advance to ensure your preferred timings are available.'), '<br />',
				'<br />',
				_('Please note that all on-site activities are weather permitting and will be arranged by your field guide upon arrival at the resort.')
			].join(''),
		airportTransferConfirmMessage: [
				'<p><strong>', _('Airport Transfers'), '</strong></p>',
				'<p>', _('Your airport transfer should be confirmed by our Guest Relations Coordinator.'), '</p>',
				'<p>', _('Should there be any delays, guests are requested to inform the hotel directly. Our drivers are instructed to wait for one hour at the airport before the guest is considered a no-show.'), '</p>',
				'<p>', _('Hotel Telephone: +971 4 8329900'), '</p>',
				'<p>', _('Arrival at Terminal 3 - Emirates Airline'), '</p>',
				'<p>', _('Your arrival transfer will be booked via our partners, Prime Limousine. Please identify yourselves to the representative from Prime Limousine, who will wait for you outside of the airport\'s arrival area (curb side). The representative will be dressed in black trousers, grey shirt and a dark gray neck tie and holding a Prime Limousine placard with your name.'), '</p>',
				'<p>', _('Arrival at Terminal 1 - Other Airlines'), '</p>',
				'<p>', _('Please proceed to the Budget Rent-a-Car Counter at the arrivals area of the airport, which is located after the customs check point, and the counter staff will then guide you to the chauffeur driven luxury four-wheel drive. Please note we cannot display placards with guest names on them. '),'</p>'
			].join(''),
		landTransferConfirmMessage: [
				'<p><strong>', _('Land Transfers'), '</strong></p>',
				'<p>', _('Your land transfer should be confirmed by our Guest Relations Coordinator.'), '</p>',
				'<p>', _('Should there be any delays, guests are requested to inform the hotel directly. Our drivers are instructed to wait for one hour before the guest is considered a no-show.'), '</p>',
				'<p>', _('Hotel Telephone: +971 4 8329900'), '</p>'
			].join(''),
		hotelArrivalConfirmMessage: [
				'<p><strong>', _('Arrival Time'), '</strong></p>',
				'<p>', _('In case of delays, please inform the hotel in advance on telephone +971 4 8329900 so we can arrange for your pick-up from the main entrance gate.'), '</p>'
			].join(''),
		showLandTransfer: true,
		showHotelArrival: true,
		showDietaryRequirements: true,
		showNumGuestsOnly: true
	},

	// wolgan valley
	'8': {
		travelTradeUrl: '/group/en/travel-and-trade/',
		bookingUrl: '/wolgan-valley/en/reservations/booking/online-booking/',
		termsUrl: '/wolgan-valley/en/terms-and-conditions/',
		cancelUrl: '/wolgan-valley/en/reservations/booking/online-booking/reservation-details/',
		numGuestsMessage: [
				'<strong>', _('Maximum Occupancy'), '</strong><br />',
				'<strong>', _('(adults and children of 2 years and above)'), '</strong><br />',
				_('Heritage Suite King: 2 guests'), '<br />',
				_('Heritage Suite Double: 2 guests'), '<br />',
				_('Wollemi Suite: 4 guests'), '<br />',
				_('Wolgan Suite: 4 guests plus 2 guests\' staff'), '<br /><br />',
				_('Wolgan Valley is not recommended for children under the age of 8.')
			].join(''),
		airportTransferMessage: [
				_('Transfers are available from and to Sydney airport and Sydney CBD hotels.'), '<br />',
				_('A member of our reservations team will contact you within 48 hours to discuss your transfer requirements.'), '<br />',
				_('The vehicle is a 4-wheel drive Toyota Land Cruiser and can accommodate up to four persons and luggage.')
			].join(''),
		landTransferMessage: [
				_('A member of our reservations team will contact you within 48 hours to discuss your transfer requirements.')
			].join(''),
		hotelArrivalMessage: _('Private vehicles will not be permitted in the resort precinct and must be left at the parking area at the main entrance gate. Guests will be collected from this point and transferred to the resort by their dedicated Field Guide. To avoid any delays it is essential to advise the resort of your arrival time. Check in time is from 1500 hours and check out time is at 1100 hours.'),
		confirmMessage: [
				_('We recommend you book any Timeless Spa treatments in advance to ensure your preferred timings are available.'), '<br />',
				'<br />',
				_('All on-site activities are weather permitting and will be arranged by your field guide upon arrival at the resort.'),
				'<div class="dottedLineSection">',
				_('We would like to advise you that the resort does not have mobile coverage due to its remote geographical location, within a canyon of the Greater Blue Mountains World Heritage Area.'), '<br/>',
				'<br/>',
				_('Please note that on the final 13 kilometres to our property the road surface is compacted all weather gravel.'),
				'</div>'
			].join(''),
		airportTransferConfirmMessage: [
				'<p><strong>', _('Airport or Land Transfers'), '</strong></p>',
				'<p>', _('Transfers are available from and to Sydney airport and Sydney CBD hotels.'), '</p>',
				'<p>', _('A member of our reservations team will contact you within 48 hours to discuss your transfer requirements.'), '</p>',
				'<p>', _('The vehicle is a 4-wheel drive Toyota Land Cruiser and can accommodate up to four persons and luggage.'), '</p>'
			].join(''),
		landTransferConfirmMessage: [
				'<p><strong>', _('Helicopter Transfers'), '</strong></p>',
				'<p>', _('A member of our reservations team will contact you within 48 hours to discuss your transfer requirements.'), '</p>'
			].join(''),
		hotelArrivalConfirmMessage: [
				'<p><strong>', _('Arrival Time'), '</strong></p>',
				'<p>', _('In case of delays, please inform the hotel in advance on telephone +61 2 6350 1800 so we can arrange your pick-up from the main entrance gate.'), '</p>'
			].join(''),
		showAirportTransferLocation: true,
		showLandTransfer: true,
		showHotelArrival: true,
		showDietaryRequirements: true,
		showNumGuestsOnly: true
	}
};

ibe.WBE.ALLOTMENT_CODES = {
	'1': 'WBE', // the harbour
	'5': 'WBE_GL', // green lakes
	'7': 'WBE_AM', // al maha
	'8': 'WBE_WV' // wolgan valley
};

ibe.Error.DEFAULT_PROFILE.message = [
	'<p>', _('Dear Guest,'), '</p>',
	'<p>', _('Our booking engine is currently offline for maintenance. We apologise for the inconvenience.'), '</p>',
	'<p>',
		_('Please contact our Reservations Team on'), '<br />',
		'<br />',
		_('Tel: +971 4 303 4222'), '<br />',
		'<br />',
		_('Opening Times: United Arab Emirates'), '<br />',
		_('Monday to Thursday 8.00am - 8.30pm, GMT+4'), '<br />',
		_('Friday, Saturday, Sunday 9.00am - 6.00pm, GMT+4'), '<br />',
		'<br />',
		_('Email:'), ' <a href="mailto:ekresorts@emirates.com">ekresorts@emirates.com</a>',
	'</p>'
].join('');

ibe.Error.PROFILES[ibe.Error.CODE_WBE_DATE_RANGE_TOO_LONG].message += ' <span class="longterm">' + _('For stays longer than 30 days, please <a href="%s">contact us</a> to arrange a long-term reservation.') + '</span>';

ibe.Error.PROFILES[ibe.Error.CODE_WBE_RESERVATION_NUMBER_INVALID].message += ' ' + _('If you have booked directly with Emirates Hotels &amp; Resorts, please contact our reservations team on tel: +971 4 303 4222 for cancellations.');

ibe.Error.PROFILES[ibe.Error.CODE_WBE_RESERVATION_ALREADY_CANCELLED].message += ' ' + _('For assistance, please contact our reservations team on tel: +971 4 303 4222.');

if (jlib.contrib.BrowserDetect.engine == 'Trident') {
	ibe.Error.PROFILES[ibe.Error.CODE_TRANSPORT_NETWORK_ERROR].message += '<br /><br />' + _('This error may occur if an emirateshotelsresorts.com site is included in the Local intranet security zone or among the list of Trusted or Restricted sites (Tools &gt; Internet Options &gt; Security).') + '<br /><br />';
}

(function () {
	var constants = ibe.constants;
	var protocol = location.protocol;

	var domain = constants.domain.toLowerCase();
	var wbeHost = constants.wbeHost.toLowerCase();
	var utilHost = constants.utilHost.toLowerCase();

	var wbeRoot = protocol + '//' + wbeHost + '.' + domain;
	var utilRoot = protocol + '//' + utilHost + '.' + domain;

	constants.domain = domain;
	constants.wbeHost = wbeHost;
	constants.utilHost = utilHost;

	constants.wbeRoot = wbeRoot;
	constants.wbeRequester = wbeRoot + constants.wbeIframe;
	constants.wbeWS = wbeRoot + constants.wbeASMX;

	constants.utilRoot = utilRoot;
	constants.utilRequester = utilRoot + constants.utilIframe;
	constants.utilWS = utilRoot + constants.utilASMX;

	constants.canInit =
		(location.hostname.toLowerCase().search(
			new RegExp('(?:^|\\.)' + domain + '$')) > -1);
	constants.replacementUrl = utilRoot +
		((location.port) ? ':' + location.port : '') + location.pathname +
		location.search + location.hash;
})();

// remove this
if (location.search.indexOf('wbe=dummy') > -1) {
	ibe.constants.wbeRequester = location.protocol + '//staging2.emirateshotelsresorts.com/common/booking/js/jlib/RemoteXHR/Requester.html';
	ibe.constants.wbeWS = location.protocol + '//staging2.emirateshotelsresorts.com/templates/booking/tests/helpers/ekh_ws2.asmx';
}

