fadeIn = function(div) {
	if($(div).fade){ $(div).fade({ duration: 0.3, from: 0.0, to: 1 }); }
	$('shipmentsBox').show();
}
loadContent = function(div,url) {
	if($(div).fade){ $(div).fade({ duration: 0.4, from: 1, to: 0.6 }); }
	new Ajax.Updater(div,url,{
		evalScripts: true,
		onSuccess:function(){
			$(div).fade({ duration: 0.3, from: 0.6, to: 1 });
		}
	});
}
submitForm = function(div,url,formName) {
	$(div).fade({ duration: 0.4, from: 1, to: 0.6 });
	new Ajax.Updater(div,url,{
        method: "POST", asynchronous: true, parameters: Form.serialize(formName),
        onFailure: function(oXHR){ $(div).update(oXHR.statusText); },							
        onSuccess: function(oXHR){
			$(div).fade({ duration: 0.3, from: 0.6, to: 1 });
			$(div).update(oXHR.responseText);
		}
	});
	return false;
}
submitFormModal = function(url,formName,evalFunctions) {
    new Ajax.Request(url,{
        method: "POST", asynchronous: true, parameters: Form.serialize(formName),
		onSuccess: function(){
			Modalbox.hide();
			eval(evalFunctions);
		}
	});
	return false;
}
Ajax.Responders.register({
	onCreate: showProcessing,
	onComplete: hideProcessing
});
function showProcessing() {
	if(Ajax.activeRequestCount > 0){
		$("status").show();
	}
}
function hideProcessing() {
	if(Ajax.activeRequestCount <= 0){
		$("status").fade({ duration: 0.5 });
	}
}