JavaScript is not working

The task:

if I want to save a new dokument in my Notes DB with a date value:21th of moth and a time value 22.00 MEZ until 2.00 MEZ, I will get a message.

The date-value is text and has the notesname: Termin_Start

The time-value is Text and has the notesname: Uhrzeit_Start

My Script(in JS-Header):

function checkdate() {

var tag = document.formular.Termin_Start.value.substr(0,2);

var std = document.formular.Uhrzeit_Start.value.substr(0,2);

var min = document.formular.Uhrzeit_Start.value.substr(3,2);

var flag = “”;

if (tag == ‘21’) {

if (std >= ‘22’) {

if (std == ‘22’ && min < ‘30’) {

flag = ""

} else {

flag = "t";

}

}

}

if (tag == ‘22’) {

if (std >= ‘00’ && std <= ‘02’) {

flag=“t”;

}

}

if (flag != ‘’) {

check = confirm(“Achtung: wegen der Datensicherung des Merkursystems (IRT) soll zu dieser Zeit keine Wartung durchgeführt werden!\nKlicken Sie auf "OK", um diesen Termin trotzdem in die Wartungs-DB einzutragen.”);

return check;

}

}

Anyone knows what I did wrong?

Thanks a lot for your help