﻿var theDivName;
var theDivTitle;
var theDivWidth;
var theDivHeight;


(function () {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

function hideLoadingPanel() {
    hideProgress();
}

function showThemedMessage() {
    $.blockUI({
        message: theDivName,
        theme: true,
        close: true,
        draggable: false,
        title: theDivTitle,
        css: {
            width: theDivWidth + 'px',
            height: theDivHeight + 'px',
            padding: '10px'
        },
        themedCSS: {
            width: theDivWidth + 'px',
            top: ($(window).height() - theDivHeight) / 2 + 'px',
            left: ($(window).width() - theDivWidth) / 2 + 'px'
        },
        focusInput: false
    });
}
function showThemedMessageNoClose() {
    $.blockUI({
        message: theDivName,
        theme: true,
        close: false,
        draggable: false,
        title: theDivTitle,
        css: {
            width: theDivWidth + 'px',
            height: theDivHeight + 'px',
            padding: '10px'
        },
        themedCSS: {
            width: theDivWidth + 'px',
            top: ($(window).height() - theDivHeight) / 2 + 'px',
            left: ($(window).width() - theDivWidth) / 2 + 'px'
        },
        focusInput: false
    });
}

function showThemedDiv() {
    $.blockUI({
        message: $(theDivName),
        theme: true,
        close: true,
        draggable: false,
        title: theDivTitle,
        css: {
            width: theDivWidth + 'px',
            height: theDivHeight + 'px',
            padding: '10px'
        },
        themedCSS: {
            width: theDivWidth + 'px',
            top: ($(window).height() - theDivHeight) / 2 + 'px',
            left: ($(window).width() - theDivWidth) / 2 + 'px'
        },
        focusInput: false
    });
}
function showProgress() {
    $.blockUI({ message: $('<div style="padding-top:10px"></div><img src="/Images/Loading.gif" alt="Processing..." /><br /><h1>Processing...</h1>') });
}

function hideProgress() {
    $.unblockUI();
}

function doLogout() {
    showProgress();
    window.location = "/Account/Logout";
}

function doLogin() {
    var pathName = window.location.pathname;
    if (pathName == null || pathName == "") {
        pathName = "/Index";
    }
    if (pathName.toLowerCase() == "/default.aspx") {
        pathName = "/Index";
    }
    window.location = "/Login?ReturnUrl=" + pathName;
}

function doRegister() {
    var pathName = window.location.pathname;
    if (pathName == null || pathName == "") {
        pathName = "/Index";
    }
    if (pathName.toLowerCase() == "/default.aspx") {
        pathName = "/Index";
    }
    window.location = "/Register?ReturnUrl=" + pathName;
}

window.fbAsyncInit = function () {
    FB.init({ appId: '167693749972089', status: true, cookie: true,
        xfbml: true
    });
};


$(function () {
    $(".jscroll").jScrollPane({ showArrows: true, scrollbarWidth: 13 });
});

