﻿
var ie=document.all;
var dom=document.getElementById;
var ns4=document.layers;
var calunits=document.layers? "" : "px";
var crossobj=null;
var bouncelimit=32 ;//(must be divisible by 8)
var direction="up";

function redo(ElementId){
bouncelimit=32
direction="up"
initbox(ElementId);
}
function initbox(ElementId){
if (!dom&&!ie&&!ns4)
return
crossobj=(dom)?document.getElementById(ElementId).style : ie? document.all.dropin : document.dropin;
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset;
crossobj.top=scroll_top-50 + calunits;
crossobj.visibility=(dom||ie)? "visible" : "show";
dropstart=setInterval("dropin()",50);
}

function dropin(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossobj.top)<180+scroll_top)
{crossobj.top=parseInt(crossobj.top) + 170 + calunits;}
else{
clearInterval(dropstart)
bouncestart=setInterval("bouncein()",50)
}
}

function bouncein(){
crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
if (bouncelimit<0)
bouncelimit+=8
bouncelimit=bouncelimit*-1
if (bouncelimit==0){
clearInterval(bouncestart)
}
}

function dismissbox(ElementId){
var SrcElement=document.getElementById(ElementId);

if (window.bouncestart) clearInterval(bouncestart)
crossobj.visibility="hidden";
//if(SrcElement)
//    SrcElement.focus();
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}




