<!--#include file="action.asp"-->
<%
    x = CInt(Request.Form("x"))
    y = CInt(Request.Form("y"))
    bug.iCurr = iCurr
    
    If Not isEmpty(Request.QueryString("help")) Then
        sCorrect = Request.Cookies("Correct")
        aCorrect = Split(bug.bugsString(),"|")
        For i=0 To UBound(aCorrect)
            If InStr(sCorrect,aCorrect(i))<1 Then
                aCorr=Split(aCorrect(i),",")
                iCorrX = aCorr(0) : iCorrY = aCorr(1)
                SetCookies "Correct", GetCookies("Correct") & "|" & aCorrect(i)
                WriteLn( "<script language='Jscript' for='window' event='onload'>" )
                WriteLn( " showDIV(1,"&iCorrX&","&iCorrY&");" )
                WriteLn( " showDIV(1,"&iCorrX+370&","&iCorrY&");" )
                WriteLn( " with(window.parent)if(clickOK)clickOK();" )
                WriteLn( " with(window.parent)if(iBugsTime)iBugsTime=iBugsTime-10;" )
                WriteLn( "</script>" )
                Exit For
            End If
        Next
	Else
		If bug.Check(x,y) Then
			Response.Cookies("Correct") = Request.Cookies("Correct") & "|" & bug.x & "," & bug.y
			WriteLn( "<script language='JScript' for='window' event='onload'>" )
			WriteLn( "showDIV(1,"&bug.x&","&bug.y&");" )
			WriteLn( "showDIV(1,"&bug.x+370&","&bug.y&");" )
			WriteLn( "with(window.parent)if(clickOK)clickOK();" )
			WriteLn( "</script>" )
		Else
			WriteLn( "<script language='JScript' for='window' event='onload'>" )
			WriteLn( "showDIV(0,"&x&","&y&");" )
			WriteLn( "showDIV(0,"&x+370&","&y&");" )
			WriteLn( "with(window.parent)if(iBugsTime)iBugsTime=iBugsTime-10;" )
			WriteLn( "</script>" )
		End If 
    End If
%>
<script language="JScript">
function showDIV(k,x,y){
    with(window.parent){
        arrDiv=document.createElement("DIV");
        document.body.insertBefore(arrDiv);
        arrDiv.style.position="absolute";
        arrDiv.style.left=x-10;
        arrDiv.style.top=y-16;
        if(k==1){
            arrDiv.innerHTML="<img src='Correct.gif'></img>";
        }else{
            arrDiv.innerHTML="<img src='Incorrect.gif'></img>";
            setTimeout("document.all["+arrDiv.sourceIndex+"].style.display='none'",1200);
        }
    }
}
</script>
