(function ($) {
$(document).ready(function(){
$(“.sidebar”).theiaStickySidebar();
$(“.closestickyadd”).click(function()
$(‘#stickyad’).hide();
);
$(‘#cssmenu’).find(‘br’).remove();
function fillElementWithAd($el, slotCode, size, targeting)
if (typeof targeting === ‘undefined’)
targeting = ;
else if ( Object.prototype.toString.call( targeting ) !== ‘[object Object]’ )
targeting = ;
var elId = $el.attr(‘id’);
googletag.cmd.push(function()
var slot = googletag.defineSlot(slotCode, size, elId);
for (var t in targeting)
slot.setTargeting(t, targeting
slot.addService(googletag.pubads());
googletag.display(elId);
//googletag.pubads().refresh([slot]);
);
if($(‘.all-story’).length>0)
$(“
“).insertAfter(“.all-story > div:nth-child(6)”);
$(“
“).insertAfter(“.all-story > div:nth-child(3)”);
if(btf_1_category_html_mobile)
$(btf_1_category_html_mobile).insertAfter(“.all-story > div:nth-child(6)”);
fillElementWithAd($(btf_1_category_html_mobile), btf_1_category_html_mobile_ad_code , btf_1_category_html_mobile_ad_dimensions, );
if($(‘.photopage’).length>0)
$(“
“).insertAfter(“div.photopage > div:nth-child(12)”);
$(“
“).insertAfter(“div.photopage > div:nth-child(6)”);
if($(‘div.article-para’).length>0){
//console.log(‘get in’);
var ci = 1;
var btf = 0;
var cq = $(“.article-para > div#fieldcontent”).attr(‘class’);
//console.log(‘cq’+cq);
var fbscript=document.createElement(‘script’);
fbscript.text= “(function(d, s, id) var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = d.createElement(s); js.id = id;js.src=”https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.9″;fjs.parentNode.insertBefore(js, fjs);(document, ‘script’, ‘facebook-jssdk’));”;
var fmain = $(“.sr”+cq);
var fdiv = ‘
‘;
$(fbscript).appendTo(fmain);
$(fdiv).appendTo(fmain);
var pl = $(“.article-para > div#fieldcontent”).children(‘p’).length;
//var adcode = inArticle1;
if(pl>3){
$(“.article-para > div#fieldcontent”).children(‘p’).each(function(i, n)
ci = parseInt(i) + 1; t=this;
//var d = $(“
“);
if((i+1)%3==0 && (i+1)>2 && $(this).html().length>10 && ci0){
var title, imageUrl, description, author, shortName, identifier, timestamp, summary, newsID, nextnews;
var previousScroll = 0;
var view_selector=”div#maincontent”;
var content_selector = view_selector;
var layout = $(content_selector);
var st = 0;
var pager_selector=”div.photo-blk-bg > div.next-story-block2″;
var next_selector=”div.photo-blk-bg > div.next-story-block2″;
var prevSlide = $(location).attr(‘href’);
var _c=””;
$(window).scroll(function() {
var last = $(pager_selector).filter(‘:last’);
var lastHeight = last.offset().top ;
st = $(layout).scrollTop();
var currentScroll = $(this).scrollTop();
if (currentScroll > previousScroll)
_up = false;
else
_up = true;
previousScroll = currentScroll;
var cutoff = $(window).scrollTop() + 64;
if($(‘div[id^=”jsp”]’).length>0)
$(‘div[id^=”jsp”]’).each(function()
if($(this).offset().top + $(this).height() > cutoff)
if(prevSlide != $(this).attr(‘data-url’))
prevSlide = $(this).attr(‘data-url’);
$(‘html head’).find(‘title’).text($(this).attr(‘data-title’));
loadshare(prevSlide, ‘G’, _c);
stitle = $(this).attr(‘data-title’);
vimg = $(this).attr(‘data-image’);
return false;
);
if(lastHeight + last.height() < $(document).scrollTop() + $(window).height())
url = $(next_selector).attr('href');
x=$(next_selector).attr('id');
nxtTitle = $(next_selector).attr("title");
stitle = $(next_selector).attr("title");
nxtHead = $(next_selector).attr("head");
stats = $(next_selector).attr("status");
});
}
/*search box*/
$(".srchlink").click(function()
$(".srchbox").slideToggle();
);
$(".subbtn").click(function()
location.href="https://news.google.com/hindi/search?q=" + $(".fildsrch").val();
return false;
);
/*************************************************************/
});
})(jQuery);