﻿// This script adds the class external to display a exit disclaimer icon and appends a redirect to Standard_External_Disclaimer.aspx
 var $j = jQuery.noConflict(); 
   $j(document).ready(function () {   
   /* convert all href that starts with http to lowercase */
       $j("a[href^='http'], a[title*='External Link'], a[title*='External link']").each(function(i){
        var oldlink = $j(this).attr('href');
        var newlink = oldlink.toLowerCase(); 
        $j(this).attr('href',newlink);
       }
       );   
       
    /* filter out all href that starts with http and does not have .gov in url */    
        $j("a[href^='http']:not([href*='.gov'])").each(function (i){
             tmp = "Standard_External_Disclaimer.aspx?redirection=" + $j(this).attr('href');
             $j(this).attr('href',tmp); 
             $j(this).after('<a href="http://www.aoa.gov/AoARoot/Site_Utilities/Disclaimer.aspx" > <img src="images/exitdisclaimer.gif" border="0" alt="External Web Site Policy"/></a>');
         }
         ); 
   });
   
   
   

