jQuery.fn.liScroll = function(settings) {
		settings = jQuery.extend({
		travelocity: 0.07
		}, settings);		
		return this.each(function(){
				var $strip = jQuery(this);
				$strip.addClass("newsticker")
				var stripWidth = 0;
				var $mask = $strip.wrap("<div class='mask'></div>");
				var $tickercontainer = $strip.parent().wrap("<div class='tickercontainer' style='overflow:hidden;'></div>");								
				var containerWidth = $strip.parent().parent().width();	//a.k.a. 'mask' width 	
				$strip.find("li").each(function(i){
				stripWidth += jQuery(this, i).outerWidth(true); // thanks to Michael Haszprunar
				});
				$strip.width(stripWidth);			
				var totalTravel = stripWidth+containerWidth;
				var defTiming = totalTravel/settings.travelocity;	// thanks to Scott Waye		
				function scrollnews(spazio, tempo){
				$strip.animate({left: '-='+ spazio}, tempo, "linear", function(){$strip.css("left", containerWidth); scrollnews(totalTravel, defTiming);});
				}
				scrollnews(totalTravel, defTiming);				
				$strip.hover(function(){
				jQuery(this).stop();
				},
				function(){
				var offset = jQuery(this).offset();
				var residualSpace = offset.left + stripWidth;
				var residualTime = residualSpace/settings.travelocity;
				scrollnews(residualSpace, residualTime);
				});			
		});	
};

$(function() {
/*
images/organisations/adobe.jpg
images/organisations/adobe_small.jpg
images/organisations/alcatel-lucent.jpg
images/organisations/malakoff-mederic.jpg
images/organisations/orange.jpg
images/organisations/Groupe-Cheque-Dejeuner.png
images/organisations/adobe.png
images/organisations/air-liquide.png
images/organisations/malakoff-mederic.png
images/organisations/renault.png
images/organisations/sncf.png
images/organisations/total.png
images/organisations/aeroports-de-paris.gif
images/organisations/ag2rlm.gif
images/organisations/arcep.gif
images/organisations/banque-populaire.gif
images/organisations/bouygues-construction.gif
images/organisations/bouygues.gif
images/organisations/credit-agricole.gif
images/organisations/fondation-de-france.gif
images/organisations/gmf.gif
images/organisations/hsbc.gif
images/organisations/ipedis.gif
images/organisations/plasticomnium.gif
images/organisations/primagaz.gif
images/organisations/saint-gobain.gif
images/organisations/sanofi-aventis.gif
images/organisations/veolia-environnement.gif
*/

	$('ul#logosClients img').css('opacity', '0.2');

	$('ul#logosClients img').each(function() {
	
		larg = $(this).width() / 2;
		haut = $(this).height() / 2;
	
		/*$(this).width('50%');
		$(this).height('50%');*/
	
			
		   
	});
	
	
	$('ul#logosClients img').hover(function() {
			
				largeurBig = '10%';
				hauteurBig = '10%';
				
				largeurInitiale = $(this).width();
				hauteurInitiale = $(this).height();
				
				largeurGros = largeurInitiale + ((largeurInitiale * 10) / 100);
				hauteurGros = hauteurInitiale + ((hauteurInitiale * 10) / 100);

			
				$(this).stop().animate({ opacity: 1.0, width: largeurGros, height: hauteurGros }, 200);
				
				
			},
			
			
			function() {
			
				$(this).stop().animate({ opacity: 0.2, width: largeurInitiale, height: hauteurInitiale }, 200);
				
				
	});
	
	
	
	/*function defilementLogo()
	{
		$('.logoclient').stop().animate({ left: '-500px' },'1000', function() {

			defilementLogo();
		});
		
		
		
	}*/
	
	//defilementLogo();
	$("ul#logosClients").liScroll();

});
