
// Drop-in content box- By Dynamic Drive
// For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
// This credit MUST stay intact for use

var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var calunits=document.layers? "" : "px"

var bouncelimit=32 //(must be divisible by 8)
var direction="up"

function initbox(){
if (!dom&&!ie&&!ns4)
return
crossobj=(dom)?document.getElementById("drop_in_ads").style : ie? document.all.drop_in_ads : document.drop_in_ads
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossobj.top=scroll_top-200+calunits
crossobj.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("dropin()",50)
}

function dropin(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
display_height=ie? truebody().clientHeight: window.innerHeight;
crossobj_height=document.getElementById("drop_in_ads").offsetHeight
objcenterpos=scroll_top+(display_height/2)-(crossobj_height/2)+80;
if (parseInt(crossobj.top)<objcenterpos)
crossobj.top=parseInt(crossobj.top)+40+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)
alwaysshow=setInterval("relocate_onmove()",100);
displayinterval=setInterval("dismissbox()",7000)
}
}

function relocate_onmove()
{
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
display_height=ie? truebody().clientHeight: window.innerHeight;
crossobj_height=document.getElementById("drop_in_ads").offsetHeight
crossobj.top=scroll_top+(display_height/2)-(crossobj_height/2)+80;
}

function dismissbox(){
clearInterval(alwaysshow)
clearInterval(displayinterval)
crossobj.visibility="hidden"
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

