jQuery(document).ready(function() {
	initPage();
});

function initPage() {
	var extensions = new Array('jpg', 'jpeg', 'gif', 'png');
	extensions = jQuery(extensions);
	var selectorString = '';
	
	extensions.each(function () {
		selectorString += "a[@href$='" + this + "'], a[@href$='" + this.toUpperCase() + "'],";
	});
	
	var imageLinks = jQuery(selectorString);
	
	imageLinks.each(function () { // adds shadowbox to each image link
		if (this.rel) {
			this.rel += " shadowbox";
		} else {
			this.rel += "shadowbox";
		}
	});
}