function putSWF( szUrl, nWidth, nHeight, szBgColor, bMenu )
{
	var szTag = "<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" WIDTH=" + nWidth + " HEIGHT=" + nHeight + ">";
	szTag += "<PARAM NAME=movie VALUE=" + szUrl + ">";
	szTag += "<PARAM NAME=menu VALUE=" + bMenu + ">";
	szTag += "<PARAM NAME=quality VALUE=best>";
	szTag += "<PARAM NAME=bgcolor VALUE=#" + szBgColor + ">";
	szTag += "<PARAM NAME=wmode VALUE=opaque>";
	szTag += "<EMBED src=" + szUrl + " menu=" + bMenu + " quality=best bgcolor=#" + szBgColor + " WIDTH=" + nWidth + " HEIGHT=" + nHeight + " TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></EMBED>";
	szTag += "</OBJECT>";
	
	document.write( szTag );
}


function putHeader( szPath, bSpace )
{
	var aszQuery = new Array(
		"ぽけでび",
		"ココア",
		"おねだりココア",
		"ココアなのー",
		"ココア ゲーム",
		"ぽけでびBOX",
		"ぽけでび学園",
		"検索してね！",
		"",
		"日々、王様。"
	);
	var szColor = "FFC9C9";
	var szSwf	= "head201003";
	var nRnd	= Math.floor( Math.random() * (aszQuery.length - 1) );
	if ( Math.random() * 100 == 0 ) {
		nRnd = 8;
	}

	var szHeader = "";
	szHeader += "<table width=100% border=0 cellpadding=0 cellspacing=0 align=center background=" + szPath + "grp/head/head-back.gif>";
	szHeader += "<tr bgcolor=#" + szColor + ">";
	szHeader += "<td width=120 height=50>　</td>";
	szHeader += "<td width=580 height=50 align=center valign=top>";
	document.write( szHeader );

	var nLen = new String( szPath ).length;
	putSWF( szPath + "grp/head/" + szSwf + ".swf?path=" + nLen, 580, 50, szColor, false );

	szHeader = "</td>";
	szHeader += "<td width=120 height=50>";
	szHeader += "<form method=get action=http://search.rd.livedoor.com/r target=_blank>";
	szHeader += "<input type=hidden name=k value=search>";
	szHeader += "<input type=hidden name=ie value=sjis>";
	szHeader += "<input type=hidden name=c value=pokedebi>";
	szHeader += "<input type=text size=12 name=q value=\"" + aszQuery[nRnd] + "\">";
	szHeader += "<input type=submit name=\"\" value=検索>";
	szHeader += "</form>";

	szHeader += "</td>";
	szHeader += "</tr>";

	szHeader += "<tr valign=center>";
	szHeader += "<td height=17 colspan=3 align=center>";
	szHeader += "<table width=600 border=0 cellpadding=0 cellspacing=0>";
	szHeader += "<td width=70 height=17><a href=" + szPath + "kingdom/kingdom.html><img src=" + szPath + "grp/head/head-menu0.gif width=70 height=15 border=0 alt=王国キャラクター紹介></td>";
	szHeader += "<td width=70><a href=" + szPath + "animation/animation.html><img src=" + szPath + "grp/head/head-menu1.gif width=70 height=15 border=0 alt=アニメーション></td>";
	szHeader += "<td width=70><a href=" + szPath + "game/game.html><img src=" + szPath + "grp/head/head-menu2.gif width=70 height=15 border=0 alt=ゲーム></td>";
	szHeader += "<td width=70><a href=" + szPath + "newspaper/newspaper.html><img src=" + szPath + "grp/head/head-menu3.gif width=70 height=15 border=0 alt=よみもの></td>";
	szHeader += "<td width=70><a href=" + szPath + "download/download.html><img src=" + szPath + "grp/head/head-menu4.gif width=70 height=15 border=0 alt=かべがみやブログパーツ></td>";
	szHeader += "<td width=70><a href=" + szPath + "mobile/mobile.html><img src=" + szPath + "grp/head/head-menu5.gif width=70 height=15 border=0 alt=ケータイ></td>";
	szHeader += "<td width=70><a href=http://pokedebi.com/cgi-bin/beastex/letter/letter.cgi><img src=" + szPath + "grp/head/head-menu9.gif width=70 height=15 border=0 alt=返信！ぽけでび伝言板></td>";
	szHeader += "<td width=70><a href=" + szPath + "support/support.html><img src=" + szPath + "grp/head/head-menu7.gif width=70 height=15 border=0 alt=サポート></td>";
	szHeader += "</table>";
	szHeader += "</td>";
	szHeader += "</tr>";
	if ( bSpace ) {
		szHeader += "<tr><td height=12></td></tr>";
	}
	szHeader += "</table>";
	document.write( szHeader );
}


function putCopyright()
{
	var szCopyright = "<center>";
	szCopyright +=	"<br>";
	szCopyright +=	"<font color=#ffffff>";
	szCopyright +=	"&#169; 2000-2010 Beastex Inc.　All rights reserved.<br>";
	szCopyright	+=	"許可なく転載することを禁止します<br>";
	szCopyright +=	"Never reproduce or republicate without permission.";
	szCopyright +=	"</font>";
	szCopyright +=	"</center>";

	document.write( szCopyright );
}


//////////////////////////////////////////////////////////////////////////////////////////

function putAdBannerL()
{
	var aszTag = new Array(
		//"<a href=\"http://click.linksynergy.com/fs-bin/click?id=rVk1/SHPrBM&offerid=147260.10000177&type=4&subid=0\"><IMG alt=\"ベネッセコーポレーション 進研ゼミ・こどもちゃれんじ\" border=\"0\" src=\"http://www.benesse.co.jp/zemi/affiliate/sozai/chu/08natu/234_60.gif\"></a><IMG border=\"0\" width=\"1\" height=\"1\" src=\"http://ad.linksynergy.com/fs-bin/show?id=rVk1/SHPrBM&bids=147260.10000177&type=4&subid=0\">",
		//"<a href=\"http://click.linksynergy.com/fs-bin/click?id=rVk1/SHPrBM&offerid=85423.10000012&type=4&subid=0\"><IMG alt=\"ベネッセコーポレーション 進研ゼミ・こどもちゃれんじ\" border=\"0\" src=\"http://www.benesse.co.jp/zemi/affiliate/sozai/chu/chukouikkan_468_60.gif\"></a><IMG border=\"0\" width=\"1\" height=\"1\" src=\"http://ad.linksynergy.com/fs-bin/show?id=rVk1/SHPrBM&bids=85423.10000012&type=4&subid=0\">",
		"<a href=http://pokedebi.com/mobile/gakuen/ target=_blank><img src=http://pokedebi.com/grp/top/notice-gakuen.gif width=410 height=70 border=no alt=ぽけでび☆学園></a>"
	);
	var nRnd	= Math.floor( Math.random() * aszTag.length );
	var szTag	= "<center>" + aszTag[nRnd] + "</center><br>";

	document.write( szTag );
}




//////////////////////////////////////////////////////////////////////////////////////////

var dhtmlnav=0;
var dhtmlBrowser=0;
if ((document.all)||(document.layers)) dhtmlBrowser=1;

function MM_preloadImages()
{
	var d = document;
	if ( d.images ) {
		if ( !d.MM_p ) {
			d.MM_p = new Array();
		}
	}

    var i,j = d.MM_p.length;
	var	a = MM_preloadImages.arguments;
    for ( i = 0; i < a.length; i++ ) {
		if ( a[i].indexOf("#") != 0 ) {
			d.MM_p[j] = new Image;
			d.MM_p[j++].src = a[i];
		}
	}
}


function MM_swapImgRestore()
{
	var i,x;
	var	a = document.MM_sr;

	for ( i = 0; a && (i < a.length) && (x = a[i]) && x.oSrc; i++ ) {
		x.src = x.oSrc;
	}
}


function MM_findObj( n, d )
{
	var	p,i,x;

	if ( !d ) {
		d=document;
	}
	if ( (p = n.indexOf("?")) > 0 && parent.frames.length ) {
	    d = parent.frames[n.substring(p+1)].document;
	    n = n.substring(0,p);
	}
	if ( !(x = d[n]) && d.all ) {
		x = d.all[n];
	}
	for ( i = 0; !x && i < d.forms.length; i++ ) {
		x = d.forms[i][n];
	}
	for ( i = 0; !x && d.layers && i < d.layers.length; i++ ) {
		x = MM_findObj( n, d.layers[i].document );
	}
	if ( !x && document.getElementById ) {
		x = document.getElementById(n);
	}

	return x;
}


function MM_swapImage()
{
	var	i,j = 0;
	var	x;
	var	a = MM_swapImage.arguments;
	document.MM_sr = new Array;

	for ( i = 0; i < (a.length - 2); i += 3 ) {
		if ( (x = MM_findObj(a[i])) != null ) {
			document.MM_sr[j++] = x;
			if ( !x.oSrc ) {
				x.oSrc = x.src;
			}
			x.src=a[i+2];
		}
	}
}


function MM_openPlainWindow( szUrl, nWidth, nHeight )
{
	window.open( szUrl, "", new String( "width=" + nWidth + ", height=" + nHeight + ", toolbar=no, locationbar=no, directories=no, status=no, menubar=no, resizeable=yes, scrollbars=no fullscreen=no" ) );
}


function MM_openScrollWindow( szUrl, nWidth, nHeight )
{
	window.open( szUrl, "", new String( "width=" + nWidth + ", height=" + nHeight + ", toolbar=no, locationbar=no, directories=no, status=no, menubar=no, resizeable=yes, scrollbars=yes fullscreen=no" ) );
}


function MM_changeImage()
{
	var	i = 0;
	var	a = MM_changeImage.arguments;

	if ( document.images ) {
		for ( i = 0; i < (a.length - 1); i += 2 ) {
			document.images[a[i]].src = a[i + 1];
		}
	}
}


function changeImage( szUrl, szName )
{
	document.images[szName].src = szUrl;
}


function openSelectedUrl( obj ) {
	szUrl = obj.options[obj.selectedIndex].value;
	if ( szUrl != "") {
		location.replace( szUrl );
	}
}


