(function($){
// http://blog.brandonaaron.net/2007/06/01/jquery-snippets-replace/
// returns the new element (that has replaced the old)
$.fn.replace_with = function(){
	var stack = [];
	return this.domManip(arguments, true, 1, function(_c){
		this.parentNode.replaceChild(_c, this);
		stack.push(_c);
	}).pushStack(stack);
};

$.fn.session_associate = function(){
	$(this).find(".sign-in, .sign-out").click(function(){
		popup_dialog.reloadable(this.href);
		return false;
	});
	return $(this);
};
})(jQuery);

$(document).ready(function(){ $("body").session_associate() });
