﻿var init = function () {
    initAjax();
    initAjaxLinkClick();
};
initAjax = function () {
    $.ajaxSetup({
        method: 'POST',
        data: {
          isAjax: true  
        },
        cache: false
    });
};
onAjaxLinkClick = function (e) {
    e.preventDefault(true);
    $.history.load(this.href.replace(/^.*#/, ''));
    return false;
};
initAjaxLinkClick = function () {
    $(".ajax-page-link").click(onAjaxLinkClick);
};

loadContent = function (el, hash) {
    el.css({opacity:.05}).html('<img src="/loadingAnimation.gif" alt="Ladevorgang, bitte warten..." />');
    el.load(hash, function () {
        el.stop(true, true);
        el.css({opacity:1});
    });
};

$(document).ready(function () {
    //init();
    function loadHistoryEntry(hash) {
        var el = $('#contenttext');
        loadContent(el, hash);
    }
    //$.history.init(loadHistoryEntry);
});

