// JavaScript Document

function formcheck(test) {
	verify.docheck('notblank',document.form['details[name]'].value,'','Name should not be blank');
	verify.docheck('notblank',document.form['details[country]'].value,'','You must select a country');
	if (getradioboxval('form','details[calltype]') == 'email') {
		verify.docheck('email',document.form['details[email]'].value,'','An email address must be entered');
	} else { 
		verify.docheck('notblank',document.form['details[phone]'].value,'','A phone number must be entered');
	}
	verify.docheck('notmatch',document.form['details[product]'].value, 'none','A Product should be selected');	
	verify.docheck('notblank',document.form['details[problem]'].value,'','You must note down your problem');
	
	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") {
			document.form.submit();
			verify.resetall();
			return true;
		};	
	};
	verify.resetall();
} //end function

setInterval("formcheck('check')",100)
