/*
Programmer: Darryl Ballard
Date created: 2008-09-16
Last updated: 2010-05-13
Version: 2.0.0

Requires:
	Prototype 1.6
	
Version History:
	2.0.0, 2010-05-13: Made external links activate without leaving a GST_External_Links object in the global namespace.
	
	1.0.0: Built
*/

// Require that Prototype is available
if (typeof Prototype != "undefined") {
	document.observe("dom:loaded", function() {
		var class_to_activate = "external";
		
		// Get all the external links
		var external_links = $$("a." + class_to_activate);
		var i, il;
		for (i = 0, il = external_links.length; i < il; i++) {
			// Only do it to links with an href
			// (No idea why this works, but it does, on FF/IE/GC)
			if (external_links[i].href) {
				external_links[i].observe("click", function(e) {
					if (this.hasClassName(class_to_activate)) {
						window.open(this.href, "externalWindow" + (new Date()).getTime());
						$(e).stop();
					}
				});
			}
		}
		
	});
}

