$(document).ready(function () {

    $("[data-page]").addClass("hide");
    showPage(location.hash);

    $(window).on('hashchange', function () {
        var newPage = location.hash;
        showPage(newPage);
    });
});

function showPage (hash) {

    if (!hash) {
        // TODO Default settings
        hash = "#home";
    }

    var $menuItem = $("[href='" + hash + "']");
    var page = hash.substring(1);

    var $nav = $(".nav");
    $nav.find("li").removeClass("active");
    $menuItem.parent().addClass("active");

    var $pages = $(".pages");

    var $newPage = $pages.find("[data-page='" + page + "']");
    var $activePage = $pages.find("[data-page].active");

    if (!$activePage.length) {
        $newPage.addClass("active").hide().fadeIn();
    }

    $activePage.fadeOut(function () {
        $activePage.removeClass("active");
        $newPage.addClass("active").hide().fadeIn();
    });
}

@@ -1,8 +1,191 @@
+var CONSTANTS = %7B%0A    defaultPage: %22#home%22,%0A    classes: %7B%0A        active: %22active%22%0A    %7D,%0A    pages: %22.pages%22,%0A    menu: %22.nav%22,%0A    menuItem: %22li%22%0A%7D;%0A%0Avar DATA_PAGE = %22data-page%22;%0A%0A
 $(docume
@@ -221,36 +221,34 @@
 $(%22%5B
-data-page%5D%22).addClass(%22hide%22
+%22 + DATA_PAGE + %22%5D%22).show(
 );%0A 
@@ -293,17 +293,17 @@
 dow).on(
-'
+%22
 hashchan
@@ -304,17 +304,17 @@
 shchange
-'
+%22
 , functi
@@ -455,55 +455,36 @@
     
-// TODO Default settings%0A        hash = %22#home%22
+hash = CONSTANTS.defaultPage
 ;%0A  
@@ -588,22 +588,30 @@
 nav = $(
-%22.nav%22
+CONSTANTS.menu
 );%0A    $
@@ -623,34 +623,64 @@
 ind(
-%22li%22).removeClass(%22
+CONSTANTS.menuItem).removeClass(CONSTANTS.classes.
 active
-%22
 );%0A 
@@ -710,24 +710,40 @@
 ddClass(
-%22
+CONSTANTS.classes.
 active
-%22
 );%0A%0A    
@@ -757,24 +757,31 @@
 ges = $(
-%22
+CONSTANTS
 .pages
-%22
 );%0A%0A    
@@ -809,25 +809,33 @@
 .find(%22%5B
-data-page
+%22 + DATA_PAGE + %22
 ='%22 + pa
@@ -882,25 +882,33 @@
 .find(%22%5B
-data-page
+%22 + DATA_PAGE + %22
 %5D.active
@@ -965,32 +965,48 @@
 ge.addClass(
-%22
+CONSTANTS.classes.
 active
-%22
 ).hide().fad
@@ -1089,24 +1089,40 @@
 veClass(
-%22
+CONSTANTS.classes.
 active
-%22
 );%0A     
@@ -1142,24 +1142,40 @@
 ddClass(
-%22
+CONSTANTS.classes.
 active
-%22
 ).hide()

add constants