function Ajax(file, data, div)
{
	if ( div != 'ajax_opinion') document.getElementById(div).innerHTML = '<img src="i/loading.gif" style="position: absolute; margin: 0; z-index: 9999; " />' + document.getElementById(div).innerHTML;
	

 
	$.ajax({
	   type: "POST",
	   url: file,
	   data: data,
	   cache: false,
	   success: function(html){
	     $("#"+div).html(html);

	   }
	});

}

Date.ONE_SECOND = 1000;
Date.ONE_MINUTE = Date.ONE_SECOND * 60;
Date.ONE_HOUR = Date.ONE_MINUTE * 60;
Date.ONE_DAY = Date.ONE_HOUR * 24;
function nap (m) {var then = new Date(new Date().getTime() + m); while (new Date() < then) {}}

function AjaxFade(file, data, div)
{
	$("#"+div).fadeOut("slow");
	$.ajax({
	   type: "POST",
	   url: file,
	   data: data,
	   cache: false,
	   success: function(html){
	     $("#"+div).html(html);
		 $("#"+div).fadeIn("slow");
	   }
	});

}

function AjaxAppend(file, data, div)
{
	$.ajax({
	   type: "POST",
	   url: file,
	   data: data,
	   cache: false,
	   success: function(html){
	     $("#"+div).append(html);
	   }
	});
}


function reloadAjax(file, data, div)
{
	 AjaxAppend(file, data, div);
	 setTimeout('reloadAjax("'+file+'","'+ data+'","'+ div+'")', 2000);
}





function additionalAction(form_id) {
	var original_action = $("#"+form_id).attr("action");
	var add_action = $("#additional_action").val();
	$("#"+form_id).attr("action", original_action + add_action);
}
