﻿    $(function(catalias){
        $('.videoLink').click(function(e)
        {
            var catalias = $(".hiddenCA").val();
            e.preventDefault();
            openRADWin(catalias);            
        })
    })

    function openRADWin(ca){
        var oWnd = radopen(null, "window1");
        oWnd.setModal = false;
        oWnd.add_close(OnClientClose);
        oWnd.setSize(510, 475);
        oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Pin);
        oWnd.center();
        // oWnd.setUrl("/Video/ShowVideo.aspx?CA=101190");
        oWnd.setUrl("/Video/ShowVideo.aspx?CA=" + ca);
    }

    function OnClientShow(radWindow) {
        if (document.documentElement && document.documentElement.scrollTop) {
            var oTop = document.documentElement.scrollTop;
            // document.documentElement.scroll = "no";
            // document.documentElement.style.overflow = "hidden";
            // document.documentElement.scrollTop = oTop;

        } else if (document.body) {
            var oTop = document.body.scrollTop;
            // document.body.scroll = "no";
            //document.body.style.overflow = "hidden";
            //document.body.scrollTop = oTop;
        }
    }

    function OnClientClose(oWnd) {

        oWnd.setUrl("about:blank"); // stops playback in IE
        oWnd.remove_close(OnClientClose);

        if (document.documentElement && document.documentElement.scrollTop) {
            //document.documentElement.scroll = "";
            //document.documentElement.style.overflow = "";
        } else if (document.body) {
            //document.body.scroll = "";
            //document.body.style.overflow = "";
        }
    }     
     
