Nie jestem pewien czy dobry dział ale skoro szukam gotowego rozwiązania to chyba tutaj

Napisałem shoutbox i teraz chcialbym go ulepszyć poprzez dodawanie wiadomości bez odświeżania strony, szukałem troche na forach ale nic nie znalazłem gdyż albo skrypt nie działał poprawnie albo nie umiałem go skonfigurować do swoich potrzeb...
Mógłby ktoś zedytować shoutbox tak aby wiadomości były dodawane bez odświeżania strony?
sb.php<?php
require("config.php");
?>
<script type="text/javascript" src="../mintAjax.js"></script>
<script type="text/javascript">
function refresh() {
var req = mint.Request();
req.OnSuccess = function () { document.getElementById("massages").innerHTML = this.responseText;},
req.OnError = function () {document.getElementById("massages").innerHTML = "Wystąpił błąd !!! </br>" + this.responseText + "</br>" + req.xmlHttpRequest.statusText ;}
req.Send ("../sb2.php");
}
var ginter=setInterval(refresh, 1000);
</script>
<div id="shoutbox"></div>
<div style="background-color: #fff; width: 320px; padding-left: 10px; padding-top: 11px;">
<form name="sb" action="trans.php" method="post">
<?php
if(isset($_SESSION['user_id'])) { ?>
<input class="inputsb" type="text" name="massage">
<input type="hidden" name="autor" value="
<?php echo $user_name; ?>">
<input type="hidden" name="hour" value="
<?php echo $godzina; ?>">
<input class="submit" type="submit" name="wyslijsb" value="Wyślij">
</form>
<?php
} else {
echo "<span style='font-size: 13px; color: #39548b'><b>Shoutbox tylko dla zalogowanych!</b></span>"; }
?>
sb2.php<?php
require("config.php");
$sql = "SELECT * FROM shoutbox ORDER BY massage_id DESC LIMIT 20";
$id = $row['massage_id'];
$autor = $row['massage_autor'];
$godzina = $row['massage_hour'];
$massage = $row['massage_body'];
if (is_int(($id)/2
)==TRUE) $bg = "#FFFFFF"; else $bg = "#f0f0f0";
?>
<div style="background-color:
<?php echo $bg; ?>; width: 293px; padding: 5px;">
<div style="font-size: 12px; color: #39548b">napisał <b>
<?php echo $autor; ?></b> o godzinie
<?php echo $godzina; ?></div>
<div>
<?php echo $massage; ?></div>
</div>
<?php
}
?>
trans.php<?php
require("config.php");
// Shoutbox
if(isset($_POST['wyslijsb'])) { $autor = $_POST['autor'];
$massage = trim($_POST['massage']); $godzina = $_POST['hour'];
$sql = "INSERT INTO shoutbox (massage_autor, massage_body, massage_hour)
VALUES ('$autor', '$massage', '$godzina')";
} else {
}
}
...