﻿
function showLoginDialog(url) {
    scrollToTop();
    $("#" + popupLoginID).Show({ iframeUrl: url, height: 200, width: 275 });
    $('iframe').attr('allowTransparency', 'true');
}

function hideLoginDialog() {
    setTimeout(function() { $("#" + popupLoginID).Hide(); }, 50);
}

function showProfileDialog(url) {
    scrollToTop();
    $("#" + popupProfileID).Show({ iframeUrl: url, height: 630, width: 400 });
    $('iframe').attr('allowTransparency', 'true');
}

function hideProfileDialog() {
    setTimeout(function() { $("#" + popupProfileID).Hide(); }, 50);
}

function showEntryDialog(url) {
    scrollToTop();
    $("#" + popupEntryID).Show({ iframeUrl: url, height: 289, width: 415 });
    $('iframe').attr('allowTransparency', 'true');
}

function hideEntryDialog() {
    setTimeout(function() { $("#" + popupEntryID).Hide(); }, 50);
}

function redirectToUrl(url) {
    if (url != null) {
        location.href = url;
    } else {
        // reload
        location.href = location.href;
    }
}

function scrollToTop() {
    $().scrollTo(0, 0);
}