

	$(document).ready(function() {

		
		var hostname = window.location.hostname;
		hostname = hostname.replace("www.","").toLowerCase();
		function check(obj){
		   var href = obj.href.toLowerCase();
		   
		   return (href.indexOf("http://")!=-1 && href.indexOf(hostname)==-1) ? true : false;            

	   };



		$('a').each(function(i) {
			if (check(this)) {
				// outgoing code
				$(this).attr('target','_blank');
				$(this).attr('class','external');

				$(this).click(function() {
					// urchin code
					//alert('hello');
					str = '/outgoinglink/' + $(this).attr('href');
					pageTracker._trackPageview(str);
				});
			}
		})
	});

