Misc stuff and basics
var xLi, xH2;
// get page title
$('.Event-Title h3 span').each(function() {
var txt = $(this), t = txt.text().split(' ');
xH2 = t.shift();
console.log(this);
});
// get sidenav titles
$('.span3 ul#menuElem > li > ul > li > a').each(function() {
var txt = $(this), t = txt.text().split(' ');
xLi = t.shift();
console.log(this);
if (xLi != xH2) {
$(this).parent().css("display", "none");
}
});
$(function() { // makes urls pretty
$('.Event-Link a').each(function() {
var txt = $(this).html();
$(this).html(txt.replace($(this).html(), $(this)[0].hostname));
});
});
jQuery(function($) {
$('h2 span').each(function() {
var text = $(this).html();
$(this).html(text.replace('ASA Board of Directors', 'Executive Council'));
});
});
// REPLACE ALL COMMAS WITH COMMA-SPACE
$(window).load(function() {
$('.selector').each(function() {
var string = $(this).html();
$(this).html(string.replace(/,/g , ', '));
});
});
// OPEN LINKS IN NEW WINDOW DEPENDING ON LOCATION/FOLDERS
$("a[href^='http']:not([href*='andrologysociety.org'])").attr("target","_blank");
$('a').click(function() {
var iHref = $(this).attr('href');
if ((iHref.indexOf("images/") != -1) || (iHref.indexOf("docs/") != -1)) {
window.open(this.href);return false;
}
});
$(document).ready(function() { });
$(function() { });
jQuery(function($) { });
$(window).load(function(){ });