﻿function tooltipify(target, numChar) {
    $.each(target, function () {
        if ($(this).html().length > numChar + 1) {
            var fullText = $(this).html();
            //$(this).attr('title', fullText);
            $(this).addClass('tooltipped');
            $(this).html($(this).html().substr(0, numChar) + '...');
        }
    });
}

function insertToMaster(container, content) {
    $('.' + container).append($('.' + content).html());
}

function redirectClick(url) {
    window.location.href = url;
}

//var counter = eval(sessionStorage.counter) || 0;
//var isInitial = false;
//var origUrl = document.location.pathname;  //History.normalizeHash(History.getShortUrl(document.location.href));
//if (origUrl == "" || origUrl == "/" || origUrl == "/Home") // if (origUrl == "" || origUrl == "./" || origUrl == "/" || origUrl == "/Home" || origUrl == "./Home")
//    origUrl = "/Home";

function PushHistoryPage() {
    counter++;
    sessionStorage.counter = counter;
    isInitial = true;
    var maonCont = $('#main_container').html();
    History.pushState({ content: maonCont, counter: counter }, null, origUrl + "=" + counter);
    isInitial = false;
}

