(function () { function fetchFile(url, successHandler, errorHandler) { var xhr = typeof XMLHttpRequest != 'undefined' ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); xhr.open('get', url, true); xhr.responseType = 'text'; xhr.onreadystatechange = function() { var status; var data; if (xhr.readyState == 4) { status = xhr.status; if (status === 200 || status === 0) { data = xhr.responseText; successHandler && successHandler(data); } else { errorHandler && errorHandler(status); } } }; try { xhr.send(); } catch(err) { errorHandler && errorHandler(err); } }; function router() { var url = location.hash.slice(2) || 'presentation'; var contentElement = document.getElementById('content'); fetchFile('Pages/' + url + '.md', function(contentMd) { contentElement.innerHTML = markdown.toHTML(contentMd); }, function() { var notFoundPage = '