/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

$(document).ready(function() {
 
        
 
         // Add txt icons to document links (doc, rtf, txt)
	$("a[href$='.pdf']").addClass("pdf");
        
	// Add txt icons to document links (doc, rtf, txt)
	$("a[href$='.doc'], a[href$='.txt'], a[href$='.rft']").addClass("txt");
        
        // Add txt icons to document links (doc, rtf, txt)
	$("a[href$='.jpg'], a[href$='.png'], a[href$='.gif'], a[href$='.jpeg']").filter(function() {
		//Compare the anchor tag's host name with location's host name
	    return $(this).find('img').size()==0;
            
	  }).addClass("img");

    
 
	// 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");
 
     //   $(".newsfeed img").prependTo($(this).parents(".newsfeed"));
        $(".newsfeed img").css('float','left');

	//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");
	//You might also want to set the _target attribute to blank
	
//	$('a').filter(function() {
//		//Compare the anchor tag's host name with location's host name
//	    return this.hostname && this.hostname !== location.hostname;
//	  }).addClass("external").attr("target", "_blank");	
});

