/*** 
	mmobject.js
	embed multimedia video object on a webpage without the embed tag
	
	by lino@fidoweb.net (C) 2006
***/

function embed_qt(_src, _id, _width, _height, _controller, _autoplay) {
	var _id = (_id == null) ? "player" : _id;
	var _width = (_width == null) ? 320 : _width;
	var _height = (_height == null) ? 240 : _height;
	var _controller = (_controller == null) ? "true" : _controller;
	var _autoplay = (_autoplay == null) ? "true" : _autoplay;
	
	var qtObj = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" id="' + _id + '" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="' + _width + '" height="' + _height + '"> ' + 
		'<param name="src" value="' + _src + '" /> ' +
		'<param name="controller" value="' + _controller + '" /> ' + 
  		'<param name="autoplay" value="' + _autoplay + '" /> ' + 
  		'<!--[if !IE]>--> ' + 
  		'<object type="video/quicktime" data="' + _src + '" width="' + _width + '" height="' + _height + '"> ' +
    	'<param name="autoplay" value="' + _autoplay + '" /> ' + 
    	'<param name="controller" value="' + _controller + '" /> ' +
  		'</object> ' + 
  		'<!--<![endif]--> ' +
		'</object>';
		
	if (_src != "") {
		document.write(qtObj);
	}
}

function embed_wmp(_src, _id, _width, _height, _controller, _autoplay) {
	var _id = (_id == null) ? "player" : _id;
	var _width = (_width == null) ? 320 : _width;
	var _height = (_height == null) ? 240 : _height;
	var _controller = (_controller == null) ? "true" : _controller;
	var _autoplay = (_autoplay == null) ? "true" : _autoplay;
	
	var wmpObj = '<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" id="' + _id + '" width="' + _width + '" height="' + _height + '"> ' + 
  		'<param name="url" value="' + _src + '" /> ' + 
  		'<param name="src" value="' + _src + '" /> ' + 
  		'<param name="showcontrols" value="' + _controller + '" /> ' +
  		'<param name="autostart" value="' + _autoplay + '" /> ' + 
  		'<!--[if !IE]>--> ' +
  		'<object type="video/x-ms-wmv" data="' + _src + '" width="' + _width + '" height="' + _height + '"> ' +
    	'<param name="src" value="' + _src + '" /> ' + 
    	'<param name="autostart" value="' + _autoplay + '" /> ' +
    	'<param name="controller" value="' + _controller + '" /> ' + 
  		'</object> ' + 
  		'<!--<![endif]--> ' +
		'</object>';
		
	if (_src != "") {
		document.write(wmpObj);
	}
}
	
	
