‘;
}else{
var centerAdContent = ”;
}
function myCoreSlider(divid){
jQuery(“#”+divid).coreSlider({ clone: true, controlNavEnabled: true, cloneItems: 3 });
}
function pgdfpadrendering(commonidentifier,imageid) {
var slot = ”;
console.log(lang);
if(lang==’te’){
if(commonidentifier==’first-dfp-photogallery-middle’){
var adPgSlot = ‘/11440465/bollywoodlife_telugu_web/bollywoodlife_telugu_ptg_300x250′;
var divID = commonidentifier+’-‘+imageid;
}else if(commonidentifier==’second-dfp-photogallery-middle’){
var adPgSlot = ‘/11440465/bollywoodlife_telugu_web/bollywoodlife_telugu_ptg_300x250_1′;
var divID = commonidentifier+’-‘+imageid;
}
}else if(lang==’hi’){
if(commonidentifier==’first-dfp-photogallery-middle’){
var adPgSlot = ‘/11440465/Bollywoodlife_hindi_Web/bollywoodlife_hindi_ptg_300x250′;
var divID = commonidentifier+’-‘+imageid;
}else if(commonidentifier==’second-dfp-photogallery-middle’){
//var adPgSlot = ‘/11440465/Bollywoodlife_hindi_Web/bollywoodlife_hindi_ptg_300x250_1′;
var divID = commonidentifier+’-‘+imageid;
}
}else{
if(commonidentifier==’first-dfp-photogallery-middle’){
var adPgSlot = ‘/11440465/Bollywoodlife_Web/bollywoodlife_ptg_300x250′;
var divID = commonidentifier+’-‘+imageid;
}else if(commonidentifier==’second-dfp-photogallery-middle’){
//var adPgSlot = ‘/11440465/Bollywoodlife_Web/bollywoodlife_ptg_300x250_1′;
var divID = commonidentifier+’-‘+imageid;
}
}
//$(‘#’+divID).empty();
var elId = divID;
console.log(“DIV : “+divID);
if(divID != ”) {
googletag.cmd.push(function() {
//googletag.display(elId);
slot = googletag.defineSlot(adPgSlot, [300, 250], elId).addService(googletag.pubads());
googletag.enableServices();
googletag.pubads().refresh([slot]);
});
}
}
function renderphotoads(commonidentifier,imageid){
var divID = commonidentifier+’-‘+imageid;
if(lang==’te’){
if(commonidentifier==’first-dfp-photogallery-middle’){
var adPgSlot = ‘/11440465/bollywoodlife_telugu_web/bollywoodlife_telugu_ptg_300x250′;
}else if(commonidentifier==’second-dfp-photogallery-middle’){
var adPgSlot = ‘/11440465/bollywoodlife_telugu_web/bollywoodlife_telugu_ptg_300x250_1′;
}
}else if(lang==’hi’){
if(commonidentifier==’first-dfp-photogallery-middle’){
var adPgSlot = ‘/11440465/Bollywoodlife_hindi_Web/bollywoodlife_hindi_ptg_300x250′;
}else if(commonidentifier==’second-dfp-photogallery-middle’){
var adPgSlot = ‘/11440465/Bollywoodlife_hindi_Web/bollywoodlife_hindi_ptg_300x250_1′;
}
}else{
if(commonidentifier==’first-dfp-photogallery-middle’){
var adPgSlot = ‘/11440465/Bollywoodlife_Web/bollywoodlife_ptg_300x250′;
}else if(commonidentifier==’second-dfp-photogallery-middle’){
var adPgSlot = ‘/11440465/Bollywoodlife_Web/bollywoodlife_ptg_300x250_1′;
}
}
googletag.cmd.push(function() {
var slotw = googletag.defineSlot(adPgSlot, [300, 250], divID).addService(googletag.pubads());
googletag.enableServices();
googletag.pubads().refresh([slotw]);
});
}
function renderphotoadsfirstgallery(commonidentifier,imageid){
var adPgSlot= getPtgAddSlot(lang,ad_num);
var divID = commonidentifier+’-‘+imageid;
googletag.cmd.push(function() {
var slotw = googletag.defineSlot(adPgSlot, [300, 250], divID).addService(googletag.pubads());
googletag.enableServices();
googletag.display(divID);
googletag.pubads().refresh([slotw]);
});
ad_num++;
}
function getPtgAddSlot(lang,ad_num)
{
var slot=”;
if(lang==’hi’)
{
slot=’/11440465/Bollywoodlife_hindi_Web/bollywoodlife_hindi_ptg_300x250′;
}else
{
slot=’/11440465/Bollywoodlife_Web/bollywoodlife_ptg_300x250′;
}
if(ad_num>0)
{
slot +=’_’+ad_num;
}
return slot;
}
// photo gallery grid lhs
var url,activeimgid,isvisible,isnextgalvisible,ishideleftvisible,divTopPosition,st,lastScrollTop;
window.addEventListener(“load”, function(event) {
lastScrollTop = 0;
$(window).scroll(function(idx) {
url = window.location.href;
url = url.replace(/?.*/, ”);
const urlArray = url.split(“/”);
if(urlArray[3]==’photos’){ //english condition
currgalleryid = urlArray[4].substring(urlArray[4].lastIndexOf(‘-‘) + 1).replace(‘/’,”);
}else if(urlArray[3]==’hi’){
currgalleryid = urlArray[5].substring(urlArray[5].lastIndexOf(‘-‘) + 1).replace(‘/’,”);
}
//console.log(urlArray)
isvisible = $(‘.photo-gallery-‘+currgalleryid+’ .rightPhoto’).isOnScreen();
if(isvisible==true){
ishideleftvisible = $(‘.photo-gallery-‘+currgalleryid+’ .hideleftlhs’).isOnScreen();
if(ishideleftvisible==true){
$(‘.stickyGrid’).removeClass(“sticky-lhs”);
}else{
st = $(this).scrollTop();
if (st > lastScrollTop){
divTopPosition = $(‘.photo-gallery-‘+currgalleryid).offset().top+400;
} else {
divTopPosition = $(‘.photo-gallery-‘+currgalleryid).offset().top+800;
console.log(‘upward direction’)
}
lastScrollTop = st;
if ($(this).scrollTop() > divTopPosition){
$(‘#gallery_id_’+currgalleryid).addClass(“sticky-lhs”);
}else{
$(‘.stickyGrid’).removeClass(“sticky-lhs”);
}
}
}else{
$(‘#gallery_id_’+currgalleryid).removeClass(“sticky-lhs”);
}
url = window.location.href;
activeimgid = url.substring(url.lastIndexOf(‘-‘) + 1).replace(‘/’,”);
$(‘.stickyGrid li’).each(function() {
let imgid = $(this).attr(‘dataimg’);
if(imgid==activeimgid){
$(‘.stickyGrid li.active’).removeClass(‘active’);
$(this).addClass(‘active’);
}
});
})
// add remove
$(document).on(“click”, ‘.stickyGrid li’,function(event){
$(‘.stickyGrid li.active’).removeClass(‘active’);
$(this).addClass(‘active’);
});
// on top scroll
$(document).on(“click”, ‘a[href^=”#”]’,function(event){
var target = $(this.getAttribute(‘href’));
console.log(“Target offset before ==”)
console.log(target.offset())
$(‘.stickyGrid li’).removeClass(‘active’);
$(this).addClass(‘active’);
if (target.length) {
event.preventDefault();
$(‘html, body’).stop().animate({
scrollTop: parseInt(target.offset().top)-80
}, 1000);
}
});
setTimeout(function(){
url = window.location.href;
url = url.replace(/?.*/, ”);
const urlArray = url.split(“/”);
//console.log(urlArray.length)
var flag = 0;
if(urlArray[3]==’photos’){ //english condition
if(urlArray.length>6) flag=1;
}else if(urlArray[4]==’photos’){
if(urlArray.length>7) flag=1;
}
if(flag==1){
var current_photo_id = url.substring(url.lastIndexOf(‘-‘) + 1);
current_photo_id = current_photo_id.replace(//.*$/, ”);
if(current_photo_id.length>0){
var scrollTarget = $(‘#’+current_photo_id);
var tVal = 100;
$(‘meta[name=”description”]’).attr(‘content’, $(‘#’+current_photo_id).nextAll().filter(‘article’).first().find(“p”).text());
var galleryTitle = $(‘#’+current_photo_id).attr(‘data-title’);
if ($(‘#’+current_photo_id).attr(‘data-title’).length > 0) {
documentTitle = galleryTitle + ‘ | ‘ + $(‘#’+current_photo_id).attr(‘data-gallery-title’) + ‘ Photogallery at BollywoodLife.com’;
$(document).attr(“title”, documentTitle);
}
$(‘html, body’).animate({scrollTop: parseInt($(scrollTarget).offset().top) – tVal }, 800);
}}
}, 1000);
$.fn.isOnScreen = function(){
var win = $(window);
var viewport = {
top : win.scrollTop(),
left : win.scrollLeft()
};
viewport.right = viewport.left + win.width();
viewport.bottom = viewport.top + win.height();
var bounds = this.offset();
bounds.right = bounds.left + this.outerWidth();
bounds.bottom = bounds.top + this.outerHeight();
return (!(viewport.right bounds.right || viewport.bottom bounds.bottom));
};
});
Bollywoodlife_Web/Bollywoodlife_AL_ATF_300x250|300,250~Bollywoodlife_Web/Bollywoodlife_AL_BTF_1_300x250|300,250~Bollywoodlife_Web/Bollywoodlife_AL_BTF_2_300x250|300,250~Bollywoodlife_Web/Bollywoodlife_AL_ATF_970x90|970,250~Bollywoodlife_Web/bollywoodlife_ros_strip|1300,50