var NetManagerModuleTrip = NetManagerBase.extend({
	
	options: {
		entityId: 0,
		currency: 'euro'
	},
	
	translate: null,
	
	initialize: function(options) {
		this.setOptions(options);
		this.translate = new NetManagerPlugini18n({translations: oI18N});
	},
	
	initTripDetail: function() {
		$E('p.buttonGeneralNotes a').addEvent('click', this.showGeneralNotes.bind(this));
		$E('p.buttonPrint a').addEvent('click', this.printItinerary.bind(this));
		$E('p.buttonBooking a').addEvent('click', this.showBookingForm.bind(this));
		if ($defined($E('div#map a'))) {
			this.detailMap = $E('div#map a').addEvent('click', this.showFullMap.bind(this));
		}
	},
	
	showGeneralNotes: function() {
		var oOverlay = null, oNotesPopup = null, oNotesHeader = null, oNotesHeader = null, oNotesContent = null, oNotesButton = null, oNotesRequest, ajaxLoaderLeft = null, ajaxLoaderTop = null;
		
		ajaxLoaderLeft = (window.getWidth() - 32) / 2 + window.getScrollLeft();
		ajaxLoaderTop = (window.getHeight() - 32) / 2 + window.getScrollTop();
		oOverlay = new Element('div').addClass('overlay').setOpacity(0.4).setStyles({
			'width'			: window.getScrollWidth(),
			'height'		: window.getScrollHeight(),
			'background'	: '#000 url(/images/front/ajax-loader.gif) ' + ajaxLoaderLeft + 'px ' + ajaxLoaderTop + 'px no-repeat'
		}).inject(document.body);
		
		oNotesPopup = new Element('div').addClass('photoPopup').setOpacity(0).setStyles({
			'top'			: (window.getHeight() - 614) / 2 + window.getScrollTop(),
			'left'			: (window.getWidth() - 698) / 2 + window.getScrollLeft()
			
		}).inject(document.body);
			
		oNotesHeader = new Element('h3').addClass('header').setText('General notes for voyage ' + this.options.voyageCode).inject(oNotesPopup);
		oNotesContent = new Element('div').setProperty('id', 'generalNotesContent').addClass('content').setStyles({'padding': '10px', 'width': '638px', 'height': '456px', 'overflow': 'scroll'}).inject(oNotesPopup);
		oNotesClose = new Element('div').addClass('closeIcon').setProperty('title', this.translate._('Close window')).addEvent('click', function() {
			$$('.overlay, .photoPopup').each(function(el) {
				el.remove();
			});
		}).inject(oNotesPopup);
		
		
		oNotesRequest = new NetManagerPluginAjax();		
		oNotesRequest.getAjaxUpdater('/trip/get-general-notes/iTripId/' + this.options.entityId, 'generalNotesContent');
		oNotesPopup.setOpacity(1);
	},
	
	showBookingForm: function() {
		var oOverlay = null, oBookingHeader = null, oBookingHeader = null, oBookingContent = null, oBookingButton = null, oBookingRequest, ajaxLoaderLeft = null, ajaxLoaderTop = null;
		this.oBookingPopup = null;
		ajaxLoaderLeft = (window.getWidth() - 32) / 2 + window.getScrollLeft();
		ajaxLoaderTop = (window.getHeight() - 32) / 2 + window.getScrollTop();
		oOverlay = new Element('div').addClass('overlay').setOpacity(0.4).setStyles({
			'width'			: window.getScrollWidth(),
			'height'		: window.getScrollHeight(),
			'background'	: '#000 url(/images/front/ajax-loader.gif) ' + ajaxLoaderLeft + 'px ' + ajaxLoaderTop + 'px no-repeat'
		}).inject(document.body);
		
		this.oBookingPopup = new Element('div').addClass('photoPopup bookingPopup').setOpacity(0).setStyles({
			'width'			: 720,
			'top'			: (window.getHeight() - 614) / 2 + window.getScrollTop(),
			'left'			: (window.getWidth() - 720) / 2 + window.getScrollLeft()
			
		}).inject(document.body);
			
		oBookingHeader = new Element('h3').addClass('header').setText('Booking request for voyage ' + this.options.voyageCode).inject(this.oBookingPopup);
		oBookingContent = new Element('div').setProperty('id', 'BookingContent').addClass('content').setStyles({
			'width'			: 680,
			'overflow-y'	: 'scroll'
			
		}).setStyle('overflow-y','scroll').inject(this.oBookingPopup);
		oBookingClose = new Element('div').addClass('closeIcon').setProperty('title', 'Close window').addEvent('click', function() {
			$$('.overlay, .photoPopup').each(function(el) {
				el.remove();
			});
		}).inject(this.oBookingPopup);
		
		
		oBookingRequest = new NetManagerPluginAjax();
		var url = '/trip/get-booking/' + this.options.voyageCode;
		oBookingRequest.getAjaxUpdater(url, 'BookingContent');
		this.oBookingPopup.setOpacity(1);
		
		
	},
	
	showFullMap: function(evt) {		
		var event = new Event(evt);
		event.stop();
		
		var oGallery = new NetManagerModuleGallery({bShowEcard: false});
		var oFullImage = new Element('img').setProperties({src:this.detailMap.getProperty('href')});
		var imgProperties = this.detailMap.getProperty('href').split('/');
		
		var iImageId = this.detailMap.getProperty('href').replace(/[^0-9]/ig,'');
		var obj = {};
		obj = {image:oFullImage, 
			   index: 0, 
			   id: imgProperties[4], 
			   large_image_id: 0, 
			   large_resolutions: '', 
			   mime: 'jpg', 
			   filename:'Itinerary area', 
			   imagewidth: imgProperties[6], 
			   imageheight: imgProperties[8], 
			   copyright:'Oceanwide expeditions', 
			   site_id: 1};
		oGallery.showImage(obj);
		
	},
	
	printItinerary: function() {
		var url, title, options;
		url     = 'http://www.oceanwide-expeditions.com/trip/print/' + this.options.voyageCode + '/currency/' + this.options.currency;
		title   = this.options.voyageCode;
		options = 'status=0,toolbar=0,location=0,menubar=1,directories=0,resizable=0,scrollbars=1,height=500,width=700';
		window.open(url, title, options);
	},
	
	changePrintCurrency: function(currency) {
		this.options.currency = currency;
		$E('p.buttonPrint a').addEvent('click', this.printItinerary.bind(this));
	},
	
	initSearchForm: function() {
		//console.log('fn: initSearchForm');
		if ($defined($('searchVoyageFormSubmit'))) {
			$('searchVoyageFormSubmit').addEvent('click', this.showSearchResults.bind(this));
			$('sCode').addEvent('keydown', this.searchVoyageKeyDown.bind(this));
		}
	},
	
	searchVoyageKeyDown: function(event) {
		var evt = new Event(event);
	    if (evt.key === 'enter') {
	    	evt.stop();
    		this.showSearchResults();
	    }
	},
	
	initViewItineraries: function() {
		if ($defined($('viewAllItineraries'))) {
			$('viewAllItineraries').addEvent('click', this.viewAllItineraries.bindWithEvent(this));
		}
			
	},
	
	showSearchResults: function() {
		//console.log('fn: showSearchResults');
		this.searchTripTable = this.getWizard('search-trip-table');
		
		if(window.getWidth() < 1750) {
			var wizardWidth = window.getWidth() - 100;
		} else {
			var wizardWidth = 1650;
		}
		
		var wizardHeight = window.getHeight() - 100;
		
		// Set variable options
		this.searchTripTable.setOptions({
			title: this.translate._('Search for voyages'),
			width: wizardWidth,
			height: wizardHeight,
			zindex: 200, 
			fnComplete: this.styleSearchTable.bind(this)
		});
		
		this.searchTripTable.setDescription(this.translate._('Click below on the trip of your choice to see the detailed itinerary.') + '<br /><font color="red">*</font> = ' + this.translate._('Departure is currently under charter or sold out.'));
		this.searchTripTable.addButton({icon:'cancel', text:this.translate._('close').substr(0, 1).toUpperCase() + this.translate._('close').substr(1), event:this.cancelSearchTripTable.bind(this)});
		this.searchTripTable.getContent('/trip/search/from/' + $('dFrom').getProperty('value') + '/till/' + $('dTill').getProperty('value') + '/code/' + $('sCode').getProperty('value'));
		this.searchTripTable.show();
		this.searchTripTable.setStatus({icon:'loading', text: this.translate._('Searching our database') + '...'});
		this.options.voyageCode = $('sCode').getProperty('value');
	},
	
	initPageTable: function() {
		//console.log('init page table');
		var tbOptions = {tableId:'itineraryTableContent',overCls: 'hover', popUp: false};		
		var itineraryTableSort = this.getTableHandler('pageTable',tbOptions);
	},
	
	styleSearchTable: function(e) {
		//console.log('fn: styleSearchTable');
		var numRows = 0;
		var tbOptions = {tableId:'itineraryTableContent',overCls: 'hover', popUp: true};		
		var itineraryTableSortPop = this.getTableHandler('popUpTable',tbOptions);
		
		if ($defined(this.searchTripTable)) {
			if ($defined($(this.searchTripTable.getInstanceId()).getElement('tbody'))) {
				this.searchTripTable.setStatus({icon:'info', text: 'Initialising...'});
				$(this.searchTripTable.getInstanceId()).getElement('tbody').getElements('tr').each(function(row) {
					$(row).addEvents({
						'mouseenter': function() { this.addClass('hover'); },
						'mouseleave': function() { this.removeClass('hover'); }
					});
					numRows = numRows + 1;
				});
				var myTips1 = new MooTips($$('.NetManagerWizard .charter'), {
					showDelay: 0,
					hideDelay: 0,
					offsets: {
						'x': 15,
						'y': -10
					},
					fixed: true
				});
				this.searchTripTable.setStatus({icon:'info', text: numRows + ' ' + this.translate._('trips found') + '.'});
			} else {
				if ($defined(this.options.voyageCode) && this.options.voyageCode !== '' && this.options.voyageCode !== 'Optional') {
					document.location.href = '/trip/show/' + this.options.voyageCode;
				}
			}
		} else {
			//console.log('searchTripTable is not defined');
		}
	},
	
	viewAllItineraries: function(e) {
				
		this.searchTripTable = this.getWizard('view-all-itineraries');
			
		// Set variable options
		this.searchTripTable.setOptions({
			title: this.translate._('All voyages and rates'),
			width: 990,
			height: 600,
			zindex: 200, 
			fnComplete: this.styleSearchTable.bind(this)
		});
		this.searchTripTable.setDescription(this.translate._('Click below on the trip of your choice to see the detailed itinerary.') + '<br /><font color="red">*</font> = ' + this.translate._('Departure is currently under charter or sold out.'));
		this.searchTripTable.addButton({icon:'cancel', text:this.translate._('close').substr(0, 1).toUpperCase() + this.translate._('close').substr(1), event:this.cancelSearchTripTable.bind(this)});
		this.searchTripTable.getContent('/trip/search/from/' + $('dFrom').getProperty('value') + '/till/' + $('dTill').getProperty('value') + '/code/' + $('sCode').getProperty('value'));
		this.searchTripTable.show();
		this.searchTripTable.setStatus({icon:'loading', text: this.translate._('Searching our database') + '...'});
	},
	
	
	
	/*viewAllItineraries: function() {
		console.log('viewAllItineraries');
		this.searchTripTable = this.getWizard('view-all-itineraries');
			
		// Set variable options
		this.searchTripTable.setOptions({
			title: this.translate._('Search for voyages'),
			width: 990,
			height: 600,
			zindex: 200
		});
			
		this.searchTripTable.addButton({icon:'cancel', text:'Sluiten', event:this.cancelSearchTripTable.bind(this)});
		this.searchTripTable.getContent('/trip/search');
		this.searchTripTable.show();
	},*/
	
	cancelSearchTripTable: function() {
		this.searchTripTable.closeWizard();
	},
	
	
	
	initAdminForm: function() {
		this.regionDropdown      = this.getDropdown({key      		: 'regionDropdown',
													 icon     		: 'icon-region', 								
													 width	  		: 288,		     
													 selectId 		: 'region_id',
													 fnEvent  		: this.onRegionTogglerClick.bind(this)});
												
		this.subregionDropdown   = this.getDropdown({key      		: 'subregionDropdown',
													 icon     		: 'icon-subregion', 	
												     selectId 		: 'subregion_id',
												     width	  		: 288,
													 fnEvent  		: this.onSubregionTogglerClick.bind(this)});
												
		this.itineraryDropdown   = this.getDropdown({key      		: 'itineraryDropdown',
													 icon     		: 'icon-itinerary', 	
												   	 selectId 		: 'itinerary_id',
												   	 width	  		: 288,
													 containerWidth	: 420});			
													 							
		this.vesselDropdown      = this.getDropdown({key      		: 'vesselDropdown',
													 icon     		: 'icon-vessel',
												   	 selectId 		: 'vessel_id',
												   	 width	  		: 288});
   	 	
	   	if (this.options.entityId > 0) {
	   		this.initDuplicator();
			this.initTripOptionTable();
			this.initTripRoomTypePricesTable();
	   	}
	   	
	   	this.moveHasManies();
	   	
	},
	
	moveHasManies: function () {
		var oTr = new Element('tr');
		var oTd = new Element('td').setProperty('colspan', '2').adopt($('hasManies')).injectInside(oTr);
		oTr.injectAfter($('charter').getParent().getParent());
	},
	
	initDuplicator: function() {
		$('duplicate_trip').setAttribute('href', $('duplicate_trip').getAttribute('href') + this.options.entityId);
	},
	
	onRegionTogglerClick: function(e) {

		this.subregionDropdown.optionsContainer.setStyle('display', 'none');
		if (this.subregionDropdown.multiOptions.length > 0) {
			this.subregionDropdown.selectedOption.setHTML(this.subregionDropdown.multiOptions[0].innerHTML);
		}
		
		this.itineraryDropdown.optionsContainer.setStyle('display', 'none');
		if (this.itineraryDropdown.multiOptions.length > 0) {
			this.itineraryDropdown.selectedOption.setHTML(this.itineraryDropdown.multiOptions[0].innerHTML);
		}
		
		var event = new Event(e);
		
		oAjax = new NetManagerPluginAjax();
		oAjax.getAjax('/trip/get-subregion-list/iRegionId/' + event.target.getProperty('value'), this.fillSubregionDropdown.bind(this), true);
	},
	
	onSubregionTogglerClick: function(e) {

		this.itineraryDropdown.optionsContainer.setStyle('display', 'none');
		if (this.itineraryDropdown.multiOptions.length > 0) {
			this.itineraryDropdown.selectedOption.setHTML(this.itineraryDropdown.multiOptions[0].innerHTML);
		}
		
		var event = new Event(e);
		oAjax = new NetManagerPluginAjax();
		oAjax.getAjax('/trip/get-itineraries-list/iSubregionId/' + event.target.getProperty('value'), this.fillItineraryDropdown.bind(this), true);
	},
	
	fillSubregionDropdown: function(sResponse) {
		var oResponse = Json.evaluate(sResponse);
		this.subregionDropdown.populate(oResponse);
		
	},
	
	fillItineraryDropdown: function(sResponse) {
		var oResponse = Json.evaluate(sResponse);
		this.itineraryDropdown.populate(oResponse);
	},
	
	initTripOptionTable: function() {
		// add button
		$('edit_trip_option_id_0').addEvent('click', this.showTripOptionForm.bind(this));
		
		// edit buttons
		$$('.edit_trip_option').each(function(editLnk) {
			editLnk.addEvent('click', this.showTripOptionForm.bind(this));
		}, this);
		
		//delete buttons
		$$('.delete_trip_option').each(function(editLnk) {
			editLnk.addEvent('click', this.confirmDeleteTripOption.bind(this));
		}, this);
	},
		
	initTripRoomTypePricesTable: function() {
		// add button
		$('add_room_type_price').addEvent('click', this.showRoomTypePricesForm.bind(this));
		
		// edit buttons
		$$('.edit_room_type_price').each(function(editLnk) {
			editLnk.addEvent('click', this.showRoomTypePricesForm.bind(this));
		}, this);
		
		//delete buttons
		$$('.delete_room_type_price').each(function(editLnk) {
			editLnk.addEvent('click', this.confirmDeleteRoomTypePrice.bind(this));
		}, this);
	},
	
	showTripOptionForm: function(e) {
		//console.log('whoohoo');
		var event = null, url = '';
		event = new Event(e);
		
		this.addTripOptionWizard = this.getWizard('add-trip-option');
		// Set variable options
		this.addTripOptionWizard.setOptions({
			title  : 'Add trip option',
			width  : 440,
			height : 280,
			zindex : 200,
			fnComplete: this.initTripOptionDropdown.bind(this)
		});
			
		this.addTripOptionWizard.addButton({icon:'cancel', text:'Sluiten', event:this.cancelAddTripOptionWizard.bind(this)});
		this.addTripOptionWizard.addButton({icon:'apply', text:'Opslaan', event:this.saveTripOption.bind(this)});
		var url  = '/trip/admin-form-trip-option';
		
		if ($defined($(event.target).getProperty('id'))) {
			url += '/iItemId/' + $(event.target).getProperty('id').replace(/[^0-9]/ig,'');  
		}
		this.addTripOptionWizard.getContent(url);
		this.addTripOptionWizard.show();
	},
		
	showRoomTypePricesForm: function(e) {
		var event = null, url = '';
		event = new Event(e);
		
		this.addRoomTypePriceWizard = this.getWizard('add-room-type-price');
		// Set variable options
		this.addRoomTypePriceWizard.setOptions({
			title: 'Add room prices',
			width: 550,
			height: 580,
			zindex: 200,
			fnComplete: function(){}
		});
			
		this.addRoomTypePriceWizard.addButton({icon:'cancel', text:'Sluiten', event:this.cancelRoomTypePriceWizard.bind(this)});
		this.addRoomTypePriceWizard.addButton({icon:'apply', text:'Opslaan', event:this.saveRoomTypePrice.bind(this)});
		url  = '/trip/admin-form-trip-room-price/iVesselId/' + this.vesselDropdown.getValue();
		
		url += '/iTripId/' + this.options.entityId;
		
		this.addRoomTypePriceWizard.getContent(url);
		
		this.addRoomTypePriceWizard.show();
	},
	
	initTripOptionDropdown: function() {
		this.tripOptionDropdown = null;
		this.tripOptionDropdown = this.getDropdown({key      : 'trip_options_id',
												    icon     : 'icon-tripoption',
											   	    selectId : 'trip_options_id',
											   	    width	 : 288});
		
	},

	saveTripOption: function() {
		this.addTripOptionForm = new NetManagerPluginForm({formElm:$('TripTripOptionsForm'), onValid: this.addTripOptionToTable.bind(this)});
		this.addTripOptionForm.processForm();
	},
	
	saveRoomTypePrice: function() {
		this.addRoomTypePriceForm = new NetManagerPluginForm({formElm:$('TripRoomTypePricesForm'), onValid: this.addRoomTypePricesToTable.bind(this)});
		this.addRoomTypePriceForm.processForm();
	},
	
	addTripOptionToTable: function() {
		
		var oTr = null, oTdTitle = null, oTdPE = null, oTdPD = null, oTdOptions = null, oTbody = null, editLnk = null, editImg = null, deleteLnk = null, deleteImg = null, lnkId = 'edit_trip_option_id_' + this.addTripOptionForm.data.id;
		
		if (!$defined($(lnkId))) {
			oTr 	   = new Element('tr');
			oTdTitle   = new Element('td').setText(this.tripOptionDropdown.getSelectedOptionText()).inject(oTr);
			oTdPE 	   = new Element('td').setText(this.addTripOptionForm.data.price_euro).inject(oTr);
			oTdPD 	   = new Element('td').setText(this.addTripOptionForm.data.price_dollar).inject(oTr);
			
			oTdOptions = new Element('td').addClass('options');
			
			editLnk    = new Element('a').addClass('edit_trip_option').setProperties({href:"javascript:void(0);", id: lnkId, title:"Trip option koppeling bewerken"}).addEvent('click',this.showTripOptionForm.bind(this)).inject(oTdOptions);
			deleteLnk  = new Element('a').addClass('delete_trip_option').setProperties({href:"javascript:void(0);", id: lnkId, title:"Trip option koppeling verwijderen"}).addEvent('click',this.confirmDeleteTripOption.bind(this)).inject(oTdOptions);
			
			oTdOptions.inject(oTr);
			
			/*oTbody = $('tripOptionsTable').getElement('tbody');
			if ($(oTbody).getElement('tr')) {
				if ($(oTbody).getElement('tr').getElement('td').getProperty('colspan') == 4) {
					newRowSlider = new Fx.Slide($(oTbody).getLast(), {duration:300}).slideOut();
					$E('#tripOptionsTable tbody').empty();
				}
			}*/
			
			oTr.inject($('tripOptionsTable').getElement('tbody'));
		
		} else {
			$(lnkId).getParent().getPrevious().setText(this.addTripOptionForm.data.price_dollar);
			$(lnkId).getParent().getPrevious().getPrevious().setText(this.addTripOptionForm.data.price_euro);
			$(lnkId).getParent().getPrevious().getPrevious().getPrevious().setText(this.tripOptionDropdown.getSelectedOptionText());
		}
		
		this.addTripOptionWizard.closeWizard();
	},
	
	addRoomTypePricesToTable: function(oResponse) {

		var oTr, oTdTitle, oTdPE, oTdPD, oTBody, oWizard;
		
		oTBody = $('tripRoomPricesTable').getElement('tbody');
		if ($type(oTBody) == 'element') {
			$('tripRoomPricesTable').getElement('tbody').getElements('tr').each(function(el){$(el).remove()});
			$each(oResponse.parseData, function(row) {
				oTr 	   = new Element('tr');
				oTdTitle   = new Element('td').setText(row.title).inject(oTr);
				oTdPE 	   = new Element('td').setText(row.price_euro).inject(oTr);
				oTdPD 	   = new Element('td').setText(row.price_dollar).inject(oTr);
				oTr.inject($(oTBody));
			});
		} 
		
		oWizard = this.getWizard('add-room-type-price').closeWizard();
	},
	
	cancelAddTripOptionWizard: function() {
		this.addTripOptionWizard.closeWizard();
	},
	
	cancelRoomTypePriceWizard: function() {
		this.addRoomTypePriceWizard.closeWizard();
	},
	
	confirmDeleteTripOption: function(e) {
		var event = new Event(e);
		// Get info
		this.rowElmId = $(event.target).getProperty('id'); 
		this.entityId = this.rowElmId.replace(/[^0-9]/ig, '');
		
		// Initialize the wizard
		this.oDeleteWizard = this.getWizard('delete-trip-option');
		
		// Set variable options
		this.oDeleteWizard.setOptions({
			title: 'Trip option verwijderen',
			width: 325,
			height: 150,
			message: 'Weet u zeker dat u deze trip option wilt verwijderen?'
		});
		
		// Add wizard buttons
		this.oDeleteWizard.addButton({icon:'cancel', text:'Annuleren', event:this.cancelDelete.bind(this)});
		this.oDeleteWizard.addButton({icon:'delete', text:'Verwijderen', event:this.deleteTripOption.bind(this)});
				
		// Show confirmation
		this.oDeleteWizard.showConfirm();
	},

	confirmDeleteRoomTypePrice: function(e) {
		var event = new Event(e);
		// Get info
		this.rowElmId = $(event.target).getProperty('id'); 
		this.entityId = this.rowElmId.replace(/[^0-9]/ig, '');
		
		// Initialize the wizard
		this.oDeleteRoomTypePriceWizard = this.getWizard('delete-room-type-price');
		
		// Set variable options
		this.oDeleteRoomTypePriceWizard.setOptions({
			title: 'Trip option verwijderen',
			width: 325,
			height: 150,
			message: 'Weet u zeker dat u deze room type price wilt verwijderen?'
		});
		
		// Add wizard buttons
		this.oDeleteRoomTypePriceWizard.addButton({icon:'cancel', text:'Annuleren', event:this.cancelDeleteRoomTypePrice.bind(this)});
		this.oDeleteRoomTypePriceWizard.addButton({icon:'delete', text:'Verwijderen', event:this.deleteRoomTypePrice.bind(this)});
				
		// Show confirmation
		this.oDeleteRoomTypePriceWizard.showConfirm();
	},

	deleteTripOption: function() {
		
		oAjax = new NetManagerPluginAjax();
		oAjax.getAjax('/trip/admin-delete-trip-option/iItemId/' + this.entityId, this.hideTripOption.bind(this), true);
	},
	
	deleteRoomTypePrice: function() {
		
		oAjax = new NetManagerPluginAjax();
		oAjax.getAjax('/trip/admin-delete-trip-room-price/iItemId/' + this.entityId, this.hideRoomTypePrice.bind(this), true);
	},
	
	hideTripOption: function() {
		
		this.oDeleteWizard.hide();
		
		if ($defined(this.rowElmId)) {
			var rowSlider = new Fx.Slide($(this.rowElmId).getParent().getParent(), {duration:300}).slideOut();
			$(this.rowElmId).getParent().getParent().remove();
		}
		
	},
	
	hideRoomTypePrice: function() {
		
		this.oDeleteRoomTypePriceWizard.hide();
		
		if ($defined(this.rowElmId)) {
			var rowSlider = new Fx.Slide($(this.rowElmId).getParent().getParent(), {duration:300}).slideOut();
			$(this.rowElmId).getParent().getParent().remove();
		}
		
	},
	
	cancelDelete: function() {
		this.oDeleteWizard.closeWizard();
	},
	
	cancelDeleteRoomTypePrice: function() {
		this.oDeleteRoomTypePriceWizard.closeWizard();
	},
	
	showGeneralNotesInPrint: function() {
		oNotesRequest = new NetManagerPluginAjax();		
		oNotesRequest.getAjaxUpdater('/trip/get-general-notes/iTripId/' + this.options.entityId, 'generalNotes');
	},
	
	bindShowFullMapInPrint: function() {
		if ($defined($E('div#printMap a'))) {
			this.detailMap = $E('div#printMap a').addEvent('click', this.showFullMapInPrint.bind(this));
		}
	},
	
	showFullMapInPrint: function(evt) {
		
		var event = new Event(evt);
		event.stop();
		/*
		var oGallery = new NetManagerModuleGallery({bShowEcard: false});
		var oFullImage = new Element('img').setProperties({src:this.detailMap.getProperty('href')});
		var imgProperties = this.detailMap.getProperty('href').split('/');
		
		var iImageId = this.detailMap.getProperty('href').replace(/[^0-9]/ig,'');
		var obj = {};
		obj = {image:oFullImage, 
			   index: 0, 
			   id: imgProperties[4], 
			   large_image_id: 0, 
			   large_resolutions: '', 
			   mime: 'jpg', 
			   filename:'Itinerary area', 
			   wiff: imgProperties[6], 
			   heiff: imgProperties[8], 
			   copyright:'Oceanwide expeditions', 
			   site_id: 1};
		oGallery.showImage(obj);
		*/
	}
	
});

NetManagerModuleTrip.implement(new Options);