﻿jQuery(document).ready(
    function() {
    
        
        var fileTypes = {
          // extension: 'image file'
          docx: '/templates/Odfjell/Scripts/LinkIcons/Extension/small/docx.gif',
          doc: '/templates/Odfjell/Scripts/LinkIcons/Extension/small/doc.gif',
          xls: '/templates/Odfjell/Scripts/LinkIcons/Extension/small/xls.gif',
          xlsx: '/templates/Odfjell/Scripts/LinkIcons/Extension/small/xlsx.gif',
          ppt: '/templates/Odfjell/Scripts/LinkIcons/Extension/small/ppt.gif',
          pptx: '/templates/Odfjell/Scripts/LinkIcons/Extension/small/pptx.gif',
          pdf: '/templates/Odfjell/Scripts/LinkIcons/Extension/small/pdf.gif'
        };
         
        // then, loop over the object
        // using jQuery's $.each()
        $.each(fileTypes, function(extension,image) {
          $('a[href$="' + extension + '"]').
            css({
              paddingLeft: '18px',
              background: 'transparent url("' + image + '") no-repeat top left'
            });
        });
        
        $('a[href^="http"]').not('#globalMenu a').not('#newWinLink a').not('.headerReadmore').not('.secondNews a').not('.moreNewsList a').not('a.test').not('#sideMenu ul li span a').not('#featuredShortcuts a').each(function (i) {
        
            if(jQuery(this).attr("href").indexOf("http://"+document.domain)==-1){
             jQuery(this).
                 css({
                  paddingLeft: '18px',
                  background: 'transparent url(/Templates/Odfjell/Styles/Images/Common/ico_newWindow_small.png) no-repeat top left'
                });
            }
        
            
        });
     
     
        
        
    }
    
)