var offsetleft=785
var offsettop=70

var ns4=document.layers?1:0
var ie4=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0

function getCookie( name )
{
        var nameOfCookie = name + "=";
        var x = 0;
        while ( x <= document.cookie.length )
        {
                var y = (x+nameOfCookie.length);
                if ( document.cookie.substring( x, y ) == nameOfCookie ) {
                        if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
                                endOfCookie = document.cookie.length;
                        return unescape( document.cookie.substring( y, endOfCookie ) );
                }
                x = document.cookie.indexOf( " ", x ) + 1;
                if ( x == 0 )
                        break;
        }
        return "";
}

function setCookie( name ) 
{
    if( document.fchk.chk001.checked )
    {
        value = "true";
    }
    else
    {
        value = "false";
    }

    document.cookie = name + "=" + escape( value ) + "; path=/; expires="
}

function makeStatic()
{
    var flgCheck;
    var topblank;
    var addtop;

    if ( getCookie( "flgCheck" )  == "true" ) 
    { 
        flgCheck = 1;
        document.fchk.chk001.checked ="true";
    }
    else
    {
        flgCheck = 0;
    }

    if (ie4) 
    {
        topblank = document.body.scrollTop + 45 - floater.offsetTop;
        addtop = Math.max(Math.abs(Math.round(topblank * 0.15)), 1) * (topblank < 0 ? -1 : 1);

        if (flgCheck)
        {
            floater.style.pixelTop += 0;
        }
        else
        {
            if( topblank != 0 )
            {
                floater.style.top = floater.offsetTop + addtop;
            }
        }
    }
    else if (ns6)
    {
        topblank = self.pageYOffset + 118 - document.getElementById("floater").offsetTop;
        addtop = Math.max(Math.abs(Math.round(topblank * 0.15)), 1) * (topblank < 0 ? -1 : 1);
        
        if (flgCheck)
        {
            document.getElementById("floater").style.top+=0;
        }
        else
        {
            if( topblank != 0 )
            {
                document.getElementById("floater").style.top = document.getElementById("floater").offsetTop + addtop;
            }
//            document.getElementById("floater").style.top=window.pageYOffset+offsettop;
        }
    }
    else if (ns4)
    {
        topblank = self.pageYOffset + 118 - document.getElementById("floater").offsetTop;
        addtop = Math.max(Math.abs(Math.round(topblank * 0.15)), 1) * (topblank < 0 ? -1 : 1);

        if (flgCheck)
        {
            eval(document.object1.top) += 0;
        }
        else
        {
                document.getElementById("floater").style.top = document.getElementById("floater").offsetTop + addtop;
        }
    }
    
    setTimeout("makeStatic()",10);
}

if (ie4||ns6) {document.write('<span id="floater" class="fixfont02" style="background-color:; position:absolute; width:50px; height:69px;Top:118; Left:'+offsetleft+'; ">')}
else if (ns4){ document.write('<LAYER top="80" name="floater" left="'+offsetleft+'">')}

if (ie4||ns6||ns4) {
//var url="http://www.wonder7th.com";var title="Wonder7th.Com 7 สิ่งมหัศจรรย์ของโลก";
document.write("<FORM id=Form1 name=fchk><center>");
document.write("<table class=fixfont02 width=125 border=0 cellspacing=0 cellpadding=0 >");
document.write("<tr><td colspan=2 class=fixfont02><font color=3d3d3d><img src=http://www.wonder7th.com/wonder_service/globe.gif align=absmiddle border=0> <A HREF=http://www.wonder7th.com/wonder_service/advertisement.htm  target=_blank alt=โฆษณากับเรา คลิกที่นี่> Advertising with us</a><br><br></td></tr>");
document.write("<tr> <TD  height=4> <center><iframe align=top width=125 height=350 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no src=http://www.wonder7th.com/wonder_service/banner_float.htm> </iframe> </center></TD></tr>");
document.write("</table>");
document.write("</center></form>");
}
if (ie4||ns6) {document.write('</span>')}
else if (ns4){document.write('</layer>')}

function menu3(){
	if (ns6||ie4||ns4)
		makeStatic()
}


menu3();
