
var last = -1;
var cpt=0;

var newx = 0;
var newy = 0;

var p_all = new Array();
var no_cycle;
var dx = 0;

function repos()
 {
   mwidth = ie ? d.body.offsetWidth : innerWidth;
   if (mwidth<765) { mwidth=765; }

   allx = ((mwidth-765)>>1)+dx;
      
   for (i=0; i<p_all.length; i++) 
    { 
      y = bbn_getY(p_all[i]);
      x = bbn_getX(p_all[i]);
      if (x!=allx) { bbn_moveTo(p_all[i], allx, y); }
    }
   
   if (p_all.length>0) { setTimeout('repos();', 5); }
  
 }

function factive(i)
 {
   no_cycle=true;   
   if (last==i) { cpt=0; return; }
   if (last!=-1) { bbn_hide(p_all[last]); }
   last = i;
   if (last!=-1) { bbn_show(p_all[i]); }
   
 }
 
function active(i)
 {
   no_cycle=false;
   cpt=0;
   if (last!=-1) { cycle(); }
 }

function cycle()
 { 
   if (last==-1 || no_cycle) { return; }
   
   cpt++;
      
   if (cpt>130)
    { cpt=0;
      bbn_hide(p_all[last]);
      last=-1;
    }
   
   setTimeout("cycle()", 10);
   
 }

function launch(str)
 { ie = document.all;
   options = 'toolbar=no, location=no, personalbar=no, status=no, menubar=no, scrollbars=yes ';
   options+='titlebar=yes, alwaysRaised=yes, alwaysLowered=no, dependant=no, hotkeys=no, z-lock=no ';
   options+='resizeabe=no, width=400, height=500, screenX=0, screenY=0';
    if (ie) { ribwin = window.open(str,'touthawin', options);  } else
     { ribwin = window.open(str, 'touthawin', options);
       ribwin.resizeTo(400,500);
       ribwin.location=str;
     }

   ribwin.focus();
  }