function LoadContent(url) {

  //get hash
  if (url.split("#").length == 1) {
    hash = "home"
    location.replace(window.location.href.split("#")[0]+"#"+hash)
    location.reload()
  } else {
    hash = url.split("#")[1]
  }

  //load content
  $("body")
    .animate({ scrollTop: 0 }, 500, function(){
      $("#content")
        .load("pages/"+hash+".html", {}, function(responseText, textStatus, XMLHttpRequest){
					$("a[rel!='external']").click(function(){ LoadContent(this.href) })
          if (textStatus == "success") {
          	$("#menu a[href!='#"+hash+"']").parent().removeClass("selected")
          	$("#menu a[href='#"+hash+"']").parent().addClass("selected")
          } else {
            $("#content").load("404.html")
          }
        })
    })
}
