function WriteVideoObject( url, width, height )
{
	var len = url.length;
	var position = eval(len - 4);
	var fileType = url.substring(position, len);

	if( fileType == ".mov" )
		WriteQuickTimeObject( url, width, height );
	else
		WriteMediaPlayerObject( url, width, height );
}

function WriteMediaPlayerObject( url, width, height )
{
	document.write("<OBJECT id='mediaPlayer' codeBase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' type='application/x-oleobject' height='" + height + "' standby='Loading Microsoft Windows Media Player components...' width='" + width +"' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' VIEWASTEXT>");
	document.write("<param name='src' value='" + url + "'/>");
	document.write("<param name='autoStart' value='true'/>");
	//document.write("<param name='showPositionControls' value='false'/>");
	//document.write("<param name='showTracker' value='false'/>");
	//document.write("<param name='enableContextMenu' value='false'/>");
	document.write("<EMBED TYPE='application/x-mplayer2' NAME='MediaPlayer' WIDTH=" + width + " HEIGHT=" + height + " SRC='" + url +"'></EMBED>");
	document.write("</OBJECT>");
}

function WriteQuickTimeObject( url, width, height )
{
	document.write("<OBJECT CLASSID='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' WIDTH='" + width +"' HEIGHT='" + height + "' CODEBASE='http://www.apple.com/qtactivex/qtplugin.cab'><PARAM name='SRC' VALUE='" + url + "'><PARAM name='AUTOPLAY' VALUE='true'>");
	document.write("<embed CLASSID='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' autostart='True' WIDTH='" + width +"' HEIGHT='" + height + "' SRC='" + url + "' PLUGINSPAGE='http://www.apple.com/quicktime/download/'></embed>");
	document.write("</OBJECT>");
}

function gotoVideoDetail( id )
{
	var len = id.length;
	var start = id.lastIndexOf( "\\" );
	var name = id.substring( start, len );
	location.href = "Main.aspx?opt=videos&naam=" + name;
}
