var formname;var fieldName;function checkMandatoryFields(){var origin=document.form.wdf_cmsorigin.value;var destination=document.form.wdf_cmsdestination.value;var fieldList="";var errorMsg="";if(origin=="")fieldList="Please provide the departure city.\n";if(destination=="")fieldList=fieldList+"Please provide the arrival city.\n";if(fieldList!=""){errorMsg="The following information is needed for your request to be processed:"+"\n\n"+fieldList;}if(errorMsg!=""){alert(errorMsg);return false;}};function checkMandatoryFFFields(){var origin=document.roundTripInputForm._origin.value;var destination=document.roundTripInputForm._destination.value;var fieldList="";var errorMsg="";if(origin==""||destination=="")fieldList="Please provide both the departure and arrival cities.\n";if(fieldList!=""){errorMsg="The following information is needed for your request to be processed:\n\n"+fieldList;}if(errorMsg!=""){alert(errorMsg);return false;}};function checkMandatoryTSFields(){var origin=document.trainStatusForm._origin.value;var destination=document.trainStatusForm._destination.value;var train=document.trainStatusForm._trainNumber.value;var fieldList="";var errorMsg="";if(train==""&&origin==""&&destination=="")fieldList=fieldList+"Please provide either: \n\t An arrival and departure city\n\t A train number and departure city\n\t A train number an arrival city\n";if(train!=""&&origin==""&&destination=="")fieldList="Please provide either the departure city or arrival city in addition to a train number\n";if(origin!=""&&destination==""&&train=="")fieldList="Please provide either the arrival city or train number in addition to the departure city\n";if(destination!=""&&origin==""&&train=="")fieldList="Please provide either the departure city or train number in addition to the arrival city\n";if(fieldList!=""){errorMsg="The following information is needed for your request to be processed:"+"\n\n"+fieldList;}if(errorMsg!=""){alert(errorMsg);return false;}};function setReturnDate(){if(document.roundTripInputForm._retmonthyear.selectedIndex<=0){var now=new Date();document.roundTripInputForm._retmonthyear.options[now.getMonth()+1].selected=true;document.roundTripInputForm._retday.options[now.getDate()].selected=true;}};function clearReturnDate(){document.roundTripInputForm._retmonthyear.options[0].selected=true;document.roundTripInputForm._retday.options[0].selected=true;};function setRoundTrip(fieldName){if(fieldName=="_destination"){if(document.roundTripInputForm._destination.value!=""){document.roundTripInputForm._tripType[1].checked=true;}else{if(document.roundTripInputForm._retmonthyear.selectedIndex==0&&document.roundTripInputForm._retday.selectedIndex==0&&document.roundTripInputForm._rethourmin.selectedIndex==0){document.roundTripInputForm._tripType[0].checked=true;}}}else{if(document.roundTripInputForm[fieldName].selectedIndex>0){document.roundTripInputForm._tripType[1].checked=true;}else{if(document.roundTripInputForm._retmonthyear.selectedIndex==0&&document.roundTripInputForm._retday.selectedIndex==0&&document.roundTripInputForm._rethourmin.selectedIndex==0){document.roundTripInputForm._tripType[0].checked=true;}}}} 