(function($) {
$(function() {
	// ajaxform can't handle file inputs!
	$('input[type=file]').each(function() {
		$input = $(this);
		name = $input.attr('name');
		id = $input.attr('id');
		klass = $input.attr('class');
		$input.replaceWith($('<input type="text" class="'+klass+'" name="'+name+'" id="'+id+'" />'));
	});

	// Set up ajax form submit for the package selection
	if($('#Form_OrderForm').length) {
		$.getScript('/sitesprocket/javascript/jquery.form.js', function() {
			$('#Form_OrderForm input[name^=Option_]').unbind("click").click(function() {
				$('#Form_OrderForm').ajaxSubmit({
					target : '#price-update'
				});
			});
		});
	}
	
	// Assign behaviours to the results table
	if($('.project_results').length) {
		$('.project_results thead a, .project_results tfoot a').live("click", function() {
			$t = $(this);
			$('.project_results').load($t.attr('href'));
			return false;
		});
		$('.project_results tfoot select').live("change",function() {
			$t = $(this);
			$('.project_results').load(
				$t.metadata().url,
				{'PerPage' : $t.val()}
			);
		});
	}
		
	// Add a message
	if($('#Form_CreateMessageForm').length) {	
		$.getScript('/sitesprocket/javascript/jquery.form.js', function() {
			$('#Form_CreateMessageForm').live("submit", function() {
				$(this).ajaxSubmit({
					target : '#messages',
					success : function() {
						$('textarea, input[name=Attachments').val('');
					}
				});
				return false;
			});
		});
	}
	
	// Payment form
	if($('.custom_address').length) {
		$check = $('input[id$=CustomAddress]');
		$address = $('.custom_address');
		if(!$check.is(':checked')) {
			$address.hide();
		}
		$check.click(function() {
			if($(this).is(':checked')) {
				$address.slideDown();
			}
			else {
				$address.slideUp();
			}
		});
	}
	
	// Lightbox
	if($("div.more-box").length) {	
		$.getScript("/sitesprocket/javascript/fancybox.js", function() {
			$("div.more-box").hide();
			$("a[rel=fb]").fancybox({hideOnContentClick:false, frameWidth:600, frameHeight:400});			
		});
	}
	
	
	
});
})(jQuery);
@@ -1367,18 +1367,78 @@
 textarea
-, 
+').val('');%0A%09%09%09%09%09%09$('.uploadify-filename').remove();%0A%09%09%09%09%09%09$('
 input%5Bna
@@ -1439,16 +1439,17 @@
 put%5Bname
+%5E
 =Attachm
@@ -1452,25 +1452,27 @@
 achments
+%5D
 ').
-val(''
+remove(
 );%0A%09%09%09%09%09

FIX - fixed uploadify holding onto files after a message is posted.