$(document).ready(function(){
	
	// Add utility first/last/alt classes to LIs.
	$("ul li:first-child").addClass("first");
	$("ul li:last-child").addClass("last");
	$("ul li:nth-child(even)").addClass("alt");
	$("table tr:nth-child(even)").addClass("alt");
		
});


$(document).ready(function() {
    //find an href with mailto: - then add the mailto class.
    //$("a[href^=mailto:]").addClass("mailto");

    // find '.pdf' or 'DownloadForm.aspx' in an href - then add the '.pdflink' class
    //$("a[href$=.pdf],a[href=DownloadForm.aspx]").addClass("pdflink");
    
    // find every 'li' inside the '.downloadWrapper' class (on the download page) - if it is not the first 'a[href]' then then remove '.pdflink' class from that achor.
    //$(".downloadWrapper li").find("a[href$=.pdf]:gt(0)").removeClass('pdflink');

    // remove the '.pdflink' class to href's with '.pdf' that surround an image
    //$("a[href$=.pdf] > img,a[href=DownloadForm.aspx] img").parent().removeClass('pdflink');

    // add icon to denote external link    
    $("a").filter(function() {
        return this.hostname && this.hostname != location.hostname; 
    }).addClass('external').attr({target: "_blank",  title: "Opens in a new window" });
	$("a > img").parent().filter(function() {
        return this.hostname && this.hostname != location.hostname; 
    }).removeClass('external');




    
});