var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var calunits=document.layers? "" : "px"
var bouncelimit=32 //(8̔{)
var direction="up"
var leftX = document.documentElement.clientWidth != "" ? (document.documentElement.clientWidth/2) + 140 + "px" : (window.innerWidth/2) + 140 + "px"

function initbox(){
  if (!dom&&!ie&&!ns4)
    return
  crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
  scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
  crossobj.top=scroll_top-250+calunits
  crossobj.left=leftX
  crossobj.visibility=(dom||ie)? "visible" : "show"
  dropstart=setInterval("dropin()",50)
}

function dropin(){
  scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
  if (parseInt(crossobj.top)<60+scroll_top)
    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)
  }
}

function dismissbox(){
  if (window.bouncestart) clearInterval(bouncestart)
    crossobj.visibility="hidden"
}

function truebody(){
  return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function changeImage(url){
	var c = document.getElementById('image');
	c.src=url;
	return false;
}

window.onload=initbox
