﻿// 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 = "/AoARoot/Site_Utilities/Standard_External_Disclaimer.aspx?redirection=" + $j(this).attr('href');
             $j(this).attr('href',tmp); 
             $j(this).after('<a href="/AoAroot/Site_Utilities/Disclaimer.aspx" > <img src="/AoAroot/Images/Icons/exitdisclaimer.gif" border="0" alt="External Web Site Policy"/></a>');
         }
         );  */  
         
    /* filter out all href that starts with http and does not have .gov or .GOV or .Gov in url   */  
        $j("a[href^='http']").not("[href*='.gov']").not("[href*='.GOV']").not("[href*='.Gov']").each(function (i){
             tmp = "/AoARoot/Site_Utilities/Standard_External_Disclaimer.aspx?redirection=" + $j(this).attr('href');
             $j(this).attr('href',tmp); 
             $j(this).after('<a href="/AoAroot/Site_Utilities/Disclaimer.aspx" > <img src="/AoAroot/Images/Icons/exitdisclaimer.gif" border="0" alt="External Web Site Policy"/></a>');
         }
         ); 
         
         
   });
   
   
   
