

;

;;jQuery.newscover = {	build : function(options) {		try {			// Default settings			var defaults = {				title: "jQuery.newscover",				effectSpeed: 750,				rotationTimeout: 3000,				mouseOverTimeout: 5000			}			// Move to options			var options = jQuery.extend(defaults, options);						// Variables			var object = this;			var index = 0;			var mouseOver = false;			var mouseOverCheck = false;			var mouseOverCounter = 0;//			jQuery(this).log("Class loaded", "info", options.title);			/*			 *	Setup			 */			changeImage();			/*			 *	Mouse actions			 */			// Hover over buttons event 			jQuery(object).hover(function() {				// Set the mouseOver variables to true and 0				mouseOver = true;				mouseOverCheck = true;				mouseOverCounter = 0;			}, function() {				mouseOver = false;				mouseOverCounter = 0;			});			// Hover over buttons event 			jQuery(object).find(".list_news_cover li").hover(function() {				// Get the index of the current selection				index = jQuery(object).find(".list_news_cover li").index(this);								// Change the image				changeImage();			}, function() {			});			/*  			 *	Automatic rotation 			 */ 			 			// Rotate			jQuery(object).everyTime(options.rotationTimeout, "rotation", function() {				// Only if the mouse isn't over the images				if(mouseOverCheck == false) {					// Set the index to that of the next button					index++;					// Check if the index is in reach					if(index >= jQuery(object).find(".list_news_cover li").length) index = 0;					// Change the image					changeImage();				}			});			// MouseOver check			jQuery(object).everyTime(options.mouseOverTimeout/10, function() {				// If the mouse isn't over anymore and the check is still running				if(mouseOver == false && mouseOverCheck == true) {					mouseOverCounter++;				}				// Counter log				//jQuery(object).log(mouseOverCounter, "info", "MouseOverCounter");								// If the mouse isn't over and the counter reacher 10, enable auto rotation				if(mouseOver == false && mouseOverCounter >= 10) {					mouseOverCheck = false;					mouseOverCounter = 0;				}			});		}		catch(err) {//			jQuery(this).log("Error during loading - " + err, "error", options.name);		}		function changeImage() {			// Remove active class			jQuery(object).find(".list_news_cover li a").removeClass("active");			// Add active class to current selection			jQuery(object).find(".list_news_cover li:eq(" + index + ") a").addClass("active");			// Hide all images			jQuery(object).find(".list_news_cover_images li").stop(true, true);			jQuery(object).find(".list_news_cover_images li").hide();			// Show selected image			jQuery(object).find(".list_news_cover_images li:eq(" + index + ")").fadeIn(options.effectSpeed);			/*			// Hide description			jQuery(object).find(".list_news_cover_images li:eq(" + index + ") .description").slideUp(0);			// Slide up description			jQuery(object).find(".list_news_cover_images li:eq(" + index + ") .description").slideDown(options.effectSpeed*2);			*/		}		return this;	}};jQuery.fn.extend({		newscover: jQuery.newscover.build});jQuery(function() {jQuery("#caroussel").newscover();});