
	var fCarouselWidth = parseInt(document.getElementById('Carousel').style.width);
	var fCarouselHeight = parseInt(document.getElementById('Carousel').style.height);
	
	var fAnimDuration = 1250.0;
	var fAnimTime = 0.0;
	var oInterval = null;

	var nImagesWidth = 380;
	var nImagesHeight = 200;
	var nImagesHalfWidth = Math.floor(nImagesWidth / 2);
	var nImagesHalfHeight = Math.floor(nImagesHeight / 2);
	
	var nPrevMilliseconds = 0;
	var nNbImagesVisibles = 5;
	var nNbImages = 14;
	var nHalfNbImages = Math.floor(nNbImages / 2);
	var nFirstImage = 0;
	var nTargetImage = -1;
	
//	var nImageDelta = 3.1452 / (nNbImagesVisibles - 1);
	var fAngleOffset = 0.2;
	var nImageDelta = (3.1452 - (fAngleOffset * 2.0)) / (nNbImagesVisibles - 1);
	var aDivs = new Array();
	var aImages = new Array();
	var aPlayButtons = new Array();
	var aInfos = new Array();
	var aShadows = new Array();
	var aTitles = new Array();
	var aDescriptions = new Array();
	var aLinks = new Array();
	
	var divCarousel = document.getElementById('Carousel');

	if(GetSwfVer() != -1)
	{
		sLocation = '' + document.location;
		if(sLocation.indexOf('belrtl') != -1) divCarousel.innerHTML = '<object id="Carrousel" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="' + fCarouselWidth + '" height="' + fCarouselHeight + '"><param name="movie" value="/videobelrtl/GED_vp/00270000/272100/272101.swf?xmlLocation=/videobelrtl' + sCarouselXmlUrl + '.xml"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="transparent"></param><embed src="/videobelrtl/GED_vp/00270000/272100/272101.swf?xmlLocation=/videobelrtl' + sCarouselXmlUrl + '.xml" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" width="' + fCarouselWidth + '" height="' + fCarouselHeight + '"></embed></object>';
		else divCarousel.innerHTML = '<object id="Carrousel" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="' + fCarouselWidth + '" height="' + fCarouselHeight + '"><param name="movie" value="/GED_vp/00270000/272100/272101.swf?xmlLocation=' + sCarouselXmlUrl + '.xml"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="transparent"></param><embed src="/GED_vp/00270000/272100/272101.swf?xmlLocation=' + sCarouselXmlUrl + '.xml" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" width="' + fCarouselWidth + '" height="' + fCarouselHeight + '"></embed></object>';
	}
	else
	{
		InitFromXml(CWS_HttpRequest(sCarouselXmlUrl + '_h5.xml'));

		if(nNbImagesVisibles >= nNbImages) nNbImagesVisibles = nNbImages - 1;
		nHalfNbImages = Math.floor(nNbImages / 2);
		nImageDelta = (3.1452 - (fAngleOffset * 2.0)) / (nNbImagesVisibles - 1);

		nPrevMilliseconds = -1;
		aImages[0].onclick();
	}

	function ImageLoaded()
	{
		this.setAttribute('loaded', true);
	}

	function FollowLink()
	{
		window.location = aLinks[nTargetImage];
	}
	
	function SetAsTarget()
	{
		if(nTargetImage == this.getAttribute('numb'))
		{
			window.location = aLinks[nTargetImage];
		}

		nTargetImage = this.getAttribute('numb');

		if (oInterval != null) window.clearInterval(oInterval);
		oInterval = window.setInterval(DoAnimStep, 1);
	}

	function DoAnimStep()
	{
		oDate = new Date();

		if (nPrevMilliseconds < 0) fElapdseTime = 0.0;
		else
		{
			fElapdseTime = oDate.getMilliseconds() - nPrevMilliseconds;

			if (fElapdseTime < 0.0) fElapdseTime += 1000.0;
		}
		nPrevMilliseconds = oDate.getMilliseconds();

		nDelta = nTargetImage - nFirstImage;
		if (nDelta == 0)
		{
			nPrevMilliseconds = -1;
			window.clearInterval(oInterval);
			oInterval = null;
		}

		fDirection = 0.0;

		if (nDelta >= 1 && nDelta <= nHalfNbImages) fDirection = -1.0;
		if (nDelta > nHalfNbImages) fDirection = 1.0;

		if (nDelta < -nHalfNbImages) fDirection = -1.0;
		if (nDelta <= -1 && nDelta >= -nHalfNbImages) fDirection = 1.0;

		fAnimTime += fElapdseTime * fDirection;
		
		if (fAnimTime > fAnimDuration) {

			nFirstImage = (nFirstImage + nNbImages - 1) % nNbImages;
			if(nFirstImage == nTargetImage) fAnimTime = 0.0;
			else fAnimTime -= fAnimDuration;
		}
		if (fAnimTime < -fAnimDuration) {

			nFirstImage = (nFirstImage + nNbImages + 1) % nNbImages;
			if(nFirstImage == nTargetImage) fAnimTime = 0.0;
			else fAnimTime += fAnimDuration;
		}

		for (j = (fDirection < 0 ? 0 : -1); j < nNbImagesVisibles + (fDirection < 0 ? 1 : 0); j++)
		{
			nImg = (nFirstImage + j + nNbImages - Math.floor(nNbImagesVisibles / 2)) % nNbImages;

			fAngle = ((fAnimTime / fAnimDuration) + j) * nImageDelta + fAngleOffset;

			fHeight = Math.sin(fAngle) * nImagesHalfHeight + nImagesHalfHeight;
			fWidth = Math.sin(fAngle) * nImagesHalfWidth + nImagesHalfWidth;
			fPosX = (fCarouselWidth / 2.0) - ((fCarouselWidth - nImagesHalfWidth - 40.0) / 2.0 * Math.cos(fAngle)) - fWidth / 2.0;
			fPosY = (fCarouselHeight - fHeight) / 2.0;

			aDivs[nImg].style.left = Math.floor(fPosX) + "px";
			aDivs[nImg].style.top = Math.floor(fPosY) + "px";
			
			aImages[nImg].width = Math.floor(fWidth);
			aImages[nImg].height = Math.floor(fHeight);

			aDivs[nImg].style.zIndex = Math.floor(fHeight);

			if(nImg == nTargetImage)
			{

				aPlayButtons[nImg].style.top = Math.floor((fHeight - 62) / 3) + "px";
				aPlayButtons[nImg].style.left = Math.floor((fWidth - 110) / 2) + "px";
				aPlayButtons[nImg].style.display = 'block';
				if(oInterval == null) aInfos[nImg].style.display = 'block';
			}
			else
			{
				aPlayButtons[nImg].style.display = 'none';
				aInfos[nImg].style.display = 'none';
			}
			
			aDivs[nImg].style.display = 'block';
		}

		while (j < nNbImages + (fDirection < 0 ? 0 : -1))
		{
			nImg = (nFirstImage + j + nNbImages - Math.floor(nNbImagesVisibles / 2)) % nNbImages;
			aDivs[nImg].style.display = 'none';

			j++
		}
	}

	function InitFromXml(sXml)
	{
		try
		{
			oXml = new ActiveXObject("Msxml2.DOMDocument.3.0");
			oXml.loadXML(sXml);
		}
		catch (e)
		{
			try
			{
				parser = new DOMParser();
				oXml = parser.parseFromString(sXml, "text/xml");
			}
			catch (e)
			{
				alert('oops');
			}
		}

		oItems = oXml.getElementsByTagName('item');

		nNbImages = 0;
		for (i = 0; i < oItems.length; i++)
		{
			aTitles[i] = GetTagValue(oItems[i], 'title');
			aDescriptions[i] = GetTagValue(oItems[i], 'description');
			aLinks[i] = GetTagValue(oItems[i], 'link');
		
			aDivs[i] = document.createElement('DIV');
			aDivs[i].style.position = 'absolute';

			aImages[i] = new Image();
			aImages[i].style.border = 'solid 1px #ffffff';
			aImages[i].src = GetTagAttribute(oItems[i], 'enclosure', 'url');
			aImages[i].setAttribute('numb', i);
			aImages[i].onclick = SetAsTarget;
			aDivs[i].appendChild(aImages[i]);

			aPlayButtons[i] = new Image();
			aPlayButtons[i].style.position = 'absolute';
			aPlayButtons[i].src = "./play-Button.png";
			aDivs[i].appendChild(aPlayButtons[i]);
			aPlayButtons[i].onclick = FollowLink;

			aInfos[i] = document.createElement('DIV');
			aInfos[i].style.backgroundImage = 'url(./background-textbox.png)';
			aInfos[i].style.color = '#ffffff';
			aInfos[i].style.position = 'absolute';
			aInfos[i].style.padding = '8px';
			aInfos[i].style.bottom = '0px';
			aInfos[i].innerHTML = '<b>' + aTitles[i] + '</b><br>' + aDescriptions[i];
			aDivs[i].appendChild(aInfos[i]);
			aInfos[i].onclick = FollowLink;

			divCarousel.appendChild(aDivs[i]);

			nNbImages ++;
		}
	
	}

	function GetTagValue(oXml, sTagName)
	{
		try
		{
			return oXml.getElementsByTagName(sTagName)[0].childNodes[0].nodeValue;
		}
		catch(e) {}

		return '';
	}

	function GetTagAttribute(oXml, sTagName, sAttributeName)
	{
		try
		{
			return oXml.getElementsByTagName(sTagName)[0].getAttribute(sAttributeName);
		}
		catch(e) {}

		return '';
	}

