var cp = {};
var fl = {};
var UClass = {}

var Base = Class.create({
	initialize: function(){
		if(fl != undefined) this.parseSwf();
	},

	parseSwf: function(){
		if (fl) {
			for (var _loc1 = 0; _loc1 < Object.keys(fl).length; _loc1++) {
				var Obj = Object.keys(fl)[_loc1];
				var childObj = Object.values(fl)[_loc1];

				if(childObj.flParams.allowfullscreen == undefined)
					childObj.flParams.allowfullscreen = "true";
				if(childObj.flParams.quality == undefined)
					childObj.flParams.quality = "best";
				if(childObj.flParams.wmode == undefined)
					childObj.flParams.wmode = "transparent";
				if(childObj.flParams.scale == undefined)
					childObj.flParams.scale = "noScale";
				if(childObj.flParams.menu == undefined)
					childObj.flParams.menu = "true";					

				var attributes = {};
					attributes.id = childObj.id;
					attributes.name = childObj.id;		
				
				swfobject.embedSWF(childObj.flParams.base + childObj.swf, childObj.id, childObj.size.width, childObj.size.height, childObj.version, "", childObj.flVars, childObj.flParams, attributes);

				$(childObj.id).wrap("div", {"class": childObj.id});
			}
		}
	}	
});

function initpage(){
	cp.base = new Base();

	if(UClass) {
		for (var _loc1 = 0; _loc1 < Object.keys(UClass).length; _loc1++) {
			var key = Object.keys(UClass)[_loc1];
			var value = Object.values(UClass)[_loc1];
			cp[key] = new Background();
		}	
	}
}

document.observe("dom:loaded",initpage);
