th; ++index) { VK.Widgets.Subscribe( VKWidgetsSubscribe[index].element_id, VKWidgetsSubscribe[index].options, VKWidgetsSubscribe[index].owner_id ); } VK.Observer.subscribe('widgets.subscribed', function(n) { vkwidget = jQuery("#vkwidget" + n).parent(); vkwidgetID = jQuery(vkwidget).attr('id'); if (jQuery(vkwidget).hasClass('evc-vk-lock')) { console.log('Fire'); //vkwidgetID = jQuery("#vkwidget" + n).parent().attr('id'); subscribeObj = jQuery.grep(VKWidgetsSubscribe, function(e){ return e.element_id == vkwidgetID; }); if (subscribeObj.length != 0) { o = subscribeObj[0].owner_id; if (jQuery.cookie('vkUnLock' + o) == 'undefined' || !jQuery.cookie('vkUnLock' + o) || jQuery.cookie('vkUnLock' + o) != subscribeObj[0].owner_id ) { jQuery.cookie('vkUnLock' + o, subscribeObj[0].owner_id, { expires: subscribeCookieExpires, path: '/' }); } location.reload(); } } }); VK.Observer.subscribe('widgets.unsubscribed', function(n) { vkwidget = jQuery("#vkwidget" + n).parent(); vkwidgetID = jQuery(vkwidget).attr('id'); if (jQuery(vkwidget).hasClass('evc-vk-lock')) { console.log('Fire'); subscribeObj = jQuery.grep(VKWidgetsSubscribe, function(e){ return e.element_id == vkwidgetID;}); if (subscribeObj.length != 0) { o = subscribeObj[0].owner_id; if (jQuery.cookie('vkUnLock' + o) != 'undefined') { jQuery.removeCookie('vkUnLock' + o); } } } }); } // console.log(VKWidgetsContactUs); // Contact Us if (typeof VKWidgetsCommunityMessages !== 'undefined') { console.log(VKWidgetsCommunityMessages); for (index = 0; index < VKWidgetsCommunityMessages.length; ++index) { VK.Widgets.CommunityMessages( VKWidgetsCommunityMessages[index].element_id, VKWidgetsCommunityMessages[index].group_id, VKWidgetsCommunityMessages[index].options ); } } }; /* ]]> */