$().ready(function() {

	$.validator.addMethod("notEqual", function(value, element, param) {
		return this.optional(element) || value != param;
	}, "Please specify a different (non-default) value");


	$.fn.center = function () {
		this.css("position","absolute");
		this.css("top", (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + "px");
		this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px");
		return this;
	}

	//delete confirmation
	$(".delete").click(function() {
		return confirm('Are you sure you wish to delete this record?');
	});

	/*
	 * Produce a popup that auto-closes
	 */
	function popup(message) {
		$.colorbox({html:'<p class="alert_popup">'+message.replace("\n", "<br />")+'</p>', width: '400px'});
	}
});
