$(function(){
	$('a.external_link').attr("target", "_blank");
});
$(document).ready(function(){
		
	//Remove outline from links
	$("a").click(function(){
		$(this).blur();
	});
});
/*replacing tag <hr> with stylable div*/
$(function(){
	$(".weditor").find("hr").wrap('<div class="fakeHr"></div>')
});
/*add alt text under image in weditor*/
$(function(){
	var imgAlt
	var imgWidth
	$('.weditor img.fleft').wrap('<div class="img-border-left"></div>')
	$('.weditor img.fright').wrap('<div class="img-border-right"></div>')
	
	$('.weditor img.fleft, .weditor img.fright').each(function (i){
		i = i+1;
		$(this).addClass("imgAlts"+i);
		imgAlt = $('.weditor .imgAlts'+i).attr("alt")
		imgWidth = $(this).width() + 8;
		$(this).parent().css('width', imgWidth + "px");
		if ($(this).attr("alt").length > 0){
			$(".weditor .imgAlts"+i).after("<p>" +imgAlt+ "</p>");
		}
	});
});
