$().ready(function(){
	$('form').bind('submit',function(){
		rtnVar = true;
		
		$(this).find(':input[required]').each(function(){
			if ($(this).val() == "") {
				$(this).addClass('errorBox');
				rtnVar = false;
			} else {
				$(this).removeClass('errorBox');
			}
		});
		
		$(this).find(':checkbox[required]').each(function(){
			if (!$(this).attr('checked')) {
				$(this).addClass('errorBox');
				rtnVar = false;
			} else {
				$(this).removeClass('errorBox');
			}
		});
		
		if (!rtnVar) {
			alert('Please complete all required fields.');
		}
		
		return rtnVar;
	});
});
