﻿/*** start modal ***/
function ShowModal(modal, eventCode) {
    $('.modal-container').show();
    $(modal).show();
    $('.tab-container > div:nth-child(1)').addClass('active');

    LogEvent('modal=' + eventCode + '&async=true');

    // center the modal
    $(modal).css('top', (($(window).height() / 2) - ($(modal).height() / 2)) + 'px');
    //$(modal).css('left', (($(window).width() / 2) - ($(modal).width() / 2)) + 'px');
}
function CloseModal() {
    $('.modal-container').hide();
    $('.modal-container').children().hide();
    $('.panel').hide();
    $('.panel1').show();
}
function ShowPanel(num, obj) {
    $('.tab-container').children().removeClass('active');
    $('.panel').hide();
    $('.panel' + num).show();
    $(obj).addClass('active');
}
/*** end modal ***/

function LogEvent(qs) {
    var href = window.location.href;
    href = href.replace('#', '');
    var seperator = '?';
    if (href.indexOf('?') > 0) {
        seperator = '&';
    }
    $.ajax({ url: href + seperator + qs });
}
