// JavaScript Document

var select_contents = 0;
var select_sub = 0;

var mouseover = 0;
var subover = "0000";

var init = false;
var chk = true;
var _swap = false;

var img_dir = "_common/images/";

var navi_dir = img_dir+"navi/";
var sub_dir = img_dir+"sub/";
var top_dir = img_dir+"topbtn/";

var path = new Array("./","../","../../","../../../");

function onLoadFunc(n,p,s)
{
	select_contents = n;
	mouseover = n;

	if(p != null)
	{
		navi_dir = path[p] + navi_dir;
		sub_dir = path[p] + sub_dir;
		top_dir = path[p] + top_dir;
	}
	if(s != null)
	{
		subover = "0"+n+"0"+s;
		select_sub = s;
		MM_swapImage("s0"+select_contents+"0"+s,"",sub_dir+"0"+select_contents+"/0"+s+"b.gif");
	}

	var i,x;
	MM_findObj("s0"+select_contents).style.visibility = "visible";
	MM_swapImage("n0"+select_contents,"",navi_dir+"0"+select_contents+"c.gif");

	chk = subover == "0000" ? true:false;

	init = true;
}

function onMouseOverFunc(num,s)
{
	if(init == false) return;
	
	if(mouseover != num && s == null)
	{
		if(chk)
		{
			MM_findObj("s0"+mouseover).style.visibility = "hidden";
			MM_findObj("s0"+num).style.visibility = "visible";

			if(select_contents != mouseover)
			{
				MM_swapImage("n0"+mouseover,"",navi_dir+"0"+mouseover+"a.gif");
			}
			else
			{
				if(chk) MM_swapImage("n0"+mouseover,"",navi_dir+"0"+mouseover+"b.gif");
			}
	
			MM_swapImage("n0"+num,"",navi_dir+"0"+num+"c.gif");
	
			mouseover = num;
		}
		else
		{
			MM_swapImage("n0"+num,"",navi_dir+"0"+num+"b.gif");
		}
		if(!_swap) _swap = true;
	}
	else if(s != null)
	{
		if(!chk && num == select_sub) return;
		
		var x = MM_findObj("s"+"0"+mouseover+"0"+num);
		MM_swapImage("s"+"0"+mouseover+"0"+num,"",sub_dir+"0"+mouseover+"/0"+num+"b.gif");
		if(!_swap) _swap = true;
	}
}

function onMouseOutFunc(num)
{
	if(chk || num == select_contents) return;
	restore();
}

function swapSub(num)
{
	MM_swapImage('tb0'+num,'',top_dir+'0'+num+'b.gif')
}

function restore()
{
	if(!_swap) return;
	MM_swapImgRestore();
}



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


