jquery(function () {
	jquery("#leavedraftyes").unbind("click").click(function()
	{
		jquery.ajax({
			url: consts.siteroot + "/" + consts.consumerUsername + "/leavedraftyes?" + consts.requestQuerystring,
			type: "POST",
			dataType: "json",
			cache: false,
			success: function(data)
			{
				window.location.href = data.retururl;
			}
		});
	});
	
	jquery("#backtodraft").unbind("click").click(function()
	{
		var url = jquery('#PendingForm').val();
		window.location.href = url;
	});
	
	jquery("#restartform").unbind("click").click(function () {
		var url = jquery('#url').val();
		window.location.href = url;
	});
	
	jquery('.acc-content').hide();
	jquery('.accordion h4 a').click(function (e) {
		if (jquery(this).parent().hasClass('current')) {
			jquery(this).parent()
				.removeClass('current')
				.next('.acc-content').slideUp(200);
		} else {
			jquery(document).find('.current')
				 .removeClass('current')
				 .next('.acc-content').slideUp(200);
			jquery(this).parent()
				  .addClass('current')
				  .next('.acc-content').slideDown(200);
		}
		e.preventDefault();
	});
});
