function photomania_pro_child_custom_js() { ?>

<script type="text/javascript">
jQuery(document).ready(function($){
  
       $("a[href^=http]").each(function(){
          if(this.href.indexOf(location.hostname) == -1) {
             $(this).attr({
                target: "_blank",
                title: "Opens in a new window"
             });
          }
       })  
  
});

</script>
<?php
}

add_action( 'wp_footer', 'photomania_pro_child_custom_js' );