
	
// Set Variables
var site = '/';  // this needs to be the 'root' of the site
	
	var first	=	(Math.floor(Math.random()*10))+'';
	var second	=	(Math.floor(Math.random()*10))+'';
	var third	=	(Math.floor(Math.random()*10))+'';
	var fourth	=	(Math.floor(Math.random()*10))+'';
	var fith	=	(Math.floor(Math.random()*10))+'';
	
	var captcha	=	(first + second + third + fourth + fith);


	
function jscaptcha()
{
// Display the Captcha Images
	document.write("<label>&nbsp;</label>");
	document.write("<div id=\"jscaptcha\" style=\"border: 1px solid #f90; width: 150px;\">");
	document.write("<img src=\"" + site + "images/" + first	+ ".gif\" alt=\"\">");
	document.write("<img src=\"" + site + "images/" + second + ".gif\" alt=\"\">");
	document.write("<img src=\"" + site + "images/" + third + ".gif\" alt=\"\">");
	document.write("<img src=\"" + site + "images/" + fourth + ".gif\" alt=\"\">");
	document.write("<img src=\"" + site + "images/" + fith + ".gif\" alt=\"\">");
	document.write("</div>");
// Display the Input Box
	document.write("<label>Enter Image Numbers</label>");
	document.write("<input onblur=\"return jscaptchaSubmit(this.form)\" type=\"text\" name=\"jscaptchaInput\">");
	
}

function jscaptchaSubmit(frm) {
     
	if(frm.jscaptchaInput.value != captcha)
	{
	    alert("Please double check the numbers you entered");
	    btn.disabled = true;
		valid = 'false';		
	}
	else {
	    btn.disabled = false;
    	valid = 'true';
	}
	return valid;
}

function ShowForm() {
    //document.getElementById("Msg").style.display = "none";
    document.getElementById("Frm").style.display = "block";
    
}

function ShowMsg() {
    document.getElementById("Frm").style.display = "none";
    document.getElementById("Msg").style.display = "block";

}

function document.onkeydown() {
    if (event.keyCode == 116) { //F5
        event.keyCode = 0;
        event.cancelBubble = true;
        return false;
     }
  
}
