var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var calunits=document.layers? "" : "px"

//must be divisible by 8
var bouncelimit= 32;
var dropDownTo = 50;
// 'down' or 'left'
var direction = "down";
// this is the width or the height depending on weather the box scrolling 
// in from the left or the top
var boxOffset = 300; 


	
function initbox()
	{
	if (!dom&&!ie&&!ns4)
		return

	crossobj = (dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
	
	
	if( direction == "down" )
		{
		scroll_from = (ie)? truebody().scrollTop : window.pageYOffset;
		crossobj.top = scroll_from - boxOffset + calunits;
		}
		else
			{
			scroll_from = (ie)? truebody().scrollLeft : window.pageXOffset;
			crossobj.left = scroll_from - boxOffset + calunits;
			}
				

	crossobj.visibility = (dom||ie)? "visible" : "show";
	dropstart=setInterval( "dropin()", 50 );
	}
	


function dropin()
	{
	if( direction == "down" )
		scroll_from = (ie)? truebody().scrollTop : window.pageYOffset;
			else
				scroll_from = (ie)? truebody().scrollLeft : window.pageXOffset;
				
	if( direction == "down" )
		boxPosition = parseInt( crossobj.top );
			else
				boxPosition = parseInt( crossobj.left );



	if ( boxPosition < dropDownTo + scroll_from )
		{
		if( direction == "down" )
			crossobj.top = parseInt( crossobj.top ) + 40 + calunits;
				else
					crossobj.left = parseInt( crossobj.left ) + 40 + calunits;
		}			
		else
			{
			clearInterval( dropstart );
			bouncestart = setInterval("bouncein()", 50);
			}
	}
	
function bouncein()
	{
	if( direction == "down" )
		crossobj.top = parseInt( crossobj.top ) - bouncelimit + calunits;
			else
				crossobj.left = parseInt( crossobj.left ) - 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 != "BackCompat" ) ? document.documentElement : document.body;
	}
	
	
window.onload=initbox
	
