function slideSwitch(){
 var $active = $('#slideshow img.active');
 var $next = $active.next();

 var $next =  $active.next().length ? $active.next(): $('#slideshow img:first');

 $active.addClass('last-active');

 $next.css({opacity: 0.0})
      .addClass('active')
      .animate({opacity: 1.0}, 1000, function(){
		  $active.removeClass('active last-active');
		});
}

var $scrollDiv = 0;
var curPoz = 0;
var nextPoz = 0;
var delay01 = 0;
var speed = 8;
var parentHeight = 0;
var stopPoint = 0;
var  startPoint = 0;
var itSpeed = 100;  //viteza iteratiei

$(document).ready(function(){
	
	$scrollDiv = $('#parteneri div div');

    speed = 2;
    parentHeight = $scrollDiv.parent().outerHeight();
    stopPoint = -285; // se scade inaltimea totala a pozelor - marginile pe verticala
    startPoint = 150;
    $scrollDiv.css({'top' : startPoint});
    $scrollDiv.css({'position' : 'relative'});

    function scrooll(){

    curPoz = parseInt($scrollDiv.css('top'));

    nextPoz = curPoz - speed;

    if (nextPoz <= stopPoint){
        nextPoz = startPoint;
        }else{nextPoz = nextPoz}

    nextPoz += 'px';
    $scrollDiv.css({'top': nextPoz});

    delay01 = window.setTimeout(scrooll, itSpeed);

}
scrooll();
$scrollDiv.mouseover(function(){
		window.clearTimeout(delay01);
		})
		.mouseout(function(){
		delay01 = window.setTimeout(scrooll, itSpeed);
		});

		$(function(){
		  setInterval( "slideSwitch()", 5000 );
		});



  $('.scrollable').scrollable({'circular':true, 'steps' : 1}).autoscroll({'autoscroll':true});

	$(function(){
		$('a.new-window').click(function(){
			window.open(this.href);
			return false;
		});
	});


});



