function getParams(sExtract)
{
	var sFieldValue = '';
	var sFieldName = '';
	var sParamAndValue  = '';
	var sSep  = '';
	var sUrl = document.location.search;
	if (sUrl)
	{
		iUrlCount = 0;
		var iLastCharPos = sUrl.length+1;
		var sFullString = sUrl.substring("?",iLastCharPos);
		var sGetString = sFullString.substring(1,iLastCharPos);
		var aUrl = sGetString.split("&");
		var iUrlLength = aUrl.length;
		for (iUrlCount =0; iUrlCount < iUrlLength; iUrlCount++)
		{
			sParamAndValue = aUrl[iUrlCount];
			sSep = sParamAndValue.indexOf("=");
			sFieldName = sParamAndValue.substring(0,sSep);
			sFieldValue = sParamAndValue.substring(sSep+1);
			if (sFieldName == sExtract)
			{
				return sFieldValue;
			}
		}
	}
}

function videoEmbed(videoLink, videoWidth, videoHeight)
{
	document.write('<object id="mediaPlayer"');
	document.write('	name="mediaPlayer"');
	document.write('	width="' + videoWidth +'"');
	document.write('	height="' + videoHeight +'"');
	document.write('	classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"');
	document.write('	codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"');
	document.write('	type="application/x-oleobject">');
	document.write('	<param name="FileName" value="' + videoLink +'">');
	document.write('	<param name="Language" value="french">');
	document.write('	<param name="BufferingTime" value="5">');
	document.write('	<param name="DisplaySize" value="4">');
	document.write('	<param name="Volume" value="10">');
	document.write('	<param name="Balance" value="10">');
	document.write('	<param name="DisplayForeColor" value="dedede">');
	document.write('	<param name="AllowChangeDisplaySize" value="TRUE">'); // ALLOW JS RESIZE
	document.write('	<param name="AllowScan" value="FALSE">');
	document.write('	<param name="AnimationatStart" value="TRUE">');
	document.write('	<param name="AudioStream" value="TRUE">');
	document.write('	<param name="AutoRewind" value="FALSE">');
	document.write('	<param name="AutoSize" value="FALSE">');
	document.write('	<param name="AutoStart" value="TRUE">');
	document.write('	<param name="ClickToPlay" value="TRUE">');
	document.write('	<param name="CurrentMarker" value="FALSE">');
	document.write('	<param name="CurrentPosition" value="TRUE">');
	document.write('	<param name="CursorType" value="FALSE">');
	document.write('	<param name="DisplayBackColor" value="FALSE">');
	document.write('	<param name="DisplayMode" value="FALSE">');
	document.write('	<param name="EnableContextMenu" value="TRUE">'); // FULL SCREEN PERMISSION
	document.write('	<param name="Enabled" value="TRUE">');
	document.write('	<param name="EnableFullScreenControls" value="TRUE">');
	document.write('	<param name="EnablePositionControls" value="TRUE">');
	document.write('	<param name="EnableTracker" value="TRUE">');
	document.write('	<param name="InvokeURLs" value="FALSE">');
	document.write('	<param name="Mute" value="FALSE">');
	document.write('	<param name="PlayCount" value="TRUE">');
	document.write('	<param name="PreviewMode" value="FALSE">');
	document.write('	<param name="Rate" value="FALSE">');
	document.write('	<param name="SelectionEnd" value="TRUE">');
	document.write('	<param name="SelectionStart" value="TRUE">');
	document.write('	<param name="SendErrorEvents" value="TRUE">');
	document.write('	<param name="SendKeyboardEvents" value="FALSE">');
	document.write('	<param name="SendMouseClickEvents" value="FALSE">');
	document.write('	<param name="SendMouseMoveEvents" value="FALSE">');
	document.write('	<param name="SendOpenStateChangeEvents" value="TRUE">');
	document.write('	<param name="SendPlayStateChangeEvents" value="FALSE">');
	document.write('	<param name="SendWarningEvents" value="TRUE">');
	document.write('	<param name="ShowAudioControls" value="FALSE">'); // Audio
	document.write('	<param name="ShowCaptioning" value="FALSE">');
	document.write('	<param name="ShowControls" value="TRUE">'); // console
	document.write('	<param name="ShowDisplay" value="FALSE">');
	document.write('	<param name="ShowGotoBar" value="FALSE">');
	document.write('	<param name="ShowPositionControls" value="FALSE">');
	document.write('	<param name="ShowStatusBar" value="TRUE">'); // buffering, time etc...
	document.write('	<param name="ShowTracker" value="FALSE">');
	document.write('	<param name="TransparentatStart" value="FALSE">');
	document.write('	<param name="VideoBorder3D" value="FALSE">');
	document.write('	<param name="VideoBorderColor" value="FALSE">');
	document.write('	<param name="VideoBorderWidth" value="FALSE">');
	document.write('	<param name="WindowlessVideo" value="FALSE">');
	document.write('	<embed	type="application/x-mplayer2"');
	document.write('			pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&"	');
	document.write('			src="' + videoLink +'"');
	document.write('			name="mediaPlayer"');
	document.write('			id="mediaPlayer"');
	document.write('			DISPLAYSIZE="0"');
	document.write('			AUTOSIZE="0"');
	document.write('			BGCOLOR="#000000"');
	document.write('			SHOWCONTROLS="1"');
	document.write('			SHOWTRACKER="0"');
	document.write('			SHOWDISPLAY="0"');
	document.write('			SHOWSTATUSBAR="1"');
	document.write('			VIDEOBORDER3D="0"');
	document.write('			AUTOSTART="1"');
	document.write('			width="' + videoWidth +'"');
	document.write('			height="' + videoHeight +'"');
	document.write('	></embed>');
	document.write('</object>');
}

function videoQTEmbed(videoLink, videoWidth, videoHeight)
{
	document.write('	<embed	type="video/quicktime"');
	document.write('			pluginspage="http://www.apple.com/quicktime/download/"	');
	document.write('			src="' + videoLink +'"');
	document.write('			qsrc="' + videoLink +'"');
	// document.write('			href="' + videoLink +'"');
	document.write('			width="' + videoWidth +'"');
	document.write('			height="' + videoHeight +'"');
	document.write('			height="' + videoHeight +'"');
	document.write('			bgcolor="black"');
	document.write('			SCALE="ASPECT"'); // TOFIT, ASPECT, 1 - 5
	document.write('			TARGETCACHE=true');
	document.write('			AUTOPLAY="true"');
	document.write('			CONTROLLER="true"');
	document.write('			LOOP="false"');
	document.write('	></embed>');
	document.write('</object>');
}

/*
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/paramtags.asp
http://www.apple.com/quicktime/authoring/embed2.html
*/

function Bfullscreen(theURL) {
	window.open(theURL, '', 'fullscreen=yes, scrollbars=0');
}
function Vfullscreen(){
	if ( navigator.appName == "Netscape" )
	{
		document.mediaPlayer.SetDisplaySize(3);
	}
	else
	{
		document.mediaPlayer.DisplaySize = 3;
	}
}

function AfficheMsg(Msg) {
	document.write(Msg);
}
