
 var pn=1;
 var pn2=1;

 var speed=6000;
 var speed2=4000;
 var max1=0;
 var max2=0;


 function SPInit(picnum,spicnum) {
  max1=picnum; //document.getElementById('maxpics1').value;
  max2=spicnum;

  for (i=1;i<=max1;i++) {
   $('#A'+i).fadeOut(1);
  }

  for (i=1;i<=max2;i++) {
   $('#B'+i).fadeOut(1);
  }
 }

 // fizreklam
 function PStep() {
  $('#A'+pn).fadeOut(speed/12,function() {
  pn++;
  if (pn>max1) { pn=1; }
  run=setTimeout("showPic()",20);
  });
 }

 function showPic() {
  $('#A'+pn).fadeIn(speed/12,function() {
   run=setTimeout("PStep();",speed/2);
  });
 }

 function clearTimer() {
  clearTimeout(run);
 }

 // sajatkepek
  function PStep2() {
  $('#B'+pn2).fadeOut(speed2/12,function() {
  pn2++;
  if (pn2>max2) { pn2=1; }
  run2=setTimeout("showPic2()",20);
  });
 }

 function showPic2() {
  $('#B'+pn2).fadeIn(speed2/12,function() {
   run2=setTimeout("PStep2();",speed2/2);
  });
 }

 function clearTimer2() {
  clearTimeout(run2);
 }




