(function($) {
	$.fn.logoslider = function(options) {
		var opts = $.extend({}, $.fn.logoslider.defaults, options);
		
		var $frame = this;
		var $logos = $frame.children('li');
		var $lastitem = Math.round($logos.length/3);
		var currentNum = 0;
		var initop = this.children('li').eq(0).height();
		var timer;

		$frame.css({ top: initop });
		timer = setTimeout(slide, opts.intstart);
		
		$logos.each(function(){
			$this = $(this);
			
			$this.hover(function(){
				clearTimeout(timer);
			}, function(){
				timer = setTimeout(slide, opts.intnext);
			});
		});
		
		function slide(){
			$frame.animate({
				opacity: 0.25,
				top: '-=' + initop
			}, opts.intslide, function() {
				$(this).animate({ opacity: 1 });
				if(currentNum < $lastitem){
					timer = setTimeout(slide, opts.intnext);
					currentNum++;
				} else {
					currentNum = 0;
					$(this).css({ top: initop });
					slide();					
				}
				
			});
		}
	}
	
	$.fn.logoslider.defaults = {
		'intstart': 500,
		'intslide': 1500,
		'intnext': 10000
	}
	
})(jQuery);

$(document).ready(function() {
	var currentPath = (window.location+'').split('/');
	$('#nav_438320 li').each(function(){
		var anc = $(this).children('a').attr('href')+'';
		anc = anc.split('/');
		if(anc[1] == currentPath[3])
		$(this).addClass('selected');
	});
});
