/**
 * Adds hover classes for IE6. Does nothing if another browser is used.
 * Included by <code>Yolly7_FlyNavigation</code>.
 * @class dtIeHover
 **/

/**
 * Specifies the element(s) which should get a hover class added if IE6 is used.
 * @config selector
 * @type string
 **/

/**
 * The name of the hover class.
 * @config className
 * @type string
 **/

/*jslint strict:false, plusplus:false*/
/*global DT:false*/

DT.CORE.register('dtIeHover', function (io, $) {
	return {
		init: function (optionsArray) {
			if (!DT.TOOLKIT.isIE6) {
				return;
			}
			var i, options, down, up;
			down = function (className) {
				return function () {
					$(this).addClass(className);
				};
			};
			up = function (className) {
				return function () {
					$(this).removeClass(className);
				};
			};
			for (i = optionsArray.length; i--;) {
				options = optionsArray[i];
				$(options.selector).hover(
					down(options.className),
					up(options.className)
				);
			}
		}
	};
});
