/**
* er_mm form validation
* elem = element to bind, by default it uses the form but you can pass in any selector like 'body' or '#containerdiv'
* make sure the elem tag is big enough for this to work!
* Version: Jan 9, 2012
*/
(function( $ ){
	$.fn.er_mm = function(elem) {

	if(elem == null) {
		elem = this;
	} else {
		elem = $(elem);
	}

	var formElementsHTML =  '<input type="hidden" class="er_mm" name="er_mm" value="0" />';

	this.append(formElementsHTML);

	elem.mousemove(function(e){
		var er_mm = $('.er_mm').val();
		er_mm++;
		if(er_mm > 50) {
			elem.unbind(e);
		}
		$('.er_mm').val(er_mm);
	});

	return this;

	};
})( jQuery );
