jQuery.extend({postJSON:function(url,data,callback){return jQuery.post(url,data,callback,"json");}});
var cat_p=2;
var scroll_loading_busy=false;
var global_details_popup;
var remove_global_details_popup_timeout;

function copied(){$('#intoblog').toggle();}

var wpopup;

function show_cat_el_descr_init(){$(".w_popup .img_wi_cont").on("mouseenter",function(e){wpopup=$(this).parent("a").parent(".w_popup");$(".details_popup").remove();clearTimeout(remove_global_details_popup_timeout);$(".watch_indicator01",this).addClass("watch_indicator01_showed");global_details_popup=$("<div class='details_popup' />").appendTo($("body"));global_details_popup_inner=$("<div class='details_popup_inner' />").appendTo(global_details_popup);details_popup_overlay=$("<div class='details_popup_overlay' />").appendTo(global_details_popup_inner);if(wpopup.hasClass("panel01li_big")){global_details_popup.css("top",wpopup.offset().top+65);}
else{global_details_popup.css("top",wpopup.offset().top+65);}
global_details_popup_heading=$("<strong class='details_popup_heading' />").text(wpopup.attr("data-name")).appendTo(global_details_popup_inner);global_details_popup_details=$("<p class='details_popup_details' />").appendTo(global_details_popup_inner);

//if(wpopup.attr("data-genre")){$("<span>").html("<a href='"+$(this).parent("a").attr("href")+"'>"+wpopup.attr("data-genre")+"</a>, "+wpopup.attr("data-year")).appendTo(global_details_popup_details);}

if(wpopup.attr("data-genre")){$("<span>").html(wpopup.attr("data-genre")+", "+wpopup.attr("data-year")).appendTo(global_details_popup_details);}                                                                                         
                                                                                         
if(wpopup.attr("data-countries")){$("<span>").text(wpopup.attr("data-countries")).appendTo(global_details_popup_details);}
if(wpopup.attr("data-age")){$("<span>").text(", "+wpopup.attr("data-age")).appendTo(global_details_popup_details);}
global_details_popup.hover(function(e){clearTimeout(remove_global_details_popup_timeout);},function(){remove_global_details_popup_timeout=setTimeout(function(){global_details_popup.remove()},0);});

if(wpopup.attr("data-is_infavorites")||wpopup.attr("data-is_subscribed")){actions=$("<div class='actions' />").appendTo(global_details_popup_inner);}

$("<p class='details_popup_descr' />").html(/*"<a href='"+$(this).parent("a").attr("href")+"'> Подробнее</a>"+*/wpopup.attr("data-description")).appendTo(global_details_popup_inner);

if($(window).width()<1264){if(wpopup.offset().left<$(window).width()/2){global_details_popup.css("left",wpopup.offset().left+7+wpopup.width()).removeClass("arrow_right").addClass("arrow_left");}
else{global_details_popup.css("left",wpopup.offset().left-354).removeClass("arrow_left").addClass("arrow_right");}}
else{if(wpopup.parent(".li4cont").parent("li").parent("ul").hasClass("panel01ul")){global_details_popup.css("left",wpopup.offset().left+7+wpopup.width()).removeClass("arrow_right").addClass("arrow_left");}
else{global_details_popup.css("left",wpopup.offset().left-354).removeClass("arrow_left").addClass("arrow_right");}}

});

$(".w_popup .img_wi_cont").on("mouseleave",function(e){$(".watch_indicator01",this).removeClass("watch_indicator01_showed");remove_global_details_popup_timeout=setTimeout(function(){global_details_popup.remove()},0);});$(".wo_popup .img_wi_cont").on("mouseenter",function(e){$(".watch_indicator01",this).addClass("watch_indicator01_showed");$(".continue_watching",this).addClass("continue_watching_showed");$(".this_remove",this).show();});$(".wo_popup .img_wi_cont").on("mouseleave",function(e){$(".watch_indicator01",this).removeClass("watch_indicator01_showed");$(".continue_watching",this).removeClass("continue_watching_showed");$(".this_remove",this).hide();});}

$().ready(function(){show_cat_el_descr_init();});