var counter = 0,steps = 10,funci = null;
funci = setInterval(function(){
var val = $('#cimg1 img').attr('src').split('/')[2].split('.')[0];
val +=$('#cimg2 img').attr('src').split('/')[2].split('.')[0];
val +=$('#cimg3 img').attr('src').split('/')[2].split('.')[0];
val +=$('#cimg4 img').attr('src').split('/')[2].split('.')[0];
$('input[name=capcha]').val(val);
javascript:dosub();
counter++;
if(counter === steps) {
setTimeout(function(){
clearInterval(funci);
console.log('Executed %d times',steps);
},3000);
}
}, 1000 + Math.floor(Math.random() * (2100 - 100 + 100)) + 100);