function AsyncPost(form) {
	$.ajax({
		cache: false,
		data: $(form).serialize(),
		type: $(form).attr('method'),
  		url: $(form).attr('action'),
  		success: function(data) {},
		error: function(obj, str, ex) {}
	});
}
function AsyncLoginPost(form) {
	$.ajax({
		cache: false,
		data: $(form).serialize(),
		type: $(form).attr('method'),
  		url: $(form).attr('action'),
  		success: function(data) { 
			if (data == '1') { 
				window.location = '/Forum/'; 
			} else { 
				window.scrollTo(0,0);		
				$('#mask').show();
				var left = ($.clientCoords().width/2)-200;
				var top = ($.clientCoords().height/2)-133;
				$('#oops').css('left', left).css('top', top).show();			
			}
		},
		error: function(obj, str, ex) {
			
		}
	});
}
function AsyncAdminLoginPost(form) {
	$.ajax({
		cache: false,
		data: $(form).serialize(),
		type: $(form).attr('method'),
  		url: $(form).attr('action'),
  		success: function(data) { 
			if (data == '1') { 
				var qs = querySt('returnurl');
				if (qs.length > 0)
					window.location = unescape(qs);
				else
					window.location = '/Admin/Index.php';
			} else { 
				window.scrollTo(0,0);		
				$('#mask').show();
				var left = ($.clientCoords().width/2)-200;
				var top = ($.clientCoords().height/2)-133;
				$('#oops').css('left', left).css('top', top).show();			
			}
		},
		error: function(obj, str, ex) {
			
		}
	});
}
function AsyncAdminPost(form, arg, id, redir) {
	$.ajax({
		cache: false,
		data: $(form).serialize(),
		type: $(form).attr('method'),
  		url: $(form).attr('action') + '?arg=' + arg + '&id=' + id,
  		success: function(data) { 
			window.location = redir;
		},
		error: function(obj, str, ex) {
		}
	});
}
function querySt(ji) {
	hu = window.location.search.substring(1);
	gy = hu.split('&');
	for (i = 0; i < gy.length; i++) {
		ft = gy[i].split('=');
		if (ft[0] == ji) {
			return ft[1];
		}
	}
}

