﻿/// <reference path="swfobject.js" />
//http://code.google.com/p/swfobject/
//http://code.google.com/p/swfobject/wiki/documentation 

//timc: had to make changes to this wrapper to support the move to 2.0 swfobject
function CustomSwfObject(url, renderControl){ 
	this.Url = url;
	this.RenderControl = renderControl;
	this.Height = '500px';
	this.Width = '500px';
	this.MinVersion = '9.0.0'; //'9.0.0' in 2.0
	
	//flash behavior params
	this.FlashParams = {
		quality : 'High',
		loop : false,
		menu : false,
		autoplay : true,
		scale : 'ShowAll'
	};
				
	//custom variables to pass to the flash
	this.FlashVariables = {};

	//not used in 1.5, but in 2.0
	this.Attributes = {};
	
	this.Render = function(){
		/*var so = new swfobject(this.Url, this.RenderControl, this.Width, this.Height, this.MinVersion, '');
		
		for(var key in this.FlashParams){ so.addParam(key, this.FlashParams[key]); }		
		for(var key in this.FlashVariables){ so.addVariable(key, this.FlashVariables[key]); }*/
		try{
		    swfobject.embedSWF(this.Url, this.RenderControl, this.Width, this.Height, this.MinVersion, '', this.FlashVariables, this.FlashParams, this.Attributes);
        }catch(e){
            alert(e);
        }
	}
}
