The simple way to solve your problem is to override your 'loadPage' function as below:
function loadPage(url,a,contentPanel){
//...
var p = $('#'+contentPanel);
p.panel('options').onLoad = function(){
$('#mainForm').find('input[name=title]').focus(); // here is the focus code
};
p.panel('refresh',url);
//...
}
Another way is to add the following code snippets in your php file that will be loaded.
<script>
$('#mainForm').find('input[name=title]').focus();
</script>