');
};
var resultApp = new expGuiCourseLight(document.getElementById("result"));
$('#submit_btn').click(function () {
var $depCode = $('input#dep_code');
var $via1Code = $('input#via1_code');
var $arrCode = $('input#arr_code');
$('#searchError').remove();
if ($depCode.val().trim() == '') {
alertMessage('「出発」を入力してください。');
return false;
}
if ($arrCode.val().trim() == '') {
alertMessage('「到着」を入力してください。');
return false;
}
// 探索条件
var searchInterface = resultApp.createSearchInterface();
searchInterface.setFrom($depCode.val());
searchInterface.setTo($arrCode.val());
if ($via1Code.val() != "") {
searchInterface.setVia($via1Code.val());
}
// search type
searchInterface.setSearchType($('input[name=type]:checked').val());
// date
searchInterface.setDate($('#yyyymm').val() + $('#day').val());
searchInterface.setTime($('#hour').val() + $('#minute').val());
// wayType
searchInterface.setShinkansen($('#sexp').prop('checked'));
searchInterface.setLimitedExpress($('#express').prop('checked'));
searchInterface.setBus($('#local').prop('checked'));
searchInterface.setPlane($('#plane').prop('checked'));
resultApp.search(
searchInterface,
function (url) {
window.open(url, '_self');
},
function (error) {
var message = error.Message;
if (typeof message == 'object') {
var array = [];
for (var i = 0; i < message.length; i++) {
array.push(message[i].text);
}
message = array.join("
");
}
alertMessage(message);
}
);
return false;
});
})();