function popup(mylink, windowname) {
				var href;
				if (! window.focus) {
								return true;
									
				}
				if (typeof(mylink) === 'string') {
								href = mylink;
				}
				else {
								href = mylink.href;
								window.open(href, windowname, 'width=400,height=400,scrollbars=yes');
								return false;
				}
}

function check() {
				var agreebox=0;
				inputname = document.form.name.value;
				inputcode=document.form.security_code.value;
				inputpassword = document.form.password.value;
				inputconfirmpassword = document.form.confirmpassword.value;
				inputemail = document.form.email.value;
				
				if (document.form.agree.checked) {
								agreebox = 1; 
				}
				if (inputname==""){
								document.form.name.focus();
								alert("Please type in an name");
								return false;
				}
				else if (inputemail==""){
								document.form.email.focus();
								alert("Please type in an email address");
								return false;
				}
			
				else if (inputpassword==""){
								document.form.password.focus();
								alert("Please type in a password");
								return false;
				}
				else if (inputconfirmpassword==""){
								document.form.confirmpassword.focus();
								alert("Please confirm password");
								return false;
				}
				else if (inputconfirmpassword!=inputpassword){
								document.form.confirmpassword.focus();
								alert("You haven't confirmed your password correctly");
								return false;
				}	
				else if (inputcode==""){
					document.form.security_code.focus();
					alert("Type in a security code");
					return false;
				}			
				
				
				else if (agreebox==0) {
								document.form.agree.focus();
								alert("Please tick this box to confirm this statement.");
								return false;
				}
				else{
								return true;
				}
				
}
