/*
メニュースクリプト「muginavi」
ver3.32.040404.2240
Copyright 2001-2004 Mugi
mail:mugi@mugi.cc
site:http://mugi.cc/
*/

var ua=navigator.userAgent
var op=!!window.opera
var nn=!op&&(navigator.appName+navigator.appVersion.charAt(0))=="Netscape4"
var saf=ua.indexOf("Safari")!=-1
var gk=ua.indexOf("Gecko")!=-1&&ua.indexOf("rv:")!=-1||saf
var moz1=gk&&ua.indexOf("rv:1.")!=-1
var ie=!op&&!!document.all
var macie=ie&&navigator.platform=="MacPPC"
var ie4=ie&&ua.indexOf("MSIE 4.")!=-1
if(ie4)document.getElementById=function(id){return document.all(id)}
var dom1=(ie||gk||op)
var o6=op&&ua.match(/Opera.6/)!=null
op=op&&!!document.createTextNode
var _table="<table cellpadding=0 cellspacing=0 border=0",_F=0
function _jssbg(a){return document.ids[a.id].backgroundColor||null}
muginavi={
version:3.32,layer:null,html:"",rootmenu:"",root:true,opened:[],hover:null,sw:null,lay:[],_:[],_p:[],_mo:[],_md:[],xy:{},
stretch:false,root_noborder:false,root_nospace:false,root_noarrow:false,align:"left",offset:0,hilight:nn?null:"",txthilight:"",borderColor:"#000000",borderWidth:1,borderStyle:"solid",arrowMark:"&gt;&gt;",arrowColor:"#000000",usetable:false,nowrap:false,imgmode:false,clickopen:false,
add:function(id,txt,url,tgt){
if(!this._[id]){
this._[id]=1
var sp=(this.imgmode||this.root&&this.root_nospace?'':'&nbsp;'),hr=false,br=(!this.root||this.vertical),tag=(ie?'span':'td'),show="muginavi.showsubmenu('"+id+"',muginavi.opened.length)",opt='',clk='',md=' onmousedown=eval(muginavi._md["'+id+'"]);event.cancelBubble=!muginavi.clickopen'
if(url){
var a=url.split("##")
for(var i=1,e,c,x;i<a.length;i++){
x=a[i].indexOf("=")
e=a[i].substring(0,x)
c=a[i].substring(x+1)
if(e.match(/onclick/i))clk=c+';'
else
if(e.match(/onmouse(over|down)/i))this['_m'+e.charAt(7).toLowerCase()][id]='if(ie&&!event)event=window.event;'+c
else
opt+=e+'="'+c+'" '
}
url=a[0]
}
if(nn)show="if(!_F){_F=1;eval(muginavi._mo['"+id+"']);"+show+";_F=0}"
if(txt=="-"){
txt=(nn?'<layer clip=4,0,5,1>':'')+'<hr align=left noshade size=1 '+(nn?'width=100%></layer>':' style=width:1;margin-left:2;margin-right:2>')
hr=true
}else{
if(url&&url!="-")
txt='<a '+(nn?'onmouseover='+show+' '+opt:'')+md+' onclick="'+clk+'muginavi.hideall();return true" href="'+url+'"'+(tgt?' target="'+tgt+'"':'')+'>'+txt+'</a>'
else
if(url=="-"){
if(nn)txt+='<layer id=noaction left=0 top=0 onmouseover="var o=this;do{o=o.parentLayer}while(!o.id.match(/^(muginavisub|muginaviparent)/));muginavi.hide(o);muginavi.chcolor(null,o)"></layer>'
}else
txt='<a href=nolink onmouseover="'+(nn?show+';':'')+'status=\'\';return true"'+md+' onclick="'+clk+'if('+this.root+'&&muginavi.clickopen){muginavi.showsubmenu(\''+id+'\',1);if(this.blur)this.blur()};return false">'+txt+'</a>'
if(br&&dom1)txt+='<span id=arw class=mnarw style="'+(this.imgmode||this.root&&this.root_noarrow?'display:none':'visibility:hidden')+';position:relative;">'+this.arrowMark+'</span>'
txt='<nobr>'+sp+txt+sp+'</nobr>'
if(url!="-"&&nn&&this.txthilight)txt+='<layer id=$ left=0 visibility=hide>'+txt.replace(/">/,'"><font color='+this.txthilight+'>').replace(/<\/a/,'</font></a')+'</layer>'
}
this.html+=(nn?'<ilayer'+(this.root&&this.usetable&&this.vertical?' width=100%':''):(br&&(gk||op||o6)?'<tr>':'')+'<'+tag+' '+opt+'style=text-align:left;cursor:'+(url=='-'||hr?'default':ie?'hand':'pointer')+';width:'+((gk||op||macie)&&!this.root||this.usetable&&(gk||op||ie&&this.vertical)?'100%':ie?'1':'0')+';height:0')+' id="'+id+'" class=muginavi>'+txt+(nn?'</ilayer>':'</'+tag+'>')+(br?gk||op||o6?'</tr>':'<br>':'')
}},
rootitems:function(){
status="Creating menu"
if(!this.borderColorSub)this.borderColorSub=this.borderColor
if(this.pos){this.pos=eval('['+this.pos+']');if(this.stretch)this.pos[0]=0;this.usetable=false}
if(this.vertical)this.stretch=false
document.write(
'<style type="text/css">\n'
+'.muginavioff{display:none}\n'
+'.muginavi a,.muginavi a:hover{background-color:transparent}\n'
+'div.muginavi,div.muginavisub{position:absolute;left:0;top:0;visibility:hidden;}\n'
+'.muginavi-nn{position:absolute}\n'
+'.mnarw{top:-0.5ex;font-size:8px;color:'+this.arrowColor+';'+(this.arrowCSS||'')+'}\n'
+(this.root_noborder?'':'#muginaviborder{border:'+this.borderWidth+'px '+this.borderStyle+' '+this.borderColor+'}\n')
+(nn&&!this.imgmode?'.muginavi{padding-top:1px}\n':'')
+'</style>'
)
this.rootmenu+=(nn?(this.pos?'<layer left='+this.pos[0]+' top='+this.pos[1]:(this.usetable?'':_table+' width=100%><tr><td'+(this.nowrap?' nowrap>':'>'))+'<ilayer')+(this.pos&&!this.stretch?'':' width='+(this.vertical?'0':'100%')):'<div style="'+(ie4&&this.usetable?'width:100%;':!this.usetable&&this.vertical?'width:'+(ie4?1:0)+';':'')+'z-index:100;'+(this.pos?'position:absolute;left:'+this.pos[0]+';top:'+this.pos[1]+'"':'" align='+this.align))+' id=muginaviparent>'+(nn?'<div class=muginavi-nn>'+(this.pos&&this.nowrap?_table+'><tr><td nowrap>':''):_table+(this.usetable&&this.vertical||this.stretch?' width=100%':'')+' id=muginaviborder><tr><td id=muginaviroot class=muginavi'+(this.nowrap?' nowrap':'')+(this.stretch?' align='+this.align:'')+'>'+(gk||op||o6?_table+'><tr>':''))
},
rootend:function(){
this.rootmenu=this.rootmenu.replace(/<br>$/,'')+this.html+(nn?'<spacer type=block width=1 height=1>'+(this.pos&&this.nowrap?'</td></tr></table>':'')+'</div>'+(this.pos?'</layer>':'</ilayer>'+(this.usetable?'':'</td></tr></table>')):(gk||op||o6?'</tr></table>':'')+'</td></tr></table></div>')
this.root=false
this.html=""
},
makesubmenu:function(id,x,y){
if(!this._p[id]){
this._p[id]=1
this.html+=('<div id="muginavisub-'+id+'" class=muginavi'+(!nn?'sub style="z-index:200;top:-10000;border:'+this.borderWidth+'px '+this.borderStyle+' '+this.borderColorSub+(ie?';width:'+(this.borderWidth*2+1):op?';width:100%':'')+'"':'')+'>'+(gk||op||o6?_table+'>':''))
if(x||y)this.xy["muginavisub-"+id]=[x,y]
}},
submenuend:function(){
this.html=this.html.replace(/<br>$/,'')+((gk||op||o6?'</table>':nn?'<spacer type=block width=1 height=1>':'')+'</div>')
document.write(this.html)
this.html=""
},
showhere:function(){
document.write(this.html)
document.write(this.rootmenu)
delete this.html
delete this.rootmenu
delete this.root
delete this._
if(ie&&!(ie4||macie||this.usetable||this.noIE5fastload))this.init()
},
chcolor:function(s,p){
var id=this.hover||""
while(1){
var lay=this.getLayer(id)
if(!lay)break
var par=this.getParent(lay)
if(lay.id==p.id.replace("muginavisub-","")||par.id=="muginaviparent")break
if(dom1){
var a=(ie4?lay.all.tags('A'):lay.getElementsByTagName('A'))[0]
a.style.color=lay._opc||""
lay.style.backgroundColor=lay._opb||""
}else
if(nn){
if(this.txthilight)lay.layers.$.visibility='hide'
lay.bgColor=_jssbg(lay)
}
eval(this.afterrestore)
this.hover=id=par.id.replace("muginavisub-","")
}
if(s){
if(dom1){
var a=(ie4?s.all.tags("A"):s.getElementsByTagName("A"))[0]
if(o6){
if(!s._opc)s._opc=a.style.color
if(!s._opb){var e=s;while(e&&!e.style.background)e=e.parentNode;if(!e.style.backgroundImage)s._opb=e.style.background}
}
a.style.color=this.txthilight
if(!o6||s._opb)
s.style.backgroundColor=this.hilight
}else
if(nn){
if(this.txthilight)s.layers.$.visibility='show'
if(!_jssbg(s))s.bgColor=this.hilight
}
eval(this.afterhilight)
this.hover=s.id
}
},
afterrestore:"",afterhilight:"",beforeshow:function(){},beforevis:function(){},
showsubmenu:function(id,clflag){
if(id==this.hover&&!(nn&&clflag))return
this.beforeshow(id)
var s,o,p,d,act,sub,side,b=this.borderWidth,nob=this.root_noborder
s=this.getLayer(id)
act=(nn||(ie4?s.all.tags("A"):s.getElementsByTagName("A")).length>0)
o=this.getLayer("muginavisub-"+id)
p=this.getParent(s)
sub=(p.id.indexOf("muginavisub")==0)
side=(this.vertical||sub)
if(nn&&!sub)p=p.parentLayer
this.hide(p)
if(!sub||this.sw&&this.sw.visibility.match(/^h/))this.sw=null
this.chcolor(act?s:null,p)
if(act&&o&&(!this.clickopen||clflag||this.opened.length)){
var _l,l,t,over,x=this.pageX(s),y=this.pageY(s),w=(nn?o.clip.width:o.offsetWidth)+this.offset,h=(nn?o.clip.height:o.offsetHeight),scr=(ie?document.body.scrollTop:window.pageYOffset)
if((gk||op)&&!sub&&!nob&&p.offsetTop==0){x+=b;y+=b}
if((macie||o6||saf)&&sub){x-=b;y-=b+(o6?2:0)}
_l=l=(side?x+(nn?p.clip.width:p.offsetWidth+(this.vertical&&!sub&&!nob?b:0))+this.offset:x)
if(l+w>this.winW()+(ie?document.body.scrollLeft:window.pageXOffset)||this.sw){
l=x+(side?sub||nn?0:-b:(nn?s.clip.width:s.offsetWidth)+(nn||!nob?b:0))-w
this.sw=(l<0?null:this.sw||p.style||p)
if(l<0)l=_l
}
t=(side?y-(sub||nn?0:b)+(o6&&sub?2:0)-(!nn||this.imgmode?0:1):y+(nn?s.clip.height+1:s.offsetHeight+(nob?0:b))+this.offset)
over=t-scr+h-this.winH();t=t-(over>0?side?over:(nn?p.clip.height:p.offsetHeight+b*2)+h+this.offset*2:0);if(scr>t)t=scr
d=this.xy[o.id];if(d){l+=d[0]*(this.sw?-1:1);t+=d[1]}
if(nn){
o.moveTo(l,t)
o.zIndex=p.zIndex+1
}else{
o.style.left=l
o.style.top=t
}
this.beforevis(o,s)
{(nn?o:o.style).visibility=nn?"show":"visible"}
this.opened[this.opened.length]=[p,o]
}
},
hide:function(o,x){
var n=-1,a=this.opened
for(var i=0,s;i<a.length;i++){
if(!x&&n<0&&a[i][0]!=o)continue
if(n<0)n=i
s=a[i][1]
with(nn?s:s.style){visibility=nn?"hide":"hidden";left=top=0}
}
if(n>=0)this.opened.length=n
},
hideall:function(){
this.hide(null,1)
this.chcolor(null,this.layer)
},
init:function(){
status=""
var c=this.layer=this.getLayer("muginaviparent")
if(!c)return
var msg=status="Creating menu"
if(nn){
var par=c.layers[0],ch,root,aflag,a,lay,d
var mw=par.left+par.clip.width,w=this.winW()
if(this.stretch){
c.bgColor=par.bgColor
if(this.pos)c.clip.width=w
}
if(!this.pos||this.stretch)par.left=(this.usetable&&this.vertical?0:this.align=="right"?c.clip.right-mw:this.align=="center"?(c.clip.width-mw)/2:0)
for(var i=0;i<document.layers.length;i++){
lay=document.layers[i]
if(lay.id.indexOf("muginavi")!=0)continue
root=(lay.id==c.id)
ch=(root?par:lay).layers
aflag=!this.fixedsize
for(var j=0;j<ch.length;j++){
this.lay[ch[j].id]=ch[j]
ch[j].bgColor=_jssbg(ch[j])
if(this.vertical||!root)ch[j].clip.width=w
if(ch[j].document.links.length){
if(this._p[ch[j].id]&&!(this.imgmode||root&&(!this.vertical||this.root_noarrow))){
a=new Layer(w,ch[j])
a.document.open();a.document.write("<font class=mnarw>"+this.arrowMark+"</font>");a.document.close()
a.clip.width=a.document.width
if(aflag&&!(this.usetable&&root)){aflag=false;lay.clip.width+=a.clip.width+3;if(root)par.clip.width+=a.clip.width+3}
a.moveTo(lay.clip.width-a.clip.width-3,(ch[j].clip.height-a.document.height)/2)
a.visibility="inherit"
}
}else{
var s=ch[j].layers
if(s.length){s[0].clip.right=lay.clip.width-(s[0].id=="noaction"?0:4);s[0].clip.height=(s[0].id=="noaction"?lay.clip.height:1000)}
}
}
if(this.borderWidth&&(!root||!this.root_noborder&&(!this.stretch&&(lay=par),true))){
d=[[0,0,lay.clip.width,1],[0,lay.clip.height-1,lay.clip.width,1],[0,0,1,lay.clip.height],[lay.clip.width-1,0,1,lay.clip.height]]
for(var n=0,b;n<4;n++){b=new Layer(w,lay);b.moveTo(d[n][0],d[n][1]);b.resizeTo(d[n][2],d[n][3]);b.bgColor=this.borderColor;b.visibility="inherit"}
}
}
if(this.pos){
c.zIndex=100
if(this.vertical)mw=c.clip.width
c.left=(
this.stretch?0:
this.align=="right"?w-this.pos[0]-mw:
this.align=="center"?(w-mw)/2+this.pos[0]:
c.left)
}
}
if(dom1){
var e=ie4?document.all.tags("SPAN"):document.getElementsByTagName(ie?"SPAN":"TD"),cl,p,r,b,w,a,aw,pw=[],mw,hr,ch,n,m=-1
function onclick(event){eval(muginavi._md[this.id]);var a=(ie4?this.all.tags("A"):this.getElementsByTagName("A"))[0],b;if(a){b=!!a.href.match(/nolink$/);(a.click?a.click():b?null:a.target?window.open(a.href,a.target):location.href=a.href)};if(!a||b)(event||window.event).cancelBubble=!!muginavi.opened.length}
function onmouseover(event){eval(muginavi._mo[this.id]);muginavi.showsubmenu(this.id,muginavi.opened.length)}
function rootclick(){muginavi.showsubmenu(this.id,true)}
for(var i=0,len=e.length;i<len;i++){
cl=e[i].className||e[i].getAttribute("class")
if(cl!="muginavi"||e[i].id=="muginaviroot")continue
n=Math.floor((i+1)/len*10);if(n>m)status=msg+" ("+(m=n)+"0%)"
p=this.getParent(e[i])
r=(p.id=="muginaviroot")
e[i].onmouseover=onmouseover
e[i].onmousedown=onclick
if(r&&this.clickopen)
e[i].onclick=rootclick
b=(r&&this.root_noborder?0:this.borderWidth*2)
if(!r&&op)p.style.width=p.all(0).offsetWidth+b
if(!r||this.vertical){
if(!pw[p.id])pw[p.id]=p.offsetWidth;w=pw[p.id]
if(!gk)e[i].style.width=(w-b<0)? 0:(w-b);
if(this._p[e[i].id]){
a=(ie?e[i].all:e[i].getElementsByTagName("SPAN"))["arw"]
if(!aw)aw=a[op?"clientWidth":"offsetWidth"]
a.style.left=-a.offsetLeft+(ie?a.offsetParent.tagName=="BODY"?this.pageX(c)+b:(r&&a.offsetParent.tagName!="SPAN"?b:0):(gk||op)&&r?b/2+(this.pos?0:this.usetable?this.pageX(c):aw):0)+w-aw-1-(r?0:b)
a.style.visibility=o6?"visible":"inherit"
}
}
}
if(op&&this.usetable)c.parentElement.vAlign="top"
ch=ie?c.all.tags("SPAN"):c.getElementsByTagName("TD")
if(this.vertical){
mw=this.usetable?c.offsetWidth:0
for(var i=0;i<ch.length;i++)
mw=Math.max(mw,ch[i].offsetWidth)
for(var i=0;i<ch.length;i++)
if(ch[i].id!="arw")
ch[i].style.width=(ie&&this.usetable?"100%":mw-(o6&&this.usetable&&!this.root_noborder?this.borderWidth*2:0))
if(!ie&&!this.usetable)c.style.width=mw+(this.root_noborder?0:this.borderWidth*2)
}
hr=ie4?document.all.tags("HR"):document.getElementsByTagName("HR")
for(var i=0,len=hr.length;i<len;i++){
p=hr[i][ie?"parentElement":"parentNode"]
cl=p.className||p.getAttribute("class")
if(cl=="muginavi"||this.vertical&&p.id==c.id){
if(macie)p.style.width=p.offsetWidth
hr[i].style.width=(macie?p.scrollWidth:p.clientWidth||p.offsetWidth||p.parentNode.clientWidth)-(gk||op||macie?this.borderWidth*2:0)-4
}}
if(this.pos)c.style.width=c.scrollWidth||c.offsetWidth
}
setTimeout("muginavi.setpos()",0)
if(o6){
this.opw=window.innerWidth
this.oph=window.innerHeight
setInterval("if(window.innerWidth!=muginavi.opw||window.innerHeight!=muginavi.oph)location.reload()",1000)
}
if(nn||ie4||macie)
setTimeout('window.onresize=function(){location.reload()}',1000)
else
window.onresize=function(){muginavi.hideall();muginavi.setpos()}
status=""
delete this.init
},
setpos:function(){
if(dom1&&this.pos){
this.layer.style.left=(
this.stretch?this.pos[0]:
this.align=="right"?this.winW()-this.pos[0]-this.layer.offsetWidth:
this.align=="center"?(this.winW()-this.layer.offsetWidth)/2+this.pos[0]:
this.layer.style.left)
if(this.stretch)
this.getLayer("muginaviborder").style.width=this.layer.style.width=gk?"100%":this.winW()-(!op||this.root_noborder?0:this.borderWidth*2)
}},
getLayer:function(id){
var o
if(dom1){o=this.lay[id]||document.getElementById(id)}else
if(nn){function _f(p,id){for(var i=0;i<p.layers.length;i++){if(p.layers[i].id==id)return p.layers[i];var sub=_f(p.layers[i],id);if(sub)return sub};return false};o=this.lay[id]||_f(document,id)}
return (o?this.lay[id]=o:null)
},
getParent:function(o){
o=o[nn?"parentLayer":ie?"parentElement":"parentNode"]
if((gk||op||o6)&&o.tagName=="TR")o=o.parentNode.parentNode
if(gk||op)o=o.parentNode
return o
},
pageX:function(e){
return dom1?this._offset(e,"Left"):nn?e.pageX:0
},
pageY:function(e){
return dom1?this._offset(e,"Top"):nn?e.pageY:0
},
_offset:function(e,p){
var n=0,b=true,m
while(e){n+=e["offset"+p];if(ie&&!macie&&e.tagName=="TABLE"){n+=(b?e.border*1:e.border!="0"?1:0);b=false};if(saf&&e.tagName=="DIV")break;e=e.offsetParent}
if(macie){m=parseInt(document.body.currentStyle["margin"+p]);if(isNaN(m))m=document.body[p.toLowerCase()+"Margin"];n+=m*1}
return n
},
winW:function(){
return (nn||gk&&!moz1?window.innerWidth-(document.height>window.innerHeight?16:0):document.body.clientWidth)
},
winH:function(){
return (nn||gk&&!moz1?window.innerHeight-(document.width>window.innerWidth?16:0):document.body.clientHeight)
}
}
window.onload=function(){setTimeout("if(muginavi.init)muginavi.init();eval(self.mnld)",1)}
document.onmousedown=function(){muginavi.hideall()}
