Dim popytka11
Dim popytka12
Dim popytka2
Dim popytka3
Dim popytka4
Dim popytka51
Dim popytka52
Dim popytka61
Dim popytka62
Dim popytka63
popytka11 = Cbyte(1)
popytka12 = Cbyte(1)
popytka2 = Cbyte(1)
popytka3 = Cbyte(1)
popytka4 = Cbyte(1)
popytka51 = Cbyte(1)
popytka52 = Cbyte(1)
popytka61 = Cbyte(1)
popytka62 = Cbyte(1)
popytka63 = Cbyte(1)

Sub znaok11_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(3.0)
tochn=CDbl(0.1)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans1.zna11.value="") OR (Not IsNumeric(Document.ans1.zna11.value)) Then
Alert "Необходимо ввести число"
ans1.zna11.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans1.zna11.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka11 <= 2)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka11 >= 1)and(popytka11 <= 2))) Then 
   Top.Hlp.Help.Document.Open
   Top.Hlp.Help.Document.Write "<HTML>"
   Top.Hlp.Help.Document.Write "<HEAD><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'><STYLE>"
   Top.Hlp.Help.Document.Write "A { text-decoration: none}"
   Top.Hlp.Help.Document.Write "A:hover {text-decoration: underline; color: #FF00FF}"
   Top.Hlp.Help.Document.Write "BODY {background-image : URL(img/b_help.gif); font-variant: normal; font-family: Times New Roman; background-color: #DFEFFF; color: black;}"
   Top.Hlp.Help.Document.Write "</STYLE></HEAD>"
   Top.Hlp.Help.Document.Write "<BODY LINK='#0000FF' ALINK='#0000FF' VLINK='#0000FF'>"
End If
If (Abs(otwet - potwet) <= tochn) AND (popytka11 <= 2) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 1, вопрос 1: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "Отвечайте на второй вопрос."
   popytka11 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka11 = 1) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 1, вопрос 1: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka11 = popytka11 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka11 = 2) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 1 вопрос 1 не решена !</B></FONT><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z8.htm TARGET=Main>Выход в меню занятия</A>"
   popytka11 = popytka11 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka11 <= 2)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka11 >= 1)and(popytka11 <= 2))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub

Sub znaok12_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(1.0)
tochn=CDbl(0.1)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans1.zna12.value="") OR (Not IsNumeric(Document.ans1.zna12.value)) Then
Alert "Необходимо ввести число"
ans1.zna12.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans1.zna12.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka12 <= 2)) or ( (Abs(otwet - potwet)) > tochn AND ((popytka12 >= 1)and(popytka12 <= 2))) Then 
   Top.Hlp.Help.Document.Open
   Top.Hlp.Help.Document.Write "<HTML>"
   Top.Hlp.Help.Document.Write "<HEAD><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'><STYLE>"
   Top.Hlp.Help.Document.Write "A { text-decoration: none}"
   Top.Hlp.Help.Document.Write "A:hover {text-decoration: underline; color: #FF00FF}"
   Top.Hlp.Help.Document.Write "BODY {background-image : URL(img/b_help.gif); font-variant: normal; font-family: Times New Roman; background-color: #DFEFFF; color: black;}"
   Top.Hlp.Help.Document.Write "</STYLE></HEAD>"
   Top.Hlp.Help.Document.Write "<BODY LINK='#0000FF' ALINK='#0000FF' VLINK='#0000FF'>"
End If
If (Abs(otwet - potwet) <= tochn) AND (popytka12 <= 2) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 1, вопрос 2: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z8.htm TARGET=Main>Выход в меню занятия</A>"
   popytka12 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka12 = 1) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 1, вопрос 2: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka12 = popytka12 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka12 = 2) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 1 вопрос 2 не решена !</B></FONT><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z8.htm TARGET=Main>Выход в меню занятия</A>"
   popytka12 = popytka12 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka12 <= 2)) or ( (Abs(otwet - potwet)) >tochn AND ((popytka12 >= 1)and(popytka12 <= 2))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub

Sub znaok2_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(2.0)
tochn=CDbl(0.1)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans2.zna2.value="") OR (Not IsNumeric(Document.ans2.zna2.value)) Then
Alert "Необходимо ввести число"
ans2.zna2.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans2.zna2.value)
If ((Abs(otwet - potwet) <= tochn) AND (popytka2 <= 2)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka2 >= 1)and(popytka2 <= 2))) Then 
   Top.Hlp.Help.Document.Open
   Top.Hlp.Help.Document.Write "<HTML>"
   Top.Hlp.Help.Document.Write "<HEAD><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'><STYLE>"
   Top.Hlp.Help.Document.Write "A { text-decoration: none}"
   Top.Hlp.Help.Document.Write "A:hover {text-decoration: underline; color: #FF00FF}"
   Top.Hlp.Help.Document.Write "BODY {background-image : URL(img/b_help.gif); font-variant: normal; font-family: Times New Roman; background-color: #DFEFFF; color: black;}"
   Top.Hlp.Help.Document.Write "</STYLE></HEAD>"
   Top.Hlp.Help.Document.Write "<BODY LINK='#0000FF' ALINK='#0000FF' VLINK='#0000FF'>"
End If
If (Abs(otwet - potwet) <= tochn) AND (popytka2 <= 2) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 2: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z8.htm TARGET=Main>Выход в меню занятия</A>"
   popytka2 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka2 = 1) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 2: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka2 = popytka2 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka2 = 2) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 2 не решена !</B></FONT><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z8.htm TARGET=Main>Выход в меню занятия</A>"
   popytka2 = popytka2 + 1
End If
If ((Abs(otwet - potwet) <= tochn) AND (popytka2 <= 2)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka2 >= 1)and(popytka2 <= 2))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub

Sub znaok3_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(4.56)
tochn=CDbl(0.01)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans3.zna3.value="") OR (Not IsNumeric(Document.ans3.zna3.value)) Then
Alert "Необходимо ввести число"
ans3.zna3.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans3.zna3.value)
If ((Abs(otwet - potwet) <= tochn) AND (popytka3 <= 3)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka3 >= 1)and(popytka3 <= 3))) Then 
   Top.Hlp.Help.Document.Open
   Top.Hlp.Help.Document.Write "<HTML>"
   Top.Hlp.Help.Document.Write "<HEAD><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'><STYLE>"
   Top.Hlp.Help.Document.Write "A { text-decoration: none}"
   Top.Hlp.Help.Document.Write "A:hover {text-decoration: underline; color: #FF00FF}"
   Top.Hlp.Help.Document.Write "BODY {background-image : URL(img/b_help.gif); font-variant: normal; font-family: Times New Roman; background-color: #DFEFFF; color: black;}"
   Top.Hlp.Help.Document.Write "</STYLE></HEAD>"
   Top.Hlp.Help.Document.Write "<BODY LINK='#0000FF' ALINK='#0000FF' VLINK='#0000FF'>"
End If
If (Abs(otwet - potwet) <= tochn) AND (popytka3 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 3: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z8.htm TARGET=Main>Выход в меню занятия</A>"
   popytka3 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka3 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 3: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka3 = popytka3 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka3 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 3: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka3 = popytka3 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka3 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 3 не решена !</B></FONT><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z8.htm TARGET=Main>Выход в меню занятия</A>"
   popytka3 = popytka3 + 1
End If
If ((Abs(otwet - potwet) <= tochn) AND (popytka3 <= 3)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka3 >= 1)and(popytka3 <= 3))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub

Sub znaok4_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(0.29)
tochn=CDbl(0.01)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans4.zna4.value="") OR (Not IsNumeric(Document.ans4.zna4.value)) Then
Alert "Необходимо ввести число"
ans4.zna4.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans4.zna4.value)
If ((Abs(otwet - potwet) <= tochn) AND (popytka4 <= 3)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka4 >= 1)and(popytka4 <= 3))) Then 
   Top.Hlp.Help.Document.Open
   Top.Hlp.Help.Document.Write "<HTML>"
   Top.Hlp.Help.Document.Write "<HEAD><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'><STYLE>"
   Top.Hlp.Help.Document.Write "A { text-decoration: none}"
   Top.Hlp.Help.Document.Write "A:hover {text-decoration: underline; color: #FF00FF}"
   Top.Hlp.Help.Document.Write "BODY {background-image : URL(img/b_help.gif); font-variant: normal; font-family: Times New Roman; background-color: #DFEFFF; color: black;}"
   Top.Hlp.Help.Document.Write "</STYLE></HEAD>"
   Top.Hlp.Help.Document.Write "<BODY LINK='#0000FF' ALINK='#0000FF' VLINK='#0000FF'>"
End If
If (Abs(otwet - potwet) <= tochn) AND (popytka4 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 4: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z8.htm TARGET=Main>Выход в меню занятия</A>"
   popytka4 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka4 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 4: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka4 = popytka4 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka4 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 4: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka4 = popytka4 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka4 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 4 не решена !</B></FONT><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z8.htm TARGET=Main>Выход в меню занятия</A>"
   popytka4 = popytka4 + 1
End If
If ((Abs(otwet - potwet) <= tochn) AND (popytka4 <= 3)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka4 >= 1)and(popytka4 <= 3))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub

Sub znaok51_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(0.95)
tochn=CDbl(0.01)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans5.zna51.value="") OR (Not IsNumeric(Document.ans5.zna51.value)) Then
Alert "Необходимо ввести число"
ans5.zna51.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans5.zna51.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka51 <= 3)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka51 >= 1)and(popytka51 <= 3))) Then 
   Top.Hlp.Help.Document.Open
   Top.Hlp.Help.Document.Write "<HTML>"
   Top.Hlp.Help.Document.Write "<HEAD><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'><STYLE>"
   Top.Hlp.Help.Document.Write "A { text-decoration: none}"
   Top.Hlp.Help.Document.Write "A:hover {text-decoration: underline; color: #FF00FF}"
   Top.Hlp.Help.Document.Write "BODY {background-image : URL(img/b_help.gif); font-variant: normal; font-family: Times New Roman; background-color: #DFEFFF; color: black;}"
   Top.Hlp.Help.Document.Write "</STYLE></HEAD>"
   Top.Hlp.Help.Document.Write "<BODY LINK='#0000FF' ALINK='#0000FF' VLINK='#0000FF'>"
End If
If (Abs(otwet - potwet) <= tochn) AND (popytka51 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 5, вопрос 1: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "Отвечайте на второй вопрос."
   popytka51 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka51 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 5, вопрос 1: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka51 = popytka51 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka51 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 5, вопрос 1: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka51 = popytka51 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka51 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 5 вопрос 1 не решена !</B></FONT><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z8.htm TARGET=Main>Выход в меню занятия</A>"
   popytka51 = popytka51 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka51 <= 3)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka51 >= 1)and(popytka51 <= 3))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub

Sub znaok52_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(0.50)
tochn=CDbl(0.01)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans5.zna52.value="") OR (Not IsNumeric(Document.ans5.zna52.value)) Then
Alert "Необходимо ввести число"
ans5.zna52.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans5.zna52.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka52 <= 3)) or ( (Abs(otwet - potwet)) > tochn AND ((popytka52 >= 1)and(popytka52 <= 3))) Then 
   Top.Hlp.Help.Document.Open
   Top.Hlp.Help.Document.Write "<HTML>"
   Top.Hlp.Help.Document.Write "<HEAD><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'><STYLE>"
   Top.Hlp.Help.Document.Write "A { text-decoration: none}"
   Top.Hlp.Help.Document.Write "A:hover {text-decoration: underline; color: #FF00FF}"
   Top.Hlp.Help.Document.Write "BODY {background-image : URL(img/b_help.gif); font-variant: normal; font-family: Times New Roman; background-color: #DFEFFF; color: black;}"
   Top.Hlp.Help.Document.Write "</STYLE></HEAD>"
   Top.Hlp.Help.Document.Write "<BODY LINK='#0000FF' ALINK='#0000FF' VLINK='#0000FF'>"
End If
If (Abs(otwet - potwet) <= tochn) AND (popytka52 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 5, вопрос 2: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z8.htm TARGET=Main>Выход в меню занятия</A>"
   popytka52 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka52 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 5, вопрос 2: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka52 = popytka52 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka52 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 5, вопрос 2: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka52 = popytka52 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka52 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 5 вопрос 2 не решена !</B></FONT><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z8.htm TARGET=Main>Выход в меню занятия</A>"
   popytka52 = popytka52 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka52 <= 3)) or ( (Abs(otwet - potwet)) >tochn AND ((popytka52 >= 1)and(popytka52 <= 3))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub

Sub znaok61_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(2.94)
tochn=CDbl(0.01)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans6.zna61.value="") OR (Not IsNumeric(Document.ans6.zna61.value)) Then
Alert "Необходимо ввести число"
ans6.zna61.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans6.zna61.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka61 <= 3)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka61 >= 1)and(popytka61 <= 3))) Then 
   Top.Hlp.Help.Document.Open
   Top.Hlp.Help.Document.Write "<HTML>"
   Top.Hlp.Help.Document.Write "<HEAD><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'><STYLE>"
   Top.Hlp.Help.Document.Write "A { text-decoration: none}"
   Top.Hlp.Help.Document.Write "A:hover {text-decoration: underline; color: #FF00FF}"
   Top.Hlp.Help.Document.Write "BODY {background-image : URL(img/b_help.gif); font-variant: normal; font-family: Times New Roman; background-color: #DFEFFF; color: black;}"
   Top.Hlp.Help.Document.Write "</STYLE></HEAD>"
   Top.Hlp.Help.Document.Write "<BODY LINK='#0000FF' ALINK='#0000FF' VLINK='#0000FF'>"
End If
If (Abs(otwet - potwet) <= tochn) AND (popytka61 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 6, вопрос 1: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "Отвечайте на второй вопрос."
   popytka61 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka61 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 6, вопрос 1: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka61 = popytka61 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka61 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 6, вопрос 1: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka61 = popytka61 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka61 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 6 вопрос 1 не решена !</B></FONT><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z8.htm TARGET=Main>Выход в меню занятия</A>"
   popytka61 = popytka61 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka61 <= 3)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka61 >= 1)and(popytka61 <= 3))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub

Sub znaok62_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(0.0)
tochn=CDbl(0.1)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans6.zna62.value="") OR (Not IsNumeric(Document.ans6.zna62.value)) Then
Alert "Необходимо ввести число"
ans6.zna62.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans6.zna62.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka62 <= 1)) or ( (Abs(otwet - potwet)) > tochn AND ((popytka62 >= 1)and(popytka62 <= 1))) Then 
   Top.Hlp.Help.Document.Open
   Top.Hlp.Help.Document.Write "<HTML>"
   Top.Hlp.Help.Document.Write "<HEAD><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'><STYLE>"
   Top.Hlp.Help.Document.Write "A { text-decoration: none}"
   Top.Hlp.Help.Document.Write "A:hover {text-decoration: underline; color: #FF00FF}"
   Top.Hlp.Help.Document.Write "BODY {background-image : URL(img/b_help.gif); font-variant: normal; font-family: Times New Roman; background-color: #DFEFFF; color: black;}"
   Top.Hlp.Help.Document.Write "</STYLE></HEAD>"
   Top.Hlp.Help.Document.Write "<BODY LINK='#0000FF' ALINK='#0000FF' VLINK='#0000FF'>"
End If
If (Abs(otwet - potwet) <= tochn) AND (popytka62 <= 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 6, вопрос 2: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "Отвечайте на третий вопрос."
   popytka62 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka62 = 1) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 6 вопрос 2 не решена !</B></FONT><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z8.htm TARGET=Main>Выход в меню занятия</A>"
   popytka62 = popytka62 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka62 <= 1)) or ( (Abs(otwet - potwet)) >tochn AND ((popytka62 >= 1)and(popytka62 <= 1))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub

Sub znaok63_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(0.00)
tochn=CDbl(0.01)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans6.zna63.value="") OR (Not IsNumeric(Document.ans6.zna63.value)) Then
Alert "Необходимо ввести число"
ans6.zna63.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans6.zna63.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka63 <= 3)) or ( (Abs(otwet - potwet)) > tochn AND ((popytka63 >= 1)and(popytka63 <= 3))) Then 
   Top.Hlp.Help.Document.Open
   Top.Hlp.Help.Document.Write "<HTML>"
   Top.Hlp.Help.Document.Write "<HEAD><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'><STYLE>"
   Top.Hlp.Help.Document.Write "A { text-decoration: none}"
   Top.Hlp.Help.Document.Write "A:hover {text-decoration: underline; color: #FF00FF}"
   Top.Hlp.Help.Document.Write "BODY {background-image : URL(img/b_help.gif); font-variant: normal; font-family: Times New Roman; background-color: #DFEFFF; color: black;}"
   Top.Hlp.Help.Document.Write "</STYLE></HEAD>"
   Top.Hlp.Help.Document.Write "<BODY LINK='#0000FF' ALINK='#0000FF' VLINK='#0000FF'>"
End If
If (Abs(otwet - potwet) <= tochn) AND (popytka63 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 6, вопрос 3: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z8.htm TARGET=Main>Выход в меню занятия</A>"
   popytka63 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka63 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 6, вопрос 3: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka63 = popytka63 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka63 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 6, вопрос 3: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka63 = popytka63 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka63 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 6 вопрос 3 не решена !</B></FONT><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z8.htm TARGET=Main>Выход в меню занятия</A>"
   popytka63 = popytka63 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka63 <= 3)) or ( (Abs(otwet - potwet)) >tochn AND ((popytka63 >= 1)and(popytka63 <= 3))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub
