    $(document).ready(function () {
        var vidLinked = ggetUrlVars()["video"];
        if (vidLinked == undefined) {
            loadFeature(false);
        } else {
            $("." + vidLinked).addClass("hpvid_fvselect");
            $(".hpvid_featurevideo .hpvid_videoTitle").html($("." + vidLinked).find("h4").html());
            $(".hpvid_featurevideo .hpvid_videoDescription").html($("." + vidLinked).find(".hpvid_viddesc").html());
            var videoElm = createVideoHP($("." + vidLinked).find(".hpvid_vurl").text(), true);
            $(".hpvid_featurevideo").find(".hpvid_videoHolder").html(videoElm);
            if ($(".hpvid_featurevideo .hpvid_videoTitle").text() == "") { $(".hpvid_cvScroll li").removeClass("hpvid_fvselect"); loadFeature(false); }
            else { $("body").scrollTo($(".hpvid_ondemandtabs"), 1000); dcsMultiTrack('DCS.dcsuri', $("." + vidLinked).find(".hpvid_vurl").text(), 'WT.ti', $("." + vidLinked).find("h4").text()); }
        }

        $(".hpvid_cvScroll li").click(function () {
            $(".hpvid_cvScroll li").removeClass("hpvid_fvselect");
            $(this).addClass("hpvid_fvselect");
            $(".hpvid_featurevideo .hpvid_videoTitle").html($(this).find("h4").html());
            $(".hpvid_featurevideo .hpvid_videoDescription").html($(this).find(".hpvid_viddesc").html());
            var videoElm = createVideoHP($(this).find(".hpvid_vurl").text(), true);
            $(".hpvid_featurevideo").find(".hpvid_videoHolder").html(videoElm);
            dcsMultiTrack('DCS.dcsuri', $(this).find(".hpvid_vurl").text(), 'WT.ti', $(this).find("h4").text());
        });
    });

    function loadFeature(autop) {
        $(".hpvid_featurevideo .hpvid_videoTitle").html($(".hpvid_videoLister .hpvid_featuredVideo").find("h4").html());
        $(".hpvid_featurevideo .hpvid_videoDescription").html($(".hpvid_videoLister .hpvid_featuredVideo").find(".hpvid_viddesc").html());
        var videoElm = createVideoHP($(".hpvid_videoLister .hpvid_featuredVideo").find(".hpvid_vurl").text(), autop);
        $(".hpvid_featurevideo").find(".hpvid_videoHolder").html(videoElm);
    }
    function createVideoHP(videoURL, autop) {
        var wmvObject = "";
        if (Silverlight.isInstalled()) {
            wmvObject = '<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="640" height="360"><param name="source" value="http://www.microsoft.com/showcase/silverlight/player/1/player-en.xap"/><param name="enableHtmlAccess" value="true" /><param name="background" value="#FF000000" /><param name="allowHtmlPopupwindow" value="true" /><param name="minRuntimeVersion" value="3.0.40624.0" /><param name="windowless" value="true" /><param name="autoUpgrade" value="true" /><param name="initParams" value="Culture=en-US,Autoplay=' + autop + ',ShowWaterMark=false,ShowMarketingOverlay=false,MiscControls=FullScreen,ShowMenu=false,AdsEnabled=false,MediaSource=' + videoURL + ',Mode=Player" /></object>';
        }
        else {
            wmvObject = "<object id='Player' width='640' height='405' classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' type='application/x-oleobject'><param name='URL' value='" + videoURL + "'><param name='uiMode' value='full'> <param name='autoStart' value='" + autop + "'> <param name='enableContextMenu' value='True'> <param name='windowlessVideo' value='True'><embed type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' id='Player' uimode='mini' enablecontextmenu='True' name='Player' width='640' height='405' src='" + videoURL + "' autostart='" + autop + "'></embed></object>";
        }
        return wmvObject;
    }
