// win-ns.js   2004.12.03  

// サブファイル既定値（修正可）//

com_color = ""               // コメント色
com_size1 = 3                // コメント１行目の文字サイズ
com_size2 = 3                // コメント２行目の文字サイズ
com_pos = 0                  // コメント位置  0 写真の下  1 タイトルバー  2 常に写真の下
com_line= 1                  // コメント行数  0 〜 2  
com_left = 1                 // ２行コメントの右揃え  0 〜 1
com_opa = 50                 // コメント背景透過度 （ｆａ４のみ）

icon_close = "close-ns.gif"  //  Close ボタン画像
icon_next = "next-ns.gif"    //  Next  ボタン画像
icon_back = "back-ns.gif"    //  Back  ボタン画像
icon_last = "last-ns.gif"    //  Last  ボタン画像

icon_vpos = 2                //  ボタン縦位置
icon_hpos = 160              //  ボタン横位置
link_close = "close "        //  Close ボタン title

color_f1 = "#445566"         // フレーム色 外（ｆａ２では境界の線と△）       
color_f2 = "#002233"         // フレーム色 中（ｆａ２では本体部）
color_f3 = "#113344"         // フレーム色 内（ｆａ２ではトラック部） 

photo_pos = 0                // 写真の縦位置  0 〜 99   0 中央
b_style = 2                  // 枠スタイル 
size_p1 = 0                  // 写真の枠幅
color_p1 ="#445566"          // 写真の枠色  
size_p2 = 1                  // 枠と写真間の幅
color_p2 ="#667788"          // 枠と写真間の色  指定無ければマット色 

image_mt = ""                // マット画像    
color_mt = "#445566"         // マット色  スクロールバー色
color_s1 = "#777777"         // スクロールバー境界色 （ｆａ２以外）

pend = 0                     // ループ表示     0 〜 1 
last_photo = 999             // 写真データの分割ポイント
photo_clik = 1               // 写真クリックの有効・無効

f_dir = ""                   // 写真ホルダー
icon_dir = ""                // ボタン画像ホルダー

com_st =" win-ns 4.1203"     // ステータスバー表示文字 （ＩＥのみ有効）


//  以上を修正しサブファイル仕様部に書くと、そちらが優先されます。

//  ｆｃ ｆｄ  メインファイル既定値 （修正可）//

width_fc = 800 ; height_fc = 600 ; top_fc = 0 ; left_fc = 0
width_fd = 640 ; height_fd = 480 ; top_fd = 0


//  以下は修正不可  // 

icon_null = "null-ns.gif"  
last_photo1 = 999 ; last_photo2 = 999 

f_name = new Array()
f_com1 = new Array()
f_com2 = new Array()
f_dat = new Array()
f_next = new Array()
f_back = new Array()

p_style  = new Array()
p_style[0] = "none"
p_style[1] = "hidden"
p_style[2] = "solid"
p_style[3] = "double"
p_style[4] = "groove"
p_style[5] = "ridge"
p_style[6] = "inset"
p_style[7] = "outset"
p_style[8] = "dashed"
p_style[9] = "dotted"

bctr=1
bd_width = 0
bd_color ="#667788"
color_p1 = "" ; color_p2 = "" ; color_f1 = "" ;color_f2 = "" ; color_f3 = ""
fnext = 1  
fname = ""
image_mt = "" 
icon_hp = 20
nctr=1
size_f1 = 0 ; size_f2 = 0 ; size_f3 = 0 ; size_p2 = 0
styl = ""
tm_h1 = 0 ; tm_w1 = 0
ttop = 1  ; tend = 0
version = 0;
wname2 = ""
xpsp2 = 0

sc_width = screen.width 
sc_height = screen.height

strv = navigator.appName.toUpperCase();
appVer  = navigator.appVersion;
if (strv.indexOf("NETSCAPE") >= 0){
    s = appVer.indexOf(" ",0);
    version = eval(appVer.substring(0,s));
    if (version >= 5){version++}
    netscape = 1
}
if (strv.indexOf("MICROSOFT") >= 0){
    appVer = navigator.userAgent;
    sv = appVer.indexOf("MSIE ",0) + 5;
    ev = appVer.indexOf(";",sv);
    version = eval(appVer.substring(sv,ev));
    netscape = 0
}

if(window.navigator.userAgent.indexOf("SV1") >= 0){xpsp2 = 54}


// メインファイル関係 //

function fa(url){alert('ｆａ を ｆａ１ ｆａ２ ｆａ３ ｆａ４に書き換えてください。') ; return}
function fa1(url){fname = "fa1" ; faa(url)}
function fa2(url){fname = "fa2" ; faa(url)}
function fa3(url){fname = "fa3" ; faa(url)}
function fa4(url){fname = "fa4" ; faa(url)}
function fa0(url){fname = "fg0" ; faa(url)}


function faa(url)
{
   if(xpsp2 == 0){
        window.open(url,fname,"width="+sc_width+",height="+sc_height+",top=0,left=0,scrollbars=1,status=1")
   }else{
        window.open(url,fname,"channelmode=yes,scrollbars=1,status=1")
   }
}


function fb(url)
{
   if(xpsp2 == 0){
        window.open(url,"fb1","width="+sc_width+",height="+sc_height+",top=0,left=0,scrollbars=1,status=1")
   }else{
        window.open(url,"fb1","channelmode=yes,scrollbars=1,status=1")
   }
}


function fc(url)
{
   fcc = "fc1_"+width_fc+"_"+height_fc
   window.open(url,fcc,"width="+width_fc+",height="+height_fc+",top="+top_fc+",left="+left_fc+",status=0,scrollbars=0")
}


function fd(url)
{
   left_fd = sc_width - width_fd - 15
   fdd = "fd1_"+width_fd+"_"+height_fd
   window.open(url,fdd,"width="+width_fd+",height="+height_fd+",top="+top_fd+",left="+left_fd+",status=0,scrollbars=0")
}


function fe(url){window.open(url,"fe1","channelmode=yes,status=0,scrollbars=1")}

function ff(url){
    window.open(url,"ff1","channelmode=yes,status=0,scrollbars=1,toolbar=1,location=0,directories=0,menubar=0")
}


tm_no  = new Array()
tm_ph  = new Array()
tm_tx  = new Array()

function tms()
{
   k = 0
   j = 1
   if(tend > 1){   
        fed = tend *2 -1   
   }else{
        fed = tm.length - 1   
   }
   
   tt= ttop*2 - 2
   for(i = tt ; i < fed ; i = i + 2){
        tm_no[j] = tm[i]
        pd0 = tm[i+1]+" "
        pt1 = pd0.indexOf(" ",0)
        tm_ph[j] = pd0.substr(0,pt1) 
        tm_tx[j] = pd0.substr(pt1+2, pd0.length)
        j++
   }
   tm_sum = j-1  
   tm_w2 = tm_w + bd_width*2  
   tm_h2 = tm_h + bd_width*2  
   styl = "border-style:"+p_style[bd_style]+"; border-color:"+bd_color+" ; border-width:"+bd_width+"px "
   subb ="javascript:"+subtype+"('"+subfile

   if(col_n == 0){
        s ="<TABLE cellpadding="+cell_p+" cellspacing=0 border=0><TBODY>"
        if((row_n == 9)||(row_n == 17)||(row_n == 22)){tm1_8()} 
        if((row_n == 12)||(row_n == 16)){tm1_11()} 
   }
   if(col_n > 0){
        s ="<TABLE cellpadding="+cell_p+" cellspacing=0 border=0 ><TBODY>"
        for(j = 1 ; j <= row_n ; j = j + 1){
             s +="<TR>" ; tdnn(col_n) ; s +="</TR>"
        }
        s +="</TBODY></TABLE>"
    }
    document.open() ; document.write(s) ; document.close()
}


function tdnn(nn)
{
    for(i = 1 ; i <= nn ; i = i + 1){
         k++
         s += "<TD align=center valign=middle width="+tm_w2+" height="+tm_h2+"><A href="+subb+"?"+tm_no[k]+"')>"
         if(bd_style < 0){
             s +="<IMG src="+tm_ph[k]+" title='"+tm_tx[k]+"' border=0 class='tm_small'>"
         }else{ 
             s +="<IMG src="+tm_ph[k]+" style='"+styl+"' title='"+tm_tx[k]+"'>"
         }
         s +="</A></TD>"
    }
}


function tm1_11()
{
    k=1
    if(tm_h1 == 0){tm_h1 = tm_h * 3 + cell_p * 4 + bd_width*4}
    if(tm_w1 == 0){tm_w1 = tm_w * 3 + cell_p * 4 + bd_width*4}
    subb="javascript:"+subtype+"('"+subfile
    s +="<TR><TD align=center valign=middle rowspan=3 colspan=3><A href="+subb+"?"+tm_no[k]+"') onfocus='this.blur()'>"
    if(bd_style < 0){
         s +="<IMG src="+tm_ph[k]+" width="+tm_w1+" height="+tm_h1+" title='"+tm_tx[k]+"' border=0 class='tm_large'>"
    }else{
         s +="<IMG src="+tm_ph[k]+" width="+tm_w1+" height="+tm_h1+" style='"+styl+"' title='"+tm_tx[k]+"'>"
    }
    s +="</A></TD>"

    for(j = 1 ; j < 4 ; j = j + 1){
        if(row_n == 16){tdnn(3)}else{tdnn(2)}
        s +="</TR><TR>"
    }
    if(row_n == 16){tdnn(6)}else{tdnn(5)}
    s +="</TR></TBODY></TABLE>"
}


function tm1_8()
{
    k=1
    if(tm_h1 == 0){tm_h1 = tm_h * 2 + cell_p * 2 + bd_width*2}
    if(tm_w1 == 0){tm_w1 = tm_w * 2 + cell_p * 2 + bd_width*2}
    s +="<TR><TD align=center valign=middle rowspan=2 colspan=2><A href="+subb+"?"+tm_no[k]+"') onfocus='this.blur()'>"
    if(bd_style < 0){
         s +="<IMG src="+tm_ph[k]+" width="+tm_w1+" height="+tm_h1+" title='"+tm_tx[k]+"' border=0 class='tm_large' >"
    }else{
         s +="<IMG src="+tm_ph[k]+" width="+tm_w1+" height="+tm_h1+" style='"+styl+"' title='"+tm_tx[k]+"'>"
    }
    s +="</A></TD>"

    for(j = 1 ; j < 3 ; j = j + 1){
        if((row_n == 17)||(row_n == 22)){ 
             tdnn(3)
        }else{
             tdnn(2)
        }
        s +="</TR><TR>"
    }
    if(row_n == 22){
        tdnn(5)
        s +="</TR><TR>"
        tdnn(5)
        s +="</TR><TR>"
        tdnn(5)
    }
    if(row_n == 17){
         tdnn(5)
         s +="</TR><TR>"
         tdnn(5)
    }
    if(row_n == 9){
         tdnn(4)
    }
    s +="</TR></TBODY></TABLE>"
}


// スクロールバー制御    ０: 無し    ３: ３色指定    他： １色指定  //

function Scr_color(s_color) 
{
   sc ="<style type='TEXT/CSS'>"
   if(s_color == "0"){
        if(sc_width >=1024){
            sc +=" BODY{overflow : hidden};"
        }
   }else{
        if(s_color != '3'){color_s1 = "#777777" ; color_s2 = s_color ;  color_s3 = s_color}
        sc +="BODY{"
        sc +="scrollbar-base-color:"+color_s2+";"
        sc +="scrollbar-darkshadow-color:"+color_s2+";"
        sc +="scrollbar-face-color:"+color_s2+";"
        sc +="scrollbar-arrow-color:"+color_s1+";"
        sc +="scrollbar-highlight-color:"+color_s1+";"
        sc +="scrollbar-3dlight-color:"+color_s3+";"
        sc +="scrollbar-track-color:"+color_s3+";"
        sc +="scrollbar-shadow-color:"+color_s3+"};"
   }
   sc +="</style>"
   document.open() ; document.write(sc) ; document.close()
}


// サブファイル関係 //

function Dsp_c0()
{
    if((version < 5)&&(netscape == 1)){alert('お使いのプラウザでは表示が正常で無い場合があります。')}
    wname1 = window.name 
    wname2 = wname1.substr(0,2) 
    if(wname2 == ""){wname2 ='fg0'}

    if((wname1 == 'fa2')||(wname1 == 'fg0')){
         if(wname1 == 'fa2'){   
              color_s1 = color_f1 ; color_s2 = color_f2 ; color_s3 = color_f3
              Scr_color("3")
         }
         if(wname1 == 'fg0'){   
              Scr_color(color_mt)
         }
    }else{
         Scr_color("0")
    }
  
    ssc ='<style type="TEXT/CSS">'
    ssc +=".sub43{background-color:"+color_f3+" ; filter:Alpha(opacity="+ com_opa+")}"
    ssc +=".sty{border-style:"+p_style[b_style]+"; border-color:"+color_p1+"; border-width:"+size_p1+"px}"
    ssc +='}</style>'
    document.open() ; document.write(ssc) ; document.close()

    
    if((wname2 == 'fa')||(wname2 == 'fb')||(wname2 == 'fg')){
        if(xpsp2 == 0){moveTo(0,0) ; resizeTo(sc_width,sc_height)}
        document.write("<BODY topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>")
    }

    if((wname2 == 'fc')||(wname2 == 'fd')){
        document.write("<BODY topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 onBlur=focus()>")
    }
}


function Dsp_c1()
{
    icon_close = icon_dir + icon_close
    icon_null = icon_dir + icon_null
    f_next[0] = icon_dir + icon_last
    f_back[0] = f_next[0]
    f_next[1] = icon_dir + icon_next
    f_back[1] = icon_dir + icon_back

    wname = window.name 
    wname1 = wname.substr(0,3) 
    wname2 = wname.substr(0,2) 
    if(wname == ""){wname2 ='fg'}
    str1 = location.search
    if(str1.length == 0){str1 = '?1'}
    stp = str1.indexOf('&',0)
    if(stp < 0){
         str2=str1
         photo_no = str2.substring(1,str2.length)
         top_photo = 1
    }else{ 
         str2 = str1.substr(0,stp)
         str3 = str1.substr(stp+1,str1.length)
         photo_no = str2.substring(1,str2.length)
         last_photo = eval(str3) 
         top_photo = photo_no
         if(last_photo == top_photo){fnext = 0}
    }

    com_st = com_st + "　　　　　"+wname1

    Read_pd()
    if(str2.length < 2){photo_no = 1}
    if(photo_no == 0){fnext = 0}
    if(photo_no == 1){bctr=0}
    if(photo_no == dat_sum){nctr=0}

    if(com_pos == 3){
        com_pos = 0
    }else{
        if((sc_width < 1024)&&(wname2 == "fa")){com_pos = 1}
        if((sc_width < 1024)&&(wname2 == "fg")){com_pos = 1}
    }

    status = com_st
    s = ""
    if(wname2 == 'fa'){  
         if(sc_width <= 1024){
             icon_hp = sc_width - icon_hpos -20
         }else{
             icon_hp = sc_width - icon_hpos 
         }
         icon_hp2 = icon_hp + 45 ; icon_hp3 = icon_hp + 90
         if(wname1 == 'fa1'){Sub_mode11()}
         if(wname1 == 'fa2'){Sub_mode21()}
         if(wname1 == 'fa3'){Sub_mode31()}
         if(wname1 == 'fa4'){Sub_mode41()}
    }else{
         if(wname2 == "fg"){
              Sub_mode01()
         }else{
              Sub_fbfe1()
         }
    }
    document.open() ; document.write(s) ; document.close()
}


function Dsp_c2()
{
    if(photo_no == 0){return}
    s = ""
    if(photo_pos > 0){s +="<img src="+icon_null+" height="+photo_pos+" width=8><br>"}
    if(color_p2 == ""){color_p2 = color_mt}  
    if(b_style < 0){
         s +="<Table cellspacing=0 border=0 cellpadding=0>"
    }else{   
         s +="<Table bgcolor="+color_p2+" cellspacing=0 border=0 cellpadding="+size_p2+" class='sty'>"
    }
    s +="<Tbody><Tr><Td align=center valign=middle>"
    if(fnext > 0){
           if (version >= 5){
                if((b_style < 0)){ 
                     s +="<img src = "+f_name[photo_no]+" NAME='photo_a' onClick='Photo_next()' class='p_class'>"
                }else{ 
                     s +="<img src = "+f_name[photo_no]+" NAME='photo_a' onClick='Photo_next()'>"
                }
           }else{
                s +="<a href='javascript:Photo_next()'>"
                s +="<IMG SRC = "+f_name[photo_no]+" NAME='photo_a' border=0></a>"
          }
     }else{
          s +="<a href='javascript:close()'>"
          s +="<img src = "+f_name[photo_no]+" NAME='photo_a' border=0 class='p_class'></a>"
    }
    s +="</Td></Tr></Tbody></Table>"
    if(wname1 != 'fa4'){Dsp_com()}
    document.open() ; document.write(s) ; document.close()
}


function Dsp_c3()
{
    s = ""
    if(wname2 == 'fa'){
        if(wname1 == 'fa1'){Sub_mode13()}
        if(wname1 == 'fa2'){Sub_mode23()}
        if(wname1 == 'fa3'){Sub_mode33()}
        if(wname1 == 'fa4'){Sub_mode43()}
    }else{
        if(wname2 == "fg"){
             Sub_mode03()
        }else{
             Sub_fbfe3()
        }
    }
    document.open() ; document.write(s) ; document.close()
}


// ｆａ１ //

function Sub_mode11()
{
    if(sc_width >= 1024){
         tb_1w = sc_width - 4 ; tb_1h = sc_height - 48
    }else{
          tb_1w = 770  ; tb_1h = 550
    }

    tb_2w = tb_1w - size_f1 - size_f1
    tb_2h = tb_1h - size_f1 - size_f1
    tb_3w = tb_2w - size_f2 - size_f2
    tb_3h = tb_2h - size_f2 - size_f2
    tb_4w = tb_3w - size_f3 - size_f3
    tb_4h = tb_3h - size_f3 - size_f3

    s =""
    Dsp_icon()
    s +="<TABLE width="+tb_1w+" height="+tb_1h+" bgcolor="+color_f1+" cellspacing=0 cellpadding=0 border=0>"
    s +="<TBODY><TR><TD align='center' valign=middle >"

    s +="<TABLE width="+tb_2w+" height="+tb_2h+" cellspacing=0 cellpadding=0 border=0>"
    s +="<TBODY><TR><TD nowrap align='center' valign=middle bgcolor="+color_f2+">"

    s +="<TABLE width="+tb_3w+" height="+tb_3h+" cellspacing=0 cellpadding=0 border=0>"
    s +="<TBODY><TR><TD nowrap align='center' valign=middle bgcolor="+color_f3+">"

    s +="<TABLE width="+tb_4w+" height="+tb_4h+" bgcolor="+color_mt+" background="+image_mt+" cellspacing=0 cellpadding=0 border=0><TBODY>"
    if(photo_pos == 0){
         s +="<TR><TD align=center valign=middle>"
         if((com_line > 0)&&(com_pos == 0)){s +="　<BR>"}
    }else{
         s +="<TR><TD align=center valign=top>"
    }
}


function Sub_mode13()
{
    for(i = 0 ; i<4 ; i=i+1){
        s +="<TD></TR></TBODY></TABLE>"
    }
}


// ｆａ２ //

function Sub_mode21()
{
    if(sc_width > 1024){tb_1w = sc_width ; tb_1h = sc_height - 40}
    if(sc_width == 1024){tb_1w = sc_width - 10; tb_1h = sc_height - 40}
    if(sc_width < 1024){tb_1w = 785 ; tb_1h = 550}
 
    tb_2w = tb_1w - 4
    tb_2h = tb_1h - 4
    tb_3w = tb_1w - 40
    tb_3h = tb_1h - 40
 
    Dsp_icon()
    s +="<TABLE width="+tb_1w+" height="+tb_1h+" cellspacing=0 cellpadding=0 border=0><TBODY><TR><TD>"
    s +="<Table width="+tb_2w+" height="+tb_2h+" cellspacing=0 cellpadding=0 border=1 bordercolor="+color_f1+" FRAME=VOID>"
    s +="<Tbody><Tr><Td nowrap width=15 height=15 bgcolor="+color_f2+"><img src="+icon_null+" width=8 height=8></Td>"
    s +="<Td nowrap align=left valign=middle bgcolor="+color_f2+"><img src="+icon_null+" width=8 height=8></Td>"
    if(sc_width > 1024){s +="<Td nowrap width=15 bgcolor="+color_f2+"><img src="+icon_null+" width=8 height=8></Td>"}

    s +="</Tr><Tr><Td nowrap bgcolor="+color_f2+"><img src="+icon_null+" width=8 height=8></Td>"
    s +="<Td nowrap align=center " 
    if(photo_pos == 0){ 
         s +=" valign=middle bgcolor="+color_mt+" background="+image_mt+">" 
    }else{
         s +="  valign=top bgcolor="+color_mt+" background="+image_mt+">"
    }
} 


function Sub_mode23()
{
   s ="</Td>"
   if(sc_width > 1024){s +="<Td  nowrap  bgcolor="+color_f2+"><img src="+icon_null+" width=8 height=8></Td>"}
   s +="</Tr>"
   if(sc_width > 1024){
        s +="<Tr><Td nowrap height=15 bgcolor="+color_f2+"><img src="+icon_null+" width=8 height=8></Td>"
        s +="<Td nowrap bgcolor="+color_f2+"><img src="+icon_null+" width=8 height=8></Td>"
        s +="<Td nowrap  bgcolor="+color_f2+"><img src="+icon_null+" width=8 height=8></Td></Tr>"
   }
   s +="</Tbody></Table>"
   s +="</TD></TR></TBODY></TABLE>"
}


// ｆａ３ //

function Sub_mode31()
{
    tb_1w = 1020
    tb_1h = 720
    Dsp_icon()
    if(sc_width > 1024){s +="<BR><BR>"}
    s +="<TABLE width="+tb_1w+" height="+tb_1h+" bgcolor="+color_mt+" background="+image_mt+" cellspacing=0 cellpadding=0 border=0><TBODY>"
    if(photo_pos == 0){
         s +="<TR><TD align=center valign=middle>"
         if((com_line > 0)&&(com_pos == 0)){s +="　<BR>"}
    }else{
         s +="<TR><TD align=center valign=top>"
    }
}


function Sub_mode33()
{
   s +="<TD></TR></TBODY></TABLE>"
}


// ｆａ４ //

function Sub_mode41()
{
    if(sc_width >= 1024){
        tb_1w = sc_width - 4 ; tb_1h = sc_height - 48
    }else{
        tb_1w = 770  ; tb_1h = 550
        com_pos = 1
    }
    tb_2h = tb_1h  - size_f3 
    tb_3h = tb_1h -  size_f3 - size_f2

    Dsp_icon()
    s +="<TABLE height="+tb_2h+" width="+tb_1w+" cellspacing=0 cellpadding=0 border=0>"
    s +="<TBODY><TR>"
    if(photo_pos == 0){
        s +="<TD nowrap align=center valign=middle bgcolor="+color_mt+" background="+image_mt+">"
    }else{
        s +="<TD nowrap align=center valign=top bgcolor="+color_mt+" background="+image_mt+">"
    }
}


function Sub_mode43()
{
   s +="</TD></TR></TBODY></TABLE>"
   if(com_pos == 0){
       s +="<DIV STYLE='position:absolute; top:"+tb_3h+"; left:0 ; z-index:0 ;'>"
       s +="<TABLE height=100 cellspacing=0 cellpadding=0 border=0 width ="+tb_1w+" class='sub43'>"
       s +="<TBODY><TR><TD height="+size_f2+" bgcolor="+color_f2+"></TD></TR>"
       s +="<TR><TD nowrap align=center valign=top><BR></TD></TR></TBODY></TABLE>"
       s +="</DIV>"

       s +="<DIV STYLE='position:absolute; top:"+tb_3h+"; left:0 ; z-index:3 ;'>"
       s +="<TABLE height=100 width ="+tb_1w+" cellpadding=5  cellspacing=0 border=0 >"
       s +="<TBODY><TR><TD nowrap align=center valign=top>"
       Dsp_com()
       s +="</TD></TR></TBODY></TABLE>"
       s +="</DIV>"
   }
}


// ｆａ０ //

function Sub_mode01()
{
    tb_1w = sc_width - 30
    tb_1h = sc_height - 20

    icon_hp = tb_1w - icon_hpos
    s +="<TABLE height="+tb_1h+" width="+tb_1w+" bgcolor="+color_mt+" background="+image_mt+" cellspacing=0 cellpadding=0 border=0>"
    s +="<TBODY>"
    s +="<TR><TD align=right valign=top>"
    Dsp_icon2()
    s +="</TD></TR>"
 
    if(photo_pos == 0){
        s +="<TR><TD align=center valign=middle>"
    }else{
        s +="<TR><TD align=center valign=top>"
    }
}


function Sub_mode03()
{s +="<BR><BR></TD></TR></TBODY></TABLE>"}


// ｆｂ−ｆｅ //

function Sub_fbfe1()
{
    tb_1w = 800 ;  tb_1h = 600
    if(wname1 == 'fb1'){
         tb_1w = sc_width - 8
         tb_1h = sc_height - 50
    }

    if((wname1 == 'fc1')||(wname1 == 'fd1')){
         tb_1w = wname.substr(4,3)
         tb_1h = wname.substr(8,3)
    }
    icon_hp = tb_1w - icon_hpos
    if(wname1 != 'fg0'){Dsp_icon()}

    s +="<TABLE height="+tb_1h+" width="+tb_1w+" bgcolor="+color_mt+" background="+image_mt+" cellspacing=0 cellpadding=0 border=0>"
    s +="<TBODY>"
    if(wname1 == 'fg0'){
         s +="<TR><TD align=right valign=top>"
         Dsp_icon2()
         s +="</TD></TR>"
    } 
    if(photo_pos == 0){
        s +="<TR><TD align=center valign=middle>"
    }else{
        s +="<TR><TD align=center valign=top>"
    }
}


function Sub_fbfe3()
{
   if(wname1 == 'fg0'){s +="<BR><BR>"}
   s +="</TD></TR></TBODY></TABLE>"
}


function Dsp_com()
{
    if(com_line > 0){
         if(com_pos == 0){ 
              s +="<DIV align=left>"
              s +="<TABLE width=100%  cellspacing=0 cellpadding=0 border=0>"
              s +="<TBODY><TR><TD align=center>"
              s +="<table cellpadding=3 cellspacing=0 border=0><tbody><tr>"
              if(com_left == 1){
                   s +="<td align=left valign=top>"
              }else{
                  s +="<td align=center valign=top>"
              }

              if(com_color != ""){s +="<FONT color="+com_color+">"}
               s +="<FONT size="+com_size1+"><SPAN ID='tx1'>"+f_com1[photo_no]+"</SPAN></FONT>"
              if(com_line > 1){
                    s +="<BR><FONT size="+com_size2+"><SPAN ID='tx2'>"+f_com2[photo_no]+"</SPAN></FONT>"
              }
              if(com_color != ""){s +="</FONT>"}

              s +="</td></tr></tbody></table>"
              s +="</TD></TR></TBODY></TABLE>"
              s +="</DIV>"
         }else{
              if(com_line == 1){
                   document.title = "　　　"+f_com1[photo_no]+"　　　　　　"
              }else{
                   document.title = "　　"+f_com1[photo_no]+"　"+f_com2[photo_no]+"　　"
              }
         }
    }
}


function Read_pd()
{
   j = 1
   k = 1
   fpd = f_dat.length - 2   
   if(com_line >1){k = 2}
   for(i = 0 ; i < fpd ; i = i + k){
        pd0 = f_dat[i]
        pt1 = pd0.indexOf(" ",0)
        if(pt1 == -1){pt1 = pd0.length}
        if(f_dir == ""){
            f_name[j] = pd0.substr(0,pt1) 
        }else{
            dir2 = (f_dir.substr(f_dir.length-1,1))
            if(dir2 !="/"){f_dir=f_dir+"/"} 
            f_name[j] = f_dir + pd0.substr(0,pt1) 
        }
        f_com1[j] = "　"+ pd0.substr(pt1+2, pd0.length)
        if(com_line > 1){f_com2[j] = "　"+ f_dat[i+1]}
        j++
   }
   dat_sum = j-1  
}


function Dsp_icon()   
{
    s = "<DIV STYLE='position:absolute; top:"+icon_vpos+"; left:"+icon_hp+" ; z-index:1 ;'>"
    Dsp_icon2()
    s +="</DIV>"
}


function Dsp_icon2()   
{
    s +="<TABLE cellpadding=2 cellspacing=0 border=0 >"
    s +="<TBODY><TR><TD nowrap align=center valign=middle>"
         if(fnext == 1){
             s +="<a href='javascript:Photo_back()' onfocus='this.blur()'>"
             s +="<img src="+f_back[bctr]+" border=0 NAME='icon_b' class='icon'></a>"
             s +="<img src="+icon_null+" width=10 border=0>"
         }
    s +="<a href='javascript:close()' onfocus='this.blur()'>"
    s +="<img src="+icon_close+" border=0 NAME='icon_c' class='icon' title="+link_close+">"
    if(fnext == 1){
         s +="<img src="+icon_null+" width=10 border=0>"
         s +="<a href='javascript:Photo_next()' onfocus='this.blur()'>"
         s +="<img src="+f_next[nctr]+" border=0 NAME='icon_n' class='icon'></a></TD>"
     }
     s +="</TR></TBODY></TABLE>"
}


function Photo_next()
{
    photo_no++
    if(photo_no == dat_sum){nctr = 0} 
    bctr = 1
    document.icon_b.src = f_back[bctr]
    document.icon_n.src = f_next[nctr]
    if((photo_no > dat_sum)||(photo_no == last_photo+1)||(photo_no == last_photo1+1)||(photo_no == last_photo2+1)){
        if(pend == 0){ 
            javascript:close()
        }else{
            photo_no=1 
        }
    }
    Next_back()
}


function Photo_back()
{
    photo_no--
    if(photo_no == 1){
        bctr = 0
        document.icon_b.src = f_back[bctr]
    }
    if(photo_no < dat_sum){
        nctr = 1
        document.icon_n.src = f_next[nctr]
    }
    if((photo_no == 0)||(photo_no < top_photo)||(photo_no == last_photo)||(photo_no == last_photo1)){
       javascript:close()
    }
    Next_back()
}


function Next_back() 
{
    document.photo_a.src = f_name[photo_no]
    if(com_line > 0){
         if(com_pos == 0){
              chText(f_com1[photo_no],'tx1')
              if(com_line > 1){chText(f_com2[photo_no],'tx2')}
         }else{
              document.title = "　　　"+f_com1[photo_no]+"　　　　　　"
         }
    }
}


function chText(text,id) 
{
    if(document.getElementById){
        obj = document.getElementById(id);
        obj.childNodes[0].nodeValue = text;
    }
}
