// Proxies cross-domain requests through ajax_proxy if they contain ns.net

$.ajaxPrefilter(
	function (options) {
		if (
			options.crossDomain && 
			options.dataType.toLowerCase().indexOf('jsonp') == -1 && 
			(
				/^https?:\/\/[a-z\d:\.]+netshelter\.(net|com)\//.exec(options.url) ||
				/^https?:\/\/[a-z\d:\.]+blackberry\.com\//.exec(options.url)
			)
		) {
			options.url = "/tools/ajax_proxy/?" + options.url;
			options.crossDomain = false;
		}
	}
);
