/*
	* Author: Ian Jamieosn
	* Name: Tidy Anchors
	
	* Description: To take "target="_blank" and replace with a javascript friendly open in pop up window.
*/
jQuery.tidyanchors = function () {
	$('a').each(function() {
		if(!jQuery.isEmptyObject($(this).attr('target'))) {
			// then there is
			// remove target
			$(this).removeAttr('target');
			// add js
			$(this).attr('onclick', 'window.open(this.href); return false;');
			$(this).attr('onkeypress', 'window.open(this.href); return false;');
		} 
	});
}
// Call the function on body load
$(document).ready(function() {
	$.tidyanchors();
});
