d0=sys.split(",");
kami=d0[0]*1;// めくる方式
mekuri=d0[1]*1;//めくる方向
seisi=d0[2]*1;//静止秒
spd=d0[3]*1;//めくり速度
at_flg=d0[4]*1;//自動実行
loop=d0[5]*1;//繰り返し
//
d1=photo.split(",");
img_w=d1[0]*1;//写真の横幅
img_h=d1[1]*1;//写真の縦幅

waku=d1[2]*1;//中心の余白
kage=d1[3]*1;		//写真の枠取りの太さ（消したければ「0」）
kage_color=d1[4];	//写真の枠取りの色
com_size=d1[5];		//文字サイズ 
com_color=d1[6];	//文字色

//イメージの先読み
img_rl=new Array();
img_com=new Array();
for(i=0;i<=n;i++){
if(mekuri==1){j=n-i;}else{j=i;}
img_rl[j]=new Array();
img_com[j]=new Array();

dd=(dt[i]+",,,,").split(",");
img_rl[j][0]=new Image();img_rl[j][0].src=img_url+dd[0];
img_rl[j][1]=new Image();img_rl[j][1].src=img_url+dd[1];
img_com[j][0]=dd[2];img_com[j][1]=dd[3];
}


//wn=0;ww=0;
flg=0;
at="";
if(mekuri==0){mn=0;ss=1;}else{mn=n;ss=-1;}
///開始///
function start(){

if(mekuri==0){mn=0;ss=1;}else{mn=n;ss=-1;}
go();
}
function back(){
ss*=-1;
return false;
}
function chg(){
kami++;kami%=2;
if(flg==1){
clearTimeout(at);

}
flg=0;
go();
}
function go(){
if(flg==1){
clearTimeout(at);
flg=0;
document.getElementById("play_button").value="開　始";
return;
}
flg=1;
document.getElementById("play_button").value="停　止";

document.getElementById("ph01").src=img_rl[mn][0].src;
document.getElementById("ph02").src=img_rl[mn][1].src;
if(kami==0){
sw();
}else{
sw1();
}
return;
}

//  和紙　//
function sw(){
mn+=ss;

if(mn>n){
if(loop==2){
mn=0;
}else{
mn=n-1;ss*=-1;
}
}
if(mn<0){
if(loop==2){
mn=n;
}else{
mn=1;ss*=-1;
}
}
muki=ss*spd;

if(muki<0){ww=0;}else{ww=img_w;}



document.getElementById("ph11").src=img_rl[mn][1].src;
document.getElementById("ph12").src=img_rl[mn][0].src;
document.getElementById("com_l").innerHTML="　";
document.getElementById("com_r").innerHTML="　";


sw_sub();
}
function sw_sub(){
ww-=muki;

if(ww<0 || ww>img_w){

document.getElementById("ph01").src=img_rl[mn][0].src;
document.getElementById("ph02").src=img_rl[mn][1].src;

document.getElementById("page11").style.width=0;
document.getElementById("page12").style.width=0;



document.getElementById("com_l").innerHTML=img_com[mn][0];
document.getElementById("com_r").innerHTML=img_com[mn][1];
if(loop == 0 && (mn==0||mn==n)){go();return;}
clearTimeout(at);
at=setTimeout("sw()",seisi*1000);

return;
}
if(muki<0){
document.getElementById("page11").style.width=ww+waku*2;
document.getElementById("page11").style.left=waku+ww;
document.getElementById("ph11").style.left=(ww-img_w);
document.getElementById("page12").style.width=img_w-(img_w-ww)+kage*2;
document.getElementById("page12").style.left=waku;
document.getElementById("ph12").style.left=0;
}else{
document.getElementById("page12").style.width=img_w-ww+kage*2;
document.getElementById("page12").style.left=(waku+ww)*2+kage*3;
document.getElementById("ph12").style.left=0;
document.getElementById("page11").style.width=img_w-ww+kage*2;
document.getElementById("page11").style.left=waku*2+kage*2+ww+img_w;
document.getElementById("ph11").style.left=ww*-1;

}


at=setTimeout("sw_sub()",10);
}


//    洋紙     //

function sw1(){



muki=ss*spd;

if(muki>0){
ww=0;
document.getElementById("ph11").src=img_rl[mn][1].src;
}else{
document.getElementById("ph11").src=img_rl[mn][0].src;
ww=img_w;
}
mn+=ss;
if(loop==2){
if(mn>n){mn=0;}
if(mn<0){mn=n;}

}else{
if(mn>=n){mn=n;ss*=-1;}
if(mn<=0){mn=0;ss*=-1;}
}
if(muki>0){
ww=0;
document.getElementById("ph02").src=img_rl[mn][1].src;
}else{
document.getElementById("ph01").src=img_rl[mn][0].src;
ww=img_w;
}

document.getElementById("com_l").innerHTML="　";
document.getElementById("com_r").innerHTML="　";

sw_sub1();
return;
}

///////

function sw_sub1(){
ww+=muki;
if(ww<0 || ww>img_w){
clearTimeout(at);
if(muki>0){
ww=img_w;

document.getElementById("ph11").src=img_rl[mn][0].src;
}else{
document.getElementById("ph11").src=img_rl[mn][1].src;
ww=0;

}
sw_sub2();
return;
}
if(muki>0){
document.getElementById("page11").style.left=img_w+waku*2+kage*2;
document.getElementById("page11").style.width=img_w-ww+kage*2;
document.getElementById("ph11").style.width=img_w-ww;
}else{
document.getElementById("page11").style.left=img_w-ww+waku;
document.getElementById("page11").style.width=ww+kage*2;
document.getElementById("ph11").style.width=ww;

}
at=setTimeout("sw_sub1()",10);
}
function sw_sub2(){
ww=ww-muki;
if(ww<0 || ww>img_w){


if(muki>0){
ww=00;
document.getElementById("ph01").src=img_rl[mn][0].src;
}else{
document.getElementById("ph02").src=img_rl[mn][1].src;
ww=img_w;
}
document.getElementById("page11").style.width=0;
document.getElementById("com_l").innerHTML=img_com[mn][0];
document.getElementById("com_r").innerHTML=img_com[mn][1];
if(loop == 0 && (mn==0||mn==n)){go();return;}
clearTimeout(at);
at=setTimeout("sw1()",seisi*1000);

return;
}
if(muki>0){

document.getElementById("page11").style.left=ww+waku;
document.getElementById("page11").style.width=img_w-ww+kage*2;
document.getElementById("ph11").style.width=img_w-ww;
}else{
document.getElementById("page11").style.left=img_w+waku*2+kage*2;
document.getElementById("page11").style.width=ww+kage*2;
document.getElementById("ph11").style.width=ww;

}
at=setTimeout("sw_sub2()",10);
}
v=0;
///////

mn=0;if(mekuri==1){mn=n;}
document.write('<div onClick="go();" onContextmenu="back();return false;" id="page0" style="position:relative;top:0;left:0;width:'+(img_w*2+waku*3+kage*4)+';height:'+(img_h+waku*2+kage*2)+';">');
document.write('<div id="page01" style="position:absolute;top:'+waku+';left:'+(waku)+';width:'+(img_w+kage*2)+';height:'+(img_h+kage*2)+';overflow:hidden;back-ground:#ff0000;border-width:5;border-color:#ff0000;z-index:1">');

document.write('<img id="ph01" style="position:relative;top:0;left:0;border-color:'+kage_color+';" src="'+img_rl[mn][0].src+'" border="'+kage+'" width='+img_w+' height='+img_h+'>');
document.write('</div>');

document.write('<div id="page02" style="position:absolute;top:'+waku+';left:'+(img_w+waku*2+kage*2)+';width:'+(img_w+kage*2)+';height:'+(img_h+kage*2)+';overflow:hidden;back-ground:#ff0000;border-width:5;border-color:#ff0000;z-index:2">');
//document.write('＜div id="page02" style="position:absolute;top:'+waku+';left:'+(img_w+waku*2+kage*2)+';width:'+(img_w+kage*2)+';height:'+(img_h+kage*2)+';overflow:hidden;back-ground:#ff0000;border-width:5;border-color:#ff0000;z-index:2"＞');

document.write('<img id="ph02" style="position:relative;top:0;left:0;border-color:'+kage_color+';" src="'+img_rl[mn][1].src+'" border="'+kage+'" width='+img_w+' height='+img_h+'>');

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

document.write('<div id="page11" style="position:absolute;top:'+waku+';left:'+waku+';width:0;height:'+(img_h+kage*2)+';overflow:hidden;back-ground:#ff0000;border-width:5;border-color:#ff0000;z-index:6">');
document.write('<img id="ph11" style="position:relative;top:0;left:0;border-color:'+kage_color+';" src="" border="'+kage+'" width='+img_w+' height='+img_h+'>');
document.write('</div>');
document.write('<div id="page12" style="position:absolute;top:'+waku+';left:+(img_w+waku*2)+;width:0;height:'+(img_h+kage*2)+';overflow:hidden;back-ground:#ff0000;border-width:5;border-color:#ff0000;z-index:5">');
document.write('<img id="ph12" style="position:relative;top:0;left:0;border-color:'+kage_color+';" src="" border="'+kage+'" width='+img_w+' height='+img_h+'>');
document.write('</div>');
//
document.write('</div>');
document.write('<table border=0 cellpadding=0><tr style="font-size:'+com_size+';color:'+com_color+'"><td align=center id="com_l" width='+(img_w)+'>'+img_com[mn][0]+'</td><td align=center width='+(img_w)+' id="com_r">'+img_com[mn][1]+'</td></tr>');
document.write('<tr><td></td><td align=right><a href="http://www2a.biglobe.ne.jp/~qpon/js/index.htm?http://qpon.quu.cc/java/page/page_b.htm" target="_qpon" title="プログラムソース無料提供中" style="font-size:10;color:'+document.fgColor+'">システム提供：ＱＰＯＮ</a></td></tr></table>');

if(at_flg==1){
document.getElementById("play_button").value="準備中";
setTimeout("go()",5000);
}
