//javascript code

var VideoUtil = Class.create();

VideoUtil.prototype = {
		
	initialize: function(params){
		this.videoContainer = $(params.id);
		this.source = params.source;
		this.image = params.image;		
		this.playerSwf = params.player || '/cms-web/swf/flvplayer.swf';
		
		this.attributes = { id: "player", name: "player" , wmode: "transparent"};
		this.params = { bgcolor: "#FFFFFF", menu: "false", quality: "high", align: "middle", play: "true", 
						loop: "true", scale: "noscale", salign: "", swLiveConnect: "true", allowscriptaccess: "always",
						allowfullscreen: "true", wmode: "transparent" };
		this.flashVars = {controlbar: 'over', bufferlength: 10 };
		this.flashVars.width = params.width || 575;
		this.flashVars.height = params.height || 271;
		this.flashVars.displayheight = this.flashVars.height;
		this.flashVars.autostart = params.autostart || false;		
	},

	startVideo : function(){
		if (this.videoContainer){			
			this.flashVars.file = this.source;
			this.flashVars.image = this.image;
			swfobject.embedSWF(this.playerSwf, this.videoContainer.id,
				this.flashVars.width, this.flashVars.height, "9.0.0", "/cms-web/js/swfobject/expressInstall.swf",				
				this.flashVars, this.attributes, this.params);
		}
	}
};



