var dropboxleft=200 //set left position of box (in px)
var dropboxtop=100 //set top position of box (in px)
var dropspeed=15 //set speed of drop animation (larger=faster)

//Specify display mode. 3 possible values are:
//1) "always"- This makes the fade-in box load each time the page is displayed
//2) "oncepersession"- This uses cookies to display the fade-in box only once per browser session
//3) integer (ie: 5)- Finally, you can specify an integer to display the box randomly via a frequency of 1/integer...
// For example, 2 would display the box about (1/2) 50% of the time the page loads.

var displaymode="always"

///Don't edit beyond here///////////

if (parseInt(displaymode)!=NaN)
var random_num=Math.floor(Math.random()*displaymode)
var ie=document.all
var dom=document.getElementById

function initboxv2(){
	if (!dom&&!ie)
	return
	dropboxleft=(document.body.clientWidth-320)/2 //set left position of box (in px)
	dropboxtop=(document.body.clientHeight-220)/2 //set top position of box (in px)
	crossboxcover=(dom)?document.getElementById("dropinboxv2cover") : document.all.dropinboxv2cover
	crossbox=(dom)?document.getElementById("dropinboxv2"): document.all.dropinboxv2
	scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
	crossbox.height=crossbox.offsetHeight
	crossboxcover.style.height=parseInt(crossbox.height)+"px"
	crossbox.style.top=crossbox.height*(-1)+"px"
	crossboxcover.style.left=dropboxleft+"px"
	crossboxcover.style.top=dropboxtop+"px"
	crossboxcover.style.visibility=(dom||ie)? "visible" : "show"
	dropstart=setInterval("dropinv2()",50)
}

function dropinv2(){
	scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
	if (parseInt(crossbox.style.top)<0){
		crossboxcover.style.top=scroll_top+dropboxtop+"px"
		crossbox.style.top=parseInt(crossbox.style.top)+dropspeed+"px"
	}else{
		clearInterval(dropstart)
		crossbox.style.top=0
	}
}

function dismissboxv2(){
	if (window.dropstart) clearInterval(dropstart)
	crossboxcover.style.visibility="hidden"
}

function truebody(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function dispMsg(str){
	str = "<table width='100%' height='100%'><tr><td valign='top' style='line-height:150%'>"+ str +"</td></tr><tr><td align='right' height='20'><a href='#' onClick='dismissboxv2();return false'>¹Ø±Õ</a></td></tr></table>";
	document.getElementById("dropinboxv2").innerHTML = str;
	if (displaymode=="oncepersession" || displaymode=="always" || parseInt(displaymode)!=NaN && random_num==0){
		if (window.addEventListener)
			window.addEventListener("load", initboxv2, false)
		else if (window.attachEvent)
			window.attachEvent("onload", initboxv2)
		else if (document.getElementById || document.all)
			window.onload=initboxv2
	}
}
