pathURL1 = "http://www.tsunam.in.arena.ne.jp/cgi-bin/xpx/";
pathURL2 = "http://www.tsunam.in.arena.ne.jp/cgi-bin/xpx/";
count_up_cgi = "counter03.cgi?";
count_out_cgi = "count.cgi?gif001,6";
cg_c = 434;
cg_r = 353;
cg_s = 20;
cg_l = 4;
cg_p = 70;
cg_line = 10;
fanart_no = "FAN ART No."+cg_c;
puzzle_no = "PUZZLE No."+cg_r;

frmc = 0;
frmn = new Array();
frmc = parent.frames.length;
for (ii=0; ii<frmc; ii++){
	frmn[ii] = parent.frames[ii].name;
}

if(frmc!=0){
	parent.document.location = "http://www.tsunam.in.arena.ne.jp/xpx/";
}

my_url = document.URL;
url_check = my_url.indexOf("babelfish",0);
if(url_check>=0){
	parent.document.location = "http://www.tsunam.in.arena.ne.jp/";
}

my_url = document.URL;
url_check = my_url.indexOf("mojolingo",0);
if(url_check>=0){
	parent.document.location = "http://www.tsunam.in.arena.ne.jp/";
}

var babelOrigUrl = "***";

//**************************************************************************
//**************　マウスカーソル追従　**************************************
//**************************************************************************

var icon_n = 5;
var start_x=0;
var start_y=0;
var stop_m_x=10;
var stop_m_y=10;
var cursor = "off";
var cursor_n = 1;
var c_c = 1;
var icon_c = 19;

//**************************************************************************
//**************************************************************************

function MM_reloadPage(init) {	//reloads the window if Nav4 resized
	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
		document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,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];}}
}

/* Functions that finds images. */
function MM_findObj(n, d) { //v3.0
	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); return x;
}

/* Functions that swaps images. */
function MM_swapImage() { //v3.0
	var i,j=0,x,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_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function preload0(){
MM_preloadImages('Library/menu/menu01_01_over.gif','Library/menu/menu01_02_over.gif','Library/menu/menu01_03_over.gif','Library/menu/menu01_04_over.gif','Library/menu/menu01_06_over.gif','Library/menu/menu01_08_over.gif','Library/menu/menu01_09_over.gif','Library/menu/menu01_10_over.gif','Library/menu/menu01_11_over.gif','Library/menu/menu01_12_over.gif','Library/menu/menu01_13_over.gif','Library/menu/menu01_16_over.gif','Library/menu/menu01_15_over.gif');
}

function preload1(){
MM_preloadImages('../Library/menu/menu01_01_over.gif','../Library/menu/menu01_02_over.gif','../Library/menu/menu01_03_over.gif','../Library/menu/menu01_04_over.gif','../Library/menu/menu01_06_over.gif','../Library/menu/menu01_08_over.gif','../Library/menu/menu01_09_over.gif','../Library/menu/menu01_10_over.gif','../Library/menu/menu01_11_over.gif','../Library/menu/menu01_12_over.gif','../Library/menu/menu01_13_over.gif','../Library/menu/menu01_16_over.gif','../Library/menu/menu01_15_over.gif');
}

function preload2(){
	from_check();
MM_preloadImages(
'renew/01.jpg','renew/02.jpg',
'renew/03.jpg','renew/03-0.jpg',
'renew/04.jpg','renew/04-0.jpg',
'renew/05.jpg','renew/05-0.jpg',
'renew/06.jpg','renew/06-0.jpg',
'renew/07.jpg','renew/07-0.jpg',
'renew/08.jpg','renew/08-0.jpg',
'renew/09.jpg','renew/09-0.jpg',
'renew/10.jpg','renew/11.jpg');
}

function preload3(){
	from_check();
MM_preloadImages(
'../renew/01.jpg','../renew/02.jpg',
'../renew/03.jpg','../renew/03-0.jpg',
'../renew/04.jpg','../renew/04-0.jpg',
'../renew/05.jpg','../renew/05-0.jpg',
'../renew/06.jpg','../renew/06-0.jpg',
'../renew/07.jpg','../renew/07-0.jpg',
'../renew/08.jpg','../renew/08-0.jpg',
'../renew/09.jpg','../renew/09-0.jpg',
'../renew/10.jpg','../renew/11.jpg');
}

function preload4(){
	from_check();
MM_preloadImages(
'../../renew/01.jpg','../../renew/02.jpg',
'../../renew/03.jpg','../../renew/03-0.jpg',
'../../renew/04.jpg','../../renew/04-0.jpg',
'../../renew/05.jpg','../../renew/05-0.jpg',
'../../renew/06.jpg','../../renew/06-0.jpg',
'../../renew/07.jpg','../../renew/07-0.jpg',
'../../renew/08.jpg','../../renew/08-0.jpg',
'../../renew/09.jpg','../../renew/09-0.jpg',
'../../renew/10.jpg','../../renew/11.jpg');
}

var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Hook for Internet Explorer 
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
		navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub menu0_FSCommand(ByVal command, ByVal args)\n');
	document.write('	call menu0_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}

//*************************************
//*********　ＣＧページra用　**********
//*************************************
function cg_menu_gen3(pageno,cgno,cell_l)
{
	not_cookie();

	cgpage = pageno + 1;
	s_no = (cgpage-1) * cgno;
	e_no =	cgpage		* cgno;
	var c0 = 1;
	var ig,len1,len2,len3 = 0;
	var img,href,start,end = "";
	var cg_pg_c,cg_no_e,cg_no_s = "";
	var page_no,no = "";
	var path1 = "../";
	var path2 = "./";
	myURL = location;

	cg_no_s = "00" + (s_no + 1);
	len1 = cg_no_s.length;
	cg_no_e = "00" + (cgno);
	len2 = cg_no_e.length;
	start = cg_no_s.substring(len1-3,len1);
	end 	= cg_no_e.substring(len2-3,len2);
//	hh = 7;
	hh = cell_l;
	ig = 800 / hh;
	ig = 50;
	vv = cgno / hh;
	aa = cgno % hh;
	if ( aa != 0 ) { vv = vv + 1;}

	document.write('<table border="0" width="100%" cellspacing="0" cellpadding="5">\n');

	document.write('	<tr>\n');
	document.write('		<td valign="middle" align="center" colspan="' + hh + '" bgcolor="#006666"><font class="big3" color="#FFFFFF">FAN ART 25 PUZZLE (CG' + end + '〜' + start + ')</font></td>\n');
	document.write('	</tr>\n');
	
	document.write('	<tr>\n');
	document.write('		<td valign="middle" align="center" colspan="' + hh + '" bgcolor="#006666"><font class="big" color="#FFFFFF">JAVAのバージョンを 最新の 1.6.0_07-b06 にしてください。</font><br>\n');
	document.write('		<font class="big" color="#FFFFFF">1.6.0_07-b06以前のバージョンでは、ご利用できない場合があります。</font></td>\n');
	document.write('	</tr>\n');


	var c1 = e_no ;
	var c3 = e_no - hh + 1;
	var i = 1;
	while ( i <= vv)
	{
//*************************************
		document.write('	<tr>\n');
		for (c = c1 ; c >= c3 ; c-=1 )
		{
			var cc = c;
			cg_pg_c = "00" + cc;
			len3 = cg_pg_c.length;
			c_no	= cg_pg_c.substring(len3-3,len3);
			if ( c >= 1)
			{
				document.write('		<td valign="middle" align="center">' + c_no + '</td>\n');
			}
		}
		document.write('	</tr>\n');
//*************************************
		document.write('	<tr>\n');
		for (c = c1 ; c >= c3 ; c-=1 )
		{
			var cc = c;
			cg_pg_c = "00" + cc;
			len3 = cg_pg_c.length;
			c_no = cg_pg_c.substring(len3-3,len3);
			href = path2 + "puzzle/puzzle5-4.php?" + cc ;
			img  = path1 + "images2/cg" + c_no + "_s.jpg";
			change_on = " changeImages2('cg" + c_no + "', '" + path1 + "images2/cg" + c_no + ".jpg');";
			change_of = " changeImages2('cg" + c_no + "', '" + path1 + "images2/cg" + c_no + "_s.jpg');";
			m_over = "window.status='" + c_no + "'; " + change_on + " return true;";
			m_out = "window.status=''; " + change_of + "  return true;";

			document.write('		<td valign="middle" align="center">');
			if ( c >= 1)
			{
				document.write('<a href="' + href + '" ');
				document.write('onmouseover="' + m_over + '" ');
				document.write('onmouseout="'  + m_out  + '">');
//				document.write('<img name="cg'+ c_no  + '" src="' + img + '" border="0" width="100" height="100" ');
				document.write('<img name="cg'+ c_no  + '" src="' + img + '" border="0" width="' + ig + '" height="' + ig + '" ');
				document.write('alt = "cg' + c_no + '"></a>');
//				document.write('alt = "cg' + c_no + '" target="_blank"></a>');
			}
			document.write('</td>\n');
		}
		document.write('	</tr>\n');
//*************************************
		i++;
		c1 = c1 - hh;
		c3 = c3 - hh;
	}
document.write('</table>\n');
}

//*************************************
//*********　newＣＧページ用　2 ********
//*************************************
function cg_menu_gen5(pageno,cgno,cell_l)
{
//	not_cookie();

	var name6 = "cookie_check";
	var data = GetCookie(name6);

	if ( data == null)
	{
		document.write('<p>\n');
		document.write('<font color="#FF0000" size="5">ご使用のブラウザがクッキー処理を有効にしていません</font>\n');
		return;
	}

	cgpage = pageno ;
	cgno1 = cgno;
	cg_n = cgno / cg_p - cgpage + 1;
	var i = 1;
	while ( i <= cg_n )
	{
		cgno = cgno - cg_p;
		i++;
	}
	
	s_no = cgno - cg_p + 1;
	e_no = cgno ;
	if(s_no < 1){s_no = 1;}
	var c0 = 1;
	var ig,len1,len2,len3 = 0;
	var img,href,start,end = "";
	var cg_pg_c,cg_no_e,cg_no_s = "";
	var page_no,no = "";
	var path1 = "../";
	var aa = 0;

	cg_no_s = "00" + (s_no);
	len1 = cg_no_s.length;
	cg_no_e = "00" + (cgno);
	len2 = cg_no_e.length;
	start = cg_no_s.substring(len1-3,len1);
	end 	= cg_no_e.substring(len2-3,len2);
//	hh = 7;
	hh = cell_l;
	ig = 800 / hh;
	ig = 50;
	vv = ((cg_p > cgno)?cgno:cg_p)/hh ;
		if (pageno == 1)
	{
		aa = cgno % hh;
			if ( aa != 0 ) { vv = vv + 1;}
	}

	document.write('<table border="0" width="100%" cellspacing="0" cellpadding="5">\n');
	document.write('	<tr>\n');
	document.write('		<td valign="middle" align="center" colspan="' + hh + '" bgcolor="#006666"><font class="big3" color="#FFFFFF">FAN ART ' + cgpage + '(CG' + end + '〜' + start + ')</font></td>\n');
	document.write('	</tr>\n');

	var c1 = e_no ;
	var c3 = e_no - hh + 1;
	var i = 1;
	while ( i <= vv)
	{
//*************************************
		document.write('	<tr>\n');
		for (c = c1 ; c >= c3 ; c-=1 )
		{
			var cc = c;
			cg_pg_c = "00" + cc;
			len3 = cg_pg_c.length;
			c_no	= cg_pg_c.substring(len3-3,len3);
			if ( c >= 1)
			{
				document.write('		<td valign="middle" align="center">' + c_no + '</td>\n');
			}
		}
		document.write('	</tr>\n');
//*************************************
	document.write('<tr>\n');
		for (c = c1 ; c >= c3 ; c-=1 )
		{
			var cc = c;
			cg_pg_c = "00" + cc;
			len3 = cg_pg_c.length;
			c_no = cg_pg_c.substring(len3-3,len3);
			href = path1 + "cg_html2/cg" + c_no + ".htm";
			img  = path1 + "images/cg" + c_no + ".jpg";
			m_over = "window.status='" + c_no + ".htm'; return true;";
			m_out = "window.status=''; return true;"
			o_click = "cg_page("+pageno+",'"+c_no+"')"; 
//			document.write('<td valign="middle" width="' + ig + '" align="center">');
			document.write('<td valign="middle" align="center">');
			if ( c >= 1)
			{
//				document.write('<a href="' + href + '"');
				document.write('<a href="javascript:'+ o_click +'" ');
				document.write('onmouseover="' + m_over + '" ');
				document.write('onmouseout="'  + m_out  + '">');
				document.write('<img name="cg'+ c_no  + '" src="' + img + '" border="0" width="' + ig + '" height="' + ig + '" ');
				document.write('alt = "cg' + c_no + '"></a>');
			}
			document.write('</td>\n');
		}
	document.write('</tr>\n');
//*************************************
		i++;
		c1 = c1 - hh;
		c3 = c3 - hh;
	}
document.write('</table>\n');
}

function cg_page(pgn,cgn){
	var name9 = "page_no";
	var name10 = "cg_no_htm";
	var path1 = "../";
	var expires3 = new Date();
	var endtime = new Date();
	expires3.setTime(expires3.getTime() + 1 * 60 * 60 * 1000);
	endtime = expires3;
	data = pgn;
	SetCookie(name9 , data , endtime , "/xpx/");
	data = "cg"+cgn+".htm";
	SetCookie(name10 , data , endtime , "/xpx/");
	document.location = path1 + "cg_html2/"+data;
}

	fanart1 = new Array();
	fanart2 = new Array();

	for (ii=0;ii<=5;ii++){
		fanart1[ii]="FAN ART "+ii;
		fanart2[ii]="../content/index4-1-"+ii+".html";
	}

function go_fanart(fanart){
	document.location = fanart2[fanart];
}

function fanart_check(){
	var name9 = "page_no";
	var fanart = GetCookie(name9);
	document.write('<a href="'+ fanart2[fanart] +'"><font color="#FFFFFF">'+ fanart1[fanart] +'</font></a>');
}

function cg_no_htm_check(){
	var name10 = "cg_no_htm";
	var cg_no_htm = GetCookie(name10);
	if (cg_no_htm != "******"){
		document.write('<font color="#FFFFFF">'+ cg_no_htm +'</font>');
	} else {
		my_href = location.pathname;
		cg_url = my_href.split("/");
		document.write('<font color="#FFFFFF">'+ cg_url[3] +'</font>');
	}
}

function open_chuui(chuui_url)
{
//	window.location.href = chuui_url;
}

function delete_cookie(aaa)
{
	DeleteCookie(aaa);
}

function not_cookie()
{
	var name6 = "cookie_check";
	var data = GetCookie(name6);

//	if ( data == null)
	if ( data != "cookie_ok")
	{
		document.location = "http://www.tsunam.in.arena.ne.jp/xpx/content/not_cookie.htm";
	}
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag1 == true)) {
		for (var i=0; i < changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function changeImages2() {
	if (document.images && (preloadFlag2 == true)) {
		for (var i=0; i < changeImages2.arguments.length; i+=2) {
			document[changeImages2.arguments[i]].src = changeImages2.arguments[i+1];
		}
	}
}

var preloadFlag2 = false;
function preloadImages2() {
	dmy_b = new Array(cg_r);
	dmy_f = new Array(cg_r);
	if (document.images) {
		var j;
		for (j = 1;j <= cg_r;j++){
			samnel_cg_no = "00" + (j);
			len1 = samnel_cg_no.length;
			samnel_b_file = "../images2/cg" + samnel_cg_no.substring(len1-3,len1) + ".jpg";
			dmy_b[j] = newImage(samnel_b_file);
			samnel_f_file = "../images2/cg" + samnel_cg_no.substring(len1-3,len1) + "_s.jpg";
			dmy_f[j] = newImage(samnel_f_file);
		}
		preloadFlag2 = true;
	}
}

function preloadImages3() {
	dmy_b = new Array(cg_r);
	dmy_f = new Array(cg_r);
	if (document.images) {
		var j;
		for (j = 1;j <= cg_r;j++){
			samnel_cg_no = "00" + (j);
			len1 = samnel_cg_no.length;
			samnel_b_file = "../images2/cg" + samnel_cg_no.substring(len1-3,len1) + ".jpg";
			dmy_b[j] = newImage(samnel_b_file);
			samnel_f_file = "../images2/cg" + samnel_cg_no.substring(len1-3,len1) + "_s.jpg";
			dmy_f[j] = newImage(samnel_f_file);
		}
		preloadFlag2 = true;
	}
}

function from_check(){
	var name3 = "acs_time";
	var today = new Date();
	var expires2 = new Date();
	var today_time = today.getTime() / 1000;
	var ent_time = Math.round(today_time);
	var hold_time0 = 60;

	var acs_time = GetCookie(name3);

	if (acs_time == null){
		acs_time = 0;
	}

	var time_check = ent_time - acs_time;
//	===================  Entry time check ================================
	if ((time_check >= (hold_time0 * 60))||(time_check <= 0)){
		access_log();
//		apricot_log();
		acs_time = ent_time;
	}
//	===================  Entry time check end ============================
	expires2.setTime(expires2.getTime() + 365 * 24 * 60 * 60 * 1000);
	SetCookie(name3 , acs_time , expires2 , "/xpx/");
}


//*************************************
//*************************************
function access_log(){
	document.write("<img src='http://www.tsunam.in.arena.ne.jp/xpx/init01.php?img&&");
	document.write(document.referrer+"&&");
	document.write(location+"&&");
	document.write(screen.width+"&&");
	document.write(screen.height+"&&");
	document.write(screen.colorDepth+"'>");
//	document.write("<img src='http://www.tsunam.in.arena.ne.jp/cgi-bin/xpx/cgi/acc/acclog.cgi?");
//	document.write("referrer="+document.referrer+"&");
//	document.write("width="+screen.width+"&");
//	document.write("height="+screen.height+"&");
//	document.write("color="+screen.colorDepth+"'>");
}

function apricot_log(){
	document.write('<IMG src="http://www.tsunam.in.arena.ne.jp/xpx/cgi-bin/apricot/apricot.php?');
	document.write('user=xpx&mode=count&refr='+escape(document.referrer));
	document.write('&scrn='+screen.width+'x'+screen.height+'x'+screen.colorDepth);
	document.write('&navi='+navigator.userAgent+'" alt="" style="border:0px;">');
}
//*************************************
//*************************************

function w_open(z,page)
{
			if (z == 0){
				page = page;
			} else {
				page = "../"+page;
			}

	wnd = window.open(page,'newwindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,width=600,height=400');
}

function w_open2(z,page)
{
			if (z == 0){
				page = page;
			} else {
				page = "../"+page;
			}

	wnd = window.open(page,'newwindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,width=700,height=500');
}

function g_loading(a)
{
	if (a==1){
		window.open("loading.html","newwindow",'toolbar=no,location=no,directories=no,status=no,menubarno,scrollbars=yes,copyhistory=no,width=400,height=100');
	}
	if (a==2){
		window.close();
	}
}

//**************************************************************************
//*********************　COOKIE WORK　**************************************
//**************************************************************************

function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1) endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg) return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}

function SetCookie (name, value) {
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
		document.cookie = name + "=" + escape (value) +
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
		((path == null) ? "" : ("; path=" + path)) +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");
}

function DeleteCookie (name) {
	var exp = new Date();
	exp.setTime (exp.getTime() - 1);	// This cookie is history
	var cval = GetCookie (name);
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

//**************************************************************************
//**************　マウスカーソル追従　**************************************
//**************************************************************************

var i;
var dstart_x=new Array(),dstart_y=new Array();

// _bro: 1=NN6+, 2=NN4, 3=IE, 4=Opera, 0=others
_bro=(window.opera?4:(document.all?3:(document.getElementById?1:(document.layers?2:0))));

for (i=0;i<=icon_n;i++) {
				dstart_x[i]=start_x;
				dstart_y[i]=start_y;
}
var mstart_x=start_x,mstart_y=start_y,stop_m_f=false;

if (document.all || document.getElementById || document.layers) {
				document.onmousemove=mouse_move_event;
				if (document.layers) document.captureEvents(Event.MOUSEMOVE);
}

function radio_set(n){
	tag_form_s = '<form name="form1" >\n';
	tag_form_e = '</form>\n';
	document.write(tag_form_s);
	var i;
	for (i = 1;i <=n;i++){
		radio = '<input type="radio" name="cursor" value="' + i + '" onClick = "icon_on_off(value)"><font color="#FFFFFF">				on' + i + '</font><br>\n';
		document.write(radio);
	}
	radio = '<input type="radio" name="cursor" value="0" onClick = "icon_on_off(value)"><font color="#FFFFFF">			  off</font><br>\n';
	document.write(radio);
	document.write(tag_form_e);
}

function icon_set() {
	var name8 = "cursor";
	var cursor = GetCookie(name8);

	if ( cursor == "off" ){
		m = 0;
		return;
	}else{
		if (cursor == null){cursor = "on1";}
		if (cursor.indexOf("on",0) == -1){cursor = "on1";}
		if (cursor == "on"){cursor = "on1";}
		var m = click_check(cursor);
		if (m > icon_c){m = icon_c;}
	}

	var i;
	for (i = 5;i >= 0;i--){
		k1 = (m-1)*10 + i;
		k2 = i;
		icon = "icon"+k2;
		otom = "otomo"+k1+".gif"
		imag = '<SPAN class="mouse0" id="' + icon + '"><IMG SRC="' + otom + '" WIDTH="64" HEIGHT="64"></SPAN>\n';
		document.write(imag);
	}
	imag = '<SPAN class="mouse0" id="icon1000"><IMG SRC="dummy01.gif" WIDTH="64" HEIGHT="64"></SPAN>\n'
	document.write(imag);
}

function icon_set2() {
	var name8 = "cursor";
	var cursor = GetCookie(name8);

	if ( cursor == "off" ){
		m = 0;
		return;
	}else{
		if (cursor == null){cursor = "on1";}
		if (cursor.indexOf("on",0) == -1){cursor = "on1";}
		if (cursor == "on"){cursor = "on1";}
		var m = click_check(cursor);
		if (m > icon_c){m = icon_c;}
	}

	var i;
	for (i = 5;i >= 0;i--){
		k1 = (m-1)*10 + i;
		k2 = i;
		icon = "icon"+k2;
		otom = "../otomo"+k1+".gif"
		imag = '<SPAN class="mouse0" id="' + icon + '"><IMG SRC="' + otom + '" WIDTH="64" HEIGHT="64"></SPAN>\n';
		document.write(imag);
	}
	imag = '<SPAN class="mouse0" id="icon1000"><IMG SRC="../dummy01.gif" WIDTH="64" HEIGHT="64"></SPAN>\n'
	document.write(imag);
}

function icon_set3() {
	var name8 = "cursor";
	var cursor = GetCookie(name8);

	if ( cursor == "off" ){
		m = 0;
		return;
	}else{
		if (cursor == null){cursor = "on1";}
		if (cursor.indexOf("on",0) == -1){cursor = "on1";}
		if (cursor == "on"){cursor = "on1";}
		var m = click_check(cursor);
		if (m > icon_c){m = icon_c;}
	}

	var i;
	for (i = 5;i >= 0;i--){
		k1 = (m-1)*10 + i;
		k2 = i;
		icon = "icon"+k2;
		otom = "../../otomo"+k1+".gif"
		imag = '<SPAN class="mouse0" id="' + icon + '"><IMG SRC="' + otom + '" WIDTH="64" HEIGHT="64"></SPAN>\n';
		document.write(imag);
	}
	imag = '<SPAN class="mouse0" id="icon1000"><IMG SRC="../../dummy01.gif" WIDTH="64" HEIGHT="64"></SPAN>\n'
	document.write(imag);
}

function mouse_move_main() {
//	var c_n = (click_check(cursor) - 1) * 10;
		if (cursor == "off"){
//			setTimeout("mouse_move_main()",60);
			return;
		}
		if (document.all || document.getElementById || document.layers) {
			var i;
			var k;
			for (i=icon_n;i>=0;i--) {
				if (i==0) {
					if (!stop_m_f) dstart_x[i]=mstart_x,dstart_y[i]=mstart_y;
						set_mouse_pos("icon"+i,dstart_x[i],dstart_y[i]);
					} else {
						dstart_x[i]=dstart_x[i-1],dstart_y[i]=dstart_y[i-1];
						set_mouse_pos("icon"+i,dstart_x[i],dstart_y[i]);
					}
			 }
			 setTimeout("mouse_move_main()",60);
		}
}

function mouse_move_event(e) {
	mstart_x=get_mouse_pos(e,true);
	mstart_y=get_mouse_pos(e,false);
}

function get_mouse_pos(e,flag) {
	if (document.all) {
		if (flag) return document.body.scrollLeft + event.x;
			else return document.body.scrollTop + event.y;
	}
	else if (document.getElementById || document.layers) {
		if (_bro == 4){
			xpos = e.clientX;
			ypos = e.clientY;
		} else {
			xpos = e.pageX;
			ypos = e.pageY;
		}
//		if (flag) return e.pageX;
//		else return e.pageY;
		if (flag) return xpos;
		else return ypos;
	}
}

function set_mouse_pos(id,x,y) {
	if (cursor == "off"){
		return;
	}

	if (document.all) {
		document.all(id).style.posLeft=x+stop_m_x;
		document.all(id).style.posTop=y+stop_m_y;
	}
	else if (document.layers) {
		document.layers[id].moveTo(x+stop_m_x,y+stop_m_y);
	}
	else if (document.getElementById || document.layers) {
		document.getElementById(id).style.left=x+stop_m_x;
		document.getElementById(id).style.top=y+stop_m_y;
	}
}

function cursor_check(n){
	var name8 = "cursor";
	var cursor = GetCookie(name8);

	c_c = n - 1;

	if ( cursor == "off" ){
		return;
//		document.form1.elements[n].click();
//		icon_on_off(0);
	}else{
		if (cursor == null){cursor = "on1";}
		if (cursor.indexOf("on",0) == -1){cursor = "on1";}
		if (cursor == "on"){cursor = "on1";}
		var m = click_check(cursor);
		if (m > n){m = n;}
		document.form1.elements[m-1].click();
		icon_on_off(m);
	}
}

function cursor_check2(n){
	var name8 = "cursor";
	var cursor = GetCookie(name8);

	n = icon_c;
	c_c = n - 1;

	if ( cursor == "off" ){
//		icon_on_off(0);
		return;
	}else{
		if (cursor == null){cursor = "on1";}
		if (cursor.indexOf("on",0) == -1){cursor = "on1";}
		if (cursor == "on"){cursor = "on1";}
		var m = click_check(cursor);
		if (m > n){m = n;}
//	 document.write (m);
		icon_on_off(m);
	}
}

function click_check(t){
		il = t.length;
		cursor_n = parseInt(t.substring(2,t.length));
		if (cursor_n == null){cursor_n = 1;}
		return cursor_n;
}

function icon_on_off(n) {
	var name8 = "cursor";
	var expires2 = new Date();

	if ( n >= 1 ){
		cursor = "on" + n;
	}else{
		cursor = "off";
		chara_out();
	}
	expires2.setTime(expires2.getTime() + 365 * 24 * 60 * 60 * 1000);
	SetCookie(name8 , cursor , expires2 , "/xpx/");
}

function chara_out(){
	var i;
	for (i=icon_n;i>=0;i--) {
//		set_mouse_pos("icon"+i,-80,-80);
	}
}

function icon_change(n){
	var name8 = "cursor";
	var expires2 = new Date();

	if ( n >= 1 ){
		cursor = "on" + n;
	}else{
		cursor = "off";
	}

	expires2.setTime(expires2.getTime() + 365 * 24 * 60 * 60 * 1000);
	SetCookie(name8 , cursor , expires2 , "/xpx/");
	document.location = "../index.html";
}

function check1(t){
 var n = click_check(t);
 var m = n + n + n;
 document.write (m);
}

function check2(t){
 var n = t.indexOf("on",0)
 if (t.indexOf("on",0) == -1){t = "out";}
 document.write (t);
}

//**************************************************************************
//*******************　FLASH Activescript 2002/03/01 ***********************
//**************************************************************************

function menu0_DoFSCommand(command, args) {
	var menu0Obj = InternetExplorer ? menu0 : document.menu0;
	if (command == "menu_on"){
		window.FW_showMenu(window.fw_menu_0,0,60);
	}
	if (command == "icon_on"){
		window.FW_showMenu(window.fw_menu_1,600,60);
	} 
	
	if (command == "menu_off"){
		FW_startTimeout();
	}
}

//**************************************************************************
//******************************　LAYER ON	********************************
//**************************************************************************

function showLAYER(layName){
	if(document.layers){
		document.layers[layName].visibility='show';
	}else if(document.all){
		document.all(layName).style.visibility='visible';
	}else if(document.getElementById || document.layers){
		document.getElementById(layName).style.visibility='visible';
	}
}

//**************************************************************************
//******************************　LAYER OFF  *******************************
//**************************************************************************

function hideLAYER(layName){
	if(document.layers){
		document.layers[layName].visibility='hide';
	}else if(document.all){
		document.all(layName).style.visibility='hidden';
	}else if(document.getElementById || document.layers){
		document.getElementById(layName).style.visibility='hidden';
	}
}
