mam.link = new function() {

	jQuery.extend(
		this,  		{ 
			version: "1.0",
			initialize: function() {		
				$("a").click(function(){
						var host = 'http://' + window.location.host;
						var link = $(this).attr('href');
						
						if($(this).attr('class') == 'article') {
							var item = $(this).attr('href');
							if($(this).text() == 'expand [+]') {
								$(this).html('collapse [-]');
							} else {								
								$(this).html('expand [+]');
							}
							
							item = '#' + item.replace(/.*#(.*)/, "$1");
							var x = $(item + '_abstract').html();
							var y = $(item + '_summary').html();
							$(item + '_summary').html(x);
							$(item + '_abstract').html(y);
							return false;
						}

						if($(this).text() == 'Abstract') {
							return false;
						}
						
						var original_link = escape(link);
						if(link.indexOf(host) == 0) {
							link = link.substring(host.length);
						}

						if(link.indexOf('http') == 0) {
							window.open('/core/misc/external.html?url='+original_link, 'external');		
							return false;
						}
						
						if(link.indexOf('mailto') == 0) {
							var person = link.substring(7);
							window.location.href= '/core/contact_us/contact_us_form.html?person=' + person;
							return false;
						}
						return true;
					}
				);
				
				$("#site-nav > ul > li > a").click( 
											
					function() 
					{
						// return false;
					}
				);
				
			}	
		
		}
	);
	
		
}