Dim popytka11
Dim popytka12
Dim popytka13
Dim popytka21
Dim popytka22
Dim popytka3
Dim popytka4
Dim popytka51
Dim popytka52
Dim popytka53
Dim popytka54
Dim popytka61
Dim popytka62
Dim popytka71
Dim popytka72
Dim popytka73
popytka11 = Cbyte(1)
popytka12 = Cbyte(1)
popytka13 = Cbyte(1)
popytka21 = Cbyte(1)
popytka22 = Cbyte(1)
popytka3 = Cbyte(1)
popytka4 = Cbyte(1)
popytka51 = Cbyte(1)
popytka52 = Cbyte(1)
popytka53 = Cbyte(1)
popytka54 = Cbyte(1)
popytka61 = Cbyte(1)
popytka62 = Cbyte(1)
popytka71 = Cbyte(1)
popytka72 = Cbyte(1)
popytka73 = Cbyte(1)

Sub znaok11_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(0.128)
tochn=CDbl(0.001)

' Проверка вводимого числа (Текст или не текст)
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 <= 3)) or ( (Abs(otwet - potwet)) > tochn AND ((popytka11 >= 1)and(popytka11 <= 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 (popytka11 <= 3) 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=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka11 = popytka11 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka11 = 2) 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 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 1, вопрос 1: Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z3.htm TARGET=Main>Выход в меню занятия</A>"
   popytka11 = popytka11 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka11 <= 3)) or ( (Abs(otwet - potwet)) >tochn AND ((popytka11 >= 1)and(popytka11 <= 3))) 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(0.512)
tochn=CDbl(0.001)

' Проверка вводимого числа (Текст или не текст)
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 <= 3)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka12 >= 1)and(popytka12 <= 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 (popytka12 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 1, вопрос 2: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "Отвечайте на следующий вопрос."
   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=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka12 = popytka12 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka12 = 2) 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 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 1, вопрос 2: Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z3.htm TARGET=Main>Выход в меню занятия</A>"
   popytka12 = popytka12 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka12 <= 3)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka12 >= 1)and(popytka12 <= 3))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub

Sub znaok13_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(0.488)
tochn=CDbl(0.001)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans1.zna13.value="") OR (Not IsNumeric(Document.ans1.zna13.value)) Then
Alert "Необходимо ввести число"
ans1.zna13.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans1.zna13.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka13 <= 3)) or ( (Abs(otwet - potwet)) > tochn AND ((popytka13 >= 1)and(popytka13 <= 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 (popytka13 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 1, вопрос 3: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z3.htm TARGET=Main>Выход в меню занятия</A>"
   popytka13 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka13 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 1, вопрос 3: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka13 = popytka13 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka13 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 1, вопрос 3: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka13 = popytka13 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka13 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 1, вопрос 3: Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z3.htm TARGET=Main>Выход в меню занятия</A>"
   popytka13 = popytka13 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka13 <= 3)) or ( (Abs(otwet - potwet)) >tochn AND ((popytka13 >= 1)and(popytka13 <= 3))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub

Sub znaok21_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(0.21)
tochn=CDbl(0.01)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans2.zna21.value="") OR (Not IsNumeric(Document.ans2.zna21.value)) Then
Alert "Необходимо ввести число"
ans2.zna21.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans2.zna21.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka21 <= 3)) or ( (Abs(otwet - potwet)) > tochn AND ((popytka21 >= 1)and(popytka21 <= 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 (popytka21 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 2, вопрос 1: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "Отвечайте на второй вопрос."
   popytka21 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka21 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 2, вопрос 1: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka21 = popytka21 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka21 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 2, вопрос 1: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka21 = popytka21 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka21 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 2, вопрос 1: Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z3.htm TARGET=Main>Выход в меню занятия</A>"
   popytka21 = popytka21 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka21 <= 3)) or ( (Abs(otwet - potwet)) >tochn AND ((popytka21 >= 1)and(popytka21 <= 3))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub


Sub znaok22_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(0.027)
tochn=CDbl(0.001)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans2.zna22.value="") OR (Not IsNumeric(Document.ans2.zna22.value)) Then
Alert "Необходимо ввести число"
ans2.zna22.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans2.zna22.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka22 <= 3)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka22 >= 1)and(popytka22 <= 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 (popytka22 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 2, вопрос 2: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z3.htm TARGET=Main>Выход в меню занятия</A>"
   popytka22 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka22 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 2, вопрос 2: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka22 = popytka22 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka22 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 2, вопрос 2: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka22 = popytka22 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka22 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 2, вопрос 2: Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z3.htm TARGET=Main>Выход в меню занятия</A>"
   popytka22 = popytka22 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka22 <= 3)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka22 >= 1)and(popytka22 <= 3))) 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(0.976)
tochn=CDbl(0.001)

' Проверка вводимого числа (Текст или не текст)
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=z3.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=z3.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.952)
tochn=CDbl(0.001)

' Проверка вводимого числа (Текст или не текст)
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=z3.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=z3.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.46)
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=z3.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.88)
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 "Отвечайте на следующий вопрос."
   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=z3.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 znaok53_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(0.12)
tochn=CDbl(0.01)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans5.zna53.value="") OR (Not IsNumeric(Document.ans5.zna53.value)) Then
Alert "Необходимо ввести число"
ans5.zna53.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans5.zna53.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka53 <= 3)) or ( (Abs(otwet - potwet)) > tochn AND ((popytka53 >= 1)and(popytka53 <= 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 (popytka53 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 5, вопрос 3: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "Отвечайте на следующий вопрос."
   popytka53 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka53 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 5, вопрос 3: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka53 = popytka53 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka53 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 5, вопрос 3: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka53 = popytka53 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka53 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 5, вопрос 3: Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z3.htm TARGET=Main>Выход в меню занятия</A>"
   popytka53 = popytka53 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka53 <= 3)) or ( (Abs(otwet - potwet)) >tochn AND ((popytka53 >= 1)and(popytka53 <= 3))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub

Sub znaok54_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(0.58)
tochn=CDbl(0.01)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans5.zna54.value="") OR (Not IsNumeric(Document.ans5.zna54.value)) Then
Alert "Необходимо ввести число"
ans5.zna54.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans5.zna54.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka54 <= 3)) or ( (Abs(otwet - potwet)) > tochn AND ((popytka54 >= 1)and(popytka54 <= 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 (popytka54 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 5, вопрос 4: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z3.htm TARGET=Main>Выход в меню занятия</A>"
   popytka54 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka54 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 5, вопрос 4: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka54 = popytka54 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka54 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 5, вопрос 4: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka54 = popytka54 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka54 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 5, вопрос 4: Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z3.htm TARGET=Main>Выход в меню занятия</A>"
   popytka54 = popytka54 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka54 <= 3)) or ( (Abs(otwet - potwet)) >tochn AND ((popytka54 >= 1)and(popytka54 <= 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(0.00004)
tochn=CDbl(0.00001)

' Проверка вводимого числа (Текст или не текст)
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=z3.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.00001)
tochn=CDbl(0.00001)

' Проверка вводимого числа (Текст или не текст)
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 <= 3)) or ( (Abs(otwet - potwet)) > tochn AND ((popytka62 >= 1)and(popytka62 <= 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 (popytka62 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 6, вопрос 2: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z3.htm TARGET=Main>Выход в меню занятия</A>"
   popytka62 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka62 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 6, вопрос 2: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka62 = popytka62 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka62 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 6, вопрос 2: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka62 = popytka62 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka62 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 6 вопрос 2 не решена !</B></FONT><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z3.htm TARGET=Main>Выход в меню занятия</A>"
   popytka62 = popytka62 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka62 <= 3)) or ( (Abs(otwet - potwet)) >tochn AND ((popytka62 >= 1)and(popytka62 <= 3))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub

Sub znaok71_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(0.937)
tochn=CDbl(0.001)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans7.zna71.value="") OR (Not IsNumeric(Document.ans7.zna71.value)) Then
Alert "Необходимо ввести число"
ans7.zna71.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans7.zna71.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka71 <= 3)) or ( (Abs(otwet - potwet)) > tochn AND ((popytka71 >= 1)and(popytka71 <= 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 (popytka71 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 7, вопрос 1: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "Отвечайте на следующий вопрос."
   popytka71 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka71 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 7, вопрос 1: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka71 = popytka71 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka71 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 7, вопрос 1: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka71 = popytka71 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka71 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 7, вопрос 1: Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z3.htm TARGET=Main>Выход в меню занятия</A>"
   popytka71 = popytka71 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka71 <= 3)) or ( (Abs(otwet - potwet)) >tochn AND ((popytka71 >= 1)and(popytka71 <= 3))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub


Sub znaok72_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(0.077)
tochn=CDbl(0.001)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans7.zna72.value="") OR (Not IsNumeric(Document.ans7.zna72.value)) Then
Alert "Необходимо ввести число"
ans7.zna72.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans7.zna72.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka72 <= 3)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka72 >= 1)and(popytka72 <= 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 (popytka72 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 7, вопрос 2: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "Отвечайте на следующий вопрос."
   popytka72 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka72 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 7, вопрос 2: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka72 = popytka72 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka72 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 7, вопрос 2: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka72 = popytka72 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka72 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 7, вопрос 2: Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z3.htm TARGET=Main>Выход в меню занятия</A>"
   popytka72 = popytka72 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka72 <= 3)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka72 >= 1)and(popytka72 <= 3))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub

Sub znaok73_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(0.077)
tochn=CDbl(0.001)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans7.zna73.value="") OR (Not IsNumeric(Document.ans7.zna73.value)) Then
Alert "Необходимо ввести число"
ans7.zna73.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans7.zna73.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka73 <= 3)) or ( (Abs(otwet - potwet)) > tochn AND ((popytka73 >= 1)and(popytka73 <= 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 (popytka73 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 7, вопрос 3: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z3.htm TARGET=Main>Выход в меню занятия</A>"
   popytka73 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka73 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 7, вопрос 3: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka73 = popytka73 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka73 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 7, вопрос 3: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka73 = popytka73 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka73 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 7, вопрос 3: Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z3.htm TARGET=Main>Выход в меню занятия</A>"
   popytka73 = popytka73 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka73 <= 3)) or ( (Abs(otwet - potwet)) >tochn AND ((popytka73 >= 1)and(popytka73 <= 3))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub

