// NeuralyS JS Library (v1.oo) 

var d = document;
var ie = document.all;
var newx = 0;
var newy = 0;
var speed = 25;

var width = ie ? d.body.offsetWidth : innerWidth;
var height = ie ? d.body.offsetHeight : innerHeight;

function tempo(i)
 { var rt = speed > 20 ? i : i<<2;
   return ie ? rt : rt << 1;
   
   
 }

function bbn_show(ob)
 { if (ie) { ie[ob].style.visibility='visible'; }
   else { d.getElementById(ob).style.visibility='visible'; }
 }

function bbn_hide(ob)
 { if (ie) { ie[ob].style.visibility='hidden'; }
   else { d.getElementById(ob).style.visibility='hidden'; }
 }

function bbn_moveTo(ob, nx, ny)
 { if (ie) { ie[ob].style.top=ny; ie[ob].style.left=nx; }
   else { d.getElementById(ob).style.left=nx; d.getElementById(ob).style.top=ny; }
 }

function bbn_moveBy(ob, nx, ny)
 { if (ie) { ie[ob].style.top = ie[ob].style.top+ny; ie[ob].style.left = ie[ob].style.left+nx; }
   else { d.getElementById(ob).style.left= d.getElementById(ob).style.left+nx;
   d.getElementById(ob).style.top= d.getElementById(ob).style.top+ny;}
 }

function bbn_getX(ob)
 { return (ie) ? ie[ob].style.left : d.getElementById(ob).style.left;
 }
 
function bbn_getY(ob)
 { return (ie) ? ie[ob].style.top : d.getElementById(ob).style.top;
 } 

function getSpeed()
 { var ta=new Date(); var tb=new Date(); tma = ta.getTime(); 
   tmb = tb.getTime(); i=0; while((tmb-tma)<200) { 
   i++; tb = new Date(); tmb = tb.getTime(); }
   return Math.round((ie ? i : i*10)/200);
 }
 
function bbn_clip(ob, na, nb, nc, nd)
 { clp = 'rect('+nb+' '+nc+' '+nd+' '+na+')';
 
 if (ie) { ie[ob].style.clip = clp;  }
 else { d.getElementById(ob).style.clip = clp; }
 }
 
 function makehexa(n) 
  { hexatab = '0123456789ABCDEF'; 
    return hexatab.charAt(n>>4)+hexatab.charAt(n&15); 
  }
  
 function mouse(e)
  { newx = (ie) ? event.clientX+d.body.scrollLeft : e.pageX;
    newy = (ie) ? event.clientY+d.body.scrollTop  : e.pageY;
  }  
 
 function capture()
  { if (!ie) d.captureEvents(Event.MOUSEMOVE); d.onmousemove=mouse; }
  
 function simple_grade(sr, sg, sb, er, eg, eb, steps, txt)
  { cr = sr; cg = sg; cb = sb;
    ir = (er-sr) / steps; ig = (eg-sg) / steps; ib = (eb-sb) / steps;
    
    for (i=0; i<txt.length; i++)
     { document.write("<font color=#"+makehexa(cr)+makehexa(cg)+makehexa(cb));
       document.write(">"+txt.charAt(i)+"</font>");
       cr+=ir; cg+=ig; cb+=ib;
     }
    
  }
 
  //function simple_degrade(max)
  // { cr = sr; cg = sg; cb = sb;
  //   ir = (er-sr) / max; ig = (eg-sg) / max; ib = (eb-sb) / max;
  // }
  
  // dégradé simple, dual, grade simple dual
  
  // simple_degrade(from, to, txt)
  // dual_degrade(from, to, txt)
  // simple_grade(from, to, steps, txt)
  // dual_grade(from, to, steps, txt)
  