﻿/// <reference path="http://jqueryjs.googlecode.com/files/jquery-1.3.2-vsdoc.js"/>
/// <reference path="shared/jquery-1.3.2-vsdoc.js"/>


function prepContent() {
	// rewrite in-site links for AJAX loads
	$("#content").find("*[text='NMPC']").wrapInner('<acronym title="Northminster Presbyterian Church"></acronym>');
	$("A[href$=.pdf]").prepend('<img src="/images/icons/icon-PDF.gif" class="type pdf" alt="PDF document" title="PDF document" />');
	$("A[href$=.doc],A[href$=.docx]").prepend('<img src="/images/icons/icon-DOC.gif" class="type doc" alt="Word document" title="Word document" />');
	$('A[href*=scr.im]:contains("email")').prepend('<img src="/images/icons/icon-EMAIL.gif" class="type email" alt="Email link" title="Email link" />');
	$('A:not([href*=pack390],[href*=slingfive],[href*=google.com],[href*=scr.im],:not([href*=http]))').prepend('<img src="/images/icons/icon-EXT.gif" class="type ext" alt="External link" title="External link" />');
}

$(function() {
	prepContent();

	/* highlight navitem for current page */
	$(".nav>LI>A[href='" + location.pathname + "']").each(function() {
		$(this).addClass('current');
	})

	// dynamic "pretty" dates
	$(".announcements .date SPAN").prettyDate();
	setInterval(function() { $(".announcements .date SPAN").prettyDate(); }, 60000);

});		