font_large = {
  "fontheight":14,
 "ß": [
    9,
    0b000000000,
    0b000000000,
    0b001111100,
    0b011000110,
    0b011000110,
    0b011111100,
    0b011000110,
    0b011000110,
    0b011000110,
    0b110111100,
    0b000000000,
    0b000000000,
    0b000000000,
    0b000000000
  ],

  "0": [
    7,
    0b0111100,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "1": [
    5,
    0b00110,
    0b01110,
    0b11110,
    0b00110,
    0b00110,
    0b00110,
    0b00110,
    0b00110,
    0b00110,
    0b00110,
    0b00000,
    0b00000,
    0b00000,
    0b00000
  ],
  "2": [
    7,
    0b0111100,
    0b1100110,
    0b0000110,
    0b0000110,
    0b0001100,
    0b0011000,
    0b0110000,
    0b1100000,
    0b1100000,
    0b1111110,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "3": [
    7,
    0b0111100,
    0b1100110,
    0b0000110,
    0b0000110,
    0b0011100,
    0b0000110,
    0b0000110,
    0b0000110,
    0b1100110,
    0b0111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "4": [
    7,
    0b0001110,
    0b0011110,
    0b0110110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1111110,
    0b0000110,
    0b0000110,
    0b0000110,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "5": [
    7,
    0b1111110,
    0b1100000,
    0b1100000,
    0b1100000,
    0b1111100,
    0b0000110,
    0b0000110,
    0b1100110,
    0b1100110,
    0b0111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "6": [
    7,
    0b0111100,
    0b1100110,
    0b1100000,
    0b1100000,
    0b1111100,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "7": [
    7,
    0b1111110,
    0b0000110,
    0b0000110,
    0b0001100,
    0b0001100,
    0b0011000,
    0b0011000,
    0b0011000,
    0b0011000,
    0b0011000,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "8": [
    7,
    0b0111100,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111100,
    0b0111100,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "9": [
    7,
    0b0111100,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111110,
    0b0000110,
    0b0000110,
    0b1100110,
    0b0111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  
  "90": [
    8,
    0b00011000,
    0b00111100,
    0b01111110,
    0b11111111,
    0b00111100,
    0b00111100,
    0b00111100,
    0b00111100,
    0b00111100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000,
    ""
  ],
  "91": [
    8,
    0b01100111,
    0b01100111,
    0b01100001,
    0b01100110,
    0b00000000,
    0b01100110,
    0b00000000,
    0b00000000,
    0b01010011,
    0b11111001,
    0b01010001,
    0b11111001,
    0b01010011,
    ""
  ],
  "94": [
    8,
    0b00000000,
    0b00000000,
    0b01100011,
    0b00110110,
    0b00011100,
    0b00011100,
    0b00110110,
    0b01100011,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],

  "¤": [
    16,
    0b0000001111000000,
    0b0000011111100000,
    0b0000111111110000,
    0b0001111111111000,
    0b0011111111111100,
    0b0111111111111110,
    0b1111101111011111,
    0b1111001111001111,
    0b1110001111000111,
    0b1100001111000011,
    0b0000001111000000,
    0b0000001111000000,
    0b0000001111000000,
    0b0000001111000000
  ],
  ">": [
    8,
    0b00000000,
    0b00000000,
    0b00010000,
    0b00011000,
    0b11111100,
    0b11111110,
    0b11111111,
    0b11111110,
    0b11111100,
    0b00011000,
    0b00010000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  " ": [
    3,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000
  ],
  "A": [
    8,
    0b00111000,
    0b01101100,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11111110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "B": [
    8,
    0b11111100,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11111100,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11111100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "Ć": [
    8,
      
    0b00010000,
    0b00100000,
    0b01111100,
    0b11000110,
    0b11000110,
    0b11000000,
    0b11000000,
    0b11000110,
    0b11000110,
    0b01111100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  
  "C": [
    8,
    0b01111100,
    0b11000110,
    0b11000110,
    0b11000000,
    0b11000000,
    0b11000000,
    0b11000000,
    0b11000110,
    0b11000110,
    0b01111100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
   
  "Č": [
    8,
    0b01111100,
    0b11000110,
    0b11000110,
    0b11000000,
    0b11000000,
    0b11000000,
    0b11000000,
    0b11000110,
    0b11000110,
    0b01111100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  
  
  "Đ": [
    9,
    0b011111000,
    0b011001100,
    0b011000110,
    0b011000110,
    0b111100110,
    0b011000110,
    0b011000110,
    0b011000110,
    0b011001100,
    0b011111000,
    0b000000000,
    0b000000000,
    0b000000000,
    0b000000000
  ],"D": [
    8,
    0b11111000,
    0b11001100,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11001100,
    0b11111000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "E": [
    8,
    0b11111110,
    0b11000000,
    0b11000000,
    0b11000000,
    0b11111110,
    0b11000000,
    0b11000000,
    0b11000000,
    0b11000000,
    0b11111110,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "F": [
    8,
    0b11111110,
    0b11000000,
    0b11000000,
    0b11000000,
    0b11111000,
    0b11000000,
    0b11000000,
    0b11000000,
    0b11000000,
    0b11000000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "G": [
    8,
    0b01111100,
    0b11000110,
    0b11000110,
    0b11000000,
    0b11011110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b01111100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "H": [
    8,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11111110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "I": [
    3,
    0b110,
    0b110,
    0b110,
    0b110,
    0b110,
    0b110,
    0b110,
    0b110,
    0b110,
    0b110,
    0b000,
    0b000,
    0b000,
    0b000
  ],
  "J": [
    7,
    0b1111110,
    0b0000110,
    0b0000110,
    0b0000110,
    0b0000110,
    0b0000110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "K": [
    8,
    0b11000110,
    0b11001100,
    0b11011000,
    0b11110000,
    0b11100000,
    0b11100000,
    0b11110000,
    0b11011000,
    0b11001100,
    0b11000110,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "L": [
    7,
    0b1100000,
    0b1100000,
    0b1100000,
    0b1100000,
    0b1100000,
    0b1100000,
    0b1100000,
    0b1100000,
    0b1100000,
    0b1111110,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "M": [
    8,
    0b11000110,
    0b11101110,
    0b11111110,
    0b11010110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "N": [
    8,
    0b11000110,
    0b11000110,
    0b11100110,
    0b11100110,
    0b11010110,
    0b11010110,
    0b11001110,
    0b11001110,
    0b11000110,
    0b11000110,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "O": [
    8,
    0b01111100,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b01111100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "P": [
    8,
    0b11111100,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11111100,
    0b11000000,
    0b11000000,
    0b11000000,
    0b11000000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "Q": [
    8,
    0b01111100,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11010110,
    0b11001110,
    0b11000110,
    0b11000110,
    0b01111101,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "R": [
    8,
    0b11111100,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11111100,
    0b11001100,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "S": [
    8,
    0b01111100,
    0b11000110,
    0b11000000,
    0b11000000,
    0b01111100,
    0b00000110,
    0b00000110,
    0b00000110,
    0b11000110,
    0b01111100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "Š": [
    8,
    0b01001000,
    0b00110000,
    0b01111100,
    0b11000110,
    0b11000000,
    0b01111100,
    0b00000110,
    0b00000110,
    0b11000110,
    0b01111100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "T": [
    9,
    0b111111110,
    0b000110000,
    0b000110000,
    0b000110000,
    0b000110000,
    0b000110000,
    0b000110000,
    0b000110000,
    0b000110000,
    0b000110000,
    0b000000000,
    0b000000000,
    0b000000000,
    0b000000000
  ],
  "U": [
    8,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b01111100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "Ü": [
    8,
    0b11000110,
    0b00000000,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b01111100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "V": [
    7,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111100,
    0b0011000,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "W": [
    8,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11010110,
    0b11111110,
    0b11101110,
    0b11000110,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "X": [
    8,
    0b11000110,
    0b11000110,
    0b11000110,
    0b01101110,
    0b00111100,
    0b00111000,
    0b01101100,
    0b11000110,
    0b11000110,
    0b11000110,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "Y": [
    9,
    0b110000110,
    0b110000110,
    0b111001110,
    0b011111100,
    0b001111000,
    0b000110000,
    0b000110000,
    0b000110000,
    0b000110000,
    0b000110000,
    0b000000000,
    0b000000000,
    0b000000000,
    0b000000000
  ],
  
  "Ž": [
    8,
    0b01001000,
    0b00110000,
    0b11111110,
    0b11111110,
    0b00000110,
    0b00001100,
    0b00011000,
    0b00110000,
    0b11111110,
    0b11111110,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  
  "Z": [
    8,
    0b11111110,
    0b11111110,
    0b00000110,
    0b00001100,
    0b00011000,
    0b00110000,
    0b01100000,
    0b11000000,
    0b11111110,
    0b11111110,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "Å": [
    8,
    0b00111000,
    0b01101100,
    0b00111000,
    0b01101100,
    0b11000110,
    0b11111110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "Ä": [
    8,
    0b11000110,
    0b00010000,
    0b00111000,
    0b01101100,
    0b11000110,
    0b11111110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "Æ": [
    12,
    0b000000000000,
    0b000001111110,
    0b000011100000,
    0b001101100000,
    0b011001100000,
    0b111111111110,
    0b110001100000,
    0b110001100000,
    0b110001100000,
    0b110001111110,
    0b000000000000,
    0b000000000000,
    0b000000000000,
    0b000000000000
  ],
  "Ø": [
    8,
    0b00000000,
    0b01111100,
    0b11001110,
    0b11001110,
    0b11010110,
    0b11010110,
    0b11010110,
    0b11100110,
    0b11100110,
    0b01111100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000

  ],
  "Ö": [
    8,
    0b11000110,
    0b01111100,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b01111100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "Ø": [
    8,
    0b00000000,
    0b01111100,
    0b11001110,
    0b11001110,
    0b11010110,
    0b11010110,
    0b11010110,
    0b11100110,
    0b11100110,
    0b01111100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "a": [
    7,
    0b0000000,
    0b0000000,
    0b0111100,
    0b1100110,
    0b0000110,
    0b0111110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111110,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],

"æ": [
    12,
    0b000000000000,
    0b000000000000,
    0b011110111100,
    0b110011100110,
    0b000011100110,
    0b011111111110,
    0b110011100000,
    0b110011100000,
    0b110011100110,
    0b011111011100,
    0b000000000000,
    0b000000000000,
    0b000000000000,
    0b000000000000
  ],

  "b": [
    7,
    0b1100000,
    0b1100000,
    0b1111100,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  
  "c": [
    7,
    0b0000000,
    0b0000000,
    0b0111100,
    0b1100110,
    0b1100110,
    0b1100000,
    0b1100000,
    0b1100110,
    0b1100110,
    0b0111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  
  "č": [
    7,
    0b0101000,
    0b0010000,
    0b0111100,
    0b1100110,
    0b1100110,
    0b1100000,
    0b1100000,
    0b1100110,
    0b1100110,
    0b0111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "ć": [
    7,
    0b0000100,
    0b0001000,
    0b0111100,
    0b1100110,
    0b1100110,
    0b1100000,
    0b1100000,
    0b1100110,
    0b1100110,
    0b0111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "d": [
    7,
    0b0000110,
    0b0000110,
    0b0111110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111110,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],

"đ": [
    7,
    0b0000110,
    0b0011111,
    0b0000110,
    0b0111110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111110,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],

  "é": [
    7,
    0b0001100,
    0b0011000,
    0b0111100,
    0b1100110,
    0b1100110,
    0b1111110,
    0b1100000,
    0b1100000,
    0b1100110,
    0b0111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "e": [
    7,
    0b0000000,
    0b0000000,
    0b0111100,
    0b1100110,
    0b1100110,
    0b1111110,
    0b1100000,
    0b1100000,
    0b1100110,
    0b0111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "f": [
    5,
    0b00110,
    0b01100,
    0b01100,
    0b01100,
    0b11110,
    0b11110,
    0b01100,
    0b01100,
    0b01100,
    0b01100,
    0b00000,
    0b00000,
    0b00000,
    0b00000
  ],
  "g": [
    7,
    0b0000000,
    0b0000000,
    0b0111110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111110,
    0b0000110,
    0b1100110,
    0b0111100,
    0b0000000
  ],
  "h": [
    7,
    0b1100000,
    0b1100000,
    0b1111100,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "i": [
    3,
    0b110,
    0b000,
    0b110,
    0b110,
    0b110,
    0b110,
    0b110,
    0b110,
    0b110,
    0b110,
    0b000,
    0b000,
    0b000,
    0b000
  ],
  "j": [
    4,
    0b0110,
    0b0000,
    0b0110,
    0b0110,
    0b0110,
    0b0110,
    0b0110,
    0b0110,
    0b0110,
    0b0110,
    0b1100,
    0b0000,
    0b0000,
    0b0000
  ],
  "k": [
    7,
    0b1100000,
    0b1100000,
    0b1100110,
    0b1101100,
    0b1111000,
    0b1110000,
    0b1111000,
    0b1101100,
    0b1100110,
    0b1100110,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "l": [
    3,
    0b110,
    0b110,
    0b110,
    0b110,
    0b110,
    0b110,
    0b110,
    0b110,
    0b110,
    0b110,
    0b000,
    0b000,
    0b000,
    0b000
  ],
  "m": [
    9,
    0b000000000,
    0b000000000,
    0b111011100,
    0b110110110,
    0b110110110,
    0b110110110,
    0b110110110,
    0b110110110,
    0b110110110,
    0b110110110,
    0b000000000,
    0b000000000,
    0b000000000,
    0b000000000
  ],
  "n": [
    7,
    0b0000000,
    0b0000000,
    0b1111100,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "o": [
    7,
    0b0000000,
    0b0000000,
    0b0111100,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "p": [
    7,
    0b0000000,
    0b0000000,
    0b1111100,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1111100,
    0b1100000,
    0b1100000,
    0b1100000,
    0b0000000
  ],
  "q": [
    8,
    0b00000000,
    0b00000000,
    0b01111100,
    0b11001100,
    0b11001100,
    0b11001100,
    0b11001100,
    0b11001100,
    0b11001100,
    0b01111100,
    0b00001100,
    0b00011110,
    0b00001100,
    0b00001100
  ],
  "r": [
    7,
    0b0000000,
    0b0000000,
    0b1101110,
    0b1111110,
    0b1110000,
    0b1100000,
    0b1100000,
    0b1100000,
    0b1100000,
    0b1100000,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "s": [
    7,
    0b0000000,
    0b0000000,
    0b0111100,
    0b1100110,
    0b1100000,
    0b0111000,
    0b0011100,
    0b0000110,
    0b1100110,
    0b0111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],

  "š": [
    7,
    0b0100100,
    0b0011000,
    0b0111100,
    0b1100110,
    0b1100000,
    0b0111000,
    0b0011100,
    0b0000110,
    0b1100110,
    0b0111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],

  "t": [
    5,
    0b00000,
    0b01100,
    0b11110,
    0b01100,
    0b01100,
    0b01100,
    0b01100,
    0b01100,
    0b01100,
    0b00110,
    0b00000,
    0b00000,
    0b00000,
    0b00000
  ],
  "ü": [
    7,
    0b0000000,
    0b0000000,
    0b1100110,
    0b0000000,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "u": [
    7,
    0b0000000,
    0b0000000,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111100,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "v": [
    7,
    0b0000000,
    0b0000000,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111100,
    0b0011000,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "w": [
    8,
    0b00000000,
    0b00000000,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11010110,
    0b11111110,
    0b01101100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "x": [
    8,
    0b00000000,
    0b00000000,
    0b11000110,
    0b11000110,
    0b01101100,
    0b00111000,
    0b01111100,
    0b11101110,
    0b11000110,
    0b11000110,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "y": [
    7,
    0b0000000,
    0b0000000,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111110,
    0b0000110,
    0b0000110,
    0b0111100,
    0b0000000,
    0b0000000
  ],

"ž": [
    8,
    0b01001000,
    0b00110000,
    0b11111110,
    0b11111110,
    0b00000110,
    0b00001100,
    0b00011000,
    0b00110000,
    0b11111110,
    0b11111110,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],

  "z": [
    8,
    0b00000000,
    0b00000000,
    0b11111110,
    0b11111110,
    0b00001100,
    0b00011000,
    0b00110000,
    0b01100000,
    0b11111110,
    0b11111110,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "å": [
    7,
    0b0011000,
    0b0100100,
    0b0111100,
    0b1100110,
    0b0000110,
    0b0111110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111110,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "ä": [
    7,
    0b1100110,
    0b0000000,
    0b0111100,
    0b1100110,
    0b0000110,
    0b0111110,
    0b1100110,
    0b1100110,
    0b1100110,
    0b0111110,
    0b0000000,
    0b0000000,
    0b0000000,
    0b0000000
  ],
  "ö": [
    8,
    0b01101100,
    0b00000000,
    0b01111100,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b11000110,
    0b01111100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "ø": [
    8,
    0b00000000,
    0b00000000,
    0b01111100,
    0b11001110,
    0b11001110,
    0b11010110,
    0b11010110,
    0b11100110,
    0b11100110,
    0b01111100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "-": [
    6,
    0b000000,
    0b000000,
    0b000000,
    0b000000,
    0b000000,
    0b111110,
    0b111110,
    0b000000,
    0b000000,
    0b000000,
    0b000000,
    0b000000,
    0b000000,
    0b000000
  ],"–": [
    6,
    0b000000,
    0b000000,
    0b000000,
    0b000000,
    0b000000,
    0b111110,
    0b111110,
    0b000000,
    0b000000,
    0b000000,
    0b000000,
    0b000000,
    0b000000,
    0b000000
  ],
  ".": [
    3,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b110,
    0b110,
    0b000,
    0b000,
    0b000,
    0b000
  ],
  ",": [
    3,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b110,
    0b110,
    0b100,
    0b000,
    0b000,
    0b000
  ],
  
  "'": [
    3,
    0b000,
    0b110,
    0b110,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000
  ],

"\"": [
    6,
    0b110110,
    0b110110,
    0b010010,
    0b000000,
    0b000000,
    0b000000,
    0b000000,
    0b000000,
    0b000000,
    0b000000,
    0b000000,
    0b000000,
    0b000000,
    0b000000
  ],

  "+": [
    8,
    0b00000000,
    0b00000000,
    0b00110000,
    0b00110000,
    0b00110000,
    0b11111100,
    0b11111100,
    0b00110000,
    0b00110000,
    0b00110000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  ":": [
    4,
    0b0000,
    0b0000,
    0b0000,
    0b0000,
    0b0110,
    0b0110,
    0b0000,
    0b0000,
    0b0110,
    0b0110,
    0b0000,
    0b0000,
    0b0000,
    0b0000
  ],
  "*": [
    8,
    0b00000000,
    0b00011000,
    0b01011010,
    0b01111110,
    0b01111110,
    0b00111100,
    0b01111110,
    0b01111110,
    0b01011010,
    0b00011000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "%": [
    10,
    "0555555550",
    "0533333350",
    "0533333350",
    "0533333350",
    "0555335550",
    "0555335550",
    "0555335550",
    "0555335550",
    "0555335550",
    "0555555550",
    "0000000000",
    "0000000000",
    "0000000000",
    "0000000000"
  ],
  "£": [
    10,
    "0222222220",
    "0233333326",
    "0233333326",
    "0233333326",
    "0222332226",
    "0222332226",
    "0222332226",
    "0222332226",
    "0222332226",
    "0222222226",
    "0066666666",
    "0000000000",
    "0000000000",
    "0000000000"
  ],
  "(": [
    1,
    0b0,
    0b0,
    0b0,
    0b0,
    0b0,
    0b0,
    0b0,
    0b0,
    0b0,
    0b0,
    0b0,
    0b0,
    0b0,
    0b0
    
  ],
  "Ô": [
    8,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000001,
    0b00000011,
    0b11000110,
    0b11001100,
    0b11011000,
    0b11110000,
    0b11100000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "/": [
    6,
    0b000110,
    0b000110,
    0b000110,
    0b001100,
    0b001100,
    0b001100,
    0b011000,
    0b011000,
    0b011000,
    0b011000,
    0b000000,
    0b000000,
    0b000000,
    0b000000
  ],
  "?": [
    8,
    0b00111000,
    0b01101100,
    0b11000110,
    0b11000110,
    0b00001100,
    0b00011000,
    0b00011000,
    0b00000000,
    0b00011000,
    0b00011000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
  "!": [
    4,
    0b0110,
    0b0110,
    0b0110,
    0b0110,
    0b0110,
    0b0110,
    0b0110,
    0b0000,
    0b0110,
    0b0110,
    0b0000,
    0b0000,
    0b0000,
    0b0000
  ],
  "_": [
    5,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b11110,
    0b00000,
    0b00000,
    0b00000,
    0b00000
  ],
  "&": [
    8,
    0b01111000,
    0b11001100,
    0b11001100,
    0b01111000,
    0b01100000,
    0b11110000,
    0b11011011,
    0b11001111,
    0b11000110,
    0b01111011,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000
  ],
    "^": [
    10,
    "0000440000",
    "0000440000",
    "0004224000",
    "0004224400",
    "0044224400",
    "0044224400",
    "0444224440",
    "0444444440",
    "4444224444",
    "4444444444",
    "0000000000",
    "0000000000",
    "0000000000",
    "0000000000",
  ],

  
}

font_small = {
  "fontheight":8,
  " ": [
    3,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
  ],
  "0": [
    5,
    0b01100,
    0b10010,
    0b10010,
    0b10010,
    0b10010,
    0b10010,
    0b01100,
    0b00000,
  ],
  "1": [
    4,
    0b0100,
    0b1100,
    0b0100,
    0b0100,
    0b0100,
    0b0100,
    0b1110,
    0b0000,
  ],
  "2": [
    5,
    0b01100,
    0b10010,
    0b00010,
    0b00100,
    0b01000,
    0b10000,
    0b11110,
    0b00000,
  ],
  "3": [
    5,
    0b11100,
    0b00010,
    0b00010,
    0b01100,
    0b00010,
    0b00010,
    0b11100,
    0b00000,
  ],
  "4": [
    5,
    0b00010,
    0b00110,
    0b01010,
    0b10010,
    0b11110,
    0b00010,
    0b00010,
    0b00000,
  ],
  "5": [
    5,
    0b11110,
    0b10000,
    0b10000,
    0b11100,
    0b00010,
    0b00010,
    0b11100,
    0b00000,
  ],
  "6": [
    5,
    0b01100,
    0b10000,
    0b10000,
    0b11100,
    0b10010,
    0b10010,
    0b01100,
    0b00000,
  ],
  "7": [
    5,
    0b11110,
    0b00010,
    0b00010,
    0b00100,
    0b01000,
    0b01000,
    0b01000,
    0b00000,
  ],
  "8": [
    5,
    0b01100,
    0b10010,
    0b10010,
    0b01100,
    0b10010,
    0b10010,
    0b01100,
    0b00000,
  ],
  "9": [
    5,
    0b01100,
    0b10010,
    0b10010,
    0b01110,
    0b00010,
    0b00010,
    0b01100,
    0b00000,
  ],
  "90": [
    8,
    0b00011000,
    0b00111100,
    0b01111110,
    0b11111111,
    0b00111100,
    0b00111100,
    0b00111100,
    0b00111100,
    0b00111100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000,
    ""
  ],
  "91": [
    8,
    0b01100111,
    0b01100111,
    0b01100001,
    0b01100110,
    0b00000000,
    0b01100110,
    0b00000000,
    0b00000000,
    0b01010011,
    0b11111001,
    0b01010001,
    0b11111001,
    0b01010011,
    ""
  ],
  "94": [
    8,
    0b00000000,
    0b00000000,
    0b01100011,
    0b00110110,
    0b00011100,
    0b00011100,
    0b00110110,
    0b01100011,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000,
  ],
  ">": [
    8,
    0b00000000,
    0b00000000,
    0b00010000,
    0b00011000,
    0b11111100,
    0b11111110,
    0b11111111,
    0b11111110,
    0b11111100,
    0b00011000,
    0b00010000,
    0b00000000,
    0b00000000,
    0b00000000,
  ],
  "A": [
    6,
    0b011100,
    0b100010,
    0b100010,
    0b111110,
    0b100010,
    0b100010,
    0b100010,
    0b000000,
  ],
  "B": [
    6,
    0b111100,
    0b100010,
    0b100010,
    0b111100,
    0b100010,
    0b100010,
    0b111100,
    0b000000,
  ],
  "č": [
    5,
    0b01010,
    0b00100,
    0b01110,
    0b10000,
    0b10000,
    0b10000,
    0b01110,
    0b00000,
  ],


  "ć": [
    5,
    0b00010,
    0b00100,
    0b01110,
    0b10000,
    0b10000,
    0b10000,
    0b01110,
    0b00000,
  ],
  
   
  "Č": [
    5,
    0b01010,
    0b00100,
    0b01110,
    0b10000,
    0b10000,
    0b10000,
    0b01110,
    0b00000,
  ],

  "C": [
    6,
    0b011100,
    0b100010,
    0b100000,
    0b100000,
    0b100000,
    0b100010,
    0b011100,
    0b000000,
  ],
  "D": [
    6,
    0b111100,
    0b100010,
    0b100010,
    0b100010,
    0b100010,
    0b100010,
    0b111100,
    0b000000,
  ],

  "Đ": [
    7,
    0b0111100,
    0b0100010,
    0b0100010,
    0b1110010,
    0b0100010,
    0b0100010,
    0b0111100,
    0b0000000,
  ],
  "E": [
    6,
    0b111110,
    0b100000,
    0b100000,
    0b111100,
    0b100000,
    0b100000,
    0b111110,
    0b000000,
  ],
  "F": [
    6,
    0b111110,
    0b100000,
    0b100000,
    0b111100,
    0b100000,
    0b100000,
    0b100000,
    0b000000,
  ],
  "G": [
    6,
    0b011100,
    0b100010,
    0b100000,
    0b100110,
    0b100010,
    0b100010,
    0b011100,
    0b000000,
  ],
  "H": [
    6,
    0b100010,
    0b100010,
    0b100010,
    0b111110,
    0b100010,
    0b100010,
    0b100010,
    0b000000,
  ],
  "I": [
    2,
    0b10,
    0b10,
    0b10,
    0b10,
    0b10,
    0b10,
    0b10,
    0b00,
  ],
  "J": [
    6,
    0b111110,
    0b000010,
    0b000010,
    0b000010,
    0b000010,
    0b100010,
    0b011100,
    0b000000,
  ],
  "K": [
    6,
    0b100010,
    0b100100,
    0b101000,
    0b110000,
    0b101000,
    0b100100,
    0b100010,
    0b000000,
  ],
  "L": [
    6,
    0b100000,
    0b100000,
    0b100000,
    0b100000,
    0b100000,
    0b100000,
    0b111110,
    0b000000,
  ],
  "M": [
    6,
    0b100010,
    0b110110,
    0b101010,
    0b100010,
    0b100010,
    0b100010,
    0b100010,
    0b000000,
  ],
  "N": [
    6,
    0b100010,
    0b110010,
    0b101010,
    0b100110,
    0b100010,
    0b100010,
    0b100010,
    0b000000,
  ],
  "O": [
    6,
    0b011100,
    0b100010,
    0b100010,
    0b100010,
    0b100010,
    0b100010,
    0b011100,
    0b000000,
  ],
  "P": [
    6,
    0b111100,
    0b100010,
    0b100010,
    0b111100,
    0b100000,
    0b100000,
    0b100000,
    0b000000,
  ],
  "Q": [
    6,
    0b011100,
    0b100010,
    0b100010,
    0b100010,
    0b100010,
    0b101010,
    0b011110,
    0b000010
  ],
  "R": [
    6,
    0b111100,
    0b100010,
    0b100010,
    0b111100,
    0b101000,
    0b100100,
    0b100010,
    0b000000,
  ],
  "S": [
    5,
    0b01110,
    0b10000,
    0b10000,
    0b01100,
    0b00010,
    0b00010,
    0b11100,
    0b00000,
  ],
  "š": [
    5,
    0b01010,
    0b00100,
    0b01110,
    0b10000,
    0b01100,
    0b00010,
    0b11100,
    0b00000,
  ],
  "T": [
    6,
    0b111110,
    0b001000,
    0b001000,
    0b001000,
    0b001000,
    0b001000,
    0b001000,
    0b000000,
  ],
  "U": [
    6,
    0b100010,
    0b100010,
    0b100010,
    0b100010,
    0b100010,
    0b100010,
    0b011100,
    0b000000,
  ],
  "Ü": [
    6,
    0b100010,
    0b000000,
    0b100010,
    0b100010,
    0b100010,
    0b100010,
    0b011100,
    0b000000,
  ],
  "V": [
    6,
    0b100010,
    0b100010,
    0b100010,
    0b100010,
    0b100010,
    0b010100,
    0b001000,
    0b000000,
  ],
  "W": [
    8,
    0b10000010,
    0b10000010,
    0b10000010,
    0b10000010,
    0b01010100,
    0b01010100,
    0b00101000,
    0b00000000,
  ],
  "X": [
    6,
    0b100010,
    0b100010,
    0b010100,
    0b001000,
    0b010100,
    0b100010,
    0b100010,
    0b000000,
  ],
  "Y": [
    6,
    0b100010,
    0b100010,
    0b010100,
    0b001000,
    0b001000,
    0b001000,
    0b001000,
    0b000000,
  ],
  "Z": [
    6,
    0b111110,
    0b000010,
    0b000100,
    0b001000,
    0b010000,
    0b100000,
    0b111110,
    0b000000,
  ],
  "Å": [
    6,
    0b001000,
    0b010100,
    0b001000,
    0b010100,
    0b111110,
    0b100010,
    0b100010,
    0b000000,
  ],
  "Ä": [
    6,
    0b100010,
    0b001000,
    0b010100,
    0b100010,
    0b100010,
    0b111110,
    0b100010,
    0b000000,
  ],
  "Ö": [
    6,
    0b010100,
    0b000000,
    0b011100,
    0b100010,
    0b100010,
    0b100010,
    0b011100,
    0b000000,
  ],
  "Ø": [
    6,
    0b000000,
    0b000000,
    0b011101,
    0b100110,
    0b101010,
    0b110010,
    0b111100,
    0b000000,
  ],
  "a": [
    6,
    0b000000,
    0b000000,
    0b011100,
    0b000010,
    0b011110,
    0b100010,
    0b011110,
    0b000000,
  ],
  "b": [
    6,
    0b100000,
    0b100000,
    0b111100,
    0b100010,
    0b100010,
    0b100010,
    0b111100,
    0b000000,
  ],

  "c": [
    5,
    0b00000,
    0b00000,
    0b01110,
    0b10000,
    0b10000,
    0b10000,
    0b01110,
    0b00000,
  ],



"Ć": [
    6,
    0b000100,
    0b001000,
    0b011100,
    0b100010,
    0b100000,
    0b100010,
    0b011100,
    0b000000,
  ],

  "d": [
    6,
    0b000010,
    0b000010,
    0b011110,
    0b100010,
    0b100010,
    0b100010,
    0b011110,
    0b000000,
  ],
  "đ": [
    6,
    0b000010,
    0b000111,
    0b000010,
    0b011110,
    0b100010,
    0b100010,
    0b011110,
    0b000000,
  ],
  "é": [
    6,
    0b000000,
    0b000000,
    0b011100,
    0b100010,
    0b111110,
    0b100000,
    0b011100,
    0b000000,
  ],
  "e": [
    6,
    0b000000,
    0b000000,
    0b011100,
    0b100010,
    0b111110,
    0b100000,
    0b011100,
    0b000000,
  ],
  "f": [
    4,
    0b0010,
    0b0100,
    0b0100,
    0b1110,
    0b0100,
    0b0100,
    0b0100,
    0b0000,
  ],
  "g": [
    6,
    0b000000,
    0b000000,
    0b011110,
    0b100010,
    0b011110,
    0b000010,
    0b011100,
    0b000000,
  ],
  "h": [
    5,
    0b10000,
    0b10000,
    0b11100,
    0b10010,
    0b10010,
    0b10010,
    0b10010,
    0b00000,
  ],
  "i": [
    2,
    0b00,
    0b10,
    0b00,
    0b10,
    0b10,
    0b10,
    0b10,
    0b00,
  ],
  "j": [
    4,
    0b0000,
    0b0010,
    0b0000,
    0b0010,
    0b0010,
    0b0010,
    0b1100,
    0b0000,
  ],
  "k": [
    5,
    0b10000,
    0b10000,
    0b10010,
    0b11100,
    0b10100,
    0b10010,
    0b10010,
    0b00000,
  ],
  "l": [
    2,
    0b10,
    0b10,
    0b10,
    0b10,
    0b10,
    0b10,
    0b10,
    0b00,
  ],
  "m": [
    6,
    0b000000,
    0b000000,
    0b110100,
    0b101010,
    0b101010,
    0b100010,
    0b100010,
    0b000000,
  ],
  "n": [
    5,
    0b00000,
    0b00000,
    0b10100,
    0b11010,
    0b10010,
    0b10010,
    0b10010,
    0b00000,
  ],
  "o": [
    6,
    0b000000,
    0b000000,
    0b011100,
    0b100010,
    0b100010,
    0b100010,
    0b011100,
    0b000000,
  ],
  "p": [
    6,
    0b000000,
    0b000000,
    0b111100,
    0b100010,
    0b100010,
    0b111100,
    0b100000,
    0b100000,
  ],
  "q": [
    7,
    0b0000000,
    0b0000000,
    0b0111100,
    0b1000100,
    0b0111100,
    0b0000100,
    0b0001110,
    0b0000100,
  ],
  "r": [
    4,
    0b0000,
    0b0000,
    0b0110,
    0b1000,
    0b1000,
    0b1000,
    0b1000,
    0b0000,
  ],
  "s": [
    5,
    0b00000,
    0b00000,
    0b01110,
    0b10000,
    0b01100,
    0b00010,
    0b11100,
    0b00000,
  ],

"Š": [
    5,
    0b01010,
    0b00100,
    0b01110,
    0b10000,
    0b01100,
    0b00010,
    0b11100,
    0b00000,
  ],

  "t": [
    5,
    0b00000,
    0b01000,
    0b01000,
    0b11100,
    0b01000,
    0b01000,
    0b00110,
    0b00000,
  ],
  "u": [
    5,
    0b00000,
    0b00000,
    0b10010,
    0b10010,
    0b10010,
    0b10010,
    0b01100,
    0b00000,
  ],
  "ü": [
    5,
    0b00000,
    0b10010,
    0b00000,
    0b10010,
    0b10010,
    0b10010,
    0b01100,
    0b00000,
  ],
  "v": [
    6,
    0b000000,
    0b000000,
    0b100010,
    0b100010,
    0b010100,
    0b010100,
    0b001000,
    0b000000,
  ],
  "w": [
    6,
    0b000000,
    0b000000,
    0b100010,
    0b101010,
    0b101010,
    0b101010,
    0b010100,
    0b000000,
  ],
  "x": [
    7,
    0b0000000,
    0b0000000,
    0b1000010,
    0b0100100,
    0b0011000,
    0b0100100,
    0b1000010,
    0b0000000,
  ],
  "y": [
    6,
    0b000000,
    0b000000,
    0b100010,
    0b100010,
    0b011110,
    0b000010,
    0b011100,
    0b000000,
  ],
  
"ž": [
    6,
    0b010100,
    0b001000,
    0b111110,
    0b000100,
    0b001000,
    0b010000,
    0b111110,
    0b000000,
  ],
"Ž": [
    6,
    0b010100,
    0b001000,
    0b111110,
    0b000100,
    0b001000,
    0b010000,
    0b111110,
    0b000000,
  ],
  "z": [
    6,
    0b000000,
    0b000000,
    0b111110,
    0b000100,
    0b001000,
    0b010000,
    0b111110,
    0b000000,
  ],
  "å": [
    6,
    0b001000,
    0b010100,
    0b011100,
    0b000010,
    0b011110,
    0b100010,
    0b011110,
    0b000000,
  ],

  "æ": [
    10,
    0b0000000000,
    0b0000000000,
    0b0111011100,
    0b0000110010,
    0b0111111110,
    0b1000110000,
    0b0111101100,
    0b0000000000,
  ],

 

  "ä": [
    6,
    0b010100,
    0b000000,
    0b011100,
    0b000010,
    0b011110,
    0b100010,
    0b011110,
    0b000000,
  ],
  "ö": [
    6,
    0b010100,
    0b000000,
    0b011100,
    0b100010,
    0b100010,
    0b100010,
    0b011100,
    0b000000,
  ],
  "ø": [
    6,
    0b000000,
    0b000000,
    0b011101,
    0b100110,
    0b101010,
    0b110010,
    0b111100,
    0b000000,
  ],
  "-": [
    5,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b11110,
    0b00000,
    0b00000,
    0b00000,
  ],"–": [
    5,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b11110,
    0b00000,
    0b00000,
    0b00000,
  ],
  ".": [
    2,
    0b00,
    0b00,
    0b00,
    0b00,
    0b00,
    0b00,
    0b10,
    0b00,
  ],"'": [
    2,
    0b00,
    0b10,
    0b00,
    0b00,
    0b00,
    0b00,
    0b00,
    0b00,
  ],
  ",": [
    3,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b000,
    0b110,
    0b110,
    0b100,
    0b000,
    0b000,
    0b000,
  ],
  "+": [
    4,
    0b0000,
    0b0000,
    0b0100,
    0b1110,
    0b0100,
    0b0000,
    0b0000,
    0b0000,
  ],
  ":": [
    3,
    0b000,
    0b000,
    0b000,
    0b010,
    0b000,
    0b000,
    0b010,
    0b000,
  ],
  "*": [
    8,
0b00011000,
0b01011010,
0b01111110,
0b00111100,
0b01111110,
0b01011010,
0b00011000,
0b00000000,

],
  
  "Ô": [
    8,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000001,
    0b00000011,
    0b11000110,
    0b11001100,
    0b11011000,
    0b11110000,
    0b11100000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000,
  ],
  "/": [
    4,
    0b0000,
    0b0010,
    0b0010,
    0b0100,
    0b0100,
    0b1000,
    0b1000,
    0b0000,
  ],
  "?": [
    8,
    0b00111000,
    0b01101100,
    0b11000110,
    0b11000110,
    0b00001100,
    0b00011000,
    0b00011000,
    0b00000000,
    0b00011000,
    0b00011000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000,
  ],
  "!": [
    2,
    0b00,
    0b10,
    0b10,
    0b10,
    0b10,
    0b00,
    0b10,
    0b00,
  ],
  "_": [
    4,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b11110,
    0b00000,
    
  ],
  "(": [
    1,
    0b0,
    0b0,
    0b0,
    0b0,
    0b0,
    0b0,
    0b0,
    0b0,
  ],
  "^": [
    11,
    "00000400000",
    "00004240000",
    "00044244000",
    "00444244400",
    "04444444440",
    "44444244444",
    "44444444444",
    "00000000000",
    
    
    
  ],
 "%": [
    10,
    "0222222220",
    "0233333320",
    "0233333320",
    "0222332220",
    "0222332220",
    "0222332220",
    "0222222220",
    "0000000000"
  ]
}



station_names_dict = {
          'Hässelby strand': 'Hässelby str.', 
          'Skärmarbrink': 'Skärmarbr.',
          'Sankt Eriksplan': 'St. Eriksplan',
          'Hammarbyhöjden': 'Hammarbyh.',
          'Danderyds sjukhus': 'Danderyds sjh',
          'Fridhemsplan': 'Fridhemspl.',
          'Solna centrum': 'Solna C',
          'Enskede gård': 'Enskede grd',
          'Västra skogen': 'Väst. skogen',
          'Rådmansgatan': 'Rådmansg.',
          'Midsommarkransen': 'Midsommarkr.',
          'Sundbyberg centrum': 'Sundbyberg C',
          'Medborgarplatsen': 'Medborgarpl.',
          'Hägerstensåsen': 'Hägerstens:en',
          'Östermalmstorg': 'Östermalmst.',
          'Mörby centrum': 'Mörby centr.',
          'Tekniska högskolan': 'Tekn. Högsk.',
          'Kungsträdgården': 'Kungsträdg.',
          'Skogskyrkogården': 'Skogskyrkog.',
          'Stockholms östra': 'Stockholm Ö',
          'Stockholm C': 'Stockholm C',
           
          'Farsta strand': 'Farsta str.'}




spec_dict = {"Ö": '&Ouml;',
            "ö": '&ouml;',
            "Ä": '&Auml;',
            "ä": '&auml;',
            "Å": '&Aring;',
            "å": '&aring;'}


replace_list_destinations = [
            (" central", " C"),
            (" centraal", " C"),
            (" centrum", " C"),
            (" Central", " C"),
            (" Centraal", " C"),
            (" hauptbahnhof", " Hbf"),
            (" Hauptbahnhof", " Hbf"),
            
            (" Centrum", " C"),
            ("Kyrka", "K:a"),
            (" kyrka", " k:a"),
            (" Station", " Stn."),
            (" station", " stn."),
            (" sjukhuset", " sjh."),
            (" sjukhus", " sjh."),
            (" strand", " str."),
            (" flygplats", " fpl."),
            (" institutet", " inst."),
            ("hamnen", "h."),
            ("Norra", "N:a"),
            ("norra", "n:a"),
            ("Södra", "S:a"),
            ("södra", "s:a"),
            ("Östra", "Ö:a"),
            ("östra", "ö:a"),
            ("Västra", "V:a"),
            ("västra", "v:a"),
            ("ängen ", "äng. "),
            (" via ", " v "),
            ("torp ", "t. "),
            ("berget", "berg. "),
            ("linjen", "l. "),
            ("SkåneExpressen", "S-Exp."),
            ("Gustavsberg Lugnet", "Gustavsb. Lugn."),
            ]

html_decode = {"%C3A4":"ä", "%20": " ", "%21": "!", "%22": "\"", "%23": "#", "%24": "$", "%25": "%", "%26": "&", "%27": "'", "%28": "(", "%29": ")", "%2A": "*", "%2B": "+", "%2C": ",", "%2D": "-", "%2E": ".", "%2F": "/", "%30": "0", "%31": "1", "%32": "2", "%33": "3", "%34": "4", "%35": "5", "%36": "6", "%37": "7", "%38": "8", "%39": "9", "%3A": ":", "%3B": ";", "%3C": "<", "%3D": "=", "%3E": ">", "%3F": "?", "%40": "@", "%41": "A", "%42": "B", "%43": "C", "%44": "D", "%45": "E", "%46": "F", "%47": "G", "%48": "H", "%49": "I", "%4A": "J", "%4B": "K", "%4C": "L", "%4D": "M", "%4E": "N", "%4F": "O", "%50": "P", "%51": "Q", "%52": "R", "%53": "S", "%54": "T", "%55": "U", "%56": "V", "%57": "W", "%58": "X", "%59": "Y", "%5A": "Z", "%5B": "[", "%5C": "\\", "%5D": "]", "%5E": "^", "%5F": "_", "%60": "`", "%61": "a", "%62": "b", "%63": "c", "%64": "d", "%65": "e", "%66": "f", "%67": "g", "%68": "h", "%69": "i", "%6A": "j", "%6B": "k", "%6C": "l", "%6D": "m", "%6E": "n", "%6F": "o", "%70": "p", "%71": "q", "%72": "r", "%73": "s", "%74": "t", "%75": "u", "%76": "v", "%77": "w", "%78": "x", "%79": "y", "%7A": "z", "%7B": "{", "%7C": "|", "%7D": "}", "%7E": "~", "%E2%82%AC": "\u20ac", "%E2%80%9A": "\u201a", "%C6%92": "\u0192", "%E2%80%9E": "\u201e", "%E2%80%A6": "\u2026", "%E2%80%A0": "\u2020", "%E2%80%A1": "\u2021", "%CB%86": "\u02c6", "%E2%80%B0": "\u2030", "%C5%A0": "\u0160", "%E2%80%B9": "\u2039", "%C5%92": "\u0152", "%C5%BD": "\u017d", "%E2%80%98": "\u2018", "%E2%80%99": "\u2019", "%E2%80%9C": "\u201c", "%E2%80%9D": "\u201d", "%E2%80%A2": "\u2022", "%E2%80%93": "\u2013", "%E2%80%94": "\u2014", "%CB%9C": "\u02dc", "%E2%84": "\u2122", "%C5%A1": "\u0161", "%E2%80": "\u203a", "%C5%93": "\u0153", "%C5%B8": "\u0178", "%C2%A1": "\u00a1", "%C2%A2": "\u00a2", "%C2%A3": "\u00a3", "%C2%A4": "\u00a4", "%C2%A5": "\u00a5", "%C2%A6": "\u00a6", "%C2%A7": "\u00a7", "%C2%A8": "\u00a8", "%C2%A9": "\u00a9", "%C2%AA": "\u00aa", "%C2%AB": "\u00ab", "%C2%AD": "\u00ac", "%C2%AE": "\u00ae", "%C2%AF": "\u00af", "%C2%B0": "\u00b0", "%C2%B1": "\u00b1", "%C2%B2": "\u00b2", "%C2%B3": "\u00b3", "%C2%B4": "\u00b4", "%C2%B5": "\u00b5", "%C2%B6": "\u00b6", "%C2%B7": "\u00b7", "%C2%B8": "\u00b8", "%C2%B9": "\u00b9", "%C2%BA": "\u00ba", "%C2%BB": "\u00bb", "%C2%BC": "\u00bc", "%C2%BD": "\u00bd", "%C2%BE": "\u00be", "%C2%BF": "\u00bf", "%C3%80": "\u00c0", "%C3%81": "\u00c1", "%C3%82": "\u00c2", "%C3%83": "\u00c3", "%C3%84": "\u00c4", "%C3%85": "\u00c5", "%C3%86": "\u00c6", "%C3%87": "\u00c7", "%C3%88": "\u00c8", "%C3%89": "\u00c9", "%C3%8A": "\u00ca", "%C3%8B": "\u00cb", "%C3%8C": "\u00cc", "%C3%8D": "\u00cd", "%C3%8E": "\u00ce", "%C3%8F": "\u00cf", "%C3%90": "\u00d0", "%C3%91": "\u00d1", "%C3%92": "\u00d2", "%C3%93": "\u00d3", "%C3%94": "\u00d4", "%C3%95": "\u00d5", "%C3%96": "\u00d6", "%C3%97": "\u00d7", "%C3%98": "\u00d8", "%C3%99": "\u00d9", "%C3%9A": "\u00da", "%C3%9B": "\u00db", "%C3%9C": "\u00dc", "%C3%9D": "\u00dd", "%C3%9E": "\u00de", "%C3%9F": "\u00df", "%C3%A0": "\u00e0", "%C3%A1": "\u00e1", "%C3%A2": "\u00e2", "%C3%A3": "\u00e3", "%C3%A4": "\u00e4", "%C3%A5": "\u00e5", "%C3%A6": "\u00e6", "%C3%A7": "\u00e7", "%C3%A8": "\u00e8", "%C3%A9": "\u00e9", "%C3%AA": "\u00ea", "%C3%AB": "\u00eb", "%C3%AC": "\u00ec", "%C3%AD": "\u00ed", "%C3%AE": "\u00ee", "%C3%AF": "\u00ef", "%C3%B0": "\u00f0", "%C3%B1": "\u00f1", "%C3%B2": "\u00f2", "%C3%B3": "\u00f3", "%C3%B4": "\u00f4", "%C3%B5": "\u00f5", "%C3%B6": "\u00f6", "%C3%B7": "\u00f7", "%C3%B8": "\u00f8", "%C3%B9": "\u00f9", "%C3%BA": "\u00fa", "%C3%BB": "\u00fb", "%C3%BC": "\u00fc", "%C3%BD": "\u00fd", "%C3%BE": "\u00fe", "%C3%BF": "\u00ff", 
"%C4%8C":"\u010c",
"%C4%86":"\u0106",
"%C5%BD":"\u017d",
"%C4%90":"\u0110",
"%C5%A0":"\u0160",
"%C4%8D":"\u010d",
"%C4%87":"\u0107",
"%C5%BE":"\u017e",
"%C4%91":"\u0111",
"%C5%A1":"\u0161"}



settingstoml = {"password": "PASSWORD",
            "mystation": "MYSTATION",
            "mini":"0",
            "msg": "MSG",
            "brightness": "BRIGHTNESS",
            "listmode": "LISTMODE",
            "reset": "RESET",
            "maxdest": "MAXDEST",
            "scroll": "SCROLL", 
            "ssid": "SSID", 
            "offset": "OFFSET", 
            "server": "SERVER",
            "sleep": "SLEEP",
            "show_my_station":"SHOW_MY_STATION",
            "siteid":"SITEID",
            "METRO":"METRO",
            "SHIP":"SHIP",
            "BUS":"BUS",
            "TRAIN":"TRAIN",
            "TRAM":"TRAM",
            "direction": "DIRECTION",
            "show_msgs": "SHOW_MSGS",
            "buses_option":"BUSES_OPTION",
            "red":"RED",
            "green":"GREEN",
            "blue":"BLUE",
            "operator":"OPERATOR",
            "country":"COUNTRY",
            "listcolor":"LISTCOLOR",
            "language":"LANGUAGE",
            "color":"COLOR",
            }

settingstxt = {"password": "none",
            "mystation": "",
            
            "brightness": 0,
            "listmode": 0,
            "rotation":0,
            
            "maxdest": 5,
            "scroll": 0, 
            "ssid": "my_ssid", 
            "offset": 0, 
            "mini":0,
            
            "clocktime": 0, 

            "user": "", 

            "sleep": 0,
            "show_my_station":0,
            "siteid":"00",
            "METRO":1,
            "SHIP":0,
            "BUS":0,
            "TRAIN":0,
            "TRAM":0,
            "direction": 0,
            "show_msgs": 0,
            "buses_option":0,
            "red":1,
            "green":1,
            "blue":1,
            "operator":"",
            "country":"se",
            "listcolor":1,
            "language":"se",
            "version":"2.87",
            "color":1,
            "long":0,
            "invert":0,
            "multiple":0,
            "timer": {"Monday":"", "Tuesday":"", "Wednesday":"", "Thursday":"", "Friday":"", "Saturday":"", "Sunday":""},
            "stations":{"1":{"mystation":"",
                             "siteid":"",
                             "METRO":1,
                             "SHIP":1,
                             "BUS":1,
                             "TRAIN":1,
                             "TRAM":1,
                             "direction": 0,
                            "show_msgs": 0,
                            "buses_option":0,
                            "red":1,
                            "green":1,
                            "blue":1,
                            "operator":"sl",
                            "country":"se",
                            "offset": 0, 
                            "active":True
                             },
                        "2":{"mystation":"T-Centralen",
                             "siteid":"9001",
                             "METRO":1,
                             "SHIP":1,
                             "BUS":1,
                             "TRAIN":1,
                             "TRAM":1,
                             "direction": 0,
                            "show_msgs": 0,
                            "buses_option":0,
                            "red":1,
                            "green":1,
                            "blue":1,
                            "operator":"sl",
                            "country":"se",
                            "offset": 0, 
                            "active":True},
                        "3":{"mystation":"0",
                             "siteid":"00",
                             "METRO":1,
                             "SHIP":1,
                             "BUS":1,
                             "TRAIN":1,
                             "TRAM":1,
                             "direction": 0,
                            "show_msgs": 0,
                            "buses_option":0,
                            "red":1,
                            "green":1,
                            "blue":1,
                            "operator":"sl",
                            "country":"se",
                            "offset": 0, 
                            "active":True}
               

            }
            }


weekday = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
month = {"Jan":1, "Feb":2, "Mar":3, "Apr":4, "May":5, "Jun":6, "Jul":7, "Aug":8, "Sep":9, "Oct":10, "Nov":11, "Dec":12}

def check_network(lang=False, status=False, ip=False):
  if ip == None:
    return ""
  elif ip: return ip
  if status: return """<green_box><small>""" + language[lang]["settings"]["connected"] +"""</small></green_box>"""
  else: return """<red_box><small>""" + language[lang]["settings"]["not_connected"] +"""</small></red_box>"""

def html(
         network_status_box,
        version_message,
        wifi_id, wifi_pwd,
        disabled, ssid_html,
        station_placeholder, 
        ifdisabled, 
        newstation_disabled, 
        v_newresults, 
        maxdest_html,
        metrocheck, 
        buscheck, 
        all_buses, 
        night_buses, 
        traincheck, 
        tramcheck, 
        shipcheck,
        offset_html, 
        direction_html, 
        brightness_html, 
        scrollspeed_html, 
        show_list_box, 
        sleep_box, 
        show_station_box,
        on_off,
        _uptime,
        border_style,
        show_msgs_box,
        red,
        green,
        blue,
        operator,
        country,
        listcolor,
        _temp,
        _language,
        system_language,
        dns_option,
        _instr,
        _current_ip,
        invert,
        if_newversion,
        _clocktime,
        long,
        user,
        _font_mini,
        selector
     
        ):
    if selector: selector = "checked"
    else: selector = ""
    operator_dropdown = country_and_operators[country.lower()]
    deviations_html = ""
    #if_result = language[_language]["display"]["select_station"] if border_style else "&nbsp;"
    if_result = "&nbsp;"# if border_style else "&nbsp;"
    if_result_ball = "&#128308;" if border_style else "&nbsp;"
    sl_tunnelbana = ""
    metro_colors = ""
    countries = ""
    
    #x_or_xl = "XL" if long > 128 else "X"
    multiple = ""
    screen_options = ""
    if long == 128: _screen = 2
    if long > 128: _screen = 3
    if long > 64:
       screen_options = ""
       for i in range(_screen):
        i += 1
        print(i)
        screen_options += """<button style="background-color: black;
  border: 2px solid black;
  color: white;
  padding-left: 5px;
  padding-right: 5px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 0px 5px;
  cursor: pointer;" type="button" id="screen" onclick="location.href='/?screen=""" + str(i) + """'">""" + str(i) + """</button>"""
    #if long == 64: 
    #   x_or_xl = "XS"
    
    
    _multiple = ""
    if long > 64:
      _multiple = """<div class="custom-control custom-switch">
  <input id="multiple" type="checkbox" class="custom-control-input" name="multiple"  """+ selector +""">
  <label class="custom-control-label" for="multiple">
 """ + language[_language]["settings"]["multiple"] + """
</label>
</div>

  <script>
function updateVariable() {
            fetch('/?multiple=1', {
                method: 'GET',
            })}
        document.getElementById("multiple").addEventListener("click", updateVariable);
</script>"""



    
    
    for _country in country_and_operators:
      #countries += "<a href='?country=" + _country + "'>" + _country + "</a>"
      countries += "<a href='?country=" + _country + "'>" + flag(_country) + "</a>"

    scroll_block = """
                  <div class="col">
    <br>  <label class="control-label" for="scroll">""" + language[_language]["settings"]["scroll"] + """:</label>
    <select id="scroll" name="scroll" class="form-control">
    """ + scrollspeed_html + """
    </select>
</div>
<script>
    function updateVariable(event) {
        const selectedValue = event.target.value;
        fetch(`/?scroll=${selectedValue}`, {
            method: 'GET',
        })
    }
    document.getElementById("scroll").addEventListener("change", updateVariable);
</script>""" if long == 128 else ""
    
    _white = """<button style="  background-color: white; /* Gul */
  border: 2px solid black;
  color: black;
  padding: 0px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;" type="button" id="white">""" + language[_language]["settings"]["white"] + """</button>


<script>
function updateVariable() {
            fetch('/?color=2', {
                method: 'GET',
            })}
        document.getElementById("white").addEventListener("click", updateVariable);
</script>""" if long == 128 else ""

    invert_disabled = """<td>
<td>

<div class="custom-control custom-switch">
  <input name = "INVERT" class="custom-control-input" type="checkbox" id="INVERT" """ + invert + """>
  <label class="custom-control-label" for="INVERT">""" + language[_language]["settings"]["invert"] + """</label>
</div>
<script>
function updateVariable() {
            fetch('/?invert=switch', {
                method: 'GET',
            })}
        document.getElementById("INVERT").addEventListener("click", updateVariable);
</script>


</td></td>
"""
    if_dns = """<details>
<summary>&#x279C; &#127760; <small>DNS</small></summary>  
</form>      
       
            <form action="/setdns" method="POST">
<table><td>
                <label for="ip">IP:</label>
           <td>     <input type="text" id="ip" name="ip" required></td></td><tr>
<td>
                <label for="ip">Netmask:</label>
    <td>            <input type="text" id="netmask" name="netmask" required></td></td>
<tr>
                <td><label for="ip">Gateway:</label>
<td>                <input type="text" id="gateway" name="gateway" required></td></td>
<tr>
<td>                <label for="ip">DNS (""" + language[_language]["settings"]["not_required"] + """):</label>
<td>                <input type="text" id="dns" name="dns"><br>
</td></td>
<tr>
<td>                
<td>                <input type="submit" value=\"""" + language[_language]["settings"]["save"] + """\">
<button style="  background-color: pink; /* Orange */
  border: 1px solid black;
  color: black;
  padding: 2px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;" type="button" onclick="location.href='/setdns?clear=true'">""" + language[_language]["settings"]["clear"] + """</button>

</td></td></table>
            </form>      
</details>""" if dns_option else ""
    
    _ships = """<div class="custom-control custom-switch">
  <input name = "SHIP" class="custom-control-input" type="checkbox" id="SHIP" """ + shipcheck + """>
  <label class="custom-control-label" for="SHIP">
                  """ + language[_language]["settings"]["ships"] + """
                   </label>
</div>
  <script>
    function updateVariable(event) {
        const selectedValue = event.target.value;
        fetch(`/?type=ship`, {
            method: 'GET',
        })
    }
    document.getElementById("SHIP").addEventListener("click", updateVariable);
</script>

"""
    _trams = """<div class="custom-control custom-switch">
  <input name = "TRAM" class="custom-control-input" type="checkbox" id="TRAM" """ + tramcheck + """>
  <label class="custom-control-label" for="TRAM">
                  """ + language[_language]["settings"]["trams"] + """
                  </label>
</div>
<script>
    function updateVariable(event) {
        const selectedValue = event.target.value;
        fetch(`/?type=tram`, {
            method: 'GET',
        })
    }
    document.getElementById("TRAM").addEventListener("click", updateVariable);
</script>

"""
    if operator == "SL": 
      deviations_html = """<div class="custom-control custom-switch">
  <input id="show_msgs" type="checkbox" class="custom-control-input" name="show_msgs"  """+show_msgs_box+""">
  <label class="custom-control-label" for="show_msgs">
 """ + language[_language]["settings"]["t_info"] + """
</label>
</div>

  <script>
function updateVariable() {
            fetch('/?show_msgs=1', {
                method: 'GET',
            })}
        document.getElementById("show_msgs").addEventListener("click", updateVariable);
</script>"""
      metro_colors = """<br>
  
  <input type="checkbox" class="btn-check" id="r" name="red" """+red+""">
  <label class="btn btn-danger" for="r"> </label>

  <script>
    function updateVariable(event) {
        const selectedValue = event.target.value;
        fetch(`/?line=red`, {
            method: 'GET',
        })
    }
    document.getElementById("r").addEventListener("click", updateVariable);
</script>

  <input type="checkbox" class="btn-check" id="g" name="green" """+green+""">
  <label class="btn btn-success" for="g"> </label>

  <script>
    function updateVariable(event) {
        const selectedValue = event.target.value;
        fetch(`/?line=green`, {
            method: 'GET',
        })
    }
    document.getElementById("g").addEventListener("click", updateVariable);
</script>

  <input type="checkbox" class="btn-check" id="b" name="blue" """+blue+""">
  <label class="btn btn-primary" for="b"> </label>

  <script>
    function updateVariable(event) {
        const selectedValue = event.target.value;
        fetch(`/?line=blue`, {
            method: 'GET',
        })
    }
    document.getElementById("b").addEventListener("click", updateVariable);
</script>
  

  """
    if operator == "HSL" or operator == "SL" or operator == "BE" or operator == "KB": sl_tunnelbana = """
    <div class="custom-control custom-switch">
    <input name = "METRO" class="custom-control-input" type="checkbox" id="METRO" """ + metrocheck + """>
  <label class="custom-control-label" for="METRO">""" + language[_language]["settings"]["subway"] + """ </label>
  """ + metro_colors + """</div>
  <script>
    function updateVariable(event) {
        const selectedValue = event.target.value;
        fetch(`/?type=metro`, {
            method: 'GET',
        })
    }
    document.getElementById("METRO").addEventListener("click", updateVariable);
</script>
  
  
  
  """
    sl_riktning = """<label class="control-label" for="direction">""" + language[_language]["settings"]["direction"] + """:</label>
               <select id="direction" name="direction" class="form-control">

    <script>
        function updateVariable(event) {
            const selectedValue = event.target.value;
            fetch(`/?direction=${selectedValue}`, {
                method: 'GET',
            })
        }
        document.getElementById("direction").addEventListener("change", updateVariable);
    </script>

               """ + direction_html + """
               </select>""" if operator == "SL" else ""
    sl_nattbussar = """<details>
    <summary>&#x279C; <small>
 """ + language[_language]["settings"]["more"] + """
</small></summary>
<small>
<div class="form-check">
  <input class="form-check-input" type="radio" name="buses_option" id="all_buses" value="option1" """+all_buses+""">
  <label class="form-check-label" for="all_buses">
    
                  """ + language[_language]["settings"]["all_buses"] + """
                  
  </label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="buses_option" id="night_buses" value="option2" """+night_buses+""">
  <label class="form-check-label" for="night_buses">
    
                  """ + language[_language]["settings"]["only_nightbuses"] + """
                  
  </label>
</div>
</small>
</details>""" if operator == "SL" else ""
    #network_status_box = ""
    #print("Uptime: ", _uptime)
    __buses = """<div class="custom-control custom-switch">
  <input name = "BUS" class="custom-control-input" type="checkbox" id="BUS" """ + buscheck + """>
  <label class="custom-control-label" for="BUS">
                  """ + language[_language]["settings"]["buses"] + """
                   </label>
<script>
    function updateVariable(event) {
        const selectedValue = event.target.value;
        fetch(`/?type=bus`, {
            method: 'GET',
        })
    }
    document.getElementById("BUS").addEventListener("click", updateVariable);
</script>
""" + sl_nattbussar + """
</div>"""

    if operator == "SJ":
        _trams = ""
        __buses = ""
        _ships = ""

    
    return """
<!DOCTYPE HTML>
<html>
<head><link href="data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAA/SURBVDhPY2RgYPgPxGQDsAFAAOGRCBgZGREGgDikAJgeJiifbDDwBuAMRPQwwaVmGITBqAHUykwQLjmAgQEA3oYYFR16cP8AAAAASUVORK5CYII=" rel="icon" type="image/x-icon" /></head>
   <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
   <title> """ + language[_language]["settings"]["title"] + """</title>

  

   <style> """ + "css_replace" + """ </style>
   <body>
      <div class="container">
      <div class="header">

""" + network_status_box + """

         <form method="post" target="" class="col-md-offset-3 col-md-6" action="/" id="rcorners0">
            <div class="form-group">

          <table style="width:100%">
          <tr>
            <td><input type="checkbox" id="onoff" class="l"  type="button" """ + on_off + """></td>
                <script>

              function updateVariable() {
              

            fetch('/?onoff=active', {
                method: 'GET',
            })}
        document.getElementById("onoff").addEventListener("click", updateVariable);
    </script>
            <td></td>
            <td>
            <div class="d-grid gap-2 d-md-flex justify-content-md-end">
            
              <div align="right">          
              <button class="button" type="button" onclick="location.href='?update=true'" """ + if_newversion + """> """  + version_message  + """
              <svg fill="currentColor" viewBox="0 0 24 24" class="icon">
              <path clip-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25zm4.28 10.28a.75.75 0 000-1.06l-3-3a.75.75 0 10-1.06 1.06l1.72 1.72H8.25a.75.75 0 000 1.5h5.69l-1.72 1.72a.75.75 0 101.06 1.06l3-3z" fill-rule="evenodd"></path>
              </svg></button>
              </div>
            
            </div>
            
            </td>
            
          </tr>
        </table>
            <hr>
                  <div class="p-1 mb-0 bg-warning text-dark font-weight-bold">
                  
                  """ + language[_language]["settings"]["title"] + " - t-skylt" + wifi_id + """


</div> 
<hr>

<table style="width:100%; border:2px solid; box-shadow:3px 3px">
  <tr><small>
    <td><b>""" + language[_language]["settings"]["info"] + "</b> " + check_network(ip=_current_ip) + """
    <br>
    
    """ + _instr + """
    
    </td>
      </tr></small>
</table>

<br>
                  <div class="form-row">
                  <div class="col">
                     <label for="ssid" class="control-label"><a href="/?checknet=true">&#128274;</a> """ + language[_language]["settings"]["network"] + """:</label>


                     <select id="ssid" class="form-control" name="ssid" """ + disabled + """>
                     """ + ssid_html + """
                     </select></div>
                        <script>
        function updateVariable(event) {
            const selectedValue = event.target.value;
            const encodedSSID = selectedValue.replace(/#/g, '%23');
            fetch(`/?ssid=${encodedSSID}`, {
                method: 'GET',
            })
        }
        document.getElementById("ssid").addEventListener("change", updateVariable);
    </script>


                     <div class="col">
                     <label for="password" class="control-label">""" + language[_language]["settings"]["password"] + """:</label>
                     <input type="text" id="password" class="form-control" name="password" placeholder="*******" value="" """+disabled + """>
<script>
    function updateVariable(event) {
        const password = event.target.value;
        const encodedPassword = password.replace(/#/g, '%23');
        fetch(`/?password=${encodeURIComponent(encodedPassword)}`, {
            method: 'GET',
        })
    }
    document.getElementById("password").addEventListener("blur", updateVariable);
</script>


                     <div class="d-grid gap-2 d-md-flex justify-content-md-end">


<button type="button" class="btn btn-outline-secondary btn-sm" """ + disabled + """ id="connect_wifi"> """ + language[_language]["settings"]["connect"] + """ </button>
</div>



<script>
  function updateVariable() {
    fetch('/?connect_wifi=true', {
      method: 'GET',
    })
    .then(response => {
      console.log('Response status:', response.status); // Check response status
      console.log('Response statusText:', response.statusText); // Check response statusText
      if (!response.ok) {
        throw new Error('Network response was not ok');
      }
      return response.json();
    })
    .then(data => {
      console.log('Data received:', data); // Check the received data
      // Get the div element you want to update
      const myDiv = document.getElementById('network');

      // Check the result from the fetch request and update the div accordingly
      if (data === true) {
        myDiv.innerHTML = '"""+check_network(lang=system_language, status=True)+"""';
      } else if (data === false) {
        myDiv.innerHTML = '"""+check_network(lang=system_language, status=False)+"""';
      } else {
        myDiv.innerText = 'Error';
      }
    })
    .catch(error => console.log('Error:', error));
  }

  document.getElementById("connect_wifi").addEventListener("click", updateVariable);
</script>


                  </div>
                  </div>


<div class="form-row">
<div class="col">

<div class="dropdown">

<button class="dropbtn" formaction="/" style="background-color: #EBEFF2; margin: -5px; float: bottom" disabled>""" + flag(country) + """</button>
  <div class="dropdown-content" style="font-size: 10px;">
    """ + countries + """
  </div>  
  </div>

<label for="operator" class="control-label"><div class="dropdown">
  <button class="dropbtn" formaction="/" style="height:20px; border: 1mm ridge rgba(252, 252, 252, .5);" disabled>""" + str("&#9660; ") + operator + """</button>
  <div class="dropdown-content" style="font-size: 10px">
  """ + operator_dropdown + """

  </div>

  </div>
""" + screen_options + """
 





<input type="text" id="sstring" class="form-control" name="sstring" placeholder=" """ + station_placeholder +  """ " value=""" + "\"" +  "" + "\"" + ifdisabled + """>

<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<button type="submit" class="btn btn-outline-secondary btn-sm"  onclick="window.location.href='/search';" id="_searchbutton" style="float: right">

 """ + language[_language]["settings"]["_search"] + """


</button> </div>
                  </div>

<div class="col">

    <label class="control-label" for="newstation" style=\" """ + border_style + """\"> """+ if_result_ball + """ </label> """+if_result+"""

    <select id="newstation" class="form-control"  name="newstation" """ + newstation_disabled + """>
    """ + v_newresults + """
    </select>

<script>
        function updateVariable(event) {
            const selectedValue = event.target.value;
            fetch(`/?newstation=${selectedValue}`, {
                method: 'GET',
            })
        }
        document.getElementById("newstation").addEventListener("change", updateVariable);
    </script>


</div>
</div>
<div class="form-row">
<div class="col">
<label class="control-label" for="maxdest">""" + language[_language]["settings"]["no_departures"] + """:</label>
<select id="maxdest" name="maxdest" class="form-control">
                     """ + maxdest_html + """
                     </select>
</div>
    <script>
        function updateVariable(event) {
            const selectedValue = event.target.value;
            fetch(`/?maxdest=${selectedValue}`, {
                method: 'GET',
            })
        }
        document.getElementById("maxdest").addEventListener("change", updateVariable);
    </script>







<div class="col">
<br>
    

  """ + sl_tunnelbana + """



""" + __buses + """




<div class="custom-control custom-switch">
  <input name = "TRAIN" class="custom-control-input" type="checkbox" id="TRAIN" """ + traincheck + """>
  <label class="custom-control-label" for="TRAIN">""" + language[_language]["settings"]["trains"] + """</label>
</div>
<script>
    function updateVariable(event) {
        const selectedValue = event.target.value;
        fetch(`/?type=train`, {
            method: 'GET',
        })
    }
    document.getElementById("TRAIN").addEventListener("click", updateVariable);
</script>

""" + _trams + """

""" + _ships + """
</div>
</div>
<br>

         <div class="form-row">
                  <div class="col">
<label class="control-label" for="offset">""" + language[_language]["settings"]["hide_departures"] + """:</label>
               <select id="offset" name="offset" class="form-control">
               """ + offset_html + """
               </select>
              </div>

<script>
    function updateVariable(event) {
        const selectedValue = event.target.value;
        fetch(`/?offset=${selectedValue}`, {
            method: 'GET',
        })
    }
    document.getElementById("offset").addEventListener("change", updateVariable);
</script>






                  <div class="col">
""" + sl_riktning + """

</div></div>



               <div class="form-row">
                  <div class="col">
                     <br>  <label class="control-label" for="brightness">""" + language[_language]["settings"]["brightness"] + """:</label>
                     <select id="brightness" name="brightness" class="form-control">
                     """ + brightness_html + """
                     </select>
                  </div>

<script>
    function updateVariable(event) {
        const selectedValue = event.target.value;
        fetch(`/?brightness=${selectedValue}`, {
            method: 'GET',
        })
    }
    document.getElementById("brightness").addEventListener("change", updateVariable);
</script>
            


""" + scroll_block + """
               


</div>
<br>
<div class="custom-control custom-switch">
  <input name = "listmode" class="custom-control-input" type="checkbox" id="abc" """ + show_list_box + """>
  <label class="custom-control-label" for="abc">
 """ + language[_language]["settings"]["list"] + """
</label>
</div>

<script>
function updateVariable() {
            fetch('/?listmode=switch', {
                method: 'GET',
            })}
        document.getElementById("abc").addEventListener("click", updateVariable);
</script>


""" + _multiple + """



<div class="custom-control custom-switch">
  <input name = "clocktime" class="custom-control-input" type="checkbox" id="clocktime" """ + _clocktime + """>
  <label class="custom-control-label" for="clocktime">
 """ + language[_language]["settings"]["clocktime"] + """
</label>
</div>

<script>
function updateVariable() {
            fetch('/?clocktime=switch', {
                method: 'GET',
            })}
        document.getElementById("clocktime").addEventListener("click", updateVariable);
</script>



""" + deviations_html + """

<div class="custom-control custom-switch">
  <input id="sleep" type="checkbox" class="custom-control-input" name="sleep"  """+sleep_box+""">
  <label class="custom-control-label" for="sleep">
 """ + language[_language]["settings"]["turn_off"] + """
</label>
</div>

  <script>
function updateVariable() {
            fetch('/?sleep=1', {
                method: 'GET',
            })}
        document.getElementById("sleep").addEventListener("click", updateVariable);
</script>

<div class="custom-control custom-switch">
  <input id="show_my_station" type="checkbox" class="custom-control-input" name="show_my_station"  """+show_station_box+""">
  <label class="custom-control-label" for="show_my_station">
 """ + language[_language]["settings"]["show_station"] + """
</label>
</div>



  <script>
function updateVariable() {
            fetch('/?show_station=1', {
                method: 'GET',
            })}
        document.getElementById("show_my_station").addEventListener("click", updateVariable);
</script>









</div>



<div class="d-grid gap-2 d-md-flex justify-content-md-end">
  <div align="right">          
  <button style='width:100px;height:40px'  type="button" class="btn btn-primary" id="savechanges"> """ + language[_language]["settings"]["save"] + """ </button>

  <script>

              function updateVariable() {
              

            fetch('/?save=true', {
                method: 'GET',
            })}
        document.getElementById("savechanges").addEventListener("click", updateVariable);
    </script>

    </div>
</div>

<div class="col">
  <label for="user" class="control-label">""" + language[_language]["settings"]["user"] + """:</label>
  <input type="text" id="user" class="form-control" name="user" placeholder='""" + user + """' value="">

    <script>
        function updateVariable(event) {
            const selectedValue = event.target.value;
            const user = selectedValue.replace(/#/g, '%23');
            fetch(`/?user=${user}`, {
                method: 'GET',
            })
        }
        document.getElementById("user").addEventListener("change", updateVariable);
    </script>

<details>
    <summary>&#x279C; <small>
 """ + language[_language]["settings"]["advanced"] + """
</small></summary>
<table style="width:100%;">
<hr>
<div class="p-1 mb-0 bg-warning text-dark font-weight-bold">

 """ + language[_language]["settings"]["advanced_settings"] + """

</div>
<hr>
 
</div>
</div>
<tr>
<td>
               </div>
<b>
 """ + language[_language]["settings"]["temp"] + """:</b><td> """ + _temp + """&#176;C <br></td></td>
<tr>
<td>
<b>Uptime:</b><td> """ + _uptime + """</td></td>

<tr>
<td>
<b>
 """ + language[_language]["settings"]["angle"] + """:</b><td> 
<button id="rotate_button" class="btn-sm btn-warning" type="button">""" + language[_language]["settings"]["rotation"] + """</button>
<script>
function updateVariable() {
    fetch('/rotate', {
        method: 'GET',
    })
    .then(response => response.text())
    .then(result => console.log('Success:', result))
    .catch(error => console.error('Error:', error));
}

document.getElementById("rotate_button").addEventListener("click", updateVariable);
</script>
</button> </td></td>


<tr>        
<td>
<b>""" + language[_language]["settings"]["width"] + """:</b><td>

<button  type="button" id="xs">""" + "XS" + """</button>
<script>
function updateVariable() {
            fetch('/?width=xs', {
                method: 'GET',
            })}
        document.getElementById("xs").addEventListener("click", updateVariable);
</script>

  <button  type="button" id="x">""" + "X" + """</button>

<script>
function updateVariable() {
            fetch('/?width=x', {
                method: 'GET',
            })}
        document.getElementById("x").addEventListener("click", updateVariable);
</script>


<button  type="button" id="xl">""" + "XL" + """</button>

<script>
function updateVariable() {
            fetch('/?width=xl', {
                method: 'GET',
            })}
        document.getElementById("xl").addEventListener("click", updateVariable);
</script>
  

</td></td>

</td></td>



<tr>
<td>
<b>""" + language[_language]["settings"]["system_language"] + """:</b><td>
<label for="country" class="control-label"><div class="dropdown">
  <button class="dropbtn" formaction="/" style="height:20px" disabled>""" + system_language + """</button>
  <div class="dropdown-content" style="font-size: 10px">
    <a href="/?language=se">Svenska</a>
    <a href="/?language=en">English</a>
  </div>
</td></td>







<tr>        
<td>
<b>""" + language[_language]["settings"]["tone"] + """:</b><td>
<button style="  background-color: #e09d00; /* Orange */
  border: 2px solid black;
  color: white;
  padding: 0px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;" type="button" id="orange">""" + language[_language]["settings"]["orange"] + """</button>

  <script>
function updateVariable() {
            fetch('/?color=0', {
                method: 'GET',
            })}
        document.getElementById("orange").addEventListener("click", updateVariable);
</script>

  <button style="  background-color: #f5d105; /* Gul */
  border: 2px solid black;
  color: white;
  padding: 0px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;" type="button" id="yellow">""" + language[_language]["settings"]["yellow"] + """</button>

<script>
function updateVariable() {
            fetch('/?color=1', {
                method: 'GET',
            })}
        document.getElementById("yellow").addEventListener("click", updateVariable);
</script>

 
  """ + _white + """

</td></td>

</td></td>


<tr>        
<td>
<b>""" + language[_language]["settings"]["list_colors"] + """:</b><td>

<div class="custom-control custom-switch">
  <input name = "LISTCOLOR" class="custom-control-input" type="checkbox" id="LISTCOLOR" """ + listcolor + """>
  <label class="custom-control-label" for="LISTCOLOR">""" + language[_language]["settings"]["list_colors_line"] + """</label>
</div>
<script>
function updateVariable() {
            fetch('/?listcolor=switch', {
                method: 'GET',
            })}
        document.getElementById("LISTCOLOR").addEventListener("click", updateVariable);
</script>
</td></td>


<tr>        
<td>
<b>""" + language[_language]["settings"]["font_mini"] + """:</b><td>

<div class="custom-control custom-switch">
  <input name = "FONTMINI" class="custom-control-input" type="checkbox" id="FONTMINI" """ + _font_mini + """>
  <label class="custom-control-label" for="FONTMINI">""" + language[_language]["settings"]["font_mini_line"] + """</label>
</div>
<script>
function updateVariable() {
            fetch('/?fontmini=switch', {
                method: 'GET',
            })}
        document.getElementById("FONTMINI").addEventListener("click", updateVariable);
</script>
</td></td>



<tr>        
<td>
<b>Timer:</b><td>
<button class="button" type="button" onclick="location.href='/?timer=set'"> &#8987;</button>
</td></td>

<tr>        
<td>
<b>DNS:</b><td>
<button class="button" type="button" onclick="location.href='/dns'"> &#127760;</button>
</td></td>

<tr>
<td>
<b>Ping-test:</b><td> <button class="btn-sm btn-warning" type="button" onclick="location.href='/ping'">Ping</button> </td></td>


<tr>        



</table>



""" + if_dns + """
         


</details>
</div>
</div>

</body>
</html>"""


country_and_operators = {"se":"""<a href="?operator=sl">SL (Stockholm)</a>
                         <a href="?operator=vt">VT (Västtrafik)</a>
                         <a href="?operator=otraf">Östgötatrafiken</a>
                         <a href="?operator=vastmanland">VL (Västmanlands län)</a>
                         <a href="?operator=dt">DT (Dalatrafik)</a>
                         <a href="?operator=jlt">JLT (Jönköpings län)</a>
                         <a href="?operator=krono">KRONO (Kronobergs länstrafik)</a>
                         <a href="?operator=ul">UL (Uppsala län)</a>
                         <a href="?operator=klt">KLT (Kalmar länstrafik)</a>
                         <a href="?operator=orebro">Länstrafiken Örebro</a>
                         <a href="?operator=xt">X-Trafik (Gävleborg)</a>
                         <a href="?operator=varm">Värmlandstrafik - Karlstadsbuss</a>
                         <a href="?operator=skane">Skånetrafiken</a>
                         <a href="?operator=fe">Trafikverkets färjor</a>
                         <a href="?operator=sj">SJ (Trafikverket)</a>""",
                         "dk":"""<a href="?operator=kb">Alle operatører</a>""",
                         "no":"""<a href="?operator=no">Entur (entire Norway)</a>""",
                         "fi":"""<a href="?operator=hsl">HSL (Helsinki)</a>""",
                         "cr":"""<a href="?operator=za">ZET (Zagreb)</a>""",
                         "nl":"""<a href="?operator=ns">Nederlandse Spoorwegen</a>""",
                         "de":"""<a href="?operator=be">Berlin-Brandenburg</a>"""
    }

list_shade = {"be":1}

language = {"se":{"settings":{"connected":"Ansluten",
                              "font_mini":"List-typsnitt",
                              "font_mini_line":"litet",
                              "not_connected":"Ej ansluten",
                              "title":"Inst&#228;llningar",
                              "network":"Ditt nätverk",
                              "password":"Ditt lösenord",
                              "search":"Sök station",
                              "_search":"Sök",
                              "no_departures":"Antal avgångar",
                              "subway":"tunnelbana",
                              "buses":"bussar",
                              "more":"mer",
                              "all_buses":"Alla bussar",
                              "only_nightbuses":"Endast nattbussar",
                              "trains":"tåg",
                              "trams":"spårväg/lokalbanor",
                              "ships":"båtar",
                              "hide_departures":"Dölj avgångar inom",
                              "direction":"Riktning",
                              "brightness":"Ljusstyrka",
                              "scroll":"Scrollhastighet",
                              "list":"visa avgångar som lista",
                              "t_info":"inkludera trafikinformation",
                              "turn_off":"släck ner vid trafikuppehåll",
                              "show_station":"visa din station ibland",
                              "multiple":"flera stationer (lista)",
                              "save":"Spara",
                              "return":"Återgå",
                              "advanced":"Avancerat",
                              "advanced_settings":"Avancerade inställningar",
                              "temp":"Systemets temperatur",
                              "minutes":"minuter",
                              "angle":"Vinkel",
                              "rotation":"rotera skärm",
                              "width":"Displaybredd",
                              "country":"Land",
                              "tone":"LED-ton",
                              "orange":"orange",
                              "yellow":"gul",
                              "white":"vit",
                              "list_colors":"Listfärger",
                              "list_colors_line":"markera",
                              "not_required":"ej obligatorisk",
                              "clear":"Rensa",
                              "connect":"Anslut",
                              "info":"Välkommen till inställningar",
                              "_instructions":"""<details><summary>...</summary>För support, besök <a href='http://t-skylt.se'>T-Skylt.se</a></details>""",
                              "instructions":"""Första gången du ansluter till skylten är adressen 192.168.4.1. 
                              Därefter beror adressen på vilken IP den får av din router. 
                              Notera IP-adressen vid uppstart av skylten.
                              <br><br>
                              Ladda om denna sida när du anslutit till ditt nätverk!
                              """,
                              "system_language": "Språk (language)",
                              "low":"Låg",
                              "middle":"Medel",
                              "high":"Hög",
                              "no_data":"Data ej tillgänglig",
                              "select_operator":"Välj operatör",
                              "choose_country":"Välj land",
                              "invert":"invertera färger",
                              "operator":"OPERATÖR",
                              "clocktime":"nedräkning/klocktid",

                              "monday":"måndag",
                              "tuesday":"tisdag",
                              "wednesday":"onsdag",
                              "thursday":"torsdag",
                              "friday":"fredag",
                              "saturday":"lördag",
                              "sunday":"söndag",

                              "user":"E-postadress",
                              "timer_title":"Timer - Välj när skylten ska vara på",
                              },
                      
                      "display":{"your_settings":"Dina inställningar:",
                                 "no_more_departures":"Inga fler avgångar",
                                 "check_connection":"Kontrollera din anslutning",
                                 "north_south":"Norr- och södergående",
                                 "north":"Norrgående",
                                 "south":"Södergående",
                                 "new_version_available":"Ny version tillgänglig: ",
                                 "sign":"Skylt",
                                 "departures":" avgångar ",
                                 "lightsoff":"Släcker ",
                                 "hiding":"Döljer avg. inom ",

                                 "connect_to":"Anslut till WIFI: ",
                                 "password_2":"Lösenord: ",
                                 "go_to":"Gå sen till webbsidan: ",
                                 "settings":"Inställningar: ",
                                 "save":" ",
                                 "select_network":"Välj nätverk: ",
                                 "reboot":"Startar om...",
                                 "updating":"Uppdaterar: ",
                                 "updating_file":"^ Uppdaterar fil: ",
                                 "no_update":"Ingen uppdatering",
                                 "new_version":"Ny version: ",
                                 "try_again":"Försök igen - ",

                                 "saving":"Sparar...",
                                 "searching":"Söker...",
                                 "checking_update":"Söker uppdatering...",
                                 "no_update": "Ingen uppdatering",
                                 "dont_turn_off":"^ Stäng inte av",
                                 "error":"Fel",
                                 "connecting":"Ansluter:",
                                 "loading":"Laddar...",
                                 "select_station":"Välj station: ",
                                 "decoding_error": "^ Avkodningsfel"



                                 }},


            "en":{"settings":{"connected":"Connected",
                              "font_mini":"List font",
                              "font_mini_line":"small",
                              "not_connected":"Not connected",
                              "title":"Settings",
                              "network":"Your WIFI",
                              "password":"Your password",
                              "search":"Enter station name",
                              "_search":"Search",
                              "no_departures":"No. of departures",
                              "subway":"subway",
                              "buses":"buses",
                              "more":"more",
                              "all_buses":"All buses",
                              "only_nightbuses":"Night buses only",
                              "trains":"trains",
                              "trams":"trams",
                              "ships":"ships",
                              "hide_departures":"Hide depts. within",
                              "direction":"Direction",
                              "brightness":"Brightness",
                              "scroll":"Scroll speed",
                              "list":"list departures",
                              "t_info":"show traffic information",
                              "turn_off":"turn off while no departures",
                              "show_station":"show your station sometimes",
                              "multiple":"multiple stops (list)",
                              "save":"Save",
                              "return":"Return",
                              "advanced":"Advanced",
                              "advanced_settings":"Advanced settings",
                              "temp":"System temperature",
                              "minutes":"minutes",
                              "angle":"Angle",
                              "rotation":"rotate display",
                              "width":"Display width",
                              "country":"Country",
                              "tone":"LED-tone",
                              "orange":"orange",
                              "yellow":"yellow",
                              "white":"white",
                              "list_colors":"List colors",
                              "list_colors_line":"highlight",
                              "not_required":"not required",
                              "clear":"Clear",
                              "connect":"Connect",
                              "system_language": "Language",
                              "info":"Welcome to settings",
                              "_instructions":"""<details><summary>...</summary>For support, visit <a href='http://t-skylt.se'>T-Skylt.se</a></details>""",
                              "instructions":"""The first time you connect to the display, the address is 192.168.4.1. 
                              The future address will be assigned by your router. 
                              Look for the IP address during bootup.
                              <br><br>
                              Please refresh this page after connecting to your WIFI!
                              """,
                              "low":"Low",
                              "middle":"Medium",
                              "high":"High",
                              "no_data":"No data available",
                              "select_operator":"Select operator",
                              "choose_country":"Choose country",
                              "invert":"invert colors",
                              "operator":"OPERATOR",
                              "clocktime":"countdown/clock time",

                              "monday":"Monday",
                              "tuesday":"Tuesday",
                              "wednesday":"Wednesday",
                              "thursday":"Thursday",
                              "friday":"Friday",
                              "saturday":"Saturday",
                              "sunday":"Sunday",

                              "user":"E-mail",
                              "timer_title":"Timer - Select when the display operates",

                              },
                              
                      
                      "display":{"your_settings":"Your settings:        ",
                                 "no_more_departures":"No more departures",
                                 "check_connection":"Check your connection",
                                 "north_south":"North and southbound",
                                 "north":"Northbound",
                                 "south":"Southbound",
                                 "new_version_available":"New version available: ",
                                 "sign":"Skylt",
                                 "departures":" departures ",
                                 "lightsoff":"Lights off ",
                                 "hiding":"Hiding depts. within ",
                                 

                                 "connect_to":"Connect to WIFI: ",
                                 "password_2":"Password: ",
                                 "go_to":"Then browse to: ",

                                 "settings":"Settings: ",
                                 "save":" ",
                                 "select_network":"Select network: ",

                                 "reboot":"Rebooting...",
                                 "updating":"Updating: ",
                                 "updating_file":"^ Updating file: ",
                                 "no_update":"No update available",
                                 "new_version":"New version: ",
                                 "try_again":"Try again - ",
                                 "checking_update":"Checking for updates...",


                                 "saving":"Saving...",
                                 "searching":"Searching...",
                                 "no_update": "No update available",
                                 "dont_turn_off":"^ Do not turn off",
                                 "error":"Error",
                                 "connecting":"Connecting:",
                                 "loading":"Loading...",

                                 "select_station":"Select station: ",
                                 "decoding_error": "^ Decoding error"

                                 }}}


def timer(_language, timer):
  for i in timer:
    try: timer[i][1]
    except: timer[i] = ["00:00","00:00"]
  
  return """
  <!DOCTYPE HTML>
  <html>
  <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
  <title>Timer</title>

  <style> """ + "css_replace" + """ </style>
  
   <body>
      <div class="container">
      <div class="header">


         
            <div class="form-group">

          <table style="width:100%">

            <td></td>
            <td>
            <div class="d-grid gap-2 d-md-flex justify-content-md-end">
            
            </div>
            
            </td>
            
          </tr>
        </table>
            <hr>
                  <div class="p-1 mb-0 bg-warning text-dark font-weight-bold">
                  
                 """ + language[_language]["settings"]["timer_title"] + """


</div> 
<hr>

  <tr>
  <td>
  <form action="?set_timer=true" method="GET">

  <b>""" + language[_language]["settings"]["monday"] + """</b>
    <div id="timeSelector">
      <input type="time" id="mondayStartTime" value=""" + timer["Monday"][0] + """>
        <span> - </span>
        <input type="time" id="mondayEndTime" value=""" + timer["Monday"][1] + """>
    </div>

    
    <script>
  const mondaystartTimeInput = document.getElementById("mondayStartTime");
  const mondayendTimeInput = document.getElementById("mondayEndTime");

  function sendTimes() {
    const startTime = mondaystartTimeInput.value;
    const endTime = mondayendTimeInput.value;

    if (startTime && endTime) {
      fetch('/?set_timer=Monday&start=' + encodeURIComponent(`${startTime}to=${endTime}`), {
        method: 'GET', }) ; } }

  mondaystartTimeInput.addEventListener("change", sendTimes);
  mondayendTimeInput.addEventListener("change", sendTimes);
</script>

    <b>""" + language[_language]["settings"]["tuesday"] + """</b>
      <div id="timeSelector">
      <input type="time" id="tuesdayStartTime" value=""" + timer["Tuesday"][0] + """>
        <span> - </span>
        <input type="time" id="tuesdayEndTime" value=""" + timer["Tuesday"][1] + """>
    </div>

    <script>
  const tuesdaystartTimeInput = document.getElementById("tuesdayStartTime");
  const tuesdayendTimeInput = document.getElementById("tuesdayEndTime");

  function sendTimes() {
    const startTime = tuesdaystartTimeInput.value;
    const endTime = tuesdayendTimeInput.value;

    if (startTime && endTime) {
      fetch('/?set_timer=Tuesday&start=' + encodeURIComponent(`${startTime}to=${endTime}`), {
        method: 'GET', }) ; } }

  tuesdaystartTimeInput.addEventListener("change", sendTimes);
  tuesdayendTimeInput.addEventListener("change", sendTimes);
</script>

  <b>""" + language[_language]["settings"]["wednesday"] + """</b>
  <div id="timeSelector">
      <input type="time" id="wednesdayStartTime" value=""" + timer["Wednesday"][0] + """>
        <span> - </span>
        <input type="time" id="wednesdayEndTime" value=""" + timer["Wednesday"][1] + """>
    </div>

    <script>
  const wednesdaystartTimeInput = document.getElementById("wednesdayStartTime");
  const wednesdayendTimeInput = document.getElementById("wednesdayEndTime");

  function sendTimes() {
    const startTime = wednesdaystartTimeInput.value;
    const endTime = wednesdayendTimeInput.value;

    if (startTime && endTime) {
      fetch('/?set_timer=Wednesday&start=' + encodeURIComponent(`${startTime}to=${endTime}`), {
        method: 'GET', }) ; } }

  wednesdaystartTimeInput.addEventListener("change", sendTimes);
  wednesdayendTimeInput.addEventListener("change", sendTimes);
</script>


  <b>""" + language[_language]["settings"]["thursday"] + """</b>
  <div id="timeSelector">
      <input type="time" id="thursdayStartTime" value=""" + timer["Thursday"][0] + """>
        <span> - </span>
        <input type="time" id="thursdayEndTime" value=""" + timer["Thursday"][1] + """>
    </div>

    
    <script>
  const thursdaystartTimeInput = document.getElementById("thursdayStartTime");
  const thursdayendTimeInput = document.getElementById("thursdayEndTime");

  function sendTimes() {
    const startTime = thursdaystartTimeInput.value;
    const endTime = thursdayendTimeInput.value;

    if (startTime && endTime) {
      fetch('/?set_timer=Thursday&start=' + encodeURIComponent(`${startTime}to=${endTime}`), {
        method: 'GET', }) ; } }

  thursdaystartTimeInput.addEventListener("change", sendTimes);
  thursdayendTimeInput.addEventListener("change", sendTimes);
</script>

  <b>""" + language[_language]["settings"]["friday"] + """</b>
  <div id="timeSelector">
      <input type="time" id="fridayStartTime" value=""" + timer["Friday"][0] + """>
        <span> - </span>
        <input type="time" id="fridayEndTime" value=""" + timer["Friday"][1] + """>
    </div>

<script>
  const fridaystartTimeInput = document.getElementById("fridayStartTime");
  const fridayendTimeInput = document.getElementById("fridayEndTime");

  function sendTimes() {
    const startTime = fridaystartTimeInput.value;
    const endTime = fridayendTimeInput.value;

    if (startTime && endTime) {
      fetch('/?set_timer=Friday&start=' + encodeURIComponent(`${startTime}to=${endTime}`), {
        method: 'GET', }) ; } }

  fridaystartTimeInput.addEventListener("change", sendTimes);
  fridayendTimeInput.addEventListener("change", sendTimes);
</script>

  <b>""" + language[_language]["settings"]["saturday"] + """</b>
  <div id="timeSelector">
      <input type="time" id="saturdayStartTime" value=""" + timer["Saturday"][0] + """>
        <span> - </span>
        <input type="time" id="saturdayEndTime" value=""" + timer["Saturday"][1] + """>
    </div>

<script>
  const saturdaystartTimeInput = document.getElementById("saturdayStartTime");
  const saturdayendTimeInput = document.getElementById("saturdayEndTime");

  function sendTimes() {
    const startTime = saturdaystartTimeInput.value;
    const endTime = saturdayendTimeInput.value;

    if (startTime && endTime) {
      fetch('/?set_timer=Saturday&start=' + encodeURIComponent(`${startTime}to=${endTime}`), {
        method: 'GET', }) ; } }

  saturdaystartTimeInput.addEventListener("change", sendTimes);
  saturdayendTimeInput.addEventListener("change", sendTimes);
</script>

  <b>""" + language[_language]["settings"]["sunday"] + """  </b>
  <div id="timeSelector">
      <input type="time" id="sundayStartTime" value=""" + timer["Sunday"][0] + """>
        <span> - </span>
        <input type="time" id="sundayEndTime" value=""" + timer["Sunday"][1] + """>
    </div>

    <script>
  const sundaystartTimeInput = document.getElementById("sundayStartTime");
  const sundayendTimeInput = document.getElementById("sundayEndTime");

  function sendTimes() {
    const startTime = sundaystartTimeInput.value;
    const endTime = sundayendTimeInput.value;

    if (startTime && endTime) {
      fetch('/?set_timer=Sunday&start=' + encodeURIComponent(`${startTime}to=${endTime}`), {
        method: 'GET', }) ; } }

  sundaystartTimeInput.addEventListener("change", sendTimes);
  sundayendTimeInput.addEventListener("change", sendTimes);
</script>

    

    <button type="button" id="savetime" onclick="location.href='/'">""" + language[_language]["settings"]["return"] + """</button>
    
    
    <button style="background-color: pink; border: 1px solid black; color: black; padding: 2px; text-align: center;
  text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer;" type="button" onclick="location.href='/?cleartimer=true'">""" + language[_language]["settings"]["clear"] + """</button>
    
    
    </td>
    </tr>    
</form>


  </td>
  </tr>           
</div>
</div>

</body>
</html>


    """

x = """ <script>

              function updateVariable() {
              

            fetch('/?savetime=time', {
                method: 'GET',
            })}
        document.getElementById("savetime").addEventListener("click", updateVariable);
    </script>"""
    


