function checkUniqueness(selector, key, upper, stripRegex1, stripRegex2, prepend) {
	jQuery(selector).
		focus(function(event){jQuery(event.target).parent().children("span.error_unique").html("");}).
		blur(function(event) {
			jQuery(this).parent().children("img.ajax_loader").show();
			value=jQuery(event.target).val(); // get the value
			if (value) {
				value=upper?(value.toUpperCase()):value; // conditionally convert to uppercase
			}
			if (stripRegex1) {
				value=value.replace(stripRegex1, ""); // strip using stripRegex
			}
			if (stripRegex2) {
				value=value.replace(stripRegex2, ""); // strip using stripRegex
			}
			if (prepend) {
				value=prepend+value; // add the prepend value
			}
			jQuery.getJSON(
				'/resource/client/isUnique.php', 
				{'key':key, 'value':(upper?(value.toUpperCase()):value) , 'casino':1351}, 
				function(data) {
					jQuery(selector).parent().children("img.ajax_loader").hide();
					switch(data.response){
					case 'yes':
						jQuery(selector).parent().children("span.error_unique").html('Is already in use. Please choose another.');
						break;
					case 'no':
					case 'failed':
					default:
						break;
					}
				});
		});
};