function getNextStoryList() { ("" == getid || void 0 == getid) && (getid = ""), ("" == gettype || void 0 == gettype) && (gettype = ""), ("" == getuser || void 0 == getuser) && (getuser = ""), ("" == getstart || void 0 == getstart) && (getstart = "10"), ("" == getstartdate || void 0 == getstartdate) && (getstartdate = ""), ("" == getenddate || void 0 == getenddate) && (getenddate = ""), ("" == getkeyword || void 0 == getkeyword) && (getkeyword = ""), ("" == getsearch_type || void 0 == getsearch_type) && (getsearch_type = ""), ("" == getsearch_by || void 0 == getsearch_by) && (getsearch_by = ""), "no" != running || "" == getpage && void 0 == getpage || ($("#loader").show(10), running = "yes", $.ajax({ type: "GET", url: site_base_url + "get_next_storylist.php", data: "page=" + encodeURIComponent(getpage) + "&nid=" + encodeURIComponent(getid) + "&start=" + encodeURIComponent(getstart) + "&startdate=" + encodeURIComponent(getstartdate) + "&enddate=" + encodeURIComponent(getenddate) + "&keyword=" + encodeURIComponent(getkeyword) + "&search_type=" + encodeURIComponent(getsearch_type) + "&search_by=" + encodeURIComponent(getsearch_by) + "&type=" + encodeURIComponent(gettype) + "&user=" + encodeURIComponent(getuser), success: function(e) { if ($("#loader").hide(10), e.match("No More Story")) $(".next-story").hide(), $("#loader").hide(10), running = "yes"; else if ("" != e) { $("#story_container").append(e), sharingIcon(), getstart = parseInt(getstart) + 10, running = "no", $("#loader").hide(10), $("#left-nav").css("height", $(document).height()), ga("send", "event", "NEXT_STORYLIST", "click", location.href, getstart, { nonInteraction: 1 }); var t = location.href; try { t = t.replace(site_base_url, "/") } catch (a) {} ga("send", "pageview", t) } }, error: function() { $("#loader").hide(10), alert("Error retreiving data reload and try again.") } })) } function numberFormat(e) { return e > 999 ? (e / 1e3).toFixed(1) + "k" : e } function escapeRegExp(e) { return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1") } function replaceAll(e, t, a) { return e.replace(new RegExp(escapeRegExp(t), "g"), a) } function getParameterByName(e) { e = e.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var t = new RegExp("[\\?&]" + e + "=([^]*)"), a = t.exec(location.search); return null == a ? "" : decodeURIComponent(a[1].replace(/\+/g, " ")) } function setCookie(e, t, a) { var r = new Date; r.setTime(r.getTime() + 24 * a * 60 * 60 * 1e3); var n = "expires=" + r.toUTCString(); document.cookie = e + "=" + t + "; " + n } function getCookie(e) { for (var t = e + "=", a = document.cookie.split(";"), r = 0; r < a.length; r++) { for (var n = a[r]; " " == n.charAt(0);) n = n.substring(1); if (-1 != n.indexOf(t)) return n.substring(t.length, n.length) } return "" } function writetoauthor() { $(".writertoauthor").on("click", function() { $(".mailtweet").show() }), $(".closebtn").on("click", function() { $(".mailtweet").hide() }), $(".email").on("click", function() { $(".wrapperdj, .boxdj").show() }), $(".close").on("click", function() { $(".wrapperdj, .boxdj, .mailtweet").hide() }) } function maxCount(e) { var t = 140; $("#textarea_feedback").html(t + " characters remaining"), $("#tweetmsg").keyup(function() { var e = $("#tweetmsg").val().length, a = t - e; $("#textarea_feedback").html(a + " characters remaining") }) } function validateWriterToAuthor() { var e = document.writertoa; return "" == e.name.value ? (alert("Please enter your name"), !1) : e.name.value.length < 3 ? (alert("Your name should contain atleast 4 characters."), !1) : "" == e.email.value ? (alert("Please enter your email"), !1) : "no" == validate_email_new(e.email.value) ? (alert("Please enter a valid email"), !1) : e.email.value.length < 5 ? (alert("Your email should contain atleast 5 characters."), !1) : "" == e.subject.value ? (alert("Please enter a subject"), !1) : "" == e.message.value ? (alert("Please enter a message"), !1) : e.message.value.length < 10 ? (alert("Your message should contain atleast 10 characters."), !1) : !0 } function sharingIcon() { $(".share-icon").on("click", function() { $(this).hide(), $(this).next("ul").show(), $(".social-wigd ul").on("mouseleave", function() { $(".social-wigd ul").hide(), $(".share-icon").show() }) }) } function searchtopic(e) { var t = document.getElementById(e); if ("" == t.value.trim()) { $('.showsearch').css('display', 'block'); $('#search_form').hide(); return false; alert("Please enter text to search."); }!1; if ("" != t.value && "" != t.value) { for (var a = t.value, r = "", n = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ", o = 0; o < a.length; o++) - 1 == n.indexOf(a.charAt(o)) || (r += " " == a.charAt(o) ? "-" : a.charAt(o)); "" != r && (r = r.toLowerCase()), t.value = r } return window.location.href = site_base_url + "topic/" + t.value + "/", !1 } function searchtopicadv() { var e = document.getElementById("searchtopicadvance"); if ("" == e.value) return alert("Please enter text to search."), !1; if ("" != e.value) { for (var t = e.value, a = "", r = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ", n = 0; n < t.length; n++) - 1 == r.indexOf(t.charAt(n)) || (a += " " == t.charAt(n) ? "-" : t.charAt(n)); "" != a && (a = a.toLowerCase()), e.value = a } if (getstart = "0", "" != $("#startdate").val() && (getstartdate = $("#startdate").val()), "" != $("#enddate").val() && (getenddate = $("#enddate").val()), "" == $("#searchtopicadvance").val()) return alert("Please enter keyword to search"), !1; getkeyword = $("#searchtopicadvance").val(), getsearch_by = $("#search_by").val(), getsearch_type = $("input[name=search_type]:checked").val(); try { window.history.pushState({ pageTitle: getkeyword }, getkeyword, site_base_url + "topic/" + e.value + "/") } catch (o) {} return $("#story_container").html(""), running = "no", getNextStoryList(), !1 } function editProfile() { var e = document.profile; return "" == e.social_name.value ? (alert("Please enter your name"), !1) : e.social_name.value.length < 4 ? (alert("Your message should contain atleast 4 characters."), !1) : void 0 } function validate_post() { if ("" == $("input[name=title]").val() || "Header" == $("input[name=title]").val()) return $("input[name=title]").addClass("error"), !1; if ($("input[name=title]").removeClass("error"), "" == $("input[name=short_description]").val() || "Sub Header" == $("input[name=short_description]").val()) return $("input[name=short_description]").addClass("error"), !1; if ($("input[name=short_description]").removeClass("error"), "" == $("input[name=category_id]").val()) return $(".dropdowndt").addClass("error"), !1; $(".dropdowndt").removeClass("error"); var e = tinyMCE.getContent("full_description"); if ("" == e) return $(".mce-tinymce").addClass("error"), !1; if ($(".mce-tinymce").removeClass("error"), "" == $("input[name=id]").val()) { if ("" == $("#header_image").val() && "" == $("#header_image_url").val()) return $(".cover-pic,#header_image,#header_image_url").addClass("error"), !1; $(".cover-pic,#header_image,#header_image_url").removeClass("error") } return "" == $("input[name=header_image_caption]").val() ? ($("input[name=header_image_caption]").addClass("error"), !1) : void $("input[name=header_image_caption]").removeClass("error") } function validate_email_new(e) { return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(e) ? "yes" : "no" } function validateContactL() { var e = document.contactus; return "" == e.message.value ? (alert("Please enter a message"), !1) : e.message.value.length < 10 ? (alert("Your message should contain atleast 10 characters."), !1) : void 0 } function validateContactWL() { var e = document.contactus; return "" == e.email.value ? (alert("Please enter your email"), !1) : "no" == validate_email_new(e.email.value) ? (alert("Please enter a valid email"), !1) : e.email.value.length < 5 ? (alert("Your email should contain atleast 5 characters."), !1) : "" == e.name.value ? (alert("Please enter your name"), !1) : e.name.value.length < 3 ? (alert("Your name should contain atleast 4 characters."), !1) : "" == e.message.value ? (alert("Please enter a message"), !1) : e.message.value.length < 10 ? (alert("Your message should contain atleast 10 characters."), !1) : !0 } var running = "no", getstart = 10, currentloct = location.href; currentloct.match("www.") || (site_base_url = site_base_url.replace("www.", "")); var newscroll = lastscroll = ""; $(document).ready(function(e) { $(window).scroll(function() { $(window).scrollTop() + $(window).height() == $(document).height() && getNextStoryList() }) }), "function" != typeof String.prototype.trim && (String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, "") }); var getstart = 10, getpage = "", getid = "", gettype = "", getuser = "", getstartdate = getenddate = getkeyword = getsearch_type = getsearch_by = "", winwidth = "", w_height = "", w_heigh = "", w_width = ""; $(document).ready(function(e) { function t() { "b" == s ? (o -= 1, $(".st_belt ul").animate({ top: "+=" + n }), 1 == o && (s = "f")) : ($(".st_belt ul").animate({ top: "-=" + n }), o += 1, o == r && (s = "b")) } navigator.userAgent.toLowerCase().match("ipad") && ($(".header-inside").attr("style", "display:block!important;"), $(".mobile-logo").attr("style", "display:none!important;")), $("#mobile-nav").click(function() { $(".main-navigation").slideToggle("slow") }); try { $("img.lazyimg").each(function() { try { var e = $(this).attr("datasrc"); $(this).attr("src", e) } catch (t) {} }) } catch (a) {} sharingIcon(), maxCount(140), writetoauthor(), $("body").prepend('
'), /* $(".new_story").click(function() { $(".wrapper").height($(document).height()), $(".wrapper").show(), $(".twsignin").show(), $(".twsignin").css("left", w_width + 50) }), $(".close_twsignin").click(function() { $(".twsignin").hide(), $(".wrapper").hide() }), */ $(".showsearch").click(function() { $(this).hide(1), $("#search_form").show(1), ga("send", "event", "SEARCH_BUTTON", "click", "OPEN", 1, { nonInteraction: 1 }) }), $("input[name=cancel]").click(function() { $("textarea[name=social_description]").val($("p.user_description").html()), $(".editprooff").hide(10), $(".editproon").show(10), $("#social_name").attr("disabled", "disabled").css({ border: "none" }) }), winwidth = $(window).width(), w_height = $(document).height(), w_heigh = $(document).height(), w_width = $(window).width(), w_width -= 350, w_width /= 2, $(".wrapper").click(function() { $(".wrapper,.savewrapper, .comment-box, .share-box,.outerdiv,.rrcomment-box,.prwrapper,.prcomment-box,.twsignin").hide() }), $(".dropdowndt img.flag").addClass("flagvisibility"), $(".dropdowndt dt a").click(function() { $(".dropdowndt dd ul").toggle() }), $(".dropdowndt dd ul li a").click(function() { var e = $(this).html(), t = $(this).attr("value"); $(".dropdowndt dd ul li").removeClass("active"), $(this).parent("li").addClass("active"), $(".dropdowndt dt a span").attr("value", t).html(e), $("#category_id").val(t), $(".dropdowndt dd ul").hide() }), $(document).bind("click", function(e) { var t = $(e.target); t.parents().hasClass("dropdowndt") || $(".dropdowndt dd ul").hide() }), $("#flagSwitcher").click(function() { $(".dropdowndt img.flag").toggleClass("flagvisibility") }), $(".p-share").click(function() { $(".comment-box").css("left", w_width) }), $(".header").focus(function() { "Header" == $(this).val() && $(this).val("") }), $(".header").blur(function() { "" == $(this).val() && $(this).val("Header") }), $(".subheader").focus(function() { "Sub Header" == $(this).val() && $(this).val("") }), $(".subheader").blur(function() { "" == $(this).val() && $(this).val("Sub Header") }), $(".cover-pic").click(function() { $(".wrapper").show(100), $(".outerdiv").show(100) }), $("#upload").addClass("border"), $("#library").click(function() { $(this).addClass("border"), $("#upload").removeClass("border"), $(".library").show(), $(".upload").hide() }), $("#upload").click(function() { $(this).addClass("border"), $("#library").removeClass("border"), $(".upload").show(), $(".library").hide() }), $(".img_select").click(function() { $(".wrapper").hide(100), $(".outerdiv").hide(100) }), $("#search").click(function() { $(this).css("background", "url(http://media2.intoday.in/indiatoday/dailyo/plus.jpg) no-repeat 0"), $("div.txt").toggleClass("txt"), $("#search-box").slideToggle() }), $("#author-story li a").click(function() { $("#author-story li a").removeClass("by-active"), $(this).addClass("by-active"), $("#search_by").val($(this).attr("val")) }); var r = $(".st_belt ul li").length, n = $(".st_belt ul li").height(), o = 1; $("#top_highlight .st_belt").css("height", n), $("#top_highlight .st_belt ul li").css("height", n); var i = setInterval(t, 6e3), s = "f"; $(".st_belt").mouseenter(function() { clearInterval(i) }), $(".st_belt").mouseleave(function() { i = setInterval(t, 6e3) }), $(".edit-btn").click(function() { $(".editproon,#socilname").hide(10), $(".editprooff").show(10), $("#social_name").show(10).removeAttr("disabled").css({ border: "1px solid #000" }) }) }), $(window).scroll(function() { var e = ($("body").height(), $(window).scrollTop()); e > 160 ? ($(".menues").css({ position: "fixed", top: "0", width: "100%", "z-index": "9999", "border-bottom": "1px solid rgb(136, 136, 136)", "box-shadow": "0px 0px 5px rgb(0, 0, 0)", "left": 0 }), $(".menu-inner ul li .nav-icon").css("color", "#2B2F31"), $("nav ul li a").addClass("nav_padding"), $(".home-icon").css("display", "none"), $(".app").css("display", "block")) : ($(".menues").css({ position: "relative", top: "0", "box-shadow": "none" }), $(".menu-inner ul li .nav-icon").css("color", "#ffc20f"), $("nav ul li a").addClass("nav_padding"), $(".home-icon").css("display", "block"), $(".app").css("display", "none"), $("#left-nav").css('top', '0px')) });