/**
	Include additional .js files
*/
Scriptaculous.require(ABS_URL() + '../../popup.js');
Scriptaculous.require(ABS_URL() + '../../swfobj.js');
	
/**
	the classMapping array links the specified class name with
	a CSS class value. For example, if we have an <a class="popup">, 
	then the following code will be triggered: new Popup(aInstance);
*/
classMapping = 
{
	Popup: "popup",
	SwfObj: "swf"
}
var oldonload = window.onload;
if (typeof window.onload != 'function') 
{
	window.onload = parseDocument;
} 
else 
{
	window.onload = function() 
	{
		oldonload();
		parseDocument();
	}
}

function parseDocument() 
{
	$H(classMapping).each
	(
		function (table) {
			className = table[0];
			classSelector = table[1];
			$(document.getElementsByClassName(classSelector)).each
			(
				function(DOMitem)
				{
					try	{
						eval("new "+className+"(DOMitem);");
					}
					catch (e) {
						// Do nothing
					}
				}.bind(this)
			)	
		}
	)
}