$(document).ready( function() { $.ajaxSetup ({ cache: false }); //remove all no javascript css tags $(".no_js").removeClass("no_js"); $(".website-link").bind("click", function() { $.ajax({ type: 'POST', url: "/ajax/link_click.php", data: {name: this.name, href: this.href}, dataType: "json" }); var _gaq = _gaq || []; _gaq.push(['_trackEvent', 'Website Click', this.name, this.href]); }); //make all hyperlinks that open external websites open up $("a[href^=http]").bind("click", function() { $(this).attr("target", "_blank"); }); // Handle recent views. $.post("/ajax/get_recent_views.php", "action=true", function(response){ $('#content').append(response) }); }); function padlength(what){ var output=(what.toString().length==1)? "0"+what : what; return output; } function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'flex') e.style.display = 'none'; else e.style.display = 'flex'; }