$(document).ready(function() {
	
	//Add the LOCK icon
	$("a.lock").prepend('<span class="lockIcon"></span>');
		
	// Add pdf icons to pdf links
	$("a[href$='.pdf']").addClass("pdf");
	 
	// Add txt icons to text document links (rtf, txt)
	$("a[href$='.txt'], a[href$='.rtf']").addClass("txt");

	// doc
	$("a[href$='.doc'], a[href$='.docx']").addClass("doc");

	// excel
	$("a[href$='.xsl'], a[href$='.xslx']").addClass("excel");

	// ppt
	$("a[href$='.ppt'], a[href$='.pptx']").addClass("ppt");

	// app
	$("a[href$='.exe'], a[href$='.msi']").addClass("app");

	// Add zip icons to Zip file links (zip, rar)
	$("a[href$='.zip'], a[href$='.rar']").addClass("zip"); 
	
	// Add email icons to email links
	$("a[href^='mailto:']").addClass("email");

	//Add external link icon to external links - 
	$('a').filter(function() {
		//Compare the anchor tag's host name with location's host name
	    return this.hostname && this.hostname !== location.hostname;
	  }).addClass("external");
	
	 
});
