// main_mf.js   2004.2.5

wofs = 0         //   ␳


var f_cnt = new Array()
var f_name = new Array()
var f_alt = new Array()
var f_dat = new Array()

function Photo_datas()
{
   for(i = 0 ; i < 6 ; i = i + 1)
   {
       f_dat[i] = fdat[i] 
   }
   
   for(i = 6 ; i < fdat.length - 3 ; i = i + 3)
   {
      p = Math.abs(3 * fdat[i]) + 3
      f_dat[p] = fdat[i] 
      f_dat[p+1] = fdat[i+1]
      f_dat[p+2] = fdat[i+2]
   }
   return(f_dat)
}


var imgs , img 
function fuldsp(ims)
{
    imgs = ims
    photono = Imgno(img)
    if ((fdat[0] == 0)||(fdat[0] == 10))
    {    
         window.open(subfile,"photon","fullscreen=1,scrollbars=1")
    }

    
    if ((fdat[0] == 1)||(fdat[0] == 11))
    {
         window.open(subfile,"photon","channelmode=1,fullscreen=1,scrollbars=1")
    }

    
    if (fdat[0] == 2)
    {   
         wsw = screen.availWidth
         hsh = screen.availHeight
         window.open(subfile,"photon","width="+wsw+",height="+hsh+",scrollbars=1,left=0,top=0")
    }


    if (fdat[0] == 3)
    {
         window.open(subfile,"photon","channelmode=1,scrollbars=1")
    }


    if (fdat[0] == 5)
    {   
         lsw = screen.availWidth - fdat[2] - 20
         window.open(subfile,"photon","width="+fdat[2]+",height="+fdat[3]+",scrollbars=0,left="+lsw+", top=2")
    }

}


function Imgno(img)
{
    img = imgs
    return(img)
}

function chText(text,id) 
{
    if(document.getElementById)
    {
         obj = document.getElementById(id);
         obj.childNodes[0].nodeValue = text;
    }
}


function getBrowserVersion()
{
    str   = navigator.appName.toUpperCase();
    version = 0;
    appVer  = navigator.appVersion;
    if (str.indexOf("NETSCAPE") >= 0)
    {
        s = appVer.indexOf(" ",0);
        version = eval(appVer.substring(0,s));
        if (version >= 5){version++}
    }
    if (str.indexOf("MICROSOFT") >= 0)
    {
        appVer = navigator.userAgent;
        sv = appVer.indexOf("MSIE ",0) + 5;
        ev = appVer.indexOf(";",sv);
        version = eval(appVer.substring(sv,ev));
     }
     return version;
}


function Photo_next()
{
    fend = f_cnt[photo_no]
    photo_no++
    if((fend < 0)||(photo_no > dat_sum)){javascript:close()}
    document.photo_a.src = f_name[photo_no]
    if ((version >= 5)&&(pflg5>0)){chText(f_alt[photo_no],'tx1')}
}


function Photo_back()
{
    photo_no--
    fend = f_cnt[photo_no]
    if((fend <= 0)||(photo_no == 0)){javascript:close()}
    document.photo_a.src = f_name[photo_no]
    if ((version >= 5)&&(pflg5 > 0)){chText(f_alt[photo_no],'tx1')}
}


function Read_pd()
{
f_dat = window.opener.Photo_datas()

   pflg0 = f_dat[0]
   pflg1 = f_dat[1]
   pflg2 = f_dat[2]
   pflg3 = f_dat[3]
   hofs  = f_dat[4]
   pflg5 = f_dat[5]
   var j = 1
   for(i = 6 ; i < f_dat.length ; i = i + 3)
   {
        f_cnt[j] = f_dat[i]
        f_name[j] = f_dat[i+1]+".jpg"
        f_alt[j] = f_dat[i+2]+"@"
        j++
   }
   dat_sum = j-1  
} 


function Sub_mf()
{
   fend = 0
   photo_no = window.opener.Imgno(img)
   
   photo_adrs = f_name[photo_no]
   cmt = f_alt[photo_no]
   
   display_width = screen.width
   display_height = screen.heigth

   if(display_width >= 1024)
   {
       fwh = 1024 - wofs
       fht = 768 - hofs
   } 
   else
   {
       fwh = 800 - wofs
       fht = 600 - hofs
   }

   ntsp = 0
   if(navigator.appName == 'Netscape'){ntsp=1} 
   getBrowserVersion()

   if (ntsp == 1)
   {
       fwh = fwh - 20
       fht = fht - 20
   }

   if (version < 5){fht = fht - 20}
 
   if(pflg1 < 1)
   {
         border1 = border11
         border2 = border12 
         border3 = border13 
         border4 = border14
   }
   else
   {
         border1 = border11
         border2 = Math.ceil(border12 / (pflg1+0.5))
         border3 = Math.ceil(border13 / (pflg1+0.5))
         border4 = border14
   }

   scr = "scroll=no"
   if(display_width < 1024)
   {
       if((pflg2 > 640)||(pflg3>480)){scr = ""}
   }
   
   if(display_width <= 1024)
   {
       link_hposs = (display_width + fwh)/2 - link_hpos 
   }
   else
   {
       link_hposs = display_width/2 + 512 - link_hpos 
   }

   if((ntsp == 1)||(display_width < 1024)){link_hposs = link_hposs - 20}
   if((pflg0 == 1)&&(ntsp == 0)){link_hposs = link_hposs - 80}

   fwh2 = fwh - border2 - border2
   fht2 = fht - border2 - border2
   fwh4 = fwh2 - border3 - border3
   fht4 = fht2 - border3 - border3

   comnt = 0
   if ((version >= 5)&&((pflg2 + pflg3) > 0)){comnt = 1}
   
   if (pflg0 < 2)
   {
      if (pflg5 == 0)
      {
         Dsp_m10()
      }
      else
      {
          Dsp_m0()
      }
   }

   if ((pflg0 == 2)||(pflg0 == 3)){Dsp_m3()}
   if (pflg0 > 3){Dsp_m5()}
   
   document.open()
   document.write(s)
   document.close()
}


function Dsp_m3()
{
   s ="<body background="+mt_image+" bgcolor="+mt_color+" text="+tx_color+" link="+tx_color+" vlink="+tx_color+" alink="+tx_color+ " topmargin=3 marginheight=3 onBlur='focus()'>"
   
   s +="<center><TABLE width='100%' cellspacing=0 cellpadding=0 border=0><TBODY>"
   
   s +="<TR><TD align='right' valign='top'>"
   s +="<font size=3><a href='javascript:Photo_back()' title='back'>&nbsp;"+link_back+"</a>&nbsp;&nbsp;"
   s +="<a href='javascript:close()'>&nbsp;"+link_close+"</a>&nbsp;&nbsp;"
   s +="<a href='javascript:Photo_next()' title='next'>&nbsp;"+link_next+"&nbsp;</a></font>"
   
   
   s +="</TD></TR>"
   s +="<TR><TD align='center' valign='top'>"
   s +="<table cellspacing=5 cellpadding="+border4+" border=0><tbody><tr><td align=center valign=middle bgcolor="+color14+">"
   s +="<a href='javascript:Photo_next()'><IMG SRC = "+f_name[photo_no]+" NAME='photo_a' border=0></a>"
   s +="</td></tr></tbody></table></TD></TR>"
   s +="<TR><TD align='center' valign='top'>"
   if (comnt == 1){s +="<SPAN ID='tx1'>"+f_alt[photo_no]+"</SPAN>"}
   s +="</TD></TR></TBODY></TABLE></center>"
}


function Dsp_m5()
{
   s ="<body background="+mt_image+" bgcolor="+mt_color+" text="+tx_color+" link="+tx_color+" vlink="+tx_color+" alink="+tx_color+ " topmargin=3 marginheight=3 onBlur='focus()'>"
   s +="<center><TABLE width='100%' height='100%'><TBODY>"
   s +="<TR><TD align='right' valign='top'>"
   if(pflg5 > 0)
   { 
      s +="<font size=3><a href='javascript:Photo_back()' title='back'>&nbsp;"+link_back+"</a>&nbsp;&nbsp;"
      s +="<a href='javascript:close()'>&nbsp;"+link_close+"</a>&nbsp;&nbsp;"
      s +="<a href='javascript:Photo_next()' title='next'>&nbsp;"+link_next+"&nbsp;</a></font>"
   }
   s +="<br></TD></TR>"
   s +="<TR><TD align='center' valign='middle'>"
   s +="<table cellspacing=5 cellpadding="+border4+" border=0><tbody><tr><td align=center valign=middle bgcolor="+color14+">"
   if(pflg5 == 0)
   { 
       s +="<a href='javascript:close()'><IMG SRC = "+f_name[photo_no]+" NAME='photo_a' border=0 alt='close'></a>"
   }
   else
   {
       s +="<a href='javascript:Photo_next()'><IMG SRC = "+f_name[photo_no]+" NAME='photo_a' border=0 alt='next'></a>"
   }
   
   s +="</td></tr></tbody></table></TD></TR>"
   s +="<TR><TD align='center' valign='bottom'>"
   if (comnt == 1){
       s +="<SPAN ID='tx1'>"+f_alt[photo_no]+"</SPAN>"
   }
   s +="<br></TD></TR></TBODY></TABLE></center>"
}


function Dsp_m10()
{
   s ="<body bgcolor="+bk_color+" text="+tx_color+" topmargin=0 leftmargin=0 marginheight=0 marginwidth=0 "+scr+">"
   s +="<center><TABLE width="+fwh+" height="+fht+" cellspacing=0 cellpadding=0  bordercolor="+color11+" border="+border1+">"
   s +="<TBODY><TR><TD align='center' valign='middle' bgcolor="+color12+">"
   s +="<table bgcolor="+color13+" width="+fwh2+" height="+fht2+" cellspacing=0  border=0>"
   s +="<tbody><tr><td align=center valign=middle>"
   s +="<table bgcolor="+mt_color+" width="+fwh4+" height="+fht4+" cellspacing=0 cellpadding=0  border=0 background="+mt_image+">"
   s +="<tbody><tr><td align=center valign=middle >"
   if (comnt == 1){s +="@<br>"}
   s +="<table cellspacing=5 cellpadding="+border4+" border=0 >"
   s +="<tbody><tr>\n"
   s +="<td align=center valign=middle bgcolor="+color14+">"
   s +="<a href='javascript:close()'><IMG SRC = "+f_name[photo_no]+" NAME='photo_a' border=0></a>"
   s +="</td></tr></tbody></table>\n"
   if (comnt == 1){s +="<DIV ID='moji'><SPAN ID='tx1'>"+f_alt[photo_no]+"</SPAN></DIV>"}
   s +="</td></tr></tbody></table>"
   s +="</td></tr></tbody></table>"
   s +="</TD></TR></TBODY></TABLE></center>"
}


function Dsp_m0()
{
    s ="<body bgcolor="+bk_color+" text="+tx_color+" link="+link_color+" vlink="+link_color+" alink="+link_color+" topmargin=0 leftmargin=0 marginheight=0 marginwidth=0 "+scr+">"
    s +="<DIV STYLE='position:absolute; top:"+link_vpos+"; left:"+link_hposs+"'>"
    s +="<SPAN STYLE='background:"+link_bg+"'><font size=3>&nbsp;"
    s +="<a href='javascript:Photo_back()' title='back'>&nbsp;"+link_back+"</a>&nbsp;&nbsp;"
    s +="<a href='javascript:close()'>&nbsp;"+link_close+"</a>&nbsp;&nbsp;"
    s +="<a href='javascript:Photo_next()' title='next'>&nbsp;"+link_next+"&nbsp;</a>&nbsp;</font></SPAN></DIV>"
  
  
   s +="<center><TABLE width="+fwh+" height="+fht+" cellspacing=0 cellpadding=0  bordercolor="+color11+" border="+border1+"><TBODY><TR><TD align='center' valign='middle' bgcolor="+color12+">"
  
   s +="<table bgcolor="+color13+" width="+fwh2+" height="+fht2+" cellspacing=0  border=0><tbody><tr><td align=center valign=middle>"
  
   s +="<table bgcolor="+mt_color+" width="+fwh4+" height="+fht4+" cellspacing=0 cellpadding=0  border=0 background="+mt_image+"><tbody><tr><td align=center valign=middle >"
     if (comnt == 1){s +="@<br>"}
  
   s +="<table cellspacing=5 cellpadding="+border4+" border=0><tbody><tr><td align=center valign=middle bgcolor="+color14+">"
   s +="<a href='javascript:Photo_next()'><IMG SRC = "+f_name[photo_no]+" NAME='photo_a' border=0></a>"
  
   s +="</td></tr></tbody></table>\n"
  
   if (comnt == 1){s +="<DIV ID='moji'><SPAN ID='tx1'>"+f_alt[photo_no]+"</SPAN></DIV>"}
  
   s +="</td></tr></tbody></table>"
   
   s +="</td></tr></tbody></table>"
  
   s +="</TD></TR></TBODY></TABLE></center>"
}




function Dspsm1_11()
{
    Photo_datas()
    var s_name = new Array()
    var j = 1
    for(i = 6 ; i < f_dat.length ; i = i + 3)
    {
         s_name[j] = f_dat[i+1]+"s.jpg"
         j++
    }
    
    s ="<TABLE cellpadding="+cell_p+" cellspacing=0 border=0><TBODY>"
    k=1
    s +="<TR><TD rowspan=3 colspan=3>"
    s += "<A href='javascript:fuldsp("+ k +")'>"
    s +="<IMG src="+s_name[k]+" width="+w_sm1+" height="+h_sm1+" border=0></A></TD>"

    for(j = 1 ; j < 4 ; j = j + 1)
    {
        for(i = 1 ; i < 3 ; i = i + 1)
        {
            k++
            s += "<TD><A href='javascript:fuldsp("+ k +")'>"
            s +="<IMG src="+s_name[k]+" width="+w_sm2+" height="+h_sm2+" border=0></A></TD>"
        }
        s +="</TR><TR>"
    }
    for(i = 1 ; i < 6 ; i = i + 1)
    {
        k++
        s += "<TD><A href='javascript:fuldsp("+ k +")'>"
        s +="<IMG src="+s_name[k]+" width="+w_sm2+" height="+h_sm2+" border=0></A></TD>"
    } 
    s +="</TR>"
    s +="</TBODY></TABLE>"

    document.open()
    document.write(s)
    document.close()
}

