En jQuery como te dice wsoulrc sería algo así en el header:
Insertar CODE, HTML o PHP:
[COLOR=#007700][FONT=Consolas]$([/FONT][/COLOR][COLOR=#0000BB][FONT=Consolas]document[/FONT][/COLOR][COLOR=#007700][FONT=Consolas]).[/FONT][/COLOR][COLOR=#0000BB][FONT=Consolas]ready[/FONT][/COLOR][COLOR=#007700][FONT=Consolas](function()[/FONT][/COLOR][COLOR=#0000BB][FONT=Consolas]{
[/FONT][/COLOR][COLOR=#007700][FONT=Consolas]$([/FONT][/COLOR][COLOR=#DD0000][FONT=Consolas]"a[@href^='http']"[/FONT][/COLOR][COLOR=#007700][FONT=Consolas]).[/FONT][/COLOR][COLOR=#0000BB][FONT=Consolas]attr[/FONT][/COLOR][COLOR=#007700][FONT=Consolas]([/FONT][/COLOR][COLOR=#DD0000][FONT=Consolas]'target'[/FONT][/COLOR][COLOR=#007700][FONT=Consolas],[/FONT][/COLOR][COLOR=#DD0000][FONT=Consolas]'_blank'[/FONT][/COLOR][COLOR=#007700][FONT=Consolas]);
[/FONT][/COLOR][COLOR=#0000BB][FONT=Consolas]}[/FONT][/COLOR][COLOR=#007700][FONT=Consolas]); [/FONT][/COLOR]
Mételo en etiquetas javascript. También asegúrate de cargar la librería de jQuery.