var ie=document.all ? true:false
var dom=document.getElementById ? true:false
var ns4=document.layers ? true:false
var calunits=document.layers? "" : "px"


var bouncelimit=32 //(must be divisible by 8)
var direction="up"

var ypos = 50
var scroll_top = 0

function initbox(){
	if (!dom&&!ie&&!ns4)
		return
		crossobj=(dom)? document.getElementById("sec0").style : (ie)? document.all.sec0 : document.sec0
		scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
		crossobj.top=scroll_top+calunits
		crossobj.visibility=(dom||ie)? "visible" : "show"
		dropstart=setInterval("sec0()",50)
}

function sec0(){
	if (parseInt(crossobj.top)<ypos+scroll_top)
	crossobj.top=parseInt(crossobj.top)+20+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 closeAll(){
	for (i = 0; i < 3; i++)
		hideSec(i);
}

function hideSec(nlayer) { 
	nlayer = String(nlayer);
	if (dom){
		temp = "sec" + nlayer;
		temp = "document.getElementById('" + temp + "').style.visibility = 'hidden'";
		eval(temp);
	}	
	else if (ns4){
		temp = "document.sec" + nlayer + ".visibility = 'hide'";
		eval(temp);
	}
	else if (ie){
		temp = "sec" + nlayer + ".style.visibility ='hidden'";
		eval(temp);
	}
} 

function showSec(n,n2) {
	n = String(n);
	n2 = String(n2);
	hideSec(n2); 
	if (dom){
		temp = 'sec' + n;
		temp = "document.getElementById('" + temp + "').style.visibility = 'visible'";
		eval(temp);
	}
	else if (ns4){
		temp = "document.sec" + n + ".visibility = 'show'";
		eval(temp);
	}
	else if (ie){
		temp = "sec" + n + ".style.visibility ='visible'";
		eval(temp);
	}
}


function truebody(){
	return (document.compatMode!="BackCompat")? document.documentElement : document.body
}

window.onload=initbox