// mn-main.js    2005.3.08 // 

bd_style = 0
width_fc = 800 ; height_fc = 600 ; top_fc = 0 ; left_fc = -1
width_fd = 640 ; height_fd = 480 ; top_fd = 0
title_size = 0 ; title_color ="#999999"
tm_h1 = 0 ; tm_w1 = 0
ttop = 1 ; tend = 0

dsp_type = ""
f_dir = "" ; icon_dir = ""
image_mt = ""  ; image_f1 = "" ; image_f2 = "" ; image_f3 = ""
com_pos = 0

bd_width = 0
bd_color ="#667788"
color_p1 = "" ; color_p2 = "" ; color_f1 = "" ;color_f2 = "" ; color_f3 = ""

wname = ""
fname = ""
image_mt = "" 

size_f1 = 0 ; size_f2 = 0 ; size_f3 = 0 ; size_p2 = 0
styl = ""

f_name = new Array()
f_com1 = new Array()
f_com2 = 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"


sc_width = screen.width 
if(sc_width <= 1024){
     sc_height = screen.height
}else{
     sc_height = screen.availHeight
}
xpsp2 = 0
if(window.navigator.userAgent.indexOf("SV1") >= 0){xpsp2 = 54}

if(document.layers){alert("お使いのブラウザでは正しく表示されない場合があります。")}

para1 ="width="+sc_width+",height="+sc_height+",top=0,left=0 ,scrollbars=1,"
chan1 = "channelmode=yes,scrollbars=1,status=1,"

 sw_height = screen.height


function fm(url)
{
    wmn ="fm"
    if(xpsp2 == 0){
         if(sw_height < 768){
               para3 = para1 +"status=0,resizable=0"
         }
         if(sw_height == 768){
               para3 = para1 + "status=0,resizable=0"
         }
         if(sw_height > 768){
                para3 = para1 + "status=0,resizable=1"
         }
    }else{
         if(sw_height < 768){para3 = chan1}
         if(sw_height == 768){para3= chan1}
         if(sw_height > 768){
              para3 = para1 + "status=1,resizable=1"
         }
    }
    swin=window.open(url,wmn,para3)
}


function fn(url)
{
    wmn ="fn"
    if(sc_width < 1024){
         para3 = para1 +"status=0,resizable=0,location=1,"
    }
    if(sc_width == 1024){
         para3 = para1 + "status=1,resizable=0,location=1,"
    }
    if(sc_width > 1024){
         para3 = para1 + "status=1,resizable=1,location=1,"
    }
    swin=window.open(url,wmn,para3)
}



function fp(url,fp_width,fp_height)
{
    wmn ="fp"
    para4 ="width="+fp_width+",height="+fp_height+",top=0,left=0 ,scrollbars=0, status=0,resizable=0,location=0"
    fpwin = window.open(url,wmn,para4)
}


function fa0(url){fm(url)}
function fa1(url){fm(url)}
function fa2(url){fm(url)}
function fa4(url){fm(url)}

function fe(url){
     para3 = "channelmode=yes,status=0,scrollbars=1"
     swin=window.open(url,"fe1",para3)
}

function ff(url){
    para3 = "channelmode=yes,status=0,scrollbars=1,toolbar=1,location=0,directories=0,menubar=1"
    swin=window.open(url,"ff1",para3)
}

tm_no  = new Array()  ; tm_ph  = new Array()  ;  tm_tx  = new Array()
tmk = 0 

function mainThmb(rown, coln, celp)
{
   col_n = coln
   row_n = rown
   cell_p = celp
   
   j= 1
   for(i = 0 ; i < tm.length ; i = i + 1){
        tm_ph[j] = tm[i]
        j++
   }
   s ="<TABLE cellpadding=0 cellspacing=0 border=0 ID='tm_table'><TBODY><TR><TD>"
   s +="<TABLE cellpadding="+cell_p+" cellspacing=0 border=0><TBODY>"
   for(j = 1 ; j <= row_n ; j = j + 1){
        s +="<TR>" 
        for(i = 1 ; i <= col_n ; i = i + 1){
            tmk++
            s += "<TD align=center>"
            s += "<A href=javascript:fm('" + subfile + "?" +tmk+ "') onfocus='this.blur()'>"
            s +="<IMG src="+tm_ph[tmk]+" border=0 ID='tm_small'></A>"
            s +="</TD>"   
        }
        s +="</TR>"
   }
   s +="</TBODY></TABLE></TD></TR></TBODY></TABLE>"
   document.open() ; document.write(s) ; document.close()
}
 


function mnTms()
{
   
   j = 1 , k = 0
   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_ph[j] = tm[i]
        tm_tx[j] = tm[i+1]
        tm_no[j] = j
        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

   s ="<DIV class='tm_table'>"
   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></DIV>"
    }
    document.open() ; document.write(s) ; document.close()
}


function tdnn(nn)
{
    for(i = 1 ; i <= nn ; i = i + 1){
         k++
         s += "<TD align=center valign=top width="+tm_w2+" height="+tm_h2+">"
         if(bd_style < 0){             
             s += "<A href="+subb+"?"+tm_no[k]+"') onfocus='this.blur()'>"
         }else{
             s += "<A href="+subb+"?"+tm_no[k]+"')>"
         }

         if(bd_style < 0){
             s +="<IMG src="+tm_ph[k]+" border=0 class='tm_small'></A>"
         }else{ 
             s +="<IMG src="+tm_ph[k]+" style='"+styl+"'></A>"
         }
         if(title_size > 0){
              s +="<br><font color="+title_color+" size="+title_size+">"+tm_tx[k]+"</font>"
         }
         s +="</TD>"   
    }
}


function tm1_11()
{
    k=1
    if(tm_h1 == 0){tm_h1 = tm_h * 3 + cell_p * 4 + bd_width*4 + title_size*15}
    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=top 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+" border=0 class='tm_large'></A>"
    }else{
         s +="<IMG src="+tm_ph[k]+" width="+tm_w1+" height="+tm_h1+" style='"+styl+"'></A>"
    }
    if(title_size > 0){
         s +="<br><font color="+title_color+" size="+title_size+">"+tm_tx[k]+"</font>"
     }
    s +="</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+ title_size*10}
    if(tm_w1 == 0){tm_w1 = tm_w * 2 + cell_p * 2 + bd_width*2}
    s +="<TR><TD align=center valign=top 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+" border=0 class='tm_large' ></A>"
    }else{
         s +="<IMG src="+tm_ph[k]+" width="+tm_w1+" height="+tm_h1+" style='"+styl+"'></A>"
    }

    if(title_size > 0){
         s +="<br><font color="+title_color+" size="+title_size+">"+tm_tx[k]+"</font>"
    }
    s +="</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>"
}


