I see in the source of your website that you are using some really old-school looking Javascript to get the AJAX effect working. Keeping your current request in mind with the fact you've already got some advanced Javascript needs on your website, I recommend you check out jQuery - you could then do something like this (simplified, of course, but perhaps it is enough to get you on your way):
<ul id='menu'>
<li><a href="pages/Home.html" class="home"><span>Home</span></a></li>
<li><a href="pages/About.html" class="about"><span>About</span></a></li>
<li><a href="pages/Services.html" class="services"><span>Services</span></a></li>
<li><a href="pages/Portfolio.html" class="portfolio"><span>Portfolio</span></a></li>
<li><a href="pages/Contact.html" class="contact"><span>Contact</span></a></li>
</ul>
And then let you replace the montrocity you have for Javascript with this:
$(function() {
$('a', '#menu').click(function() { // when someone clicks on a menu link...
// get the page contained in the links href attribute....
$.get($(this).attr('href'), function(html) {
// once the content is here, animate the content div...
$('#MainContent').animate({
height: '20px' // make the div smaller....
}, 'fast', function() {
// when it is all the way down, update the div with the new
// html, and animate it back up....
$(this).html(html).animate({
height: 'auto'
}, 'fast');
});
});
return false;
});
});
This will make your website:
- More cross-browser compatible, as jQuery abstracts any incompatibilities out.
- More standards/best-practices compliant (ie, no inline Javascript)
- More accessible to people with Javascript disabled. As it is right now if I don't have Javascript enabled (~5% of people) and I click on any of your menu links nothing will happen. With this solution at the very least the page content will show up, although you could do some server-side code to make it so that the whole page shows if the request is not coming from Javascript.