/*
 * Package
 */
var stratos = (function (base) {
	return base;
})( stratos || {} );


/*
 * articleSlider closure
 */
stratos.hovers = (function ($) {
	
	/**
	 * Public interface (methods will be added below)
	 */
	var publicInterface = {};
	
	
	/**
	 * Private variables
	 */
	
	/**
	 * Private method:
	 * Adds rollover effects 
	 */
	function addHoverEffects() {
		
		$("a.hover").not(".active").hover( function (){
			var imageSrc = $(this).find("img").attr("src");
			var prefix = imageSrc.substr( 0, imageSrc.lastIndexOf(".") );
			$(this).find("img").attr({src: prefix + "_hover.gif"});
		}, function () {
			var imageSrc = $(this).find("img").attr("src");
			var prefix = imageSrc.substr( 0, imageSrc.lastIndexOf(".") );
			if (prefix.indexOf("_hover")>=0) {
				prefix = prefix.substr( 0, imageSrc.lastIndexOf("_hover") );
			}
			$(this).find("img").attr({src: prefix + ".gif"});
		});
	}
	
	/**
	 * Private method:
	 * Adds alpha rollover effects 
	 */
	function addAlphaHoverEffects() {
		
		$("a.alphaHover").not(".active").hover( function (){
			$(this).addClass("mouseOver");
		}, function () {
			$(this).removeClass("mouseOver");
		});
	}
	
	/**
	 * Public method:
	 * Initialize the slider behavior
	 */
	publicInterface.init = function () {
		addHoverEffects();
		addAlphaHoverEffects();
	};

	return publicInterface;
	
})(jQuery);

