var timer;


var activeLayerId = 0;


var alpha = 0;


var IE = document.all?true:false


if (!IE) document.captureEvents(Event.MOUSEMOVE)


document.onmousemove = getMouseXY;


var mouseX = 0


var mouseY = 0


var close = false;


var completed = false;


function FadeInLayer()


{





        if (!activeLayerId) return;





        var layer = document.getElementById("div"+activeLayerId);





        layer.style.filter = "Alpha(Opacity="+alpha+")";


        layer.style.MozOpacity = alpha/100;


        if (alpha<90)


        {


                alpha+=10;


                timer = setTimeout("FadeInLayer()",20);


        }





        else





        {





                clearTimeout(0);





        }





}


function OpenLayer(id)


{


        if (!completed) return;


        if (activeLayerId) LayertMutat(activeLayerId,'hidden');


        if (id) activeLayerId = id;


        name = "div"+activeLayerId;


    if (document.getElementById)


    {


                  document.getElementById(name).style.left = mouseX+20;


                  document.getElementById(name).style.top = mouseY-20;


                var layer = document.getElementById("div"+activeLayerId);


                layer.style.filter = "Alpha(Opacity=0)";


                layer.style.MozOpacity = 0;


                LayertMutat(activeLayerId,'visible');


                alpha = 0;


                timer = setTimeout("FadeInLayer()",100);


        }


    else if (document.all)


        {


                document.all[name].style.left = mouseX+20;


                document.all[name].style.top = mouseY-20;


                LayertMutat(id,'visible');


        }


    else if (document.layers)


        {


                document.layers[name].left = mouseX+20;


                document.layers[name].top = mouseY-20;


                LayertMutat(id,'visible');


        }


}


function CloseLayer()


{


        if (!completed) return;


        clearTimeout(0);


        LayertMutat(activeLayerId,'hidden');


}


function LayertMutat(id,visibility)


{


  if (!id) return;


  name = "div"+id;


  if (document.getElementById)  document.getElementById(name).style.visibility = visibility;


  else if (document.all) document.all[name].style.visibility = visibility;


  else if (document.layers) document.layers[name].visibility = visibility;


}


function getMouseXY(e) {


  if (IE) { // grab the x-y pos.s if browser is IE


    mouseX = event.clientX + document.body.scrollLeft


    mouseY = event.clientY + document.body.scrollTop


  } else {  // grab the x-y pos.s if browser is NS


    mouseX = e.pageX


    mouseY = e.pageY


  }


  if (mouseX < 0){mouseX = 0}


  if (mouseY < 0){mouseY = 0}


  return true


}


function PopUp(URL,iWidth,iHeight)


{


        var iLeft=window.screen.width/2 - iWidth/2;


        var iTop=window.screen.height/2 - iHeight/2 - 25;


          if (iWidth>700) iWidth = 700;


          if (iHeight>500) iHeight = 500;


        objDialogWindow=window.open(URL,"_blank",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + iWidth + ',height=' + iHeight + ',screenX=' + iLeft + ',screenY=' + iTop + ',left=' + iLeft + ',top=' + iTop);


}


function Init()


{


        completed = true;


}

