function login_form(path, success_page) {
	var url = addParameter(path, "success=" + escape(success_page));
	url = addParameter(url, "path=" + getURLParam(location.href, "path"));
	url = addParameter(url, "query=" + getURLParam(location.href, "query"));
	
	new Ajax.Request(url, {
		method: 'get',
		parameters: { randid: Math.random() },
		onSuccess: function(transport) {
			showLoginModal(transport.responseText);
		}
	});
}

function conditionally_show_login_form(path) {
	var matchingIndex = window.location.href.indexOf('login=t');
	
	if (matchingIndex > -1) {
		login_form(path, '');
	}
}

function change_search_action(path) {
	$('search').action = path;
}

function forgot_password_form(path) {
	new Ajax.Request(path, {
		method: 'get',
		parameters: { randid: Math.random() },
		onSuccess: function(transport) {
			showModalDialog(transport.responseText);
		}
	});
}

function submit_forgot_password_form(servlet) {

	// POST
	new Ajax.Request(servlet, {
		method: 'post',
		parameters: { randid: Math.random() },
		onSuccess: function(transport) {
			showModalDialog(transport.responseText);
		},
		postBody: get_form_values('fp')
	});
}

function go_to_login_page() {
}

function conditionally_show_shipping_info(page) {
	var matchingIndex = window.location.href.indexOf('delivery_info=t');
	
	if (matchingIndex > -1) {
		show_modal(page);
	}
}
