Popular in Ballon D'Or
Latest
-1) { img_url = /href='http://www.expopakistan.gov.pk/?([^']+)'/.exec(lines[i])[1]; temp_info[this.href] = img_url; //console.log(img_url); } } img_url = img_url.replace(/\/s[0-9]+\//, "/w200-h103-c/"); $(".inpost-link#" + index + " img").attr("src", img_url); if (post_title != "") { $(".inpost-link#" + index + " span").html(post_title); } }); } } } }); } //automatic header bar if(document.URL.indexOf(".html") > -1 | document.URL.indexOf("post-preview") > -1) { var tabs = $(".link-anchor-2"); //header bar currently not present if ($(".headerbar-2-container").not("#tabs").length == 0 && tabs.length > 0) { $(".headerbar-2-container").remove(); $(".nav-message-container").remove(); var headerbar_html = ''; $("#headerbar").after(headerbar_html + ''); addClass(document.body, "nav2-shown"); HideBarInApp(); } } //toggle class headerbar-2 $("#Header1").on("click", ".headerbar-2 > li > a", function () { $(".headerbar-2 > li > a").removeClass("highlight"); $(this).addClass("highlight"); }); if (document.getElementById("blog-pager") != null && $("#blog-pager").html().length < 10) { $("#blog-pager").remove(); } //load normal site if device isn't mobile //is mobile? (function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera); if(document.URL.indexOf("m=1") >= 0){ if(!jQuery.browser.mobile) { var url = document.URL.replace("?m=1", "").replace("&m=1", "") window.location.replace(url); } } // fix paddings in KIt Overview if (document.URL.indexOf("kit-overview") > -1 && document.URL.indexOf("app=1") > -1) { $(".link-anchor-2").css("padding-top", "40px"); } function isAndroid () { return (navigator.userAgent.toLowerCase().indexOf("android") > -1); } nativeAds = [ { title: "CFS: Shop Now - Extra 10% Off with FH10", image: [ "https://1.bp.blogspot.com/-RdzemYOwu8c/W_E3UqimMgI/AAAAAAABurU/zUAZKDBKt4sRFRdWYubSSXmqzOS2wBv1wCLcBGAs/s1600/classicfootballshirts_44790571_484507982044204_8756982609610574970_n.jpg", "https://2.bp.blogspot.com/-iR6U4xIFNg8/W_E3U14GTTI/AAAAAAABurc/XxATf_wrhzYMJAqFvVeM5ttABKa0nfFBACLcBGAs/s1600/classicfootballshirts_44816186_176935076589422_7705553530891110362_n.jpg", "https://3.bp.blogspot.com/-iO7wWxvyZuM/W_E3VujTk0I/AAAAAAABurg/dUg9HBiHfi4DUzNvc970D3wIh4LOwv9IQCLcBGAs/s1600/classicfootballshirts_45437740_251358688876346_1945534210140287350_n.jpg", "https://3.bp.blogspot.com/-mkAjph22OaI/W_E3UlqABeI/AAAAAAABurY/FAJqOctnLYgU3YDFXhvZFsJtva5-kxbywCLcBGAs/s1600/Untitled-1.jpg" ], link: "https://www.classicfootballshirts.co.uk/?ref=footyheadlines&clickref=fh_native", content: "Use FH10 for an additional 10 percent off at CFS (Classic Football Shirts)!", origin: "Classic Football Shirts", weight: 8 }, { title: "Boot Calendar - All Leaked and Released Football Boots", image: [ "https://4.bp.blogspot.com/-XBpM2rRP3qU/W1bW9tbP2qI/AAAAAAABo2w/bbQbKV67vDAK7Lo-Kp2kVMj2-VhaFo4CACLcBGAs/s1600/boot-cal.jpg", "https://1.bp.blogspot.com/-0wwuTMtpSYM/W1N5DUzIdhI/AAAAAAABosA/8l-wcaQWuuYzNZheqCqKwO72OQc458hJACLcBGAs/s1600/og-adidas-predator-accelerator-boots-2.jpg", "https://4.bp.blogspot.com/-z_G7sq9OIQ0/W1L3J-z9I1I/AAAAAAABomI/GJ5noUnDkFoy99P8JE91NFQiTQxd-EjGgCLcBGAs/s1600/nike-phantom-venom-2019-boots-orange-black-2.jpg", "https://4.bp.blogspot.com/-rz3vYe5LRuo/W1NMDGhBFzI/AAAAAAABorE/suIQ9F0eu4o-P2bYmVXYrf7lLTW8DObIQCLcBGAs/s1600/adidas-team-mode-pack-51.jpg", "https://4.bp.blogspot.com/-fU6rLqAhvF0/W1NKrADk4RI/AAAAAAABop0/G4jV6AplDEUR_wKix6MDSKzD2YhAJHdTgCLcBGAs/s1600/adidas-team-mode-pack-33.jpg" ], link: "http://www.expopakistan.gov.pk/?2018/05/boot-calendar.html", content: "Welcome to the brand-new Wpsoccer Boot Calendar. In order to give you an even better overview over the upcoming football boot leaks and releases, we've completely revamped the Boot Calendar. We hope you like it! Check out some of the latest updates below:", origin: "Wpsoccer", weight: 1 }, { title: "2019-20 Kit Overview: All 19-20 Kit Leaks and Info", image: "https://3.bp.blogspot.com/-RM4Z3afphb8/W7eN3m-XcnI/AAAAAAABs2o/mZrq4F_rsrAlUx90OjS_7Z1Z3-LZKCSiwCLcBGAs/s1600/19-20-kit-overview.jpg", link: "http://www.expopakistan.gov.pk/?2018/10/2019-20-kit-overview-all-19-20-kit-leaks-info.html", content: "Over the past few weeks, the first details on next season's kits have surfaced. Although it's admittedly quite early, we've decided to open our famed Kit Overview for the 2019-20 campaign.", origin: "Wpsoccer", weight: 3 }, { title: "Wpsoccer App", type: "android", origin: "Wpsoccer", link: "https://play.google.com/store/apps/details?id=com.footyheadlines.footyheadlines", content: "", image: "https://1.bp.blogspot.com/-ff_9gaHuqzQ/WSlyoN7fNxI/AAAAAAABOBc/uxVHGk9AzxkuVrhNns-w8crcgLdSAMhdQCLcB/s1600/app-ad.jpg" } ]; function getGeodata(){ var script=document.createElement('script'); script.src="http://www.geoplugin.net/javascript.gp"; var done=false; script.onload=script.onreadystatechange = function(){ if ( !done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete') ) { done=true; //script // filter ads by location var language = window.navigator.userLanguage || window.navigator.language; nativeAds = $.grep(nativeAds, function(e){ if (e.country) { if (language.indexOf("e.country") > -1) { return true; } return language.indexOf("e.country"); //return e.country == geoplugin_countryCode(); } else { return true; } }); //load ads AddMoreAds(); script.onload = script.onreadystatechange = null; } }; script.onerror = function() { AddMoreAds(); } document.body.appendChild(script); } //AddMoreAds(); //getGeodata(); // remove based on time var now_time = new Date().getTime(); nativeAds = $.grep(nativeAds, function(e) { if (e.start_time) { var start_time = Date.parse(e.start_time); if (start_time > now_time) { //console.log("Disabled based on start time - " + e.title); return false; } } if (e.end_time) { var end_time = Date.parse(e.end_time); if (end_time < now_time) { //console.log("Disabled based on end time - " + e.title); return false; } } return true; }); // filter ads by location var language = window.navigator.userLanguage || window.navigator.language; nativeAds = $.grep(nativeAds, function(e){ if (e.country) { return (language.indexOf(e.country) > -1); } else { return true; } }); // filter ads if (!isAndroid()) { nativeAds = $.grep(nativeAds, function(e){ return e.type != "android"; }); } $.each(nativeAds, function(index, value) { // duplicate by weight if (value.weight != null) { if (value.weight > 0) { for (var i = 0; i < value.weight; i++) { nativeAds.push(nativeAds[index]); } } } }); function getRandom(arr, n) { var result = new Array(n), len = arr.length, taken = new Array(len); if (n > len) throw new RangeError("getRandom: more elements taken than available"); while (n--) { var x = Math.floor(Math.random() * len); result[n] = arr[x in taken ? taken[x] : x]; taken[x] = --len in taken ? taken[len] : len; } return result; } function NativeAd() { if (Math.floor(Math.random() * 3) == 1) { //kitbag test var temp_native_ads = getRandom(inPostAdsSpliced, 5); var url_homepage = "https://www.awin1.com/cread.php?awinmid=686&awinaffid=503539&clickref=&p=" + encodeURIComponent("http://www.kitbag.com/stores/kitbag/en"); var temp_html = "
Shop at- free worldwide delivery on all orders
"; for (var i = 0; i < temp_native_ads.length; i++) { var url = "https://www.awin1.com/cread.php?awinmid=686&awinaffid=503539&clickref=&p=" + encodeURIComponent(temp_native_ads[i].url); var temp_title = temp_native_ads[i].title; if (temp_title.length > 25) { temp_title = temp_title.substring(0,24)+"..."; } temp_html += "
" + temp_title + "
Buy now
"; } temp_html += "
"; $nativeAd = $(temp_html); return $nativeAd[0]; } else { //random create ad // random number between 0 and 20 var nativeAdIndex = Math.floor(Math.random() * nativeAds.length * 2); if (nativeAds[nativeAdIndex] != null) { $nativeAd = $("
"); var image_link = ""; if (nativeAds[nativeAdIndex].image.constructor === Array) { image_link = nativeAds[nativeAdIndex].image[Math.floor(Math.random() * nativeAds[nativeAdIndex].image.length)]; } else { image_link = nativeAds[nativeAdIndex].image; }; //sometimes bigger (1/3 of cases - only desktop) /* if (mobile == 0) { //every fourth ad is big if ((Math.floor(Math.random() * 4) == 0 || nativeAds[nativeAdIndex].alwaysBig) && !nativeAds[nativeAdIndex].alwaysSmall) { $nativeAd.removeClass("mszobr"); image_link = image_link.replace(/\/s[0-9]+\//, '/w350-h179-c/'); } else { image_link = nativeAds[nativeAdIndex].imageSquare || image_link; image_link = image_link.replace(/\/s[0-9]+\//, '/s200-c/'); } } else { image_link = image_link.replace(/\/s[0-9]+\//, '/w400-h205-c/'); } */ image_link = image_link.replace(/\/s[0-9]+\//, '/w350-h179-c/'); if ($nativeAd != null) { $nativeAd.find("a").attr("href", nativeAds[nativeAdIndex].link); $nativeAd.find("a").attr("target", "_blank"); //$nativeAd.find("a").attr("href", "/p/out.html?type=native&target=" + encodeURIComponent(nativeAds[nativeAdIndex].link) + "&label=" + encodeURIComponent(nativeAds[nativeAdIndex].origin + "http://www.expopakistan.gov.pk/images/contact/foot.asp" + nativeAds[nativeAdIndex].title + "http://www.expopakistan.gov.pk/images/contact/foot.asp" + nativeAds[nativeAdIndex].link)); //$nativeAd.find("a").attr("onClick", "_gaq.push([\"_trackEvent\", \"native\", \"click\", \"" + nativeAds[nativeAdIndex].origin + "http://www.expopakistan.gov.pk/images/contact/foot.asp" + nativeAds[nativeAdIndex].title + "http://www.expopakistan.gov.pk/images/contact/foot.asp" + nativeAds[nativeAdIndex].link + "\", 0]);"); $nativeAd.find(".post-img").attr("data-src", image_link); $nativeAd.find(".post-title > a").text(nativeAds[nativeAdIndex].title); $nativeAd.find(".post-snippet").html(createSummaryText(nativeAds[nativeAdIndex].content)); if (nativeAds[nativeAdIndex].origin != null) { $nativeAd.find("#mszobr-origin").text(nativeAds[nativeAdIndex].origin); } if (nativeAds[nativeAdIndex].origin == "Wpsoccer") { $nativeAd.find(".post-meta").remove(); } } return $nativeAd[0]; } else { return null; } } } //add native ad at "position 2" (only if page has posts) if (!noads) { //$("#main-wrap2").prepend(NativeAd()); //lazyload(); } else { $("#ad-3").css("display", "none"); $("#ad-1").css("display", "none"); $("#sidebar").css("display", "none"); } //display "no posts found" if (document.URL.indexOf("/search") > -1) { if (document.getElementById("blog-posts").innerHTML.length < 10) { $("#main-page").append($("")); } } //add more native ads function AddMoreAds() { var posts = $("#blog-posts > .post"); /* native top */ /* var nativeAdIndex = Math.floor(Math.random() * nativeAds.length); if (nativeAds[nativeAdIndex] != null) { var t_image_link = ""; if (nativeAds[nativeAdIndex].image.constructor === Array) { t_image_link = nativeAds[nativeAdIndex].image[Math.floor(Math.random() * nativeAds[nativeAdIndex].image.length)]; } else { t_image_link = nativeAds[nativeAdIndex].image; }; t_image_link = t_image_link.replace(/\/s[0-9]+\//, '/w350-h179-c/'); //var t_onclick = " onclick=\"_gaq.push(['_trackEvent', 'native', 'click', '" + nativeAds[nativeAdIndex].origin.replace("'", "") + "http://www.expopakistan.gov.pk/images/contact/foot.asp" + nativeAds[nativeAdIndex].title.replace("'", "") + "http://www.expopakistan.gov.pk/images/contact/foot.asp" + nativeAds[nativeAdIndex].link + "', 0]);\""; var t_link = "/p/out.html?type=native&target=" + encodeURIComponent(nativeAds[nativeAdIndex].link) + "&label=" + encodeURIComponent(nativeAds[nativeAdIndex].origin + "http://www.expopakistan.gov.pk/images/contact/foot.asp" + nativeAds[nativeAdIndex].title + "http://www.expopakistan.gov.pk/images/contact/foot.asp" + nativeAds[nativeAdIndex].link); //"/p/out.html?type=native&target=" + encodeURIComponent(nativeAds[nativeAdIndex].link) + "&label=" + encodeURIComponent(nativeAds[nativeAdIndex].origin + "http://www.expopakistan.gov.pk/images/contact/foot.asp" + nativeAds[nativeAdIndex].title + "http://www.expopakistan.gov.pk/images/contact/foot.asp" + nativeAds[nativeAdIndex].link) var html = "

" + nativeAds[nativeAdIndex].title + "

"; if (nativeAds[nativeAdIndex].origin != "Wpsoccer") { html += "
Ad " + nativeAds[nativeAdIndex].origin + "
"; } html += "
"; if (windowWidth > 450 && windowWidth <= 1100) { } else { var t_index = getRandomInt(0, 3); if (t_index < 2) { $("#top-block-side > div:eq(" + t_index + ")").before($(html)); } else if (t_index == 2) { $("#top-block-side > div:eq(1)").after($(html)); } } } */ var temp_index = getRandomInt(0, 2); while (temp_index < posts.length) { $(posts[temp_index]).before(NativeAd()); temp_index += getRandomInt(3,5); } /* var ad_temp_index = 0; while (ad_temp_index < posts.length) { //$(posts[ad_temp_index]).after("
"); $(posts[ad_temp_index]).after("
"); (adsbygoogle = window.adsbygoogle || []).push({}); ad_temp_index += 6; } */ $("#content-rec").before(NativeAd()); //lazy load images lazyload(); } AddMoreAds(); // load blogger basic css /* var cssId = 'myCss'; // you could encode the css path itself to generate id.. if (!document.getElementById(cssId)) { var head = document.getElementsByTagName('head')[0]; var link = document.createElement('link'); link.id = cssId; link.rel = 'stylesheet'; link.type = 'text/css'; link.href = 'https://www.blogger.com/static/v1/widgets/3332739511-widget_css_bundle.css'; link.media = 'all'; head.appendChild(link); } */ /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ var disqus_shortname = 'footyheadlines'; // required: replace example with your forum shortname //loading more posts at bottom (function(a) { function h() { load = false; g || (g = !0, d ? (b.find("a").hide(), b.find("img").show(), a.ajax(d, { dataType: "html" }).done(function(c) { var c = a("
").append(c.replace(j, "")), e = c.find("a.blog-pager-older-link"); e ? d = e.attr("href") : (d = "", b.hide()); var c_temp = c.find(i); c = c.find(i).children(".post"); var tempPostCount = c.length; //remove pager on first scroll if (count == 0) { /* $("#PopularPosts2").appendTo(a(main)); $("#PopularPosts3").appendTo(a(main)); $("#social-buttons").appendTo(a(main)); */ $("#disqus-container").appendTo(a(main)); var blogPager = document.getElementById("blog-pager"); //blogPager.parentNode.removeChild(blogPager); if (blogPager != null) blogPager.style.display = "none"; } count++; $(".post-comment-link").each(function(index) { $(this).removeClass("post-comment-link"); }); /* facebook like box */ /* if (count > 1 | document.URL.indexOf("html") < 0) { if (Math.floor(Math.random() * 100) < 50) { $("#main-wrap2").append($('')); } } */ /* ads */ var index_ad = getRandomInt(1, 3); if (count == 1) { index_ad = getRandomInt(3, 5); } var ad_count = 0; while (index_ad < c.length) { c.splice(index_ad, 0, $("
")[0]); ad_count++; //a(main).append($("
TEST
")); index_ad += getRandomInt(4, 7); } console.log(ad_count); /* native ad */ var index = getRandomInt(0, 2); while (index < c.length) { $nativeAd = NativeAd(); //console.log($nativeAd); if ($nativeAd != null) { c.splice(index, 0, $nativeAd); //console.log(c); } index+= getRandomInt(3, 5); } if (count == 1 && document.URL.indexOf("html") > 0) { //console.log("2140105194"); //$("#col-main-1").append($("
Latest
")); $("#col-main-1").append(c); } else if (tempPostCount > 0) { $("#main-page").append($("
")); ad_count++; $("#main-page").append($("
")); ad_count++; $("#col-main-" + count).append(c); } /* // realigning posts if (count == 1 & document.URL.indexOf("html") > 0) { var topPosts = c.filter(".top"); var normalPosts = c.not(".top"); a(main).append(topPosts); a(main).append(normalPosts); //console.log(topPosts); //console.log(normalPosts); } else { a(main).append(c); } */ //load ads into containers for (var counter = 0; counter < ad_count; counter++) { (adsbygoogle = window.adsbygoogle || []).push({}); } // lazy load images lazyload(); /* end realigning posts */ //c.insert(1,div); // remove small post if same as opened post $(".post.index").each(function(index) { if (!$(this).hasClass("checked")) { $(this).addClass("checked"); if (current.indexOf($(this).children(".post-link").attr("href")) > -1 | current.indexOf($(this).children(".post-info").children(".post-link").attr("href")) > -1) { $(this).remove(); } } }); if (document.URL.indexOf("html") > 0 && count == 1) { var social_buttons = c_temp.children("#social-buttons"); var story_text = c_temp.children("#story-text"); var nf_button = c_temp.children("#nf-text"); var fhes_button = c_temp.children("#fhes-text"); var fbdb_embed = c_temp.children("#fbdb-embed"); $("#main-wrap2").find(".post.index").eq(1).after($('')); $("#main-wrap2").find(".post.index").eq(1).after(fbdb_embed); iFrameResize({}, '#fbdb-iframe'); $("#main-wrap2").find(".post.index").eq(2).after(social_buttons); $("#main-wrap2").find(".post.index").eq(2).after(nf_button); $("#main-wrap2").find(".post.index").eq(3).after(story_text); /* var div = $("
"); var div2 = $("
"); a(main).find(".post.index").eq(2).after(div); if (a(main).find(".post.index").length > 4) { a(main).find(".post.index").eq(4).after(div2); } else { a(main).append(div2); } UnimportantPostsFetcher(); */ } /* if ((count > 1 | document.URL.indexOf("html") < 0) & (document.URL.indexOf("search") < 0)) { a(main).append($("
")); var script = document.createElement('script'); script.src = "http://www.expopakistan.gov.pk/?feeds/posts/summary/-/ZZZ?published&alt=json&max-results=6&start-index=" + (unimportantPostsCount + 1) + "&callback=UnimportantPosts2"; document.body.appendChild(script); } */ //window._gaq && window._gaq.push(["_trackPageview", d]); window.gapi && window.gapi.plusone && window.gapi.plusone.go && window.gapi.plusone.go(); window.disqus_shortname && a.("https://" + window.disqus_shortname + ".disqus.com/blogger_index.js"); window.FB && window.FB.XFBML && window.FB.XFBML.parse && window.FB.XFBML.parse(); window.twttr && window.twttr.widgets && window.twttr.widgets.load && window.twttr.widgets.load(); b.find("img").hide(); b.find("a").show(); g = !1 })) : b.hide()) load = true; } function k() { if (!menu_open) { var a = Math.max(f.height(), l.height(), document.documentElement.clientHeight), b = f.scrollTop() + f.height(); threshold > a - b && h() } } var d = "", load = true, b = null, i = "div.blog-posts", //main = "div#main-wrap2", main = "#blog-posts", g = !1, f = a(window), l = a(document), threshold = 1000, count = 0, j = /[^<]*(?:(?!<\/ad>)<[^<]*)*<\/ad>/gi, current = document.URL; if (document.location.href.indexOf('m=1') > -1) { threshold = 700; } /*a(document).ready(function () {*/ if ((d = a("a.blog-pager-older-link").attr("href")) && !menu_open && load) { var c = a('Load more posts'); c.click(h); //var e = a(''); f.scroll(k); b = a('
'); /* b.append(c); */ //b.append(e); //b.insertBefore(a("#blog-pager")); } /*})*/ })(jQuery); function comparisonImageResizer() { var $width=$(".post-body").width(); var $curHeight=window.comparisonImageHeight;//$("#comparison").height(); if ($width<738) { $("#comparison").css({"width":$width+"px","height":$width/738*$curHeight+"px"}); } } delta = 350; var lastScrollTop = 0; if ($("#tabs").length > 0 & document.URL.indexOf("html") > 0) { $(window).scroll(function(event) { var st = $(this).scrollTop(); if (st > lastScrollTop && st > delta) { // downscroll code $("body").addClass("tabs-hidden"); } else { // upscroll code $("body").removeClass("tabs-hidden"); } lastScrollTop = st; }); } if($("#comparison").length != 0) { moveDivisor(); window.comparisonImageHeight=$("#comparison").height(); comparisonImageResizer(); console.log("Comparison found."); } $(window).resize(function() { if($("#comparison").length != 0) { comparisonImageResizer(); } }); //mobile $("#open-search-mobile").click(function () { $(".google-search").toggleClass("google-search-visible"); $("#open-search-mobile").css("display","none"); $("#cancel-search").css("display","block"); $(".search-box").focus(); }); $("#cancel-search").click(function () { $(".google-search").toggleClass("google-search-visible"); $("#open-search-mobile").removeAttr("style"); $("#cancel-search").removeAttr("style"); }); var menu_open = false; function toggleMenu() { if ($(document.body).hasClass("visible")) { var scrollTop = document.getElementById("outer-wrapper").scrollTop; //var scrollTop = document.body.scrollTop; //console.log(scrollTop); $(document.body).removeClass("visible"); window.scrollTo(0,scrollTop); menu_open = false; } else { var scrollTop = window.pageYOffset; $(document.body).addClass("visible"); //document.body.scrollTop = scrollTop; document.getElementById("outer-wrapper").scrollTop = scrollTop; menu_open = true; } } $("#menu-icon").click(function () { toggleMenu(); }); $("#black-overlay").click(function () { toggleMenu(); }); function toggleSearch() { if (windowWidth <= 850) { $("#headerbar").toggleClass("search-open"); if ($("#headerbar").hasClass("search-open")) { $("#search-box").focus(); } } } $(".search-icon").click(function () { toggleSearch(); }); $("#search-box").blur(function () { toggleSearch(); }); $(".close-search").click(function () { toggleSearch(); }); $( ".post-shares" ).each(function(index) { var obj_shares = $(this); var url = obj_shares.attr("data-href"); var count = 0; var count_comm = 0; var count_site = ""; $.getJSON("https://api.facebook.com/method/fql.query?query=select%20total_count%20from%20link_stat%20where%20url=%27" + url + "%27&format=json", function(json,$obj) { var count_fb = json[0].total_count; count = count + count_fb; count_site = count; if (count>1000) { count_site=(Math.floor(count/100)/10).toFixed(1)+'k'; count_site=count_site.replace('.0',''); } if (count == 1) {obj_shares.text(count_site + " Share"); } else {obj_shares.text(count_site + " Shares"); } }); /* $.getJSON("http://urls.api.twitter.com/1/urls/count.json?callback=?&url=" + url, function(json,$obj) { var count_tw = json.count; count = count + count_tw; count_site = count; if (count>1000) { count_site=(Math.floor(count/100)/10).toFixed(1)+'k'; count_site=count_site.replace('.0',''); } if (count == 1) {obj_shares.text(count_site + " Share"); } else {obj_shares.text(count_site + " Shares"); } }); */ }); $("#show-more").click(function(){ $("#hidden-boot-calendar").toggle(); $("#show-more").toggle(); }); //function tablet function is_touch_device() { return (('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)); } if (is_touch_device()) { $('.nav').toggleClass('tablet'); $('.nav').removeClass('normal'); $("ul.nav > li > a").click(function () { if($(this).parent().children().size() > 1) { $(this).parent().toggleClass('tablet-open').siblings().removeClass('tablet-open'); return false; } }); } $('.load-delay').each(function () { $(this).attr('src', $(this).attr('delayedsrc')); }); /* //load feed var script2 = document.createElement('script'); //script2.src = "http://ajax.googleapis.com/ajax/services/feed/load?q=http%3A%2F%2Fwww.footyheadlines.com%2Ffeeds%2Fposts%2Fdefault&num=5&output=json&v=1.0&callback=showrecentposts"; script2.src="http://www.expopakistan.gov.pk/?feeds/posts/default?max-results=5&alt=json&callback=showrecentposts"; document.body.appendChild(script2); //boot watch sidebar var script6 = document.createElement('script'); script6.src = "http://www.expopakistan.gov.pk/?feeds/posts/default/-/Boot%20Watch?alt=json&max-results=3&callback=BootWatchSidebar"; document.body.appendChild(script6); */ if(document.URL.indexOf("html") < 0){ //UnimportantPostsFetcher(); } function inView(elem) { var docViewTop = $(window).scrollTop(); var docViewBottom = docViewTop + $(window).height(); var elemTop = $(elem).offset().top; var elemBottom = elemTop + $(elem).outerHeight(); return (elemBottom <= docViewTop); } $el = $(".headerbar-2-container"); if( $el.length & $("#item-post")) { $(document).scroll(function() { if (inView($("#item-post")) && !$el.hasClass("closed")) { $el.addClass("closed"); } else if (!inView($("#item-post")) && $el.hasClass("closed")) { $el.removeClass("closed"); } }); } //disqus var disqusloaded = false; if(document.URL.indexOf(".html") >= 0){ var el = document.getElementById("button-disqus"); function LoadDisqus() { el.remove(); var bloggerjs = document.createElement('script'); bloggerjs.type = 'text/javascript'; bloggerjs.async = true; bloggerjs.src = 'https://'+disqus_shortname+'.disqus.com/blogger_item.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(bloggerjs); disqusloaded = true; } if (document.URL.indexOf("comment") >= 0) { LoadDisqus(); } if (el != null) { el.onclick=function(){ LoadDisqus(); } } } /* * * DON'T EDIT BELOW THIS LINE * * */ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; s.src = 'https://' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); /* slideshow */ function ChangeSlideText(wrapper) { $currentSlide = wrapper.find(".slide.active img"); $descriptionWrapper = wrapper.find(".description"); if ($currentSlide.attr("alt") != null){ $descriptionWrapper.css("display", "block"); $descriptionWrapper.text($currentSlide.attr("alt")); } else { $descriptionWrapper.css("display", "none"); $descriptionWrapper.text(""); } } $currentValue = 0; function ChangeSlide(type, wrapper) { $currentSlideshow = wrapper.find(".slideshow"); $currentSlide = wrapper.find(".slide.active"); $arrowRight = wrapper.find(".slideshow-arrow.right"); $arrowLeft = wrapper.find(".slideshow-arrow.left"); $currentValue = $currentSlideshow.attr("data-transform"); if ($currentValue == null) { $currentValue = 0; } $maxValue = $currentSlideshow.attr("data-count"); $previousValue = $currentValue; if (type == "right") { $currentValue = parseInt($currentValue) - 1; $arrowLeft.css("display", "block"); wrapper.find(".image-count").css("display","none"); } else if (type == "left") { $currentValue = parseInt($currentValue) + 1; $arrowRight.css("display", "block"); } $currentSlideshow.addClass("transition"); if ($currentValue <= 0 & ($currentValue * (-1)) <= ($maxValue - 1)) { $currentSlideshow.css("transform", "translateX(" + ($currentValue * $currentSlideshow.width()) + "px)"); $currentSlideshow.attr("data-transform", $currentValue); } else { $currentSlideshow.css("transform", "translateX(" + ($previousValue * $currentSlideshow.width()) + "px)"); } if ($currentValue == 0) { $arrowLeft.css("display", "none"); } else if (($currentValue * (-1)) == ($maxValue - 1)) { $arrowRight.css("display", "none"); } } $(".slideshow-arrow").click(function() { $slideshowWrapper = $(this).parent().parent(); if ($(this).hasClass("right")) { ChangeSlide("right", $slideshowWrapper); } else if ($(this).hasClass("left")) { ChangeSlide("left", $slideshowWrapper); } }); $(".slideshow-wrapper").on("touchstart", touchstart); $(".slideshow-wrapper").on("touchmove", touchmove); $(".slideshow-wrapper").on("touchend", touchend); var touchStart = 0; var currentImage = null; function touchstart(e) { touchStart = e.originalEvent.touches[0].pageX; touchStartY = e.originalEvent.touches[0].clientY; currentImage = $(e.currentTarget).find(".slideshow"); currentImage.removeClass("transition"); } function touchmove(e) { var touch = e.originalEvent.touches[0].pageX; var difference = touch - touchStart; $currentValue = currentImage.attr("data-transform"); if ($currentValue == null) $currentValue = 0; currentImage.css("transform", "translateX(" + (($currentValue * currentImage.width()) + difference) + "px)"); } function touchend(e) { var touchEnd = e.originalEvent.changedTouches[0].pageX; var touchEndY = e.originalEvent.changedTouches[0].clientY; //currentImage.css("transform", ""); var difference = touchEnd - touchStart; var differenceY = Math.abs(touchEndY - touchStartY); if (differenceY < Math.abs(difference)) { if (difference > 5) { ChangeSlide("left", $(e.currentTarget)); } else if (difference < -5) { ChangeSlide("right", $(e.currentTarget)); } } else { currentImage.addClass("transition"); currentImage.css("transform", "translateX(" + (currentImage.attr("data-transform") * currentImage.width()) + "px)"); } } $(".slideshow").each(function(index){ $(this).find("li").first().addClass("active"); /* Add image count indicator */ $image_count = $(this).find("li").length; $(this).attr("data-count", $image_count); $(this).attr("data-transform", 0); $(this).parent().find(".slideshow-controls").append("
+" + ($image_count-1) + "
"); //console.log($(this).find(".slideshow-controls")); }); $(".slideshow-wrapper").each(function(index) { ChangeSlideText($(this)); }); script.onload = script.onreadystatechange = null; } }; document.body.appendChild(script); } (); /* if (window.addEventListener) window.addEventListener("load", ); else if (window.attachEvent) window.attachEvent("onload", ); else window.onload = ; */ //]]>