var g_IsWin = false;
var g_IsIE  = false;
var g_IsNN  = false;
var g_IsOK  = false;
/* browser check functions*/
function BrowserCheck( tStr, strURL )
{
    var tMes = "";
    
    var theAgent = navigator.userAgent;
    theAgent = theAgent.toUpperCase();
    
    if( theAgent.indexOf("WIN")>=0 ) g_IsWin = true;

    var theNav = navigator.appName;
    theNav = theNav.toUpperCase();
    
    var theVer = ""+navigator.appVersion;

    if( theAgent.indexOf( "MSIE") >=0 )
    {
        g_IsIE = true;

        var fno = theAgent.indexOf( "MSIE");
        theVer = theAgent.substring( fno+5, fno+8);
    }
    else
    {
        g_IsNN = true;
        
        var fno = theVer.indexOf( " " );
        theVer = theVer.substring(0,fno);
        theVer = eval( theVer );

        setTimeout("window.onresize = ReloadThis", 1000);
    }

    if( g_IsIE && parseFloat(theVer)<5.0 )
    {
        g_IsOK = false;
        tMes += "Your browser is InternetExplorer "
            + theVer
            + ".\n"
    }
    else if( g_IsNN && parseFloat(theVer)<5.0 )
    {
        g_IsOK = false;
        tMes += "Your browser is Netscape.\n"
    }
    else
        g_IsOK = true;

    /* action */
    if( (!g_IsWin || !g_IsOK ) && tStr && (tStr.indexOf("alert")>=0) )
    {
        if( !g_IsWin )
            tMes = "This page is only checked by Windows XP.\n"
                + "In usage's OS, this page may not be displayed correctly.\n";
        if( !g_IsOK )
            tMes += "To see this page you have to use over InternetExplorer 5.0 or Netscape 6.0. Sorry.";
        
        alert( tMes );
    }
    
    if( !g_IsOK )
    {

        if( tStr && (tStr.indexOf("back")>=0) )
        {
            history.back();
        }
        else if( tStr && (tStr.indexOf("jump")>=0) && strURL )
        {
            location.href= strURL;
        }
    }
    return g_IsOK;
}
function OpenSubWnd( URL )
{
    var SubWin = window.open('',
                             'SubWindow',
                             'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=200,height=600');
    SubWin.opener=self;
    SubWin.location.replace( URL);
}
function EvalFunc(jsStr)
{
  return eval(jsStr)
}
/* NN functions */
function ReloadThis()
{
    window.location.reload();
}
/* common functions */
var g_szRef;
var g_szScr;
function GetEnv()
{
    buf = escape(parent.document.referrer);
    buf = "";
    g_szRef = "";
    for(i=0; i<buf.length; i++)
    {
        str = buf.charAt(i);
        g_szRef += (str=="+") ? "%2B" : str;
    }
    g_szScr = screen.width+","+screen.height+","+screen.colorDepth;
}

function ShowMenu( str_root_path )
{
	var str = "<DIV class='topmenu'>"
	+ "<TABLE border=0 width=800 height=80>"
	+ " <TR>"
	+ "  <TD align=right vAlign=bottom style='text-align: right; vertical-align: bottom;'>"
	+ "   <SCRIPT LANGUAGE='JavaScript'>"
	+ "    document.write('<IMG SRC=\"" + str_root_path + "cgi-bin/status/count.cgi?LOG=wiggles&DIGIT=6&FONT=miniscu&REF=',g_szRef,'&SCR=',g_szScr,'\" width=36 height=9>');"
	+ "   </SCRIPT>"
	+ "   <NOSCRIPT>"
	+ "    <IMG src='" + str_root_path + "cgi-bin/status/count.cgi?LOG=wiggles&DIGIT=6&FONT=miniscu&REF=noscript&SCR=-' width=36 height=9>"
	+ "   </NOSCRIPT>"
	+ "   <div style='color:#808080; font-weight:bold; font-size:10px;'>since Oct.1, 2002</div>"
	+ "  </TD>"
	+ " </TR>"
	+ "</TABLE>"
	+ "<div id='menu'>"
	+ " <TABLE width=800>"
	+ "  <TR>"
	+ "   <TD><a HREF='" + str_root_path + "index.html'>TOP</A></TD>"
	+ "   <TD><a HREF='" + str_root_path + "aboutthewiggles/index.html'>The Wiggles ってなあに？</A></TD>"
	+ "   <TD><a HREF='" + str_root_path + "aboutthewiggles/members/index.html'>The Wiggles メンバー</A></TD>"
	+ "   <TD><a HREF='" + str_root_path + "aboutthewiggles/friends/index.html'>The Wiggles の仲間たち</A></TD>"
	+ "   <TD><a HREF='" + str_root_path + "goods/index.html'>グッズ</A></TD>"
	+ "   <TD><a HREF='" + str_root_path + "news/index.html'>News</A></TD>"
	+ "   <TD><a HREF='" + str_root_path + "column/index.html'>コラム</A></TD>"
	+ "  </TR>"
	+ " </TABLE>"
	+ " <TABLE width=800>"
	+ "  <TR>"
	+ "   <TD width=100><a HREF='" + str_root_path + "cgi-bin/contribu/contribute.cgi'>Wig BBS</A></TD>"
	+ "   <TD width=100><a HREF='" + str_root_path + "cgi-bin/contr_2/contribute.cgi'>Other BBS</A></TD>"
	+ "   <TD width=160><a HREF='" + str_root_path + "cgi-bin/mezashit/mezase.cgi'>The Wiggles ファン登録</A></TD>"
	+ "   <TD width=160><a HREF='" + str_root_path + "cgi-bin/diarypro/diary.cgi'>Tadashi's Page</A></TD>"
	+ "   <TD><a HREF='" + str_root_path + "links/index.html'>LINK</A></TD>"
	+ "   <TD><a HREF='" + str_root_path + "about/index.html'>about</A></TD>"
	+ "   <TD>&nbsp<!-- dummy --></TD>"
	+ "  </TR>"
	+ " </TABLE>"
	+ "</div> <!-- menu -->"
	+ "</div> <!-- topmenu -->";
    document.write(str);
}
function AdsFooter()
{
	document.write( "<iframe src='http://rcm-jp.amazon.co.jp/e/cm?t=mama2001-22&o=9&p=16&l=st1&mode=dvd-jp&search=WIggles&fc1=000000&lt1=&lc1=3366FF&bg1=FFFFFF&f=ifr' marginwidth='0' marginheight='0' width='468' height='336' border='0' frameborder='0' style='border:none;' scrolling='no'></iframe>" );

/*
	// Amazon Assoc
    amazon_ad_tag = "dbgout-22";  amazon_ad_width = "728";  amazon_ad_height = "90";  amazon_ad_logo = "hide";  amazon_ad_include = "wiggles;知育;英語;音楽;英才";  amazon_ad_categories = "abcl";
    str = "<script type='text/javascript' src='http://www.assoc-amazon.jp/s/ads.js'></script>";
	document.write(str);

	// Google AdSense
    google_ad_client = "pub-8897189060402965";
    google_ad_width = 728;
    google_ad_height = 90;
    google_ad_format = "728x90_as";
    google_ad_type = "text_image";
    //2007-02-18: Wiggles
    google_ad_channel = "5664370675";
    google_color_border = "A8DDA0";
    google_color_bg = "EBFFED";
    google_color_link = "0000CC";
    google_color_text = "6F6F6F";
    google_color_url = "008000";

    var str = "<script type='text/javascript'  src='http://pagead2.googlesyndication.com/pagead/show_ads.js'></script>";
	document.write(str);
*/
}
function ShowFooter()
{
	var str = "<div class='copyright'>"
	+ "LINK FREE : address&gt;http://www.thewigglesfan.com/ : banner imag&gt;http://www.thewigglesfan.com/images/banner.gif<BR>"
	+ "since Oct.1.2002. E-mail:<a href=mailto:thewigglesfan@gmail.com>thewigglesfan@gmail.com</a> (C) 2002-2005 Thumoo ALL RIGHTS RESERVED"
	+ "</div> <!-- copyright -->";
	document.write(str);
}
/* - execute - */
/*GetEnv();*/
