/*var etList = {
dateFormat : function (sd) {
var timeStamp = sd,
cd = new Date();
sd = sd.replace(/-/g, ' ');
if (sd == "" || sd == null)
return;
sd = new Date(sd);
if (cd.getTime() < sd.getTime())
return;
var diff = Math.abs(cd.getTime() - sd.getTime());
diff = ((diff / 1000) / 60);
if (diff < 1440) {
if (diff < 60) {
if (diff < 2) {
timeStamp = parseInt(diff) + " Minute ago";
} else {
timeStamp = parseInt(diff) + " Minutes ago";
}
} else if (diff < 1440) {
if (diff < 119) {
timeStamp = Math.floor(diff / 60) + " Hour ago";
} else {
timeStamp = Math.floor(diff / 60) + " Hours ago";
}
}
} else {
timeStamp = timeStamp.substring(0, timeStamp.lastIndexOf(","));
}
return timeStamp;
}
}*/
var balanceSecHight = { // For blancing left right widgets height
init:function (lelm,relm,rhid,gap) {
if (gap === undefined) {
gap = 0;
}
var i = 0;
do{
var lsh = $(lelm).outerHeight(), lrh = $(relm).outerHeight(), len = $(rhid).length;
if(i < len && lsh > (lrh + gap)) {
$(rhid).eq(i).show();
} else {
break;
}
i++;
} while(1);
}
}
function fixedAdSpotLight() { // To set spotlight and RHS ad fixed when scroll
var topRHSPos = $("#sideBar").offset().top + $("#sideBar").outerHeight(), topRhsAdHeight = $("#sideBar .topSec1").eq(0).outerHeight() + 40;
if (($(window).scrollTop() > topRHSPos) && (($("#pageContent").outerHeight() - topRHSPos) >= topRhsAdHeight) && ($(".bottomBar").offset().top - $(window).scrollTop() >= topRhsAdHeight)) {
$("#sideBar .topSec1").eq(0).css({ position: "fixed", top: "25px" });
} else {
$("#sideBar .topSec1").eq(0).removeAttr("style");
}
}
function adwidgetMain(adData, container) {
if (adData != null) {
var conObj = document.getElementById(container),
imgShow = (conObj.getAttribute("data-img") == 0) ? '' : '',
conText = '' + imgShow + '
' + adData.paidAds[0].text + '
Sponsored by ' + adData.paidAds[0].brandtext + ''; conObj.innerHTML = conText; conObj.style.display = 'block'; } else { // generate default content } } function adwidgetslidebox(data,container){ if (data != null) { //console.log(data); var conObj = document.getElementById(container), conText = 'Adv: '+data.paidAds[0].brandtext+'
'; conObj.innerHTML = conText; conObj.style.display = 'block'; } } function adwidgettopnews(data, container) { if (data != null) { var conObj = document.getElementById(container), conText = '' + data.paidAds[0].title + 'Sponsored by '+data.paidAds[0].brandtext+'
'; conObj.innerHTML = conText; conObj.style.display = 'block'; } } function adwidgetslider(data, container) { if (data != null) { //console.log(data); var conObj = document.getElementById(container), conText = 'Sponsored by '+data.paidAds[0].brandtext+'
'; conObj.innerHTML = conText; conObj.style.display = 'block'; } } function socialRHSHide() { if(typeof skinningExist!="undefined" && skinningExist==true && $("#topNavFixed").length){ $("#topNavFixed").addClass("skinningExist") } /*$("#shareHorz").show(); $("#shareVertHolder").hide();*/ } //for tab //Tip Show-Hide /*$('.tip h3 a').click(function(){ $('.tip .inner').slideDown(); return false; }); $('.tip .close').click(function(){ $('.tip .inner').slideUp(); return false; });*/ defaultPhotoShow = function() { if($('li:visible .tabVerticalInd .tabs ul li').hasClass("active")){ $('[data-subsec2="' + subsec2 + '"]').trigger('click'); } else { $('[data-subsec2]').eq(0).trigger('click'); } } slide = { currentVisibleMsid: function() { if($('li:visible .tabVerticalInd .tabs ul li').hasClass("active")){ return $('li:visible .tabVerticalInd .tabs ul li.active').attr('data-msid'); } else { return $('li:visible .tabVerticalInd .tabs ul li').eq(0).attr('data-msid'); } }, load: function (msid) { loading.show(); var my_obj = $('[data-msid="' + msid + '"]'); var curpg = parseInt(my_obj.attr('data-curpg')) + 1; my_obj.attr('data-curpg', curpg) $.ajax({ url: my_obj.attr('data-url') + '&partial=1&curpg=' + curpg, success:function (data) { //console.log(data); $('[data-msid-ref="' + msid + '"] .sliderContainer').append(data); loading.hide(); }, complete: function () { loading.hide(); } }); } }; //for slider function aSlider(type) { var current_visible_msid = slide.currentVisibleMsid(); var sCount = $('[data-msid-ref="' + current_visible_msid + '"] .slidmainCont .sliderContainer .slideBox').length; var sliderCount = $('[data-msid-ref="' + current_visible_msid + '"]').attr('data-current-slide'); sliderCount = typeof sliderCount == 'undefined' ? 0 : sliderCount; if (sliderCount == (sCount - 1)) { sliderCount = -1; } if (type == 'fwd') { sliderCount++; $('[data-msid-ref="' + current_visible_msid + '"] .sliderContainer').animate({left: (-1 * 525 * sliderCount)}, function() { $('[data-msid-ref="' + current_visible_msid + '"]').attr('data-current-slide', sliderCount); }); var curpg = $('[data-msid="' + current_visible_msid + '"]').attr('data-curpg'); if((sliderCount + 1) == parseInt(curpg) * 2) { slide.load(current_visible_msid); } } else { if (sliderCount > 0) { sliderCount--; $('[data-msid-ref="' + current_visible_msid + '"] .sliderContainer').animate({left: (-1 * 525 * (sliderCount))}, function() { $('[data-msid-ref="' + current_visible_msid + '"]').attr('data-current-slide', sliderCount); }); } } if (sliderCount > 0) { $(".indleft .nextPrevl span").removeClass('none'); } else { $(".indleft .nextPrevl span").addClass('none'); } if (sliderCount < 0) { sliderCount = 0; } } //for tab function bindTab() { $(".tabVerticalInd").etTabs({ tabs: ".tabs > ul.tUl > li", content: ".content > ul > li", speed: 300 }); $('#photoVideo .tabsBtn ul li a').click(function() {if($(this).text().toLowerCase() == 'slideshows'){$('.tabMore a').eq(0).show().siblings().hide()} else {$('.tabMore a').eq(1).show().siblings().hide()};}) } function toggleTabMore(ind){ $('.tabMore a').eq(ind).show().siblings().hide(); } function bindTabSubList() { $(".tabVerticalInd .tabs li").not('.MoreSlid li').click(function() { var ind = $(this).parent('.MoreSlid').length == 0 ? $(this).index() : 7 + $(this).index(); var $target = $(this).parents(".tabs").siblings(".content").find(">ul > li").eq(ind); //debugger; if ($target.is(":empty")) { $target.load($(this).attr("data-url")); } $(".MoreSlid").hide(); $('.MoreSlid li').removeClass('active'); }); $('.MoreSlid li').click(function() { $(this).addClass('active').siblings().removeClass('active'); }); } loading = { init: function () { $('#photoVideo').append("