| | |
| | | type = 'GT8S'; |
| | | low = 0; |
| | | |
| | | if(id == 313) { |
| | | if(id == 313 || id == 323) { |
| | | type = 'GT8C' |
| | | low = 1; |
| | | } |
| | |
| | | type = 'N8S-NF'; |
| | | low = 0; |
| | | |
| | | if((451 <= id && id <= 453) || id == 462) { |
| | | if((451 <= id && id <= 455) || id == 462) { |
| | | type = 'N8C-NF'; |
| | | low = 1; |
| | | } |
| | |
| | | }; |
| | | } |
| | | |
| | | function tramIdToVehicleId(tramId) { |
| | | if(0 <= tramId && tramId <= 999) { |
| | | var vehicleId = '0000' + (tramId + 736); |
| | | vehicleId = vehicleId.substr(vehicleId.length - 4) |
| | | return '635218529567218' + vehicleId; |
| | | } |
| | | } |
| | | |
| | | // Element mangling |
| | | function deleteChildren(element) { |
| | | while(element.lastChild) element.removeChild(element.lastChild); |
| | |
| | | function setText(element, text) { |
| | | deleteChildren(element); |
| | | element.appendChild(document.createTextNode(text)); |
| | | } |
| | | |
| | | // Other functions |
| | | var decodeEntitiesTextArea = document.createElement('textarea'); |
| | | function decodeEntities(text) { |
| | | decodeEntitiesTextArea.innerHTML = text; |
| | | return decodeEntitiesTextArea.value; |
| | | } |