var send_post = function ( form_id, url1, id1, url2, id2, timeout ) {
	if (
		document.getElementById( id1 ),
		document.getElementById( form_id ) && url1
	) {
		var post_data = $('#' +form_id).serialize();
		$.ajax({
			type: "POST",
			data: post_data,
			url: url1,
			success: function( data ){
				$("#"+id1).html( data );
				if ( url2 )
					setTimeout(function(){
						$.ajax({
							type: "POST",
							data: post_data,
							url: url2,
							success: function( data ) {
								$("#"+id2).html( data );
							}
						})
					},timeout);
			}
		})
	} else
		alert('error: bad data!');
}
var send_get = function ( url1, id1, url2, id2, timeout ) {
	if ( document.getElementById( id1 ) && url1 ) {
		$.ajax({
			url: url1,
			success: function( data ){
				$("#"+id1).html( data );
				if ( url2 )
					setTimeout(function(){
						$.ajax({
							url: url2,
							success:function( data ){
								$("#"+id2).html( data );
							}
						})
					},timeout);
			}
		})
	} else
		alert('error: bad data!');
}
