var winw, posleft, tuned = document.getElementById("idtune"), tunepd = document.getElementById("idtunep"), 
remd = document.getElementById("idrem"), picremd = document.getElementById("idpicrem"), remind=0, timrem, rempic=true;

picrem2 = newImage("images/srvc_picrem2.jpg");
set_posrem();
window.onresize=set_posrem;
removl();

function set_posrem()
{
  winw = document.body.clientWidth;
  if (winw > 770)
    posleft =  (winw - 770)/2;
  else
    posleft = 0;
  remd.style.left=posleft + 195 + "px";
  tuned.style.left=posleft + 412 + "px";
  tunepd.style.left=posleft + 410 + "px";
}

function removl()
{
   remind = remind + 1;
   if (remind == 1)
     timrem = setTimeout("removl()",4000);
   else
    if (remind > 1 && remind < 95)
    {
      remd.style.left = (parseInt(remd.style.left) +4) + "px";
      timrem = setTimeout("removl()",1);
    }
   else
   if (remind == 95)
   {
      remd.style.zIndex=5;
      remd.style.left=posleft + "px";
      timrem = setTimeout("removl()",1);
      remd.style.zIndex=10;
   }
   else
    if (remind > 95 && remind < 145)
    {
      if (remind == 100)
      {
         if (rempic)
            picremd.src = "images/srvc_picrem2.jpg";
         else
            picremd.src = "images/srvc_picrem.jpg";
      }
      remd.style.left = (parseInt(remd.style.left) +4) + "px";
      timrem = setTimeout("removl()",1);
    }
   else
   if (remind == 145)
   {
      remind = 0; 
      if (rempic) 
         rempic = false;
      else
         rempic = true;
      timrem = setTimeout("removl()",4000);
   }
}
