﻿

    $(document).ready(function () {

        //create default Bubble Popups for all buttons...
        $('.popupdiv').CreateBubblePopup({
            selectable: true,

            position: 'top',
            align: 'center',

            innerHtml: '',

            innerHtmlStyle: {
                color: '#FFFFFF',
                'text-align': 'center'
            },

            themeName: 'all-black',
            themePath: '/content/jqb/jquerybubblepopup-theme',
            openingDelay: 1500

        });

  

        $('.popupdiv').mouseover(function () {

            //get a reference object for "this" target element
            var button = $(this);

            var requestData = { ItemId: button.context.getAttribute("item_id"), PartialViewName: "_PartialShortPopupMediaInfoItem" };

            var _contentType = 'application/json; charset=utf-8'; // 'application/x-www-form-urlencoded';


            $.ajax(
    {
        type: 'POST',
        contentType: _contentType,
        data: JSON.stringify(requestData),
        dataType: 'html',
        url: '/Item/GetMediaInfo',
        success: function (result) {
            button.SetBubblePopupInnerHtml('<div class="itemPopup">' + result + '</div>', false);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
        }
    });



        
        }); //end mouseover event


    });


