/**
 * Efectos de cambio de propiedades al hacer hover sobre elementos
 */




/**
 * Establece el efecto de cambio de propiedad a los elementos 'matchCSS'
 */
function initTogglePropertyHover (matchCSS, property, from, to, toDuration, fromDuration)
	{
	var items = $$(matchCSS);

	
	if(items==null||items.length<=0)
		return;

	if(Browser&&Browser.ie6)
		{
		toDuration = Math.round(toDuration/2);
		fromDuration = Math.round(fromDuration/2);
		}

	items.each
		(
		function(item) 
			{

			if(item.togglePropertyHoverFx==null||item.togglePropertyHoverFx==undefined)
				item.togglePropertyHoverFx = new Fx.Toggle(item);

			item.setStyle(property, from);

			item.addEvent('mouseenter',
				function(event) 
					{
					item.togglePropertyHoverFx.pause();
					item.togglePropertyHoverFx.options.duration = toDuration;
					item.togglePropertyHoverFx.toggleProperty(property, item.getStyle(property), to, true);
					}
				);

			item.addEvent('mouseleave',
				function(event) 
					{
					item.togglePropertyHoverFx.pause();
					item.togglePropertyHoverFx.options.duration = fromDuration;
					item.togglePropertyHoverFx.toggleProperty(property, item.getStyle(property), from, true);
					}
				);

						
			}
		);

	}

