// swf.js
// Libreria per il rendering portabile degli oggetti flash
// 12/9/2006 - C.C.

// Esempio di uso: addSwf("/file.swf", 'width="500" height="250"');
// altri parametri utili: wmode="transparent"

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}

var swfCount = 0;
var swfObjects = new Array();

function addSwf(src, props) {
	document.write('<span id="spn_swf_' + (++swfCount) + '"></span>');
	swfObjects[swfCount] = 'src="' + src + '" ' + props;
}

function loadSwfObjects() {
	for (var pos = 1; pos <= swfCount; ++pos) {
		document.getElementById("spn_swf_" + pos).innerHTML = '<embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" ' + swfObjects[pos] + '></embed>';
	}
}

addLoadEvent(loadSwfObjects);
