$(function() {
$('a').click(function() {
var jumpTo = $(this).attr('href');
if(jumpTo == '#wrapper') {
$(document.body).ScrollTo(800, 'easein'); return false;
}
else if(jumpTo.charAt(0) == '#') {
$(jumpTo).ScrollTo(800, 'easein'); return false;
}
});
});

var url = "http://" + location.hostname + location.pathname;
$('a[@href*="#"]').click(function() {
var id = this.href.substring(this.href.indexOf('#'),this.href.length);
var hrefUrl = this.href.split(id);
if(hrefUrl[0] == url) {
if(id == '#header') {
$('body').addClass('body');
$('.body').ScrollTo(800, 'easein');
$('body').removeClass();
return false;
}else{
$(id).ScrollTo(800, 'easein');
return false;
}
}
});