




function fillveb(divid,videopath,w,h,atstart,loop,controls) {
	var div=document.getElementById(divid);
	/*var veb=document.createElement('embed');
	veb.setAttribute('src',videopath);
	veb.setAttribute('width',w);
	veb.setAttribute('height',h);
	//veb.setAttribute("id","new_id");
	veb.setAttribute('loop','false');
	//veb.setAttribute("hidden","true");
	veb.setAttribute('autostart','true');
	//veb.setAttribute("enablejavascript...
	veb.setAttribute('showcontrols','true');
	veb.setAttribute('type','application/x-mplayer2');
	veb.setAttribute('pluginspage','http://www.microsoft.com/windows/windowsmedia/download/');
	div.appendChild(veb);*/
	var object=document.createElement('object');
	var embed=document.createElement('embed');
	var ext=extractfileext(videopath); ext=ext.toLowerCase();
	var param1=0; var param2=0; var param3=0; var param4=0; var param5=0; var param6=0;
	if (ext=='avi'||ext=='mpg'||ext=='wmv') {
		object.setAttribute("classid", "CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95");
		object.setAttribute("codebase", "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701");
		object.setAttribute("standby", "Loading Microsoft Windows Media Player components...");
		object.setAttribute("type", "application/x-oleobject");
		object.setAttribute("width",w);object.setAttribute("height",h+45);
		param1=document.createElement("param");param1.setAttribute("name","fileName");param1.setAttribute("value",videopath);
		param2=document.createElement("param");param2.setAttribute("name","animationatStart");param2.setAttribute("value","true");
		param3=document.createElement("param");param3.setAttribute("name","transparentatStart");param3.setAttribute("value","true");
		param4=document.createElement("param");param4.setAttribute("name","autoStart");param4.setAttribute("value",atstart?'true':'false');
		param5=document.createElement("param");param5.setAttribute("name","showControls");param5.setAttribute("value",controls?'true':'false');
		param6=document.createElement("param");param6.setAttribute("name","loop");param6.setAttribute("value",loop?'true':'false');		
		object.appendChild(param1);object.appendChild(param2);object.appendChild(param3);
		object.appendChild(param4);object.appendChild(param5);object.appendChild(param6);		
		embed.setAttribute("type", "application/x-mplayer2");
		embed.setAttribute("pluginspage", "http://microsoft.com/windows/mediaplayer/en/download/");
		embed.setAttribute("src",videopath);
		embed.setAttribute("width",w);embed.setAttribute("height",h+45);
		embed.setAttribute("loop",loop?'true':'false');
		embed.setAttribute("autostart",atstart?'true':'false');
		embed.setAttribute("showcontrols",controls?'true':'false');		
	}
	else if (ext=='mov'||ext=='m4v'||ext=='mp4') {
		object.setAttribute("classid", "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B");
		object.setAttribute("codebase", "http://www.apple.com/qtactivex/qtplugin.cab");
		object.setAttribute("width",w);object.setAttribute("height",h+15);
		param1=document.createElement("param");param1.setAttribute("name","src");param1.setAttribute("value",videopath);
		param2=document.createElement("param");param2.setAttribute("name","autoplay");param2.setAttribute("value",atstart?'true':'false');
		param3=document.createElement("param");param3.setAttribute("name","controller");param3.setAttribute("value",controls?'true':'false');			
		object.appendChild(param1);object.appendChild(param2);object.appendChild(param3);
		embed.setAttribute("pluginspage", "http://www.apple.com/quicktime/download/");
		embed.setAttribute("src",videopath);
		embed.setAttribute("width",w);embed.setAttribute("height",h+15);
		embed.setAttribute("autoplay",atstart?'true':'false');
		embed.setAttribute("controller",controls?'true':'false');
	}
	try { object.appendChild(embed);div.appendChild(object); }
	catch(e) { div.appendChild(embed); }
/*
<object id="MediaPlayer" width="550" 
	height="450" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" 
	standby="Loading Microsoft Windows Media Player components..." 
	type="application/x-oleobject" 
	codebase="http://activex.microsoft.com/activex/controls/mplayer/
	en/nsmp2inf.cab#Version=6,4,7,1112">
	<param name="filename" value="media/lorikeets.mpg">
	<param name="autoStart" value="true">               
	<param name="showControls" value="true">
	<param name="ShowStatusBar" value="true">
	<param name="Autorewind" value="true">
	<param name="ShowDisplay" value="false">   
	<embed src="media/lorikeets.mpg" width="550" 
	height="450" type="application/x-mplayer2" 
	name="MediaPlayer" autostart="1" 
	showcontrols="0" showstatusbar="1" 
	autorewind="1" showdisplay="0">
	</embed>
</object>
*/
}





