function showResults(id, results) {
	document.getElementById(id).innerHTML = results;
}

var callbacks1 = {
   getDestinationsByAirport: function(results) {
	   showResults("show_destinations", results);
   }
}

var callbacks2 = {
   getDatesByDestinationAndAirport: function(results) {
	   showResults("show_months", results);
   }
}

var callbacks3 = {
   getDatesByCruiseLine: function(results) {
	   showResults("show_months2", results);
   }
}

function getDestinations(travel_from) {

	if(travel_from != ''){
		var remote = new cruise_offers(callbacks1);
		document.getElementById("show_destinations").innerHTML = "<select name=\"destination\" class=\"plaindark\"><option>Loading data...</option></select>";
		remote.getDestinationsByAirport(travel_from);
	}else{
		document.getElementById("show_destinations").innerHTML = "<select name=\"destination\" class=\"plaindark\"><option>Select your departure point</option></select>";
	}
}

function getMonths(travel_from, destination) {

	if(destination != '' && travel_from != ''){
		var remote = new cruise_offers(callbacks2);
		document.getElementById("show_months").innerHTML = "<select name=\"from_date\" class=\"plaindark\"><option>Loading data...</option></select>";
		remote.getDatesByDestinationAndAirport(destination, travel_from);
	}else{
		document.getElementById("show_months").innerHTML = "<select name=\"from_date\" class=\"plaindark\"><option>Select your departure point and destination</option></select>";
	}
}

function getMonthsByCruiseLine(cruise_line) {

	if(cruise_line != ''){
		var remote = new cruise_offers(callbacks3);
		document.getElementById("show_months2").innerHTML = "<select name=\"from_date\" class=\"plaindark\"><option>Loading data...</option></select>";
		remote.getDatesByCruiseLine(cruise_line);
	}else{
		document.getElementById("show_months2").innerHTML = "<select name=\"depart_date\" class=\"plaindark\"><option>Select a cruise_line</option></select>";
	}

}