
$.fn.logoslides = function(c) {
	if (c.imgs.length<2) return;
	var obj = $(this), pid = $(this).attr('id'), i_1 = c.imgs[c.count], i_2 = c.imgs[c.count+1];
	$(this).children().remove();
	$(this).append(
		$.create('div', {'id':pid+'_cnt'}, [
			$.create('img', {'src':i_1,'align':"absmiddle"}, []),
			$.create('img', {'src':i_2,'align':"absmiddle","class":"img_right"}, [])
		])
	 );
	if (c.resize===true) {
		var maxw = $(this).width() / c.nrofimgs;
		var maxh = $(this).height();
		$(this).find('img').each( function(i) {
			var w = $(this).width(), h = $(this).height(), p = 1;
			p = (maxw/w <= maxh/h || maxw/w===undefined) ? maxw/w : maxh/h ;
			$(this).css({
				'width':Math.round(w*p),
				'height':Math.round(h*p)
			});
		});
	}
	var new_count = (c.count+2<c.imgs.length) ? c.count+2 : 0 ;
		
	$('#'+pid+'_cnt')
	.css({ 'opacity':0 })
	.animate({'opacity':1},1000)
	.animate({'opacity':1},2000)
	.animate({'opacity':0},1000,'linear', function(){
		obj.logoslides({
			'imgs' : c.imgs,
			'resize' : c.resize,
			'nrofimgs' : c.nrofimgs,
			'count' : new_count
		});
	});
};


