// JavaScript Document
function formcheck(test) {

	verify.docheck('notblank',document.form['details[name]'].value,'','You must enter your name');
	verify.docheck('notblank',document.form['details[company]'].value,'','You must enter your company');
	verify.docheck('notblank',document.form['details[address1]'].value,'','You must enter your address');
	verify.docheck('notblank',document.form['details[city]'].value,'','You must enter your city');
	verify.docheck('notblank',document.form['details[county]'].value,'','You must enter your county/state');
	verify.docheck('notblank',document.form['details[postcode]'].value,'','You must enter your postcode/zip');
	verify.docheck('notblank',document.form['details[countryid]'].value,'','You must enter your county');
	verify.docheck('notblank',document.form['details[preferred_currency]'].value,'','You must select your preferred currency');
	verify.docheck('email',document.form['details[email]'].value,'','You must enter your email address');
	if ((document.form['details[password]'].value == '') && (document.form['details[passwordconfirm]'].value == '')) {
		document.getElementById('pwmatchyes').style.display = 'none';
		document.getElementById('pwmatchno').style.display = 'none';
	} else {
		if (verify.docheck('match',document.form['details[password]'].value,document.form['details[passwordconfirm]'].value,'Your Password does not match Password Confirm') == true) {
			document.getElementById('pwmatchyes').style.display = 'none';
			document.getElementById('pwmatchno').style.display = 'inline';
		} else {
			document.getElementById('pwmatchyes').style.display = 'inline';
			document.getElementById('pwmatchno').style.display = 'none';		
		};
	};
	
	if (verify.fail == true) {
		document.form.submit2.disabled = true;
		if (test == "submit") { 
			alert(verify.failedon);
			verify.resetall();
			return false;
		};
	} else {
		document.form.submit2.disabled = false
		if (test == "submit") {
//			alert('ok');
			document.form.submit();
			verify.resetall();
			return true;
		};	
	};
	verify.resetall();
} //end function

setInterval("formcheck('check')",100)