//支援
hlp=(document.location+"??").split("?");
helper=0;
if(hlp[1]=="help"){helper=1;}
if(hlp[1]=="help1"){helper=1;}
if(hlp[1]=="help2"){helper=2;}
if(hlp[1]=="help3"){helper=3;}
//if(helper>=1){moji_size=Math.floor(moji_size*2);}

if(helper>=1){

moji_size=Math.floor(moji_size*2);
}
//

//---2005/04/17---//

gc=gaku_color+",,,,";
gcc=gc.split(",");
gaku_color=gcc[0];
gfont_color=gcc[1];if(gfont_color==""){gfont_color=document.fgColor;}
gfont_size=gcc[2];if(gfont_size==""){gfont_size=14;}
gaku_bgcolor=gcc[3];if(gaku_bgcolor==""){gaku_bgcolor="#cccccc";}
gaku_imgcolor=gcc[4];if(gaku_imgcolor==""){gaku_imgcolor="0";}

iti=moji_align+",0";
com_iti=iti.split(",");
moji_align=com_iti[0];yohaku=com_iti[1]*1;
if(sw>0 && sh>0 && gaku<4){
onload=wh_chack;
}
sum_w=sw;
scr=kakudai+",,,,";
scr_bg=scr.split(",");
dw_flg=scr_bg[3]*1;
kakudai=scr_bg[0]*1;
if(scr_bg[1]==""){scr_bg[1]="#000000";}
r=w_time+",0,0,";rr=r.split(",");
w_time=rr[0]*1;
w_loop=rr[1]*1;if(helper>0){w_loop=1;}//支援ならＬＯＯＰなし
mac=navigator.appVersion.indexOf("Mac");
nav=navigator.appName.substring(0,1);
nav_ver=navigator.appVersion;
nav_sv=nav_ver.indexOf("Windows NT 5.1; SV1");

//拡大
scr_ww=screen.width;

typ=new Array();
typ[0]="channelmode=yes";//ボタン、タイトルバー表示
typ[1]="width="+(screen.width-10)+",height="+(screen.height-52)+",top=0,left=0";//タイトルバー表示
typ[2]="fullscreen=yes,scrollbars=no";//写真のみ
typ[3]="fullscreen=yes";//[X]ボタンのみ
//写真タイプセット
function syasin_type(){
if(syasin==0){syasin_typ="width="+screen.width+" height="+screen.height;}//縦横１００％
if(syasin==1){syasin_typ="width="+screen.width;}//横１００％
if(syasin==2){syasin_typ="";}//写真原寸
if(syasin==3){syasin_typ="height="+screen.height;}//タテ１００％
if(syasin>3 && syasin<100){syasin_typ="width="+(Math.floor(syasin*screen.width*0.01));}
if(syasin>=100){syasin_typ="width="+syasin;}


}
//サムネール白黒
function color_set(p,q){
if(p==0){
mihon[(q-1)].filters["gray"].enabled=false;
}else{
mihon[(q-1)].filters["gray"].enabled=true;
}
}
//サムネール仕上げ
function wh_chack(){
for(i=0;i<n;i++){
sn_l=document.mihon[i].width;
sn_h=document.mihon[i].height;
if(sn_l>sum_w){
document.mihon[i].width=sum_w;
document.mihon[i].height=(sum_w/sn_l)*sn_h;
}
}
}

//サムネル
waku=new Array();
waku[0]='border=0';
waku[1]='border=2 cellpadding=6 bgcolor='+gaku_color;
waku[2]='border=0 cellpadding=0 cellspacing=0 width='+(sw*1+8)+' height='+(sh*1+8)+' style="text-align:left;text-valign:top;"';
waku[3]='border=0 cellpadding=10 cellspacing=0 width='+(sw*1+8)+' height='+(sh*1+8)+' style="text-align:left;text-valign:top;filter:shadow(color='+gaku_color+',direction=135)"';

if(gaku<4 && sw>0 && sh>0){
document.write('<table width="90%" border="0" cellpadding=0>');
for(i=1;i<=n;i++){
dd=(dt[i]+",,,").split(",");
if(dd[0]==""){dd[0]=dd[1];}
if(i%xn==1){document.write('<tr height="',sw,'">');}
document.write('<td align="center" valign=top>');
document.write('<table ',waku[gaku],'><tr><td ');
if(gaku!=3){document.write('bgcolor="',gaku_bgcolor,'" ');}
document.write('valign=middle align=center width="',sw,'"  height="',sh,'">');

if(document.layers || mac>0){document.write('<a href="javascript:op(',i,')">');}
if(gaku_imgcolor=="1"){
document.write('<img src="',ur,dd[0],'" name="mihon" height="',sh,'" border=1 onMouseover="color_set(0,',i,')"  onMouseout="color_set(1,',i,')" onClick="op(',i,')" style="cursor:hand;border-color:#ffffff;filter:gray();">'); 
}else{
if(gaku_imgcolor=="2"){
document.write('<img src="',ur,dd[0],'" name="mihon" height="',sh,'" border=1 onClick="op(',i,')" style="cursor:hand;border-color:#ffffff;filter:gray();">'); 
}else{
document.write('<img src="',ur,dd[0],'" name="mihon" height="',sh,'" border=1 onClick="op(',i,')" style="cursor:hand;border-color:#ffffff;">'); 
}
}
if(document.layers || mac>0){document.write('</a>');}
if(gaku==2){
document.write('</td><td><table width=8 height=100% border=0 cellpadding=0 cellspacing=0><tr height=8><td></td></tr><tr height='+(sh-8)+'><td bgcolor='+gaku_color+'></td></tr></table>');
document.write('</td></tr><tr><td colspan=2><table width=100% height=8 border=0 cellpadding=0 cellspacing=0><tr><td width=8></td><td width='+sw+' bgcolor='+gaku_color+'></td></tr></table>');
}
document.write('</td></tr></table>');

document.write('<span style="color:',gfont_color,';font-size:',gfont_size,'">',dd[2],'</span><br>');

document.write('</td>');
if(i%xn==0){document.write('</tr>');} 
}
if(i%xn!=0){document.write('</tr>');}
document.write('<tr><td align=right colspan="'+xn+'"><img src="http://qpon.quu.cc/cgi-bin/week/count.cgi?quality4" width=0 height=0><a href="http://www.ne.jp/asahi/qpon/b/java/url_chg.htm" target="_qpon"><font color=#ff000 size=2>ページ管理者様：このシステムを提供していますサーバーを閉鎖します、ここをクリックして新しいサーバーに入れ替えてください。ＱＰＯＮ</font></a></td></tr>'); 
document.write('</table>');
if(nav!="M" && (gaku_imgcolor=="1" || wip==25 || wip==26)){
document.write('<font size=2 color=#ff0000>インターネット　エクスプローラ以外はモノクロになりません</font><br>');
}
/*
if(nav_sv>0 && kakudai==2){
//document.write('<a href="http://www2a.biglobe.ne.jp/~qpon/html/xp_sp2.htm" target="mc"><font size=1 color=#ff4488>フルスクリーン鑑賞設定法</font></a><br><br>');
}
*/
}

////////////////////////////////////
//障害者支援
function con_menu(){
return false;
}
me=3;

function menu_ud(){
if(helper==1&&event.button!=2){return;}
if(helper==2&&event.button==1){menu_sub();return;}
helper_bgm.src="http://qpon.quu.cc/helper/up.wav";
if(helper==1){clearTimeout(mt);}
if(me==0){roll(-1);menu_sub();return false;}
if(me==1){history.back();}
if(me==2){roll(0);at();window.blur();return false;}
if(me==3){roll(1);menu_sub();return false;}
return false;
}
me_ud=-1;
function menu_sub(){

document.getElementById("menu"+me).filters["invert"].enabled=false;

if(me>=3){me=3;me_ud=-1;}
if(me<=0){me=0;me_ud= 1;}
me+=me_ud;
if(helper!=3){
document.getElementById("menu"+me).filters["invert"].enabled=true;
}
helper_bgm.src="http://qpon.quu.cc/helper/pi.wav";
if(helper==1){
mt=setTimeout("menu_sub()",2000);
}
}
function link_focus(p){
document.getElementById("menu"+p).filters["invert"].enabled=true;

}
function link_blur(p){
document.getElementById("menu"+p).filters["invert"].enabled=false;

}
menu_top=0;

function roll(s){
if(s==0){
menu_top=0;
document.getElementById("menu_table").style.top=menu_top;
return false;
}
menu_top+=(200*s);
if(menu_top<0){menu_top=0;}
document.getElementById("menu_table").style.top=menu_top;
scrollTo(0,menu_top);
}
if(helper>=1){
if(hlp[0].indexOf("oiroy61okeus")>0){document.write('</div>');}//堤よりお対策
document.write('<table id="menu_table" border=1 width=100 height=100% bgcolor=#ffffff style="position:absolute;top:0;left:0;font-size:70;z-index:9">');
document.write('<tr height=100><th style="background:#ffffff;color:#000000;font-size:70;filter:invert(enabled=0);" id="menu0"><a href="javascript:roll(-1);" style="background:#ffffff;color:#000000;font-size:70;" onMouseOver="link_focus(0)" onMouseOut="link_blur(0)" onFocus="link_focus(0)" onBlur="link_blur(0)" id="hr0" tabindex="1">↑</a></th></tr>');
document.write('<tr height=100><th style="background:#ffffff;color:#000000;font-size:70;filter:invert(enabled=0);" id="menu1"><a href="javascript:history.back();" style="background:#ffffff;color:#000000;font-size:70;" onMouseOver="link_focus(1)" onMouseOut="link_blur(1)" onFocus="link_focus(1)" onBlur="link_blur(1)" id="hr1" tabindex="2">閉</a></th></tr>');
document.write('<tr height=100><th style="background:#ffffff;color:#000000;font-size:70;filter:invert(enabled=0);" id="menu2"><a href="javascript:at();me=2;window.blur();" style="background:#ffffff;color:#000000;font-size:70;" onMouseOver="link_focus(2)" onMouseOut="link_blur(2)" onFocus="link_focus(2)" onBlur="link_blur(2)" id="hr2" tabindex="3">見</a></th></tr>');
document.write('<tr height=100><th style="background:#ffffff;color:#000000;font-size:70;filter:invert(enabled=0);" id="menu3"><a href="javascript:roll(+1);" style="background:#ffffff;color:#000000;font-size:70;" onMouseOver="link_focus(3)" onMouseOut="link_blur(3)" onFocus="link_focus(3)" onBlur="link_blur(3)" id="hr3" tabindex="4">↓</a></th></tr>');
document.write('<tr><th valign=bottom style="font-size:20;background:#ffffff;color:#000000">');
if(helper==1){
document.write('移動自動<br>確定：右');
}
if(helper==2){
document.write('移動：左<br>確定：右');
}
if(helper==3){
document.write('リンク自動巡回');
}

document.write('</th></tr></table>');

document.write('<bgsound id="helper_bgm">');
document.onmouseup=con_menu;
document.oncontextmenu=con_menu;

document.onmousedown=menu_ud;
document.onload=menu_sub();
}


//}
//document.write('<bgsound id="bgm_sound" src="">');
////////////////////////////////////

alt_dt="左：閉じる／右：次へ,左：閉じる／右：静止".split(",");
if(kakudai ==4){alt_dt=",".split(",");}
//次へ
seisi_flg=0;
function next_button(p){
/////////if(at_flg==0){
p_no+=p;if(p_no>n){p_no=1;}
if(p_no<1){p_no=n;}
//一巡したとき
if(w_loop>0 && start_no==p_no && p==1){cls();}
dd=(dt[p_no]+",,,").split(",");
ww=('<img src="'+ur+dd[1]+'" name="myimg" border=0 '+syasin_typ +' alt="'+alt_dt[0]+'" galleryimg="no"');
if(wip==25 || wip==26){
ww+=(' style="filter:gray();"');
}
ww+=(' onLoad="img_flg()">\n');
win.document.getElementById("img_td").innerHTML =ww;
win.document.getElementById("com").innerHTML = '<table cellpadding=5><tr><td width='+yohaku+'><br></td><td id="txt" style="color:'+moji_color+';background-color:'+moji_bgcolor+';font-size:'+moji_size+'">'+dd[3]+'</td><td width='+yohaku+'><br></td></tr></table>';

if(wip==25){
win.wip25_on();
}
}
/*
if(at_flg==1){
seisi_flg++;
seisi_flg=seisi_flg%2;

}
}
*/
//閉じる
at_flg=0;open_flg=0;
function cls(){
if(helper>=1){menu_sub();}//支援者用

/////alert(wip_flg);////////////
if(at_flg==1 && wip_flg==1){
	open_flg=2;
}else{
	open_flg=0;
	wip_flg=0;
	if(at_flg==1){
		at_flg=0;seisi_flg=0;
		clearTimeout(tim);
	}
win.window.close();
}
}
//閉じるボタン
function close_button(){if(kakudai==3){
if(at_flg==0){
if(nav=="N"){
ww=('<a href="javascript:cls()" style="background-color:'+moji_bgcolor+';color:'+moji_color+';font-size:12;">左クリック：閉じる</a>｜<a href="javascript:opener.next_button(1)" style="background-color:'+moji_bgcolor+';color:'+moji_color+';font-size:12;">右クリック：次へ</a>');
}else{
ww=('左クリック：閉じる｜右クリック：次へ');

}
}else{
if(nav=="N"){
ww=('<a href="javascript:cls()" style="background-color:'+moji_bgcolor+';color:'+moji_color+';font-size:12;">左クリック：閉じる</a>｜<a href="javascript:opener.next_button(1)" style="background-color:'+moji_bgcolor+';color:'+moji_color+';font-size:12;">右クリック：静止</a>');
}else{
ww=('左クリック：閉じる｜右クリック：静止');

}
}
win.document.getElementById("button").innerHTML =ww;
}

}
load_flg=1;
//自動スライド
function at(){
at_flg=1;seisi_flg=0;

load_flg=1;

op(1);
p_no=1;
tim=setTimeout("at_sub()",w_time*1000);

load_flg=1;
close_button();
}

//
wip_flg=0;


function at_sub(){

if(seisi_flg!=0){return}
if(load_flg!=1){return;}
tim=setTimeout("at_sub()",w_time*1000);

load_flg=0;
p_no++;
if(p_no>n){
	p_no=1;
	if( w_loop>0){
		open_flg=2;
	}
}
dd=(dt[p_no]+",,,").split(",");
if(open_flg==1){
	wip_flg=1;
	if(nav=="M"){
		if(wip==25){win.wip25_on();}
	
		if(wip>0 && wip<25){win.tp.filters["revealTrans"].Apply();}
		
		sty="";	if(wip==25 || wip==26){	sty=' style="filter:gray();"';}
		ww=('<img src="'+ur+dd[1]+'" name="myimg" border=0 '+syasin_typ +' alt="'+alt_dt[0]+'" galleryimg="no"'+sty+' onLoad="img_flg()">\n');
		win.document.getElementById("img_td").innerHTML =ww;
		if(wip>0 && wip<25){
			win.tp.filters["revealTrans"].Transition=(wip-1);
			win.tp.filters["revealTrans"].play();
		}
	}
	if(nav!="M"){
		ww=('<img src="'+ur+dd[1]+'" name="myimg" border=0 '+syasin_typ +' alt="'+alt_dt[0]+'" galleryimg="no" onLoad="img_flg()">\n');
		win.document.getElementById("img_td").innerHTML =ww;
	}
	win.document.getElementById("com").innerHTML = '<table cellpadding=5><tr><td width='+yohaku+'><br></td><td id="txt" style="color:'+moji_color+';background-color:'+moji_bgcolor+';font-size:'+moji_size+'">'+dd[3]+'</td><td width='+yohaku+'><br></td></tr></table>';
	wip_flg=0;
}



//

//遅いＰＣ対策
if(open_flg==2){
if(helper==1){menu_sub();}//支援者用
	open_flg=0;
	at_flg=0;
	clearTimeout(tim);
	win.window.close();
	seisi_flg=0;
return;
}
}

//画像読込みチェック
function img_flg(){
load_flg=1;
}

//拡大ウインドウ
p_no=1;open_flg=0;start_no=1;
function op(p){
syasin_type();
p_no=p;start_no=p;
dd=(dt[p]+",,,").split(",");
if(scr_ww<1000 && kakudai==3){kakudai=4;}
win=window.open("","quality",typ[kakudai]);
win.document.open();
www=win_write(p_no);
win.document.write(www);

win.document.close();
open_flg=1;
/*
if(nav_sv>0 && kakudai==2){
win.document.title="高画質写真表示（「フルスクリーン鑑賞」の設定をするとタイトルバーが消せます）";
}
*/
if(wip==25){
win.wip25_on();
}
}

//拡大ＨＴＭＬ
function win_write(qq){

scr_w=screen.width;scr_h=screen.height;

if(nav=="N"){
scr_h=innerHeight;
}



no=qq*1;

ddm=(dt[no]+",,,").split(",");


ww =('<html>\n');
ww+=('<head><title>高画質写真表示</title>\n');
ww+=('<script language="javascript">\n');
ww+=('nav=navigator.appName.substring(0,1);\n');
ww+=('dw_flg='+dw_flg+';');
ww+=('//白黒タイマー\n');
ww+=('mono_flg=0;\n');
ww+=('function wip25(c){\n');
ww+=('if(!c){\n');
ww+=('tp.filters["blendTrans"].Apply();\n');
ww+=('tp.filters["blendTrans"].duration=3;\n');
ww+=('tp.filters["blendTrans"].play();\n');
ww+=('}\n');
ww+=('myimg.filters["gray"].enabled=c;\n');

ww+=('mono_flg=0;\n');
ww+=('}\n');
ww+=('function wip25_on(){\n');
ww+=('wip25(true);mono_tim=setTimeout("wip25(false)",2000);mono_flg=1;\n');
ww+=('}\n');
ww+=('function cls(){\n');
ww+=('if(event.shiftKey){next(-1);return;}');
ww+=('opener.cls();\n');
ww+=('}\n');
ww+=('function next(p){\n');
ww+=('if(p!=-1){p=1;}');
ww+=('if(event.shiftKey && dw_flg==1 && p!=-1){return;}\n');
ww+=('opener.next_button(p);\n');
ww+=('return false;\n');
ww+=('}\n');
ww+=('function link_focus(p){document.getElementById("menu"+p).filters["invert"].enabled=true;}');
ww+=('function link_blur(p){document.getElementById("menu"+p).filters["invert"].enabled=false;}');

ww+=('function keydw(e){;\n');
ww+=('if(nav=="N"){cod=e.which;}else{cod=event.keyCode;};\n');
ww+=('if(cod==39||cod==13){next(1);};\n');
ww+=('if(cod==38||cod==40||cod==27){cls();};\n');
ww+=('if(cod==37||cod==8){next(-1);};\n');
if(helper==3){
ww+=('if(cod==9){cls();};\n');
}
ww+=('};\n');
ww+=('function keyup(e){cod="";};\n');
ww+=('if (nav=="N"){document.captureEvents( Event.CLICK | Event.CONTEXTMENU | Event.ONKEYDOWN | Event.ONKEYUP );\n');
ww+=('}else{\n');
if(helper>=1){
ww+=('document.oncontextmenu=cls;\n');
ww+=('document.onmousedown=cls;\n');
}else{
ww+=('document.oncontextmenu=next;\n');
ww+=('document.onclick=cls;\n');
}
ww+=('}\n');
ww+=('document.onkeydown=keydw;\n');
ww+=('document.onkeyup=keyup;\n');

ww+=('function img_flg(){\n');

ww+=('img_ww=myimg.width;\n');
ww+=('img_hh=myimg.height;\n');
ww+=('img_wh=img_ww/img_hh;\n');
ww+=('if(img_ww>screen.width){img_ww=screen.width-1;img_hh=Math.floor(img_ww/img_wh);}\n');
ww+=('if(img_hh>screen.height){img_hh=screen.height-1;img_ww=Math.floor(img_hh*img_wh);}\n');
ww+=('document.myimg.width=img_ww;document.myimg.height=img_hh;\n');
ww+=('load_flg=1;\n');
ww+=('opener.img_flg();\n');
ww+=('}\n');

ww+=('</sc');
ww+=('ript>\n');
ww+=('</head>\n');
ww+=('<body bgcolor="'+scr_bg[1]+'" background="'+scr_bg[2]+'" leftmargin="0" topmargin="0" marginheight=0 marginwidth=0 scroll="no" onLoad="img_flg();">\n');
win.document.write(ww);ww="";
ww+=('<center>\n');
//写真
if(nav=="N"){
ww+=('<div id="tp" onClick="cls()" onContextmenu="next(1)" style="position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;vertical-align:middle;filter:revealTrans(Transition='+wip+');margin:auto;">\n');

}else{
if(wip==25 || wip==26){
ww+=('<div id="tp" style="position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;vertical-align:middle;filter:blendTrans(duration=3);margin:auto;">\n');
}else{

ww+=('<div id="tp" style="position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;vertical-align:middle;filter:revealTrans(duration=3,Transition='+wip+');margin:auto;">\n');

}
}
ww+=('<table width=100% height=100% cellpadding=0 cellspacing=0><tr><td align="center" valigin="middle" id="img_td">');
if(kakudai!=4){
ww+=('<img src="'+ur+ddm[1]+'" name="myimg" border=0 '+syasin_typ +' alt="左：閉じる／右：次へ"');
}else{
ww+=('<img src="'+ur+ddm[1]+'" name="myimg" border=0 '+syasin_typ +' alt=""');
}
if(wip==25 || wip==26){
ww+=(' style="filter:gray();"');
}
ww+=(' galleryimg="no">\n</td></tr></table></div>\n');
win.document.write(ww);ww="";
//

nav=navigator.appName.substring(0,1);
if(nav=="N"){
win_h=win.innerHeight-48;
}else{
win_h=win.document.body.clientHeight-36;
if(kakudai==1){win_h=win.document.body.clientHeight-54;}
}
//コメント配置
ww+=('<div id="com" style="position:absolute;top:'+(win_h-yohaku)+';left:0;width:100%;filter:blendTrans(duration=2);text-align:'+moji_align+';" >\n');
ww+=('<table cellpadding=5><tr><td width='+yohaku+'><br></td><td id="txt" style="color:'+moji_color+';background-color:'+moji_bgcolor+';font-size:'+moji_size+'">'+ddm[3]+'<br></td><td width='+yohaku+'><br></td></tr></table>\n');
ww+=('</div>\n');

//閉じるボタン表示
if(kakudai==3){
if(nav=="N"){
ww+=('<div id="button" style="position:absolute;top:0;left:0;background-color:'+moji_bgcolor+';color:'+moji_color+';font-size:12;cursor:hand"><a href="javascript:cls()" style="background-color:'+moji_bgcolor+';color:'+moji_color+';font-size:12;">左クリック：閉じる</a>｜<a href="javascript:opener.next_button(1)" style="background-color:'+moji_bgcolor+';color:'+moji_color+';font-size:12;">右クリック：次へ</a></div>\n');
}else{
ww+=('<div id="button" style="position:absolute;top:0;left:0;background-color:'+moji_bgcolor+';color:'+moji_color+';font-size:12;cursor:hand">左クリック：閉じる｜右クリック：次へ</div>\n');

}
}
if(helper==3){
ww+=('<div id="h3" style="position:absolute;top:0;left:0;"><table><tr height=100><th style="background:#ffffff;color:#000000;font-size:70;filter:invert(enabled=0);" id="menu1"><a href="javascript:history.back();" style="color:#000000;font-size:70;" onMouseOver="link_focus(1)" onMouseOut="link_blur(1)" onFocus="link_focus(1)" onBlur="link_blur(1)" id="hr1">閉</a></th></tr></table></div>\n');

}
//ww+=('<div id="f" style="position:absolute;top:30;left:100;"><form name=myform><input type=text name="f_w"><input type=text name="f_h"></form></div>\n');
ww+=('</center></body></html>\n');
return ww;

}
