
var com = {
	userspace : {
		widgets : {

			videosslideshowcytadelle : {
	
	
	_jSlideShows : {},
	
	Start : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			this._jSlideShows[parCode] = {oTimer:null};
			
		this.Stop(parCode);
		
		this._jSlideShows[parCode].oTimer = setInterval("com.userspace.widgets.videosslideshowcytadelle.SlideNext('" + parCode + "');", 4000);
	},
	
	Stop : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			return;
		
		var oDiv 	= $('#' + parCode + ' div')[1];
		oDiv.style.left = 0 + 'px';
		
		clearInterval(this._jSlideShows[parCode].oTimer);
		this._jSlideShows[parCode].oTimer = 0;
	},
	
	MouseOver : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			return;
			
		this.Stop(parCode);
		
		var oControl = $('#' + parCode + ' div.controls')[0];
		oControl.style.display = 'block';
		
		var  oControlBackground = $('#' + parCode + ' div.controls-background')[0];
		oControlBackground.style.display = 'block';
	},
	
	MouseOut : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			return;
		
		var oControl = $('#' + parCode + ' div.controls')[0];
		oControl.style.display = 'none';
		
		var  oControlBackground = $('#' + parCode + ' div.controls-background')[0];
		oControlBackground.style.display = 'none';
		
		this.Start(parCode);
	},
	
	SlideMove : function(parCode,iIndex)
	{
		if (!this._jSlideShows[parCode])
			return;
			
		var oDiv 	= $('#' + parCode + ' div.slideshow')[0];
		var tSlides = $('img',oDiv);
		for(var i=0,n=tSlides.length;i<n;i++)
		{
			oSlide = tSlides[i];
			
			if (oSlide.getAttribute('x-index') == iIndex)
				break;
			
			// Move slides
			if (oSlide.parentNode.tagName == 'A')	oSlide = oSlide.parentNode;
			oDiv.appendChild(oDiv.removeChild(oSlide));
			oDiv.style.left = 'auto';
		}
	},
	
	SlideNext : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			return;
		
		var oDiv 	= $('#' + parCode + ' div.slideshow')[0];
		var oImg 	= $('img',oDiv)[0];
		var jSize	= ct.style.GetDimensions(oImg);
		
		// Create animation
		ct.animations.Create('default',0,parseInt(jSize.width),function(parCode)
		{
			var oDiv 	= $('#' + parCode + ' div')[1];
			
			oDiv.style.left = 0 + 'px';
			return true;
		},
		function(iValue,parCode)
		{
			var oDiv 	= $('#' + parCode + ' div')[1];
			var oImg 	= $('img',oDiv)[0];
			var jSize	= ct.style.GetDimensions(oImg);
			
			oDiv.style.left = parseInt(0 * parseInt(jSize.width) - iValue) + 'px';	
			return true;
		},
		function(parCode)
		{
			var oDiv 	= $('#' + parCode + ' div')[1];
			var oSlide 	= $('img',oDiv)[0];
			
			if (oSlide.parentNode.tagName == 'A')	oSlide = oSlide.parentNode;
			oDiv.appendChild(oDiv.removeChild(oSlide));
			oDiv.style.left = 'auto';
			return true;
		},
		parCode);
		
		// Start animation
		ct.animations.Start();
	}
	
			},
			websitesmenu : {

	MouseOver : function(parCode,oEvent)
	{
		var jMouseEvent = ct.mouse.GetEvent(oEvent);
		
		// Open submenu
		com.userspace.widgets.websitesmenu.OpenSubmenu(jMouseEvent.Target);
		
	},
	
	MouseOut : function(parCode,oEvent)
	{
	},
	
	OpenSubmenu : function(oMenuItem)
	{
		// --------------------------------------------------------------------------------------
		// Declare variables
		var oUL,oLI,oSpan,oLabel,oCur,oSubMenus,oSubMenu;
		
		// --------------------------------------------------------------------------------------
		// Find the LI and UL
		oLI = oDiv = oWidget  = null;
		oUL = oCur = oClicked = oMenuItem;
		while(oCur != document)
		{
			if (oCur.tagName == 'LI')	oLI = oCur;
			if (oCur.tagName == 'UL')	oUL = oCur;
			if (oCur.tagName == 'DIV' && /cw_widget/.test(oCur.className)){oWidget = oCur;break;}
			oCur = oCur.parentNode;
		}
		if (oUL == null || oLI == null || oWidget == null)
			return;
		
		// --------------------------------------------------------------------------------------
		// Get menus, then submenu
		oCTMenu		= $('div.ct_menu');
		if (!oCTMenu) return;
		oCTMenu[0].setAttribute('id',oWidget.getAttribute('id'));
		
		oSubMenus	= $('#' + oWidget.getAttribute('id') + ' ul.submenu.i' + oLI.getAttribute('x-index'));
		if (!oSubMenus) return
		if (oSubMenus.length == 0) return;
		
		// --------------------------------------------------------------------------------------
		// Display the menu
		ct.menu.ShowXY(oLI,{"X":0,"Y":0},oSubMenus[0],true);
	},
	
	effects:
	{
		
		chenillard : 
		{
			_jMenus : [],
			
			Start : function(parCode)
			{
				if (!this._jMenus[parCode])
					this._jMenus[parCode] = {oTimer:null,oMenu:null,iCurIndex:0};
				
				// --------------------------------------------------------------------------------------
				// Stop current animation
				this.Stop(parCode);
				
				// --------------------------------------------------------------------------------------
				// Create new one
				this._jMenus[parCode].oMenu		= $('#' + parCode + ' ul.menu')[0];
				this._jMenus[parCode].oTimer 	= setInterval("com.userspace.widgets.websitesmenu.effects.chenillard.Next('" + parCode + "');", 2000);
				this._jMenus[parCode].iCurIndex = 0;
			},
			
			Stop : function(parCode)
			{
				if (!this._jMenus[parCode])
					return;
				
				// --------------------------------------------------------------------------------------
				// Remove hilights and add hilight to the correct
				var jMenuData 	= this._jMenus[parCode];
				if (jMenuData.oMenu)
				{
					var tMenuItems	= $('li.item',jMenuData.oMenu);
					ct.style.klass.Remove(tMenuItems,'hilight');
				}
				
				// --------------------------------------------------------------------------------------
				// Clear interval
				clearInterval(this._jMenus[parCode].oTimer);
				this._jMenus[parCode] = {oTimer:null,oMenu:null,iCurIndex:0};
			},
	
			Next : function(parCode)
			{
				// --------------------------------------------------------------------------------------
				// Get ojects
				var jMenuData 	= this._jMenus[parCode];
				var tMenuItems	= $('li.item',jMenuData.oMenu);
				var oCTMenu		= $('div.ct_menu')[0];
				
				// --------------------------------------------------------------------------------------
				// Remove hilights and add hilight to the correct
				ct.style.klass.Remove(tMenuItems,'hilight');
				
				// --------------------------------------------------------------------------------------
				// Verify if the menu is already opened, then do not display animation
				if (!oCTMenu) return;
				if (oCTMenu.style.display == 'block' && oCTMenu.getAttribute('id') == parCode) return;
				
				// --------------------------------------------------------------------------------------
				// Hilight the current index
				ct.style.klass.Add(tMenuItems[jMenuData.iCurIndex],'hilight');
				jMenuData.iCurIndex = (jMenuData.iCurIndex < tMenuItems.length - 1 ? jMenuData.iCurIndex + 1 : jMenuData.iCurIndex = 0);
			}
		}
	}

			},
			websitesmenu : {

	MouseOver : function(parCode,oEvent)
	{
		var jMouseEvent = ct.mouse.GetEvent(oEvent);
		
		// Open submenu
		com.userspace.widgets.websitesmenu.OpenSubmenu(jMouseEvent.Target);
		
	},
	
	MouseOut : function(parCode,oEvent)
	{
	},
	
	OpenSubmenu : function(oMenuItem)
	{
		// --------------------------------------------------------------------------------------
		// Declare variables
		var oUL,oLI,oSpan,oLabel,oCur,oSubMenus,oSubMenu;
		
		// --------------------------------------------------------------------------------------
		// Find the LI and UL
		oLI = oDiv = oWidget  = null;
		oUL = oCur = oClicked = oMenuItem;
		while(oCur != document)
		{
			if (oCur.tagName == 'LI')	oLI = oCur;
			if (oCur.tagName == 'UL')	oUL = oCur;
			if (oCur.tagName == 'DIV' && /cw_widget/.test(oCur.className)){oWidget = oCur;break;}
			oCur = oCur.parentNode;
		}
		if (oUL == null || oLI == null || oWidget == null)
			return;
		
		// --------------------------------------------------------------------------------------
		// Get menus, then submenu
		oCTMenu		= $('div.ct_menu');
		if (!oCTMenu) return;
		oCTMenu[0].setAttribute('id',oWidget.getAttribute('id'));
		
		oSubMenus	= $('#' + oWidget.getAttribute('id') + ' ul.submenu.i' + oLI.getAttribute('x-index'));
		if (!oSubMenus) return
		if (oSubMenus.length == 0) return;
		
		// --------------------------------------------------------------------------------------
		// Display the menu
		ct.menu.ShowXY(oLI,{"X":0,"Y":0},oSubMenus[0],true);
	},
	
	effects:
	{
		
		chenillard : 
		{
			_jMenus : [],
			
			Start : function(parCode)
			{
				if (!this._jMenus[parCode])
					this._jMenus[parCode] = {oTimer:null,oMenu:null,iCurIndex:0};
				
				// --------------------------------------------------------------------------------------
				// Stop current animation
				this.Stop(parCode);
				
				// --------------------------------------------------------------------------------------
				// Create new one
				this._jMenus[parCode].oMenu		= $('#' + parCode + ' ul.menu')[0];
				this._jMenus[parCode].oTimer 	= setInterval("com.userspace.widgets.websitesmenu.effects.chenillard.Next('" + parCode + "');", 2000);
				this._jMenus[parCode].iCurIndex = 0;
			},
			
			Stop : function(parCode)
			{
				if (!this._jMenus[parCode])
					return;
				
				// --------------------------------------------------------------------------------------
				// Remove hilights and add hilight to the correct
				var jMenuData 	= this._jMenus[parCode];
				if (jMenuData.oMenu)
				{
					var tMenuItems	= $('li.item',jMenuData.oMenu);
					ct.style.klass.Remove(tMenuItems,'hilight');
				}
				
				// --------------------------------------------------------------------------------------
				// Clear interval
				clearInterval(this._jMenus[parCode].oTimer);
				this._jMenus[parCode] = {oTimer:null,oMenu:null,iCurIndex:0};
			},
	
			Next : function(parCode)
			{
				// --------------------------------------------------------------------------------------
				// Get ojects
				var jMenuData 	= this._jMenus[parCode];
				var tMenuItems	= $('li.item',jMenuData.oMenu);
				var oCTMenu		= $('div.ct_menu')[0];
				
				// --------------------------------------------------------------------------------------
				// Remove hilights and add hilight to the correct
				ct.style.klass.Remove(tMenuItems,'hilight');
				
				// --------------------------------------------------------------------------------------
				// Verify if the menu is already opened, then do not display animation
				if (!oCTMenu) return;
				if (oCTMenu.style.display == 'block' && oCTMenu.getAttribute('id') == parCode) return;
				
				// --------------------------------------------------------------------------------------
				// Hilight the current index
				ct.style.klass.Add(tMenuItems[jMenuData.iCurIndex],'hilight');
				jMenuData.iCurIndex = (jMenuData.iCurIndex < tMenuItems.length - 1 ? jMenuData.iCurIndex + 1 : jMenuData.iCurIndex = 0);
			}
		}
	}

			},
			videosslideshowcytadelle : {
	
	
	_jSlideShows : {},
	
	Start : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			this._jSlideShows[parCode] = {oTimer:null};
			
		this.Stop(parCode);
		
		this._jSlideShows[parCode].oTimer = setInterval("com.userspace.widgets.videosslideshowcytadelle.SlideNext('" + parCode + "');", 4000);
	},
	
	Stop : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			return;
		
		var oDiv 	= $('#' + parCode + ' div')[1];
		oDiv.style.left = 0 + 'px';
		
		clearInterval(this._jSlideShows[parCode].oTimer);
		this._jSlideShows[parCode].oTimer = 0;
	},
	
	MouseOver : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			return;
			
		this.Stop(parCode);
		
		var oControl = $('#' + parCode + ' div.controls')[0];
		oControl.style.display = 'block';
		
		var  oControlBackground = $('#' + parCode + ' div.controls-background')[0];
		oControlBackground.style.display = 'block';
	},
	
	MouseOut : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			return;
		
		var oControl = $('#' + parCode + ' div.controls')[0];
		oControl.style.display = 'none';
		
		var  oControlBackground = $('#' + parCode + ' div.controls-background')[0];
		oControlBackground.style.display = 'none';
		
		this.Start(parCode);
	},
	
	SlideMove : function(parCode,iIndex)
	{
		if (!this._jSlideShows[parCode])
			return;
			
		var oDiv 	= $('#' + parCode + ' div.slideshow')[0];
		var tSlides = $('img',oDiv);
		for(var i=0,n=tSlides.length;i<n;i++)
		{
			oSlide = tSlides[i];
			
			if (oSlide.getAttribute('x-index') == iIndex)
				break;
			
			// Move slides
			if (oSlide.parentNode.tagName == 'A')	oSlide = oSlide.parentNode;
			oDiv.appendChild(oDiv.removeChild(oSlide));
			oDiv.style.left = 'auto';
		}
	},
	
	SlideNext : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			return;
		
		var oDiv 	= $('#' + parCode + ' div.slideshow')[0];
		var oImg 	= $('img',oDiv)[0];
		var jSize	= ct.style.GetDimensions(oImg);
		
		// Create animation
		ct.animations.Create('default',0,parseInt(jSize.width),function(parCode)
		{
			var oDiv 	= $('#' + parCode + ' div')[1];
			
			oDiv.style.left = 0 + 'px';
			return true;
		},
		function(iValue,parCode)
		{
			var oDiv 	= $('#' + parCode + ' div')[1];
			var oImg 	= $('img',oDiv)[0];
			var jSize	= ct.style.GetDimensions(oImg);
			
			oDiv.style.left = parseInt(0 * parseInt(jSize.width) - iValue) + 'px';	
			return true;
		},
		function(parCode)
		{
			var oDiv 	= $('#' + parCode + ' div')[1];
			var oSlide 	= $('img',oDiv)[0];
			
			if (oSlide.parentNode.tagName == 'A')	oSlide = oSlide.parentNode;
			oDiv.appendChild(oDiv.removeChild(oSlide));
			oDiv.style.left = 'auto';
			return true;
		},
		parCode);
		
		// Start animation
		ct.animations.Start();
	}
	
			},
			websitesmenu : {

	MouseOver : function(parCode,oEvent)
	{
		var jMouseEvent = ct.mouse.GetEvent(oEvent);
		
		// Open submenu
		com.userspace.widgets.websitesmenu.OpenSubmenu(jMouseEvent.Target);
		
	},
	
	MouseOut : function(parCode,oEvent)
	{
	},
	
	OpenSubmenu : function(oMenuItem)
	{
		// --------------------------------------------------------------------------------------
		// Declare variables
		var oUL,oLI,oSpan,oLabel,oCur,oSubMenus,oSubMenu;
		
		// --------------------------------------------------------------------------------------
		// Find the LI and UL
		oLI = oDiv = oWidget  = null;
		oUL = oCur = oClicked = oMenuItem;
		while(oCur != document)
		{
			if (oCur.tagName == 'LI')	oLI = oCur;
			if (oCur.tagName == 'UL')	oUL = oCur;
			if (oCur.tagName == 'DIV' && /cw_widget/.test(oCur.className)){oWidget = oCur;break;}
			oCur = oCur.parentNode;
		}
		if (oUL == null || oLI == null || oWidget == null)
			return;
		
		// --------------------------------------------------------------------------------------
		// Get menus, then submenu
		oCTMenu		= $('div.ct_menu');
		if (!oCTMenu) return;
		oCTMenu[0].setAttribute('id',oWidget.getAttribute('id'));
		
		oSubMenus	= $('#' + oWidget.getAttribute('id') + ' ul.submenu.i' + oLI.getAttribute('x-index'));
		if (!oSubMenus) return
		if (oSubMenus.length == 0) return;
		
		// --------------------------------------------------------------------------------------
		// Display the menu
		ct.menu.ShowXY(oLI,{"X":0,"Y":0},oSubMenus[0],true);
	},
	
	effects:
	{
		
		chenillard : 
		{
			_jMenus : [],
			
			Start : function(parCode)
			{
				if (!this._jMenus[parCode])
					this._jMenus[parCode] = {oTimer:null,oMenu:null,iCurIndex:0};
				
				// --------------------------------------------------------------------------------------
				// Stop current animation
				this.Stop(parCode);
				
				// --------------------------------------------------------------------------------------
				// Create new one
				this._jMenus[parCode].oMenu		= $('#' + parCode + ' ul.menu')[0];
				this._jMenus[parCode].oTimer 	= setInterval("com.userspace.widgets.websitesmenu.effects.chenillard.Next('" + parCode + "');", 2000);
				this._jMenus[parCode].iCurIndex = 0;
			},
			
			Stop : function(parCode)
			{
				if (!this._jMenus[parCode])
					return;
				
				// --------------------------------------------------------------------------------------
				// Remove hilights and add hilight to the correct
				var jMenuData 	= this._jMenus[parCode];
				if (jMenuData.oMenu)
				{
					var tMenuItems	= $('li.item',jMenuData.oMenu);
					ct.style.klass.Remove(tMenuItems,'hilight');
				}
				
				// --------------------------------------------------------------------------------------
				// Clear interval
				clearInterval(this._jMenus[parCode].oTimer);
				this._jMenus[parCode] = {oTimer:null,oMenu:null,iCurIndex:0};
			},
	
			Next : function(parCode)
			{
				// --------------------------------------------------------------------------------------
				// Get ojects
				var jMenuData 	= this._jMenus[parCode];
				var tMenuItems	= $('li.item',jMenuData.oMenu);
				var oCTMenu		= $('div.ct_menu')[0];
				
				// --------------------------------------------------------------------------------------
				// Remove hilights and add hilight to the correct
				ct.style.klass.Remove(tMenuItems,'hilight');
				
				// --------------------------------------------------------------------------------------
				// Verify if the menu is already opened, then do not display animation
				if (!oCTMenu) return;
				if (oCTMenu.style.display == 'block' && oCTMenu.getAttribute('id') == parCode) return;
				
				// --------------------------------------------------------------------------------------
				// Hilight the current index
				ct.style.klass.Add(tMenuItems[jMenuData.iCurIndex],'hilight');
				jMenuData.iCurIndex = (jMenuData.iCurIndex < tMenuItems.length - 1 ? jMenuData.iCurIndex + 1 : jMenuData.iCurIndex = 0);
			}
		}
	}

			},
			websitesmenu : {

	MouseOver : function(parCode,oEvent)
	{
		var jMouseEvent = ct.mouse.GetEvent(oEvent);
		
		// Open submenu
		com.userspace.widgets.websitesmenu.OpenSubmenu(jMouseEvent.Target);
		
	},
	
	MouseOut : function(parCode,oEvent)
	{
	},
	
	OpenSubmenu : function(oMenuItem)
	{
		// --------------------------------------------------------------------------------------
		// Declare variables
		var oUL,oLI,oSpan,oLabel,oCur,oSubMenus,oSubMenu;
		
		// --------------------------------------------------------------------------------------
		// Find the LI and UL
		oLI = oDiv = oWidget  = null;
		oUL = oCur = oClicked = oMenuItem;
		while(oCur != document)
		{
			if (oCur.tagName == 'LI')	oLI = oCur;
			if (oCur.tagName == 'UL')	oUL = oCur;
			if (oCur.tagName == 'DIV' && /cw_widget/.test(oCur.className)){oWidget = oCur;break;}
			oCur = oCur.parentNode;
		}
		if (oUL == null || oLI == null || oWidget == null)
			return;
		
		// --------------------------------------------------------------------------------------
		// Get menus, then submenu
		oCTMenu		= $('div.ct_menu');
		if (!oCTMenu) return;
		oCTMenu[0].setAttribute('id',oWidget.getAttribute('id'));
		
		oSubMenus	= $('#' + oWidget.getAttribute('id') + ' ul.submenu.i' + oLI.getAttribute('x-index'));
		if (!oSubMenus) return
		if (oSubMenus.length == 0) return;
		
		// --------------------------------------------------------------------------------------
		// Display the menu
		ct.menu.ShowXY(oLI,{"X":0,"Y":0},oSubMenus[0],true);
	},
	
	effects:
	{
		
		chenillard : 
		{
			_jMenus : [],
			
			Start : function(parCode)
			{
				if (!this._jMenus[parCode])
					this._jMenus[parCode] = {oTimer:null,oMenu:null,iCurIndex:0};
				
				// --------------------------------------------------------------------------------------
				// Stop current animation
				this.Stop(parCode);
				
				// --------------------------------------------------------------------------------------
				// Create new one
				this._jMenus[parCode].oMenu		= $('#' + parCode + ' ul.menu')[0];
				this._jMenus[parCode].oTimer 	= setInterval("com.userspace.widgets.websitesmenu.effects.chenillard.Next('" + parCode + "');", 2000);
				this._jMenus[parCode].iCurIndex = 0;
			},
			
			Stop : function(parCode)
			{
				if (!this._jMenus[parCode])
					return;
				
				// --------------------------------------------------------------------------------------
				// Remove hilights and add hilight to the correct
				var jMenuData 	= this._jMenus[parCode];
				if (jMenuData.oMenu)
				{
					var tMenuItems	= $('li.item',jMenuData.oMenu);
					ct.style.klass.Remove(tMenuItems,'hilight');
				}
				
				// --------------------------------------------------------------------------------------
				// Clear interval
				clearInterval(this._jMenus[parCode].oTimer);
				this._jMenus[parCode] = {oTimer:null,oMenu:null,iCurIndex:0};
			},
	
			Next : function(parCode)
			{
				// --------------------------------------------------------------------------------------
				// Get ojects
				var jMenuData 	= this._jMenus[parCode];
				var tMenuItems	= $('li.item',jMenuData.oMenu);
				var oCTMenu		= $('div.ct_menu')[0];
				
				// --------------------------------------------------------------------------------------
				// Remove hilights and add hilight to the correct
				ct.style.klass.Remove(tMenuItems,'hilight');
				
				// --------------------------------------------------------------------------------------
				// Verify if the menu is already opened, then do not display animation
				if (!oCTMenu) return;
				if (oCTMenu.style.display == 'block' && oCTMenu.getAttribute('id') == parCode) return;
				
				// --------------------------------------------------------------------------------------
				// Hilight the current index
				ct.style.klass.Add(tMenuItems[jMenuData.iCurIndex],'hilight');
				jMenuData.iCurIndex = (jMenuData.iCurIndex < tMenuItems.length - 1 ? jMenuData.iCurIndex + 1 : jMenuData.iCurIndex = 0);
			}
		}
	}

			},
			videosslideshowcytadelle : {
	
	
	_jSlideShows : {},
	
	Start : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			this._jSlideShows[parCode] = {oTimer:null};
			
		this.Stop(parCode);
		
		this._jSlideShows[parCode].oTimer = setInterval("com.userspace.widgets.videosslideshowcytadelle.SlideNext('" + parCode + "');", 4000);
	},
	
	Stop : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			return;
		
		var oDiv 	= $('#' + parCode + ' div')[1];
		oDiv.style.left = 0 + 'px';
		
		clearInterval(this._jSlideShows[parCode].oTimer);
		this._jSlideShows[parCode].oTimer = 0;
	},
	
	MouseOver : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			return;
			
		this.Stop(parCode);
		
		var oControl = $('#' + parCode + ' div.controls')[0];
		oControl.style.display = 'block';
		
		var  oControlBackground = $('#' + parCode + ' div.controls-background')[0];
		oControlBackground.style.display = 'block';
	},
	
	MouseOut : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			return;
		
		var oControl = $('#' + parCode + ' div.controls')[0];
		oControl.style.display = 'none';
		
		var  oControlBackground = $('#' + parCode + ' div.controls-background')[0];
		oControlBackground.style.display = 'none';
		
		this.Start(parCode);
	},
	
	SlideMove : function(parCode,iIndex)
	{
		if (!this._jSlideShows[parCode])
			return;
			
		var oDiv 	= $('#' + parCode + ' div.slideshow')[0];
		var tSlides = $('img',oDiv);
		for(var i=0,n=tSlides.length;i<n;i++)
		{
			oSlide = tSlides[i];
			
			if (oSlide.getAttribute('x-index') == iIndex)
				break;
			
			// Move slides
			if (oSlide.parentNode.tagName == 'A')	oSlide = oSlide.parentNode;
			oDiv.appendChild(oDiv.removeChild(oSlide));
			oDiv.style.left = 'auto';
		}
	},
	
	SlideNext : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			return;
		
		var oDiv 	= $('#' + parCode + ' div.slideshow')[0];
		var oImg 	= $('img',oDiv)[0];
		var jSize	= ct.style.GetDimensions(oImg);
		
		// Create animation
		ct.animations.Create('default',0,parseInt(jSize.width),function(parCode)
		{
			var oDiv 	= $('#' + parCode + ' div')[1];
			
			oDiv.style.left = 0 + 'px';
			return true;
		},
		function(iValue,parCode)
		{
			var oDiv 	= $('#' + parCode + ' div')[1];
			var oImg 	= $('img',oDiv)[0];
			var jSize	= ct.style.GetDimensions(oImg);
			
			oDiv.style.left = parseInt(0 * parseInt(jSize.width) - iValue) + 'px';	
			return true;
		},
		function(parCode)
		{
			var oDiv 	= $('#' + parCode + ' div')[1];
			var oSlide 	= $('img',oDiv)[0];
			
			if (oSlide.parentNode.tagName == 'A')	oSlide = oSlide.parentNode;
			oDiv.appendChild(oDiv.removeChild(oSlide));
			oDiv.style.left = 'auto';
			return true;
		},
		parCode);
		
		// Start animation
		ct.animations.Start();
	}
	
			},
			websitesmenu : {

	MouseOver : function(parCode,oEvent)
	{
		var jMouseEvent = ct.mouse.GetEvent(oEvent);
		
		// Open submenu
		com.userspace.widgets.websitesmenu.OpenSubmenu(jMouseEvent.Target);
		
	},
	
	MouseOut : function(parCode,oEvent)
	{
	},
	
	OpenSubmenu : function(oMenuItem)
	{
		// --------------------------------------------------------------------------------------
		// Declare variables
		var oUL,oLI,oSpan,oLabel,oCur,oSubMenus,oSubMenu;
		
		// --------------------------------------------------------------------------------------
		// Find the LI and UL
		oLI = oDiv = oWidget  = null;
		oUL = oCur = oClicked = oMenuItem;
		while(oCur != document)
		{
			if (oCur.tagName == 'LI')	oLI = oCur;
			if (oCur.tagName == 'UL')	oUL = oCur;
			if (oCur.tagName == 'DIV' && /cw_widget/.test(oCur.className)){oWidget = oCur;break;}
			oCur = oCur.parentNode;
		}
		if (oUL == null || oLI == null || oWidget == null)
			return;
		
		// --------------------------------------------------------------------------------------
		// Get menus, then submenu
		oCTMenu		= $('div.ct_menu');
		if (!oCTMenu) return;
		oCTMenu[0].setAttribute('id',oWidget.getAttribute('id'));
		
		oSubMenus	= $('#' + oWidget.getAttribute('id') + ' ul.submenu.i' + oLI.getAttribute('x-index'));
		if (!oSubMenus) return
		if (oSubMenus.length == 0) return;
		
		// --------------------------------------------------------------------------------------
		// Display the menu
		ct.menu.ShowXY(oLI,{"X":0,"Y":0},oSubMenus[0],true);
	},
	
	effects:
	{
		
		chenillard : 
		{
			_jMenus : [],
			
			Start : function(parCode)
			{
				if (!this._jMenus[parCode])
					this._jMenus[parCode] = {oTimer:null,oMenu:null,iCurIndex:0};
				
				// --------------------------------------------------------------------------------------
				// Stop current animation
				this.Stop(parCode);
				
				// --------------------------------------------------------------------------------------
				// Create new one
				this._jMenus[parCode].oMenu		= $('#' + parCode + ' ul.menu')[0];
				this._jMenus[parCode].oTimer 	= setInterval("com.userspace.widgets.websitesmenu.effects.chenillard.Next('" + parCode + "');", 2000);
				this._jMenus[parCode].iCurIndex = 0;
			},
			
			Stop : function(parCode)
			{
				if (!this._jMenus[parCode])
					return;
				
				// --------------------------------------------------------------------------------------
				// Remove hilights and add hilight to the correct
				var jMenuData 	= this._jMenus[parCode];
				if (jMenuData.oMenu)
				{
					var tMenuItems	= $('li.item',jMenuData.oMenu);
					ct.style.klass.Remove(tMenuItems,'hilight');
				}
				
				// --------------------------------------------------------------------------------------
				// Clear interval
				clearInterval(this._jMenus[parCode].oTimer);
				this._jMenus[parCode] = {oTimer:null,oMenu:null,iCurIndex:0};
			},
	
			Next : function(parCode)
			{
				// --------------------------------------------------------------------------------------
				// Get ojects
				var jMenuData 	= this._jMenus[parCode];
				var tMenuItems	= $('li.item',jMenuData.oMenu);
				var oCTMenu		= $('div.ct_menu')[0];
				
				// --------------------------------------------------------------------------------------
				// Remove hilights and add hilight to the correct
				ct.style.klass.Remove(tMenuItems,'hilight');
				
				// --------------------------------------------------------------------------------------
				// Verify if the menu is already opened, then do not display animation
				if (!oCTMenu) return;
				if (oCTMenu.style.display == 'block' && oCTMenu.getAttribute('id') == parCode) return;
				
				// --------------------------------------------------------------------------------------
				// Hilight the current index
				ct.style.klass.Add(tMenuItems[jMenuData.iCurIndex],'hilight');
				jMenuData.iCurIndex = (jMenuData.iCurIndex < tMenuItems.length - 1 ? jMenuData.iCurIndex + 1 : jMenuData.iCurIndex = 0);
			}
		}
	}

			},
			videosslideshowcytadelle : {
	
	
	_jSlideShows : {},
	
	Start : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			this._jSlideShows[parCode] = {oTimer:null};
			
		this.Stop(parCode);
		
		this._jSlideShows[parCode].oTimer = setInterval("com.userspace.widgets.videosslideshowcytadelle.SlideNext('" + parCode + "');", 4000);
	},
	
	Stop : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			return;
		
		var oDiv 	= $('#' + parCode + ' div')[1];
		oDiv.style.left = 0 + 'px';
		
		clearInterval(this._jSlideShows[parCode].oTimer);
		this._jSlideShows[parCode].oTimer = 0;
	},
	
	MouseOver : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			return;
			
		this.Stop(parCode);
		
		var oControl = $('#' + parCode + ' div.controls')[0];
		oControl.style.display = 'block';
		
		var  oControlBackground = $('#' + parCode + ' div.controls-background')[0];
		oControlBackground.style.display = 'block';
	},
	
	MouseOut : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			return;
		
		var oControl = $('#' + parCode + ' div.controls')[0];
		oControl.style.display = 'none';
		
		var  oControlBackground = $('#' + parCode + ' div.controls-background')[0];
		oControlBackground.style.display = 'none';
		
		this.Start(parCode);
	},
	
	SlideMove : function(parCode,iIndex)
	{
		if (!this._jSlideShows[parCode])
			return;
			
		var oDiv 	= $('#' + parCode + ' div.slideshow')[0];
		var tSlides = $('img',oDiv);
		for(var i=0,n=tSlides.length;i<n;i++)
		{
			oSlide = tSlides[i];
			
			if (oSlide.getAttribute('x-index') == iIndex)
				break;
			
			// Move slides
			if (oSlide.parentNode.tagName == 'A')	oSlide = oSlide.parentNode;
			oDiv.appendChild(oDiv.removeChild(oSlide));
			oDiv.style.left = 'auto';
		}
	},
	
	SlideNext : function(parCode)
	{
		if (!this._jSlideShows[parCode])
			return;
		
		var oDiv 	= $('#' + parCode + ' div.slideshow')[0];
		var oImg 	= $('img',oDiv)[0];
		var jSize	= ct.style.GetDimensions(oImg);
		
		// Create animation
		ct.animations.Create('default',0,parseInt(jSize.width),function(parCode)
		{
			var oDiv 	= $('#' + parCode + ' div')[1];
			
			oDiv.style.left = 0 + 'px';
			return true;
		},
		function(iValue,parCode)
		{
			var oDiv 	= $('#' + parCode + ' div')[1];
			var oImg 	= $('img',oDiv)[0];
			var jSize	= ct.style.GetDimensions(oImg);
			
			oDiv.style.left = parseInt(0 * parseInt(jSize.width) - iValue) + 'px';	
			return true;
		},
		function(parCode)
		{
			var oDiv 	= $('#' + parCode + ' div')[1];
			var oSlide 	= $('img',oDiv)[0];
			
			if (oSlide.parentNode.tagName == 'A')	oSlide = oSlide.parentNode;
			oDiv.appendChild(oDiv.removeChild(oSlide));
			oDiv.style.left = 'auto';
			return true;
		},
		parCode);
		
		// Start animation
		ct.animations.Start();
	}
	
			},
			"end":"end"
		},
		apps : {

			"end":"end"
		}
	}
};

