function CreateWMObject(filename, width, height, autostart, playcount, uiMode, controls, statusbar, altText, pageid)
{

		if (filename.toLowerCase().lastIndexOf("mp3") == -1) {
			document.write('<OBJECT id="VIDEO" width="' +width+ '" height="' +height+ '" ')
			document.write('	CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" ')
			document.write('	type="application/x-oleobject" ')
			document.write('    codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112" VIEWASTEXT> ')
			document.write('	<PARAM NAME="filename" VALUE="' +filename+ '"> ')
			document.write('	<PARAM NAME="SendPlayStateChangeEvents" VALUE="True"> ')
			document.write('	<PARAM NAME="showstatusbar" VALUE="'+statusbar+'"> ')
			document.write('	<param name="transparentatStart" value="1"> ')
			document.write(' <param name="WMode" value="Transparent"> ')		
			document.write('	<param name="autoStart" value="' +autostart+ '"> ')
			document.write('	<param name="uiMode" value="' +uiMode+ '"> ')
			document.write('	<param name="showcontrols" value="' +controls+ '"> ')
			document.write('	<param name="playcount" value="' +playcount+ '"> ')
			document.write('	<param name="alt" value="' +altText+ '"> ')
			document.write(' <EMBED type="application/x-mplayer2" ')
			document.write(' pluginspage="http://microsoft.com/windows/mediaplayer/ en/download/" ')
			document.write(' id="mediaPlayer" name="mediaPlayer" displaysize="4" autosize="0" ')
			document.write(' showcontrols="' +controls+ '" showtracker="1" ')
			document.write(' width="' +width+ '" height="' +height+ '" src="' +filename+ '" autostart="' +autostart+ '" ')
			document.write(' alt="' +altText+ '" playcount="' +playcount+ '"> ')
			document.write('<div>'+altText+ ' <A href=default.aspx?page=' +pageid+ '>Click here for textual description.</A></div> ')
			document.write(' </EMBED></OBJECT> ')
		} else	{
		
			var altText = altText.replace("\'", "\\\'");
			var altTextHeight;
			
			if (height < 85) height = 85;
			altTextHeight = height - 40;
			
			document.write(' <object id="audioplayer" width="'+width+'" height="'+height+'" data="/plugins/media/flowplayer-3.1.5.swf"');
			document.write(' type="application/x-shockwave-flash">  ');
			document.write(' <param name="movie" value="/plugins/media/flowplayer-3.1.5.swf" />   ');
			document.write(' <param name="flashvars" value="config={');
			document.write(' 				\'clip\':{\'url\':\''+filename+'\',\'autoPlay\':false,\'autoBuffering\':true}');
			document.write(' 			 ,\'canvas\':{\'border\':\'2px solid #eeeeee\',\'borderRadius\':15,\'backgroundColor\':\'#d2d2d2\'}');
			document.write('			 ,\'play\':{\'opacity\':0 }');
			document.write(' 			 ,\'plugins\': { ');
			document.write('						\'controls\': {\'fullscreen\':false,\'volume\':false,\'backgroundColor\':\'#e0e0e0\',\'borderRadius\':15}');
			document.write('					 ,\'altText\': {\'url\':\'flowplayer.content-3.1.0.swf\',\'html\':\'<p>'+altText+'</p>\',\'border\':\'none\',\'height\':'+altTextHeight+',\'opacity\':1}');
			document.write('				}');
			document.write(' }"	/> ');
			document.write(' </object> ');
		}

}

function CreateQuicktimeObject(filename, width, height, autoplay, loop, controls, altText, pageid)
{
		document.write('<OBJECT width="' +width+ '" height="' +height+ '" ')
		document.write('   codebase="http://www.apple.com/qtactivex/qtplugin.cab" ')
		document.write('	CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ')
		document.write('	VIEWASTEXT> ')
		document.write('	<PARAM NAME="src" VALUE="' +filename+ '"> ')
		document.write('	<param name="autoplay" value="' +autoplay+ '"> ')
		document.write('	<param name="controller" value="' +controls+ '"> ')
		document.write('   <param name="WMode" value="Transparent"> ')
		document.write('	<param name="loop" value="' +loop+ '"> ')
		document.write('	<param name="alt" value="' +altText+ '"> ')
		document.write(' <EMBED ')
		document.write(' pluginspage="http://www.apple.com/quicktime/download/" ')
		document.write(' width="' +width+ '" height="' +height+ '" src="' +filename+ '" autoplay="' +autoplay+ '" ')
		document.write(' alt="' +altText+ '" controller="' +controls+ '" loop="' +loop+ '"> ')
		document.write('<div>'+altText+ ' <A href=default.aspx?page=' +pageid+ '>Click here for textual description.</A></div> ')
		document.write(' </EMBED></OBJECT> ')
}

function CreateFlashObject(filename, width, height, bgcolor, title, img, loop)
{
		document.write(' <object style="width:' +width+ 'px; height: '+ height +'px; background-color: ' +bgcolor+ ';" ')
		document.write(' type="application/x-shockwave-flash" data="' +filename+ '" title="' +title+ '" VIEWASTEXT> ')
		document.write(' <param name="movie" value="' +filename+ '" /> ')
		document.write(' <param name="WMode" value="Transparent"> ')
		document.write(' <param name="menu"  value="false"> ')
		document.write(' <param name="loop" value="'+loop+'" /> ')
		document.write(' <img src="' +img+ '" height="' +height+ '" width="' +width+ '" alt="'+ title +'" /> ')
		document.write(' </object> ')
}

function CreateRPObject(filename, width, height, autoplay, loop, alttext, pageid)
{
		document.write (' <OBJECT ID=RVOCX CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" ')
		document.write (' WIDTH="'+width+'" HEIGHT="'+height+'"> ')
		document.write (' <PARAM NAME="SRC" VALUE="'+filename+'"> ')
		document.write (' <PARAM NAME="AutoStart" VALUE="'+autoplay+'"> ')
		document.write (' <PARAM NAME="Loop" VALUE="'+loop+'"> ')		
		document.write (' <PARAM NAME="CONTROLS" VALUE="ImageWindow"> ')
		document.write (' <PARAM NAME="CONSOLE" VALUE="_master"> ')
		document.write(' <EMBED ')
		document.write(' width="' +width+ '" height="' +height+ '" src="' +filename+ '" autostart="' +autoplay+ '" ')
		document.write(' alt="' +alttext+ '" controls="ImageWindow" loop="' +loop+ '"> ')
		document.write('<div>'+alttext+ ' <A href=default.aspx?page=' +pageid+ '>Click here for textual description.</A></div> ')
		document.write(' </EMBED></OBJECT> ')
}

function CreateRPObjectWithGui(filename, width, height, autoplay, loop, alttext, pageid)
{
		document.write (' <OBJECT ID=RVOCX CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" ')
		document.write (' WIDTH="'+width+'" HEIGHT="'+height+'"> ')
		document.write (' <PARAM NAME="AutoStart" VALUE="'+autoplay+'"> ')
		document.write (' <PARAM NAME="Loop" VALUE="'+loop+'"> ')		
		document.write (' <PARAM NAME="CONTROLS" VALUE="ImageWindow"> ')
		document.write (' <PARAM NAME="CONSOLE" VALUE="_master"> ')
		document.write(' <EMBED ')
		document.write(' name="player" type="audio/x-pn-realaudio-plugin" console="_master" width="' +width+ '" height="' +height+ '" autostart="' +autoplay+ '" ')
		document.write(' alt="' +alttext+ '" controls="ImageWindow" loop="' +loop+ '"> ')
		document.write(' </EMBED></OBJECT> ')
		
		document.write ('<div><OBJECT ID=RVOCX CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" ')
		document.write (' WIDTH="'+width+'" HEIGHT="55"> ')
		document.write (' <PARAM NAME="SRC" VALUE="'+filename+'"> ')
		document.write (' <PARAM NAME="AutoStart" VALUE="'+autoplay+'"> ')
		document.write (' <PARAM NAME="Loop" VALUE="'+loop+'"> ')		
		document.write (' <PARAM NAME="CONTROLS" VALUE="Default"> ')
		document.write (' <PARAM NAME="CONSOLE" VALUE="video1"> ')
		document.write(' <EMBED ')
		document.write(' name="player" type="audio/x-pn-realaudio-plugin" console="video1" width="'+width+'" height="55" src="' +filename+ '" autostart="' +autoplay+ '" ')
		document.write(' alt="' +alttext+ '" controls="Default" loop="' +loop+ '"> ')
		document.write('<div>'+alttext+ ' <A href=default.aspx?page=' +pageid+ '>Click here for textual description.</A></div> ')
		document.write('</EMBED></OBJECT> ')
}

function CreateFLVObject(filename, width, height, bgcolor, title, img, loop)

{
    //document.write(' <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"')
    //document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" ')
    //document.write(' width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'"> ') 
    //document.write(' <param name="movie" value="'+filename+'"/>')
    //document.write(' <param name="quality" value="high" /> ')    
    //document.write(' <param name="loop" value="'+loop+'" /> ')
    //document.write(' <img src="' +img+ '" height="' +height+ '" width="' +width+ '" alt="'+ title +'" /> ')
    //document.write(' <embed src= "'+filename+'" ')
    //document.write(' quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" ')
    //document.write(' type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'" /> ')
    //document.write(' </object> ')    


		var re=new RegExp("file=(.*?)\&");
		filename = re.exec(filename)[1];
		
		if (width>470) width = 470;
				
    document.write(' <object id="flowplayer" width="'+width+'" height="'+height+'" data="plugins/media/flowplayer-3.1.5.swf" bgcolor="'+bgcolor+'" ');
    document.write(' type="application/x-shockwave-flash">  ');
    document.write(' <param name="movie" value="plugins/media/flowplayer-3.1.5.swf" />   ');
		document.write(' <param name="allowfullscreen" value="true" />  ');
    document.write(' <param name="flashvars" value="config={');
		document.write(' 				\'clip\':{\'url\':\''+filename+'\',\'autoPlay\':false,\'autoBuffering\':true}');
		document.write(' }" />  ');
    document.write(' </object> ');

}

           





 
