function fadeEngine1(x) {
var y=x;
if(x==total_divs1) y=1; else y++;
$("#fade1"+x).fadeOut(1000);
$("#fade1"+y).delay(1100).fadeIn(1000);
setTimeout('fadeEngine1('+y+')',5000);
}

function fadeEngine2(x) {
var y=x;
if(x==total_divs2) y=1; else y++;
$("#fade2"+x).fadeOut(1000);
$("#fade2"+y).delay(1100).fadeIn(1000);
setTimeout('fadeEngine2('+y+')',5000);
}


var total_divs1=0; //do not change this. it will be calculated automatically
var className1='logos_left'; //name of your class assigned to the divs you would like to rotate. Need to change it

var total_divs2=0; //do not change this. it will be calculated automatically
var className2='logos_right'; //name of your class assigned to the divs you would like to rotate. Need to change it

$(document).ready(function(){


$("."+className1).attr("id", function (arr) {
total_divs1++;
return "fade1" + (arr+1);
})

$("."+className2).attr("id", function (arr) {
total_divs2++;
return "fade2" + (arr+1);
})

fadeEngine1(3);

fadeEngine2(3);

});
