//function used to attach the ajax handlers to the external link items
$(document).ready(function() {
	var document = $(this);
	
	 $.ajaxManager.initialise({
        responseType: $.ajaxManager.dataType.JSON,
        requestType: $.ajaxManager.requestType.POST
    });
	
	document.find('.mp-ajax-external-link').click(function(event) {
		event.preventDefault();
		
		var link = $(this);
		var id = link.attr('id');
		var href = link.attr('href');

		//make the ajax call
		$.ajaxManager.updateUrl(href);
		$.ajaxManager.onSuccess = function(p_response) {
			processAjaxResponse(p_response);
		};
		$.ajaxManager.makeRequest();
		
	});
	
	//internal method used to wire up the link
	var processAjaxResponse = function(response) {
		var url = response.arguments.lnk;
		window.open(url,'','');
	}
});