A really simple and easy way to modify your theme page.tpl file to handle ajax calls is to:
1. Above the first output in the page.tpl file (doctype declaration) Add the following code:
if(!isSet($_GET["ajax"]) && !isSet($_POST["ajax"])) {
2. At the very end of the page.tpl file, add the following code:
} else {
print $content;
}
Usage: