function GE_makeExternalLink(link) {
	if (link.readAttribute('title')) {
		if ( link.readAttribute('title').indexOf('(opens in new window)') < 0 ) { 
			link.writeAttribute('title',link.readAttribute('title')+' (opens in new window)');
		}
	}
	link.observe('click', function(e){
		if (/MSIE/i.test(navigator.userAgent)) {
			this.writeAttribute('target','_blank');
		} else {
			window.open(this.readAttribute('href'), 'ge_external_link');
			e.stop();
		}
	});
}

document.observe("dom:loaded", function() {

	//if (document.location.href.match("https://")) return;

	var exclude_list = new Array();
	//add to the exclude list below by pushing new strings onto the array
	exclude_list.push("://careers.geblogsstage.geready.com/");
	exclude_list.push("://careers.geblogs.com/");

	//also part of the exclude list: download links for videos, audio and pdfs
	//exclude_list.push(".pdf");
	exclude_list.push(".m4v");
	exclude_list.push(".flv");
	exclude_list.push(".mp3");
	exclude_list.push(".mp4");
	var elen = exclude_list.length;
	
	var links = document.links;
	var i = links.length;
	while(i--) {
		var link = $(links[i]);

		var url = link.readAttribute("href");
		if( url.match("://") ){ //only if we match the http(s):// absolute link indicator
			var externalFlag = true; //guilty until proven innocent

			var j = elen;
			while(j--) {// Loop looking for excluded links
				if(url.match(exclude_list[j])) {
					var externalFlag = false; //innocent!
					break;
				}

			}
			
			if(externalFlag) {
				GE_makeExternalLink(link);
			}
		}
		else
			{
				if(url.match(".pdf") || url.match("ar2007/") || url.match("/research/"))
					{
					GE_makeExternalLink(link);
					}
			}
	}
});
