function updateURL( URL, Name) { if (typeof history.pushState == 'function' ) { var stateObj = { foo: "bar" }; history.pushState( stateObj, "Obsidian - " + Name, URL); } } $("document").ready(function() { $(".folder").click(function() { $("#loading").show(); title = encodeURI($(this).children(".title").children("a").attr("href")); Name = $(this).children(".title").children("a").html(); $("body").load(title); updateURL(title, Name); }); $(".thumb").click(function() { title = encodeURI($(this).children("a").attr("bref")); $("#lightbox").html(''); $("#viewer").fadeIn(); return false; }); $("#container").click(function() { $("#viewer").fadeOut(); }); });