for(i=0;i<=n;i++){
dt[i]+=",,";
}
mm=(moji+",,,").split(",");
moji_size=mm[0];moji_color=mm[1];
mm=spac.split(",");
space_size=mm[0];
space_color=mm[1];
stp=Math.floor(img_w/10);img_w=stp*10;//移動ピッチ
if(wh==1){
stp=Math.floor(img_h/10);img_h=stp*10;
}
if(wh==1){stp=img_h/10;}
w=0;
nn=0;mm=0;
mv_flg=0;
flg=0;
fil=new Array();
doc=new Array();

//ファイルの先読み
for(i=0;i<=n;i++){
dd=dt[i].split(",");
fil[i]=new Image();fil[i].src=url+dd[0];
doc[i]=dd[1];
}

//方向
function chg(p){
if(document.layers){
nn++;

if(nn>n){nn=0;}
document.nc.src=fil[nn].src;
}else{


muki=p;
set();
}
}
///イメージセット///
function set(){

if(flg==1){
return;
}else{
set_sub();
}
}

//
function set_sub(){
if(muki==1){ll="ll_";rr="rr_";}else{ll="rr_";rr="ll_";}
w=0;

mm=nn+muki;
if(mm>n){mm=0;}
if(mm<0){mm=n;}
if(wh==0){
document[ll+"1"].width=0;
}else{
document[ll+"1"].height=0;
}
document[rr+"1"].src=fil[nn].src;

if(wh==0){
document[rr+"1"].width=img_w;
}else{
document[rr+"1"].height=img_h;
}
document[rr+"2"].src=fil[mm].src;
document[ll+"1"].src=fil[mm].src;
document[ll+"2"].src=fil[nn].src;
//document.book_f.com.value=doc[mm];

mv();

nn=nn+muki;
if(nn>n){nn=0;}
if(nn<0){nn=n;}
}
//自動
function at_start(){
setTimeout("at()",tim);
}
function at(){
if(document.layers){return;}
if(flg==1){
flg=0;
clearTimeout(at_tm);
return;
}
at_tm=setTimeout("at_sub()",tim/2);

//at_sub();
flg=1;
}
//
function at_sub(){
if(mv_flg==0){
set_sub();
}
//at_tm=setTimeout("at_sub()",tim);
}

//めくる
function mv(){

if(w>20){
clearTimeout(tm);
mv_flg=0;
if(flg==1){
at_tm=setTimeout("at_sub()",tim);
}
return;
}
if(wh==1){
if(w<10){
document[rr+"1"].height=img_h-w*stp;

}
if(w==10){
document[rr+"1"].height=0;
document.book_f.com.value=doc[mm];
}
if(w>10){
document[ll+"1"].height=(w-10)*stp;

}
}else{
if(w<10){
document[rr+"1"].width=img_w-w*stp;
}
if(w==10){
document[rr+"1"].width=0;
document.book_f.com.value=doc[mm];
}
if(w>10){
document[ll+"1"].width=(w-10)*stp;
}
}
w=w+1;
mv_flg=1;

tm=setTimeout("mv()",50); 

}

//初期配置
if(wh==1){
cp2='rect(0,'+img_w +','+img_h/2+',0)';cp1='rect('+img_h/2+','+img_w+','+img_h+',0)';
}else{
cp1='rect(0,'+img_w/2+','+img_h+',0)';cp2='rect(0,'+img_w+','+img_h+','+img_w/2+')';
}
img_l=0;img_top=0;
document.write('<table border=0 cellpadding=',space_size,' bgcolor=',space_color,'><tr><td>');
document.write('<table border=0 cellpadding=0 width=',img_w,' height=',img_h,'><tr><td>');

document.write('<div  style="position:relative;width:',img_w,'px;height:',img_h,'px;text-align:center;">');

document.write('<div id="ll_02" valign=middle style="position:absolute;top:',img_top,';left:',img_l,';width:',img_w,';height:',img_h,';clip:',cp1,'">');
document.write('<a href="javascript:void(0)" onClick="chg(0)">');
document.write('<table height=',img_h,' width=',img_w,' border=0 cellspacing=0 cellpadding=0><tr><td align=center valign=middle>');
document.write('<img src="',fil[0].src,'" name="ll_2" width=',img_w,' height=',img_h,' border=0 galleryimg="no" alt="">');
document.write('</td></tr></table></a></div>\n');

document.write('<div id="rr_02" valign=middle  style="position:absolute;top:',img_top,';left:',img_l,';width:',img_w,';height:',img_h,';clip:',cp2,'">');
document.write('<a href="javascript:void(0)" onClick="chg(0)">');
document.write('<table height=',img_h,' width=',img_w,' border=0 cellspacing=0 cellpadding=0><tr><td align=center valign=middle>');
document.write('<img src="',fil[0].src,'" name="rr_2" width=',img_w,' height=',img_h,' border=0 galleryimg="no" alt="">');
document.write('</td></tr></table></a></div>\n');

document.write('<div id="ll_01"  style="position:absolute;top:',img_top,';left:',img_l,';width:',img_w,';height:',img_h,';clip:',cp1,'">');
document.write('<a href="javascript:void(0)" onClick="chg(-1)">');
document.write('<table height=',img_h,' width=',img_w,' border=0 cellspacing=0 cellpadding=0><tr><td align=center valign=middle>');
document.write('<img src="',fil[0].src,'" name="ll_1" width=',img_w,' height=',img_h,' border=0 galleryimg="no" alt="">');
document.write('</td></tr></table></a></div>\n');

document.write('<div id="rr_01" style="position:absolute;top:',img_top,';left:',img_l,';width:',img_w,';height:',img_h,';clip:',cp2,'">');
document.write('<a href="javascript:void(0)" onClick="chg(1)">');
document.write('<table height=',img_h,' width=',img_w,' border=0 cellspacing=0 cellpadding=0><tr><td align=center valign=middle>');
document.write('<img src="',fil[0].src,'" name="rr_1" width=',img_w,' height=',img_h,' border=0 galleryimg="no" alt="">');
document.write('</td></tr></table></a></div>\n');
document.write('</div>\n');
document.write('</td></tr></table>\n');
document.write('</td></tr></table>\n');
document.write('<table><form name="book_f"><tr><td>');
if(moji_color==""){moji_color=document.fgColor;}
if(moji_size==""){moji_size=24;}
fc=document.fgColor;
document.write('<input type=text name="com" value="',doc[0],'" style="width:',img_w,';border-width:0;font-size:',moji_size,';background-color:transparent;text-align:center;color:',moji_color,'">');
//document.write('<br><input type=text name="test" value="',doc[0],'" style="width:',img_w,';border-width:0;font-size:',moji_size,';background-color:transparent;text-align:center;color:',moji_color,'">');
c=document.fgColor;if(c==document.bgColor){c=moji_color;}
document.write('</td></tr><tr><td align="right"><img src="http://qpon.quu.cc/cgi-bin/week/count.cgi?book3" 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>');

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


if(page==1){
window.onload=at_start;
}
