//
// $B%V%i%&%6H=JLMQ%*%V%8%'%/%H$N%;%C%H(B
//
	var NN4 = document.layers;
	var browser = navigator.userAgent;

	// iCab
	if ( browser.match( /iCab[^0-9a-zA-Z]*([0-9.]+)/ ) ) {
		var iCab = cat_version( RegExp.$1 )-0;
	}

	// $B$a$A$c8E$$%V%i%&%6(B
	var vo_mozilla = browser.match( /$Mozilla\/[0-3]/ );

	// IE 4.x $B0JA0(B
	if ( browser.match( /MSIE[^0-9a-zA-Z]*([0-9.]+[^;])/i ) ) {
		var IE = cat_version( RegExp.$1 )-0;
	}

	// Opera
	if ( browser.match( /Opera[^0-9a-zA-Z]*([0-9.]+)[^;]/ ) ) {
		var Opera = cat_version( RegExp.$1 )-0;
	}

	// $B%]%C%W%"%C%W%&%#%s%I%&$KBeBX%9%?%$%k%7!<%HA*BrMQ%a%K%e!<%P!<(B
	// $B$rI=<($9$k$?$a$K(B Netscape 6 / Mozilla $B7O%V%i%&%6$rH=JL(B
	PRODUCT = navigator.product;
	if ( PRODUCT ) {
		var N6 = PRODUCT.match("Gecko");
	}

//                                                                //
// $B%\%C%/%9$N%]%8%7%g%K%s%0"b%l%$%d!<2=$KBP1~$7$F$$$k$+$I$&$+H=JL(B //
//                                                                //
// iCab $B$N(B 2.8 $B0J2<$O%]%8%7%g%K%s%0$K$OHsBP1~(B
// Netscape 4 $B$O%]%8%7%g%K%s%0$N4p=`$,$H$A68$C$F$F%@%a(B
// Mozilla/0$B!A(B3 $B$N8E$$%V%i%&%6$O$J$s$+I]$$$+$i5Q2<(B
// IE 4.x(Mac) $B$O%]%8%7%g%K%s%0$N4p=`$,$H$A68$C$F$F%@%a(B
// IE 4.x(Win) $B$O>e$KJo$C$FIT5v2D(B
// Opera 6 $B$O$A$c$s$H7h$a$i$l$?HO0OFb$KI=<($7$F$/$l$J$$$7(B overflow
// $B%W%m%Q%F%#$rL5;k$9$k!J%l%$%d!<$=$N$b$N$O0U?^$I$*$j(B ON/OFF $B2DG=!K(B
// $BF|K\8l2=$N1F6A$+$b!"$H$+;W$&!#(B
// 2002.06

	function layer_ng() {
		if ( NN4 || vo_mozilla || IE < 5 || iCab <= 2.81 || Opera <= 6.03 ) {
			return true;
		} else {
			return false;
		}
	}
	// DIV $B%\%C%/%9$X$N%9%?%$%k$NE,MQ$,$G$-$k$1$I(B JavaScript $B$G(B CSS $B$r(B
	// $BA`:n$G$-$J$$!"$D$^$j%l%$%d(I0$B2=$G$-$J%V%i%&%6$N$&$A!"J,$+$C$F$$$kJ,$K(B
	// $B4X$7$F=|30(B


//
//  $BCm<a%&%#%s%I%&%7%j!<%:(B
//

//  $BCm<a%&%#%s%I%&>.(B
//  args: URI  $B$4$/$4$/%U%D!<$K(B
//  rets: false$B!J$3$l$rJV$7$F$*$/$H$R$H$D$N(B A $B$G(B JavaScript ON/OFF$B!K(B
function annote_small( URL, 	command, ID ) {
//	if ( Opera ) {
//		var ID = get_fid( URL )
//		if ( ID ) {
//			hover_layer( ID );
//			return false;
//		}
//	}

	if ( chk_scrn() == "XGA+" ) {
		command = 'annote = window.open( URL, "annote", "width=400,height=450,scrollbars=yes,resizable=yes';
	} else if ( chk_scrn() == "SVGA-" ) {
		command = 'annote = window.open( URL, "annote", "width=250,height=300,scrollbars=yes,resizable=yes';
	} else {
		command = 'annote = window.open( URL, "annote", "width=300,height=350,scrollbars=yes,resizable=yes';
	}

	if ( N6 ) {
		command += ',menubar=yes");';
	} else {
		command += '");';
	}

	eval(command);
	annote.focus();
	return false;	// false $B$rJV$9$H$h$$$i$7$$!#(B
}

//  $BCm<a%&%#%s%I%&Cf(B
//  args: URI  $B$4$/$4$/%U%D!<$K(B
//  rets: false$B!J$3$l$rJV$7$F$*$/$H$R$H$D$N(B A $B$G(B JavaScript ON/OFF$B!K(B
function annote_middle( URL, command ) {
	if ( chk_scrn() == "XGA+" ) {
		command = 'annote = window.open( URL, "annote", "width=500,height=550,scrollbars=yes,resizable=yes';
	} else if ( chk_scrn() == "SVGA-" ) {
		command = 'annote = window.open( URL, "annote", "width=400,height=450,scrollbars=yes,resizable=yes';
	} else {
		command = 'annote = window.open( URL, "annote", "width=350,height=400,scrollbars=yes,resizable=yes';
	}

	if ( N6 ) {
		command += ',menubar=yes");';
	} else {
		command += '");';
	}

	eval(command);
	annote.focus();
	return false;	// false $B$rJV$9$H$h$$$i$7$$!#(B
}

//  $BCm<a%&%#%s%I%&Bg(B
//  args: URI  $B$4$/$4$/%U%D!<$K(B
//  rets: false$B!J$3$l$rJV$7$F$*$/$H$R$H$D$N(B A $B$G(B JavaScript ON/OFF$B!K(B
function annote_large( URL, command ) {
	if ( chk_scrn() == "XGA+" ) {
		command = 'annote = window.open( URL, "annote", "width=800,height=700,scrollbars=yes,resizable=yes';
	} else if ( chk_scrn() == "SVGA-" ) {
		command = 'annote = window.open( URL, "annote", "width=600,height=430,scrollbars=yes,resizable=yes';
	} else {
		command = 'annote = window.open( URL, "annote", "width=650,height=560,scrollbars=yes,resizable=yes';
	}

	if ( N6 ) {
		command += ',menubar=yes");';
	} else {
		command += '");';
	}

	eval(command);
	annote.focus();
	return false;	// false $B$rJV$9$H$h$$$i$7$$!#(B
}


//  $B%9%/%j!<%s%5%$%:H=JL(B
//  args: N/A
//  rets:    XGA+ / default / SVGA-
//        XGA$B0J>e(B / default / SVGA $BL$K~(B
//        SVGA $B!A(B XGA $B$rI8=`$HA[Dj$7$F$^$9!#(B

	function chk_scrn() {
		if ( screen.height >= 1000 ) {
			return 'XGA+';
		} else if ( screen.width >= 800 ) {
			return 'default';
		} else {
			return 'SVGA-';
		}
	}


//  $B%&%#%s%I%&%/%m!<%:4X?t(B
//  args: N/A  $B$J$$$C$9(B
//  rets: N/A  $B$J$$$C$9(B

	function exit() {
		close();
	}

/*
input type="button" $B$NCf$G(B onClick $B$K(B close() $B4X?t$r=q$$$F$b$A$c$s$H8F$S=P$5$l$J$$!#(Bclose() $B$r8F$S=P$9$@$1$N(B exit() $B4X?t$rDj5A$7!"$=$l$r(B HTML $B$+$i8F$S=P$9$H$&$^$/$$$/!#%f!<%6!<Dj5A4X?t$NJ}$,F0:n$,3N$+$J$h$&$@!#(B
*/

//  $B?F%&%#%s%I%&$K(B URL $B$r(B
//  args: URL  $B$4$/%U%D!<(B
//  rets: false;

	function parent_url( URL ) {
		window.opener.location.href=URL;
		return false;
	}


/* PNG $B$rI8=`$G!VI=<($G$-$k%V%i%&%6$+$I$&$+!W%A%'%C%/(B

$B$3$N%A%'%C%/$O!VE,Ev$K!W0BA4$h$j!#40A4$K%V%i%&%6C1BN$G$NI=<($,2DG=$H3NG'(B
$B$N<h$l$?%P!<%8%g%s0J30$O6/0z$K(B Plug-In $B$K@)8f$rEO$9$3$H$K$9$k!#(BPlug-In 
$B$N<oN`$OLd$o$J$$$,!"$3$A$i$G3NG'$7$?$N$O(B QuickTime Plug-In $B$N$_!#(B

PDF $B$N$h$&$K(B QuickTime 4 Plug-In $B$,F~$C$F$$$l$P%V%i%&%6$,<+F0$G(B Plug-In 
$B$K@)8f$rEO$9$H;W$C$F$$$?$s$@$1$I!"$=$&$G$b$J$$$i$7$$!#5U$K(B PDF $B$G$b(B Mac 
$B$G$O$A$c$s$HI=<($5$l$?$j$5$l$J$+$C$?$j$7$?$3$H$b$+$D$F$"$C$?!#FC$K(B Mac + 
Netscape $B$G$O4D6-$K$h$C$F:F8=$7$?$j$7$J$+$C$?$j$9$k!#(BPlug-In $B$N%P%C%F%#(B
$B%s%0$H$+!"$"$k$N$+$b$7$l$J$$!#(B

Windows $B$N$h$&$K3HD%;R4XO"IU$1$KMj$C$?J}$,3Z$J$N$OJ,$+$k$1$I!D!#(B

$B!V(BGIF $B$G:n$l$P!W!)(B  $B$4$b$C$H$b!#$I$&$;%"%k%U%!%A%c%s%M%k$H$+9bEY$J;H$$J}(B
$B$O$7$F$J$$$7$M!#(B
*/

//  PNG $B%A%'%C%/4X?t(B
//  args: N/A         $B$J$$$C$9(B
//  rets: true/false  $B??(B/$B56$GJV$k$N$G(B if ( png_ok() ) $B$G$I$&$>(B

	function png_ok() {
		return !png_ng();
	}

	// OK $B=hM}$@$H(B OK $B$@$HJ,$+$C$F$$$k%V%i%&%6$9$Y$F$rNs5s$7$J$-$c$$$1$J$$$N$G!"(B
	// NG $B$@$HJ,$+$C$F$$$k%V%i%&%60J30$OFCJL$J=hM}$r$7$J$$$H$$$&4X?t$K$7$?(B
	// 2002.01.29.

	function png_ng(		RET ) {
		RET = false;
//		browser = navigator.userAgent; $B$9$G$KDj5A:Q$_(B
		platform = navigator.platform;
		
		// Netscape 4.03 $B$h$jA0$J$i(B NG
		if ( navigator.appName == "Netscape" ) {
			version = navigator.appVersion.match( /[0-9\.]+/ ) - 0;
			if ( version <= 4.03 ) {
				RET = true;
			} else {
				RET = false;
			}
		}

		// Internet Explorer 4.0$B!J(BWin$B!K$h$jA0(B or 5.0$B!J(BMac$B!K$h$jA0$J$i(B NG
		if ( browser.match( /MSIE[^0-9\.]*([0-9\.]+)/ ) ) { 
			version = RegExp.$1 - 0;
			if ( version < 4 ) {
				RET = true;
			} else if ( platform.match(/Mac/) && version < 5 ) {
				RET = true;
			} else {
				RET = false;
			}
		}

		return RET;
	}
	// $B$?$@$7!"(B100%$B0J30$NF)L@EY$N%5%]!<%H$O(B Mozilla 5 $B0J30$OIT2D(B


//
// $B%l%$%d!<$N(B ON/OFF
// for IE 5 or later/Netscape 6 or later
// Not Support Netscape 4.x type `LAYER'
//

	function layer_on( LAYER, X, Y ) {
		// $B0l8+L5BL$@$1$I!"$9$Y$F$N%l%$%d!<$r>C$7$F$+$iI=<($7$F$^$9!#(B
		if ( document.getElementById ) {	//NN6,Mozilla,IE5$BMQ(B
			for ( i in layers ) {
				document.getElementById(layers[i]).style.visibility = 'hidden';
			}
			document.getElementById(LAYER).style.visibility = 'visible';
		} else if ( document.all ) {		//IE4$BMQ(B
			for ( i in layers ) {
				document.all(layers[i]).style.display = 'none';
			}
			document.all(LAYER).style.display = 'block';
		}
	}

	function layer_off( LAYER ) {

		if ( document.getElementById ) {	//NN6,Mozilla,IE5$BMQ(B
			if ( LAYER ) {
				document.getElementById(LAYER).style.visibility = 'hidden';
			} else {
				all_layer_off();
			}
		} else if ( document.all ) {		//IE4$BMQ(B
			if ( LAYER ) {
				document.all(LAYER).style.visibility = 'hidden';
			} else {
				all_layer_off();	// $B0z?t$,$J$$;~$OA4It$N%l%$%d!<$r>C$9(B
			}
		}

	}

	//
	// $BG[Ns$KF~$C$F$$$k$9$Y$F$N%l%$%d!<$r>C$9(B
	//
	function all_layer_off() {
		// NN6, Mozilla, IE5
		if ( document.getElementById ) {
			for ( i in layers ) {
				document.getElementById(layers[i]).style.visibility = 'hidden';
			}
		// IE4
		} else if ( document.all ) {
			for ( i in layers ) {
				document.all(layers[i]).style.visibility = 'hidden';
			}
		}
	}

	// display $B%W%m%Q%F%#$N@Z$jBX$($@$H(B IE 5$B!J(BMac$B!K$,%]%8%7%g%s68$$$^$/$j(B
	// visibility $B%W%m%Q%F%#$NJ}$,L5Fq(B

//
// Opera$B!J(BMDI$B%V%i%&%6!KMQ$K%]%C%W%"%C%W%&%#%s%I%&$r%]%C%W%"%C%W%l%$%d!<$K(B
//
// args:ID
//
//function hover_layer( ID ) {
//	document.getElementById( ID ).style.posHeight=
//}

//
// URL $B$NCf$+$i%U%i%0%a%s%H(B ID $B$r%2%C%H$9$k(B
//

function get_fid( URL ) {
	URL.match( /#(.*)/ );
	if ( RegExp.$1 ) {
		return RegExp.$1;
	} else {
		return false;
	}
}

//
// $BJ#?t$N%T%j%*%I!J(B.$B!K$K$h$C$FJ,3d$5$l$F$$$k%P!<%8%g%sHV9f$r(B
// $BHf3S$7$d$9$$$h$&$K0l$D$N>/?t$KO"7k!J:F5"!K(B
//
// args : $B%T%j%*%I$r#2$D0J>e;}$D%P!<%8%g%sHV9f(B
// ret  : 2$B8DL\$N%T%j%*%I$r:o$j<h$C$?%P!<%8%g%sHV9f(B
//
function cat_version( sep_version ) {
	if ( sep_version.match( /([0-9^.]+)(\.)([0-9^.]+)(\.)([0-9]+)/ ) ) {
		return cat_version( RegExp.$1+RegExp.$2+RegExp.$3+RegExp.$5 );
	} else {
		return sep_version;
	}
}


//  $BA*Br$7$?%9%?%$%k%7!<%H$r(B cookie $B$K=q$-9~$_!"%Z!<%8$r%j%m!<%I$9$k(B
//  args: $B%9%?%$%k%7!<%H$NL>A0$N0lIt(B
//
//  $B4|BT$5$l$k%9%?%$%k%7!<%H$NL>A0$N0lIt!J(Bset_style $B$H$N$+$i$_!K(B
//  $BBg(B  xxxxx"_large".css
//  $BCf(B  xxxxx"_normal".css
//  $B>.(B  xxxxx"_small".css
//
function wrt_style( STYLE ) {
	document.cookie = "css-size=" + STYLE;
	location.reload();
}

/*
$B2hLL$NBg$-$5$*$h$S%f!<%6!<$N;X<($K$h$C$F%9%?%$%k%7!<%H$rBgCf>.$N#3CJ3,$G@Z$jBX$($k!#(B

$B$^$:(B cookie $B$rFI$_$K9T$/!#(B
$B%9%?%$%k%7!<%H$N>pJs$,$"$l$P$=$l$rJV$7!"$J$1$l$P2hLL%5%$%:$K1~$8$F%G%U%)%k%H$N%9%?%$%k%7!<%H$r:NMQ$7!"$=$N(B <link> $BJ8$r@8@.$9$k!#(B

$B%9%?%$%k%7!<%H%U%!%$%kL>$O0J2<$N$h$&$JL>A0$rA[Dj$7$F$$$k!#(B
$BBg(B  xxxxx_large.css
$BCf(B  xxxxx_normal.css
$B>.(B  xxxxx_smal.css

$B0z?t$O(B xxxxx $B$rM?$($k(B
*/

//  $B%9%?%$%k%7!<%H%;%C%H4X?t(B
//  args: $B%9%?%$%k%7!<%H$N4pK\L>(B
//  rets: N/A
function set_style( stylename,		SIZE ) {
	SIZE = document.cookie;
	if ( SIZE.match( /css-size=([^=;]*)/ ) ) {
		wrt_link( stylename, RegExp.$1 );
	// cookie $B$K%"%/%;%9$G$-$J$+$C$?>l9g$O$3$C$A(B
	} else {
		scrn = chk_scrn();
		if ( scrn.match( /\+/ ) ) {
			wrt_link( stylename, '_large' );
		} else if ( scrn.match( /\-/ ) ) {
			wrt_link( stylename, '_size' );
		} else {
			wrt_link( stylename, '_normal' );
		}
	}
}

//  $B<B:]$K(B <link> $B%?%0$r@8@.$9$k%k!<%A%s(B
//  $B$3$s$@$1!#(B
function wrt_link( stylename, size ) {
	document.write( '<link rel="stylesheet" type="text/css" href="' + stylename + size + '.css">' );
}

/*
$BMW$9$k$K(B <head> $BFb$G$d$k$H(B HTML $B$NJ8K!$KH?$9$k$N$H!"(BIE $B$G$NF0:n$,IT3N<B$J$N$G30It(B JavaScript $B$NCf$+$i(B HTML $B%U%!%$%k$NCf$K@8@.$9$k$N$,%]%$%s%H(B
*/
