LazyEmebdded = Class.create({
  initialize: function(params) {
    this.options = Object.extend({
        link: 'openVideo',
        height: 292,
        width: 480
      }, 
      params || {}
    );
    $(this.options.link).observe('click',this.onShowVideo.bindAsEventListener(this));
  },
  onShowVideo: function(event) {
    event.stop();
    renderEmbedded(this, this.options.link);    
  }
});

OnLoadEmbedded = Class.create({
  initialize: function(options) {
    this.options = options;
    Event.observe(window, 'load', this.onLoad.bindAsEventListener(this), false);
  },
  onLoad: function(event) {
    renderEmbedded(this, this.options.element);    
  }
});

function renderEmbedded(controller, element) {
  var object = 
       '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" ' + 
       'height="' + controller.options.height + '" width="' + controller.options.width + '">' + 
       '  <param name="src" value="' + controller.options.url + '">' + 
       '  <param name="controller" value="true">' + 
       '  <param name="autoplay" value="true">' + 
       '  <param name="target" value="myself">' + 
       '  <param name="type" value="video/quicktime">' + 
       '  <embed src="' + controller.options.url + '" pluginspage="http://www.apple.com/quicktime/download/"' + 
       '         controller="true" target="myself" type="video/quicktime" height="' + controller.options.height + 
       '" width="' + controller.options.width + '" autoplay="true" >'; 
       '</object>';
  $(element).innerHTML = object;
}
