var adImages = new Array("/images/links/hacienda.png","/images/links/irs.png","/images/links/ccpa.png","/images/links/deptEstado.png","/images/links/crim.png","/images/links/microsoft.jpg");
var adText = new Array("http://www.hacienda.gobierno.pr","http://www.irs.gov","http://www.colegiocpa.com","http://www.estado.gobierno.pr","http://www.crimpr.net","http://www.microsoft.com");
var thisAd = -1;

function rotate()
{
  thisAd++;

  if (thisAd == adImages.length)
  {
    thisAd = 0;
  }

  document.getElementById("adBanner").src = adImages[thisAd];
  document.getElementById("adText").href = adText[thisAd];

  setTimeout("rotate()", 3 * 1000);
}


//--------------------------------------------------------------------------


function sAction()
{
  document.sForm.mySearch.value = "";
}


//--------------------------------------------------------------------------


function JSFX_FloatTopDiv()
{
  var wWidth = window.document.body.clientWidth;

  if (wWidth <= 905)
    wWidth = 905/1.97-0;
  else
    wWidth = (905/1.97-0)+(wWidth-905)/1.97;

  var startX = wWidth, startY = 62;
  var ns = (navigator.appName.indexOf("Netscape") != -1);

  function ml(id)
  {
    var el=document.getElementById?document.getElementById(id):document.all?document.all[id]:document.layers[id];
    if(document.layers)
      el.style=el;

    el.sP=function(x,y){this.style.left=x;this.style.top=y;};
    el.x = startX;
    el.y = startY;

    return el;
  }

  window.stayTopLeft=function()
  {
    var pX = ns ? pageXOffset : document.body.scrollLeft;

    ftlObj.x += (pX + startX - ftlObj.x)/8;
    ftlObj.sP(ftlObj.x, ftlObj.y);

    setTimeout("JSFX_FloatTopDiv()", 10);
  }

  ftlObj = ml("divStayCenter");
  stayTopLeft();
}


//--------------------------------------------------------------------------


function JSFX_FloatTopDiv02(num4Page)
{
  var startX = 0, startY = 0;
  var ns = (navigator.appName.indexOf("Netscape") != -1);

  function ml02(id)
  {
    var el=document.getElementById?document.getElementById(id):document.all?document.all[id]:document.layers[id];
    if(document.layers)
      el.style=el;

    el.sP=function(x,y){this.style.left=x;this.style.top=y;};
    el.x = startX;
    el.y = startY;

    return el;
  }

  window.stayTopRight=function()
  {
    var pY = ns ? pageYOffset : document.body.scrollTop;

    ftlObj.y += (pY + startY - ftlObj.y)/num4Page;
    ftlObj.sP(ftlObj.x, ftlObj.y);

    setTimeout("JSFX_FloatTopDiv02(" + num4Page + ")", 10);
  }

  ftlObj = ml02("divStayTopRight");
  stayTopRight();
}
