﻿function scrollTop(e, sender) {
    jQuery(function($) {
        var theRegexp = new RegExp("\.btnWatch$", "ig");
        if (!sender.EventTarget.match(theRegexp)) {
            $.scrollTo('#mainContainer', 500, { easing: 'easeinout' });

            return false;

        }
    });
}

function GetRadWindow() {
    var oWindow = null;
    if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz az well)
    return oWindow;
}

function RedirectParentPage(newUrl) {
    GetRadWindow().Close();
    GetRadWindow().BrowserWindow.document.location.href = newUrl;
}

function CloseOnReload() {

    GetRadWindow().Close();
}

function RefreshParentPage() {
    GetRadWindow().Close();
    GetRadWindow().BrowserWindow.location.reload();
}

