window.onload = function() {

	// get the captcha div on the page
	var captchaNode = document.getElementById("captcha");
	/* img elements in the form of strings
	 could loop to create them and use a better naming convention
	 for the code images, but this was faster. */
	var a = new Array(3);
	a[0] = '<img class="vimg" src="1_glyph.gif" alt="1" />';
	a[1] = '<img class="vimg" src="y_glyph.gif" alt="Y" />';
	a[2] = '<img class="vimg" src="t_glyph.gif" alt="T" />';	
	a[3] = '<img class="vimg" src="z_glyph.gif" alt="Z" />';
	
	for(var i = 0; i < a.length; i++) {
		var vImg = document.createElement("div");
		vImg.className = "captchawrapper"; 
		vImg.innerHTML = a[i];
		a[i] = vImg;
		captchaNode.appendChild(a[i]);
	}		
}
	// check the code
	function verifyCode() {
		var codeVal = document.forms[0].captchaverify.value;	
		var codeStr = "1YTZ";
		
		if(codeVal == codeStr) {
			formsubmit(document.forms[0]);
		}
		else {
			alert("Incorrect code. Please enter the correct key (key is case sensitive).");
		}
	}
