// initializes webservice request
//		format p_strRoute:	"departure;destination"
//		format p_strDate:	"dd.mm.yyyy"
function GetTimetable(p_strRoute, p_strDate) {
    jQuery("#date").attr("value", p_strDate);

    // indicate loading of timetable
    ShowLoadingBar();

    jQuery.ajax({
        type: "GET",
        url: "/_v2/scripts/ws/ws_vesselTimetable.php?route=" + p_strRoute + "&date=" + p_strDate,
        success: ShowTimetableData,
        error: ShowTimetableError
    });
};

function ShowLoadingBar() {
    jQuery("#timetable").empty();
    jQuery("#timetable").append('<table cellpadding="0" cellspacing="0" border="0" class="timetable"><tr><td width="100%" height="100" valign="middle" align="center"><img src="media/gfx/else/loader_01.gif" /></td></tr></table>');
};

function ShowTimetableData(data, ioArgs) {
	// builds table due to outward journeys
	// can also display return journeys --> not implemented on client-side (js)
	jQuery("#timetable").empty();
    jQuery("#timetable").append(data);
};

function ShowTimetableError(data, ioArgs) {
	// this functions is called when an error occurs
	alert("An error occured.\nPlease try again!");
};