/*
	Functions.js
	Copyright 2009 Avalanche Creative
	
	JavaScript functions for Syron MP3 Clips
	Requires Prototype Framework ("prototype.js")
*/


//	Adds a target="_blank" attribute to all anchor tags
//	found with an attribute with rel="external" at runtime.
//
//	*	Thanks to Marius Stanciu for the helpful technique.
//		URL:	http://marius.code-purity.com/archives/2009/4/13/opening_pages_in_a_new/
function addExternalLinks(){
	links	= $$('a[rel="external"]');

	links.each(function(link){
		if(link.readAttribute('href') != "" && link.readAttribute("href") != '#')
			link.writeAttribute('target','_blank');
	});
}

Event.observe(window, "load", addExternalLinks);