var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var ns6 = (!document.all && document.getElementById);

if(ns6||ns4) 
{
pageWidth = window.innerWidth/2-250;
pageHeight = window.innerHeight/2-50;
}
else if(ie) 
{
pageWidth = document.body.clientWidth/2-250;
pageHeight = document.body.clientHeight/2-50;
}

var bouncelimit=32 //(must be divisible by 8)
var direction="up"

function initbox(){
if (!dom&&!ie&&!ns4)
return
crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
scroll_top=(ie)? document.body.scrollTop : window.pageYOffset
crossobj.top=scroll_top-250
crossobj.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("dropin()",50)
}

function dropin(){
scroll_top=(ie)? document.body.scrollTop : window.pageYOffset
if (parseInt(crossobj.top)<100+scroll_top)
crossobj.top=parseInt(crossobj.top)+40
else{
clearInterval(dropstart)
bouncestart=setInterval("bouncein()",50)
}
}

function bouncein(){
crossobj.top=parseInt(crossobj.top)-bouncelimit
if (bouncelimit<0)
bouncelimit+=8
bouncelimit=bouncelimit*-1
if (bouncelimit==0){
clearInterval(bouncestart)
}
}

function dismissbox(){
if (window.bouncestart) clearInterval(bouncestart)
crossobj.visibility="hidden"
}


function get_cookie(Name) {
var search = Name + "="
var returnvalue = ""
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function dropornot(){
if (get_cookie("droppedin")==""){
window.onload=initbox
document.cookie="droppedin=yes"
}
}

document.write('<div id="dropin" style="position:absolute;visibility:hidden;left:'+pageWidth+';top:'+pageHeight+';width:500;height:300">');
document.writeln("");
document.writeln("<table border=\"0\" width=\"520\" cellspacing=\"0\" cellpadding=\"2\" bgcolor=\"#800080\">");
document.writeln("  <tr>");
document.writeln("    <td width=\"100%\">");
document.writeln("      <table border=\"0\" width=\"100%\" bgcolor=\"#FFFFFF\" cellspacing=\"0\" cellpadding=\"2\">");
document.writeln("        <tr>");
document.writeln("          <td width=\"100%\" bgcolor=\"#ffffff\"><img src=\"/login/i/yamie.gif\" align=\"left\"><font style=\"color:red\"><br />");
document.writeln("小蕃薯呀米要告訴你天大的好消息！<br />");
document.writeln("小蕃薯推出全新的遊戲單元「<a href=\"http://kids.yam.com/game/yamiegame/\">呀米遊樂場</a>」！<br />");
document.writeln("有好玩的五子棋、俄羅斯方塊、組合拼圖、對對碰...轟動上線！<br />");
document.writeln("趕快到「<a href=\"http://kids.yam.com/game/yamiegame/\">呀米遊樂場</a>」試玩嘍！");
document.writeln("            <div align=\"right\"><a href=\"javascript:dismissbox()\">[關閉視窗] </a></div>");
document.writeln(" </td>");
document.writeln("        </tr>");
document.writeln("      </table>");
document.writeln("    </td>");
document.writeln("  </tr>");
document.writeln("</table>");
document.writeln("");
document.writeln("</div>");

dropornot();
