//支援
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;}
//
smm=sm.split(",");
sw=smm[0]*1;sh=smm[1]*1;xn=smm[2]*1;gaku=smm[3]*1;gaku_color=smm[4]

//muki=("1,0,-1,0,0,1,0,-1,0,0,1,1").split(",");
nav=navigator.appName.substring(0,1);
g_bgc=(bgc+",,,").split(",");
if(g_bgc[1]==""){g_bgc[1]=g_bgc[0];g_bgc[2]=0;}

//tt=spd.split(",");
//sx=muki[tt[2]*2]*1;sy=muki[(tt[2]*2+1)]*1;

dt=da.split(",");n=dt.length;
if(dt[n-1]==""){n--;}
//
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";}
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");
document.onload=wh_chack;
////
function op(p){
win=window.open("","slid","fullscreen=yes");
win.document.open();
ww=('<html>\n<head>\n');
ww+=('<script language="javascript">\n')
if(p*1<0){at=1;p=0;}else{at=0;}
ww+=('da="'+da+'";\n');
ww+=('bgc="'+bgc+'";');
ww+=('ur="'+ur+'";');
ww+=('spd="'+spd+'";\n');
ww+=('at="'+at+'";\n');
ww+=('cc='+p+';\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 cls(){\n');
if(helper>=1){
ww+=('opener.menu_sub();\n');
}
ww+=('window.close();return false;}\n');
ww+=('document.onclick=cls;\n');
if(helper==3){
ww+=('function keydw(e){;\n');
ww+=('cod=event.keyCode;\n');
ww+=('if(cod==9){cls();};\n');
ww+=('};\n');
ww+=('document.onkeydown=keydw;\n');
}
ww+=('document.title="[F11]キーでフルスクリーンになります";\n');
ww+=('</sc')
ww+=('ript>\n');
ww+=('</head>\n');
ww+=('<body scroll=no onload="opener.full_check();go();" style="filter:progid:DXImageTransform.Microsoft.Gradient(gradientType='+g_bgc[2]+',StartColorStr='+g_bgc[1]+',EndColorStr='+g_bgc[0]+');">\n');
ww+=('<script language="javascript">\n');
ww+=wwmm();
ww+=('</sc')
ww+=('ript>\n');
dd=(dt[0]+";").split(";");
ww+=('<img src="'+ur+dd[0]+'" id="mylay" name="myimg" alt="左：閉じる/右：静止" galleryimg="no" onClick="window.close()" style="position:absolute;top:100;left:0;filter:alpha(opacity=0,style=0)">');
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+=('</body>\n</html>\n');

win.document.write(ww);
win.document.close();
}
//フルスクリーンチェック
function full_check(){
win_height=screen.height-win.document.body.clientHeight;
if(win_height>24){
document.getElementById('full_height').innerHTML='<br><a href="http://www2a.biglobe.ne.jp/~qpon/html/xp_sp2.htm" style="font-size:10;color:#ff8800">フルスクリーン鑑賞法</a>';
}
}
//サムネール仕上げ
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=0;i<n;i++){
if(i%xn==0){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,')">');}
dd=(dt[i]+";").split(";");
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,'">No.',(i+1),'</span><br>');

document.write('</td>');
if((i+1)%xn==0){document.write('</tr>');} 
}
if((i+1)%xn!=0){document.write('</tr>');}

document.write('<tr><td align=right colspan="'+xn+'"><a href="http://www2a.biglobe.ne.jp/~qpon/js/index.htm?http://qpon.quu.cc/java/quality/fade10_b.htm" target="_qpon" title="プログラムソース無料提供中"><font size=1 color='+gfont_color+'>システム提供：ＱＰＯＮ</font></a><span id="full_height"></td></tr>'); 

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

//障害者支援

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);op(-1);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){
/*
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="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="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:op(-1);me=2;window.blur();" style="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="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;color:#000000">');
*/
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();
}
}



function wwmm(){wm="";
wm+='muki=("0,0,1,0,-1,0,0,1,0,-1,1,1,-1,1,1,-1,-1,-1,0,0").split(",");\n';
wm+='nav=navigator.appName.substring(0,1);\n';
wm+='g_bgc=(bgc+",,,").split(",");\n';
wm+='if(g_bgc[1]==""){g_bgc[1]=g_bgc[0];g_bgc[2]=0;}\n';
wm+='dt=da.split(",");n=dt.length;if(dt[n-1]==""){n--;}\n';
wm+='tt=(spd+",,,").split(",");\n';

wm+='rr=tt[0]*10;rc=100/rr;loop=tt[4]*1;\n';
if(helper>0){
wm+='loop=0;\n';
}
wm+='c=0;r=1;x=0;t=tt[0]*1;\n';
wm+='syasin=new Image();\n';
wm+='dd=(dt[cc]+";").split(";");\n';
wm+='syasin.src=ur+dd[0];\n';
wm+='sxy=tt[2]*1;\n';
wm+='if(sxy==9){sxy=Math.floor(Math.random()*8)+1}\n';
wm+='if(dd[1]!=""){sxy=dd[1]*1;}\n';
wm+='sx=muki[sxy*2]*1;sy=muki[(sxy*2+1)]*1;\n';

wm+='//開始\n';
wm+='at_flg=0;\n';
wm+='function go(){\n';

wm+='chg();\n';
wm+='at_flg=1;mov();\n';
wm+='}\n';

wm+='//移動\n';

wm+='function mov(){\n';
wm+='if(t==tt[1]*1){\n';
wm+='document.getElementById("mylay").style.visibility="visible";\n';
wm+='}\n';
wm+='t=tt[0]*1;c+=r;x+=ido_w;y+=ido_h;\n';
wm+='if(c<1){\n';
wm+='if((at==1 && cc==0 && loop!=1)|| at!=1){close();}else{chg();}\n'
//wm+='if(at==1 && cc!=0){chg();}else{close();}\n';
wm+='}\n';
wm+='if(c>rr || c<1){r*=-1;t=tt[1]*1;\n';
wm+='if(c<1){document.getElementById("mylay").style.visibility="hidden";}\n';
wm+='}\n';
wm+='if(nav=="M"){\n';
wm+='document.getElementById("mylay").filters["alpha"].opacity=Math.floor(c*rc);\n';
wm+='}\n';
wm+='document.getElementById("mylay").style.left=x;\n';
wm+='document.getElementById("mylay").style.top=y;\n';
wm+='tm=setTimeout("mov()",t);\n';
wm+='}\n';
wm+='//画像差し替え\n';
wm+='function chg(){\n';
wm+='cc++;\n';
wm+='if(cc>=n){cc=0;}\n';
wm+='img_w=syasin.width;img_h=syasin.height;\n';
wm+='ido_w=((document.body.clientWidth-img_w)/(rr*2))*sx;\n';
wm+='ido_h=(document.body.clientHeight-img_h)/(rr*2)*sy;\n';
wm+='document.images["myimg"].src=syasin.src;\n';
wm+='x1=((document.body.clientWidth-img_w)/2);\n';
wm+='x=x1-x1*sx;\n';
wm+='y1=(document.body.clientHeight-img_h)/2;\n';
wm+='y=y1-y1*sy;\n';
wm+='dd=(dt[cc]+";").split(";");\n';
wm+='syasin=new Image();syasin.src=ur+dd[0];\n';
wm+='sxy=tt[2]*1;\n';
wm+='if(sxy==9){sxy=Math.floor(Math.random()*8)+1}\n';

wm+='if(dd[1]!=""){sxy=dd[1]*1;}\n';
wm+='sx=muki[sxy*2]*1;sy=muki[(sxy*2+1)]*1;\n';
wm+='}\n';
wm+='//静止\n';
wm+='function stp(){\n';
wm+='if(event.shiftKey){return;}\n';
wm+='if(at_flg==1){\n';
wm+='clearTimeout(tm);at_flg=0;;\n';
wm+='}else{;\n';
wm+='at_flg=1;t=tt[0]*1;tm=setTimeout("mov()",t);\n';
wm+='}\n';
wm+='return false;\n';
wm+='}\n';
if(helper>0){
wm+='document.oncontextmenu=cls;\n';
}else{
wm+='document.oncontextmenu=stp;\n';
}
return wm;
}
