	var currentAdviceName = null;
	var Validation_showAdvice = Validation.showAdvice;
	var Validation_hideAdvice = Validation.hideAdvice;
	var hasValidated = false;


	Validation.showAdvice = function(elm, advice, adviceName) {
		var msg = '';
		switch(adviceName) {
			case 'validate-one-required':
				msg = 'You seem to have missed some fields, please check and try again';
				jQuery(elm).parent().parent().find('span.error-indicator').fadeIn('slow');
				jQuery(elm).parent().addClass('invalid');
				break;
			case 'validate-select':
			case 'required-entry':
				msg = 'You seem to have missed some fields, please check and try again';
				jQuery(elm).parent().find('span.error-indicator').fadeIn('slow');
				jQuery(elm).addClass('invalid');
				break;
			case 'validate-password':
				msg = 'Please enter 6 or more characters. Leading or trailing spaces will be ignored.';
				jQuery(elm).parent().find('span.error-indicator').fadeIn('slow');
				jQuery(elm).addClass('invalid');
				break;
			case 'validate-emails':
				msg = 'Please enter a valid email address, please change and try again';
				jQuery(elm).parent().find('span.error-indicator').fadeIn('slow');
				jQuery(elm).addClass('invalid');
				break;
			case 'validate-products-used':
				msg = 'Please select atleast one category and product.';
				jQuery(elm).parent().find('span.error-indicator').fadeIn('slow');
				jQuery(elm).addClass('invalid');
				break;
			case 'validate-rating':
				msg = 'Please select one of each of the ratings above.';
				jQuery(elm).parent().find('span.error-indicator').fadeIn('slow');
				jQuery(elm).addClass('invalid');
				break;
			case 'validate-cpassword':
				msg = 'Oops, your passwords don\'t seem to match, please re-enter and try again.';
				jQuery(elm).parent().find('span.error-indicator').fadeIn('slow');
				jQuery(elm).addClass('invalid');
				break;
			case 'validate-email':
				msg = 'Please enter a valid email address, please change and try again';
				jQuery(elm).parent().find('span.error-indicator').fadeIn('slow');
				jQuery(elm).addClass('invalid');
				break;
            case 'validate-number':
				msg = 'Please enter a valid number in this field';
				jQuery(elm).parent().find('span.error-indicator').fadeIn('slow');
				jQuery(elm).addClass('invalid');
				break;
            case 'validate-phoneStrict':
				msg = 'Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890.';
				jQuery(elm).parent().find('span.error-indicator').fadeIn('slow');
				jQuery(elm).addClass('invalid');
				break;
            case 'validate-uk-postcode':
				msg = 'Please enter a valid UK postcode.';
				jQuery(elm).parent().find('span.error-indicator').fadeIn('slow');
				jQuery(elm).addClass('invalid');
				break;
			case 'validate-email-exist':
				msg = 'You\'re already a member, please sign in by entering your details to the left';
				jQuery(elm).parent().find('span.error-indicator').fadeIn('slow');
				jQuery(elm).addClass('invalid');
				break;
		}

		if (!hasValidated) {
			jQuery('#form-error').fadeIn('slow');
			jQuery('#form-error-msg').html(msg);
			currentAdviceName = adviceName;
		}
	}
	Validation.hideAdvice = function(elm, advice, adviceName) {
		Validation_hideAdvice.call(this, elm, advice);
		if(advice != null) {
			switch(adviceName) {
				case 'validate-one-required':
					jQuery(elm).parent().removeClass('invalid');
					jQuery(elm).parent().parent().find('span.error-indicator').fadeOut('slow');
					break;
				default:
					jQuery(elm).parent().find('span.error-indicator').fadeOut('slow');
					jQuery(elm).removeClass('invalid');
					break;
			}
		}
	}
	Validation.targetForm = 'ako';

