﻿var select=null;

window.onload=function()
{
	if(!document.getElementById){return;}

	//ニュース概要表示制御処理
	//alert();
	if(document.getElementById('news'))
	{
		var items=document.getElementById('news').getElementsByTagName("div");
		for(var i=0; i<items.length; i++)
		{
			div   =items[i].getElementsByTagName("div")[0];
			if(div)
			{
				div.style.visibility='hidden';
				div.style.position  ='absolute';

				title=items[i].getElementsByTagName("h3")[0];
				value=title.firstChild.nodeValue;
				title.removeChild(title.firstChild);

				a    =document.createElement('a');
				text=document.createTextNode(value);

				a.setAttribute('href','javascript:;');
				a.onclick=function(){news(this,1);}
				a.appendChild(text);
				title.appendChild(a);
			}
		}
	}
}


function news(x,s)
{
	//ニュース概要表示制御処理
	if(s==1)
	{
		//概要を表示する処理
		value=x.firstChild.nodeValue;
		title=x.parentNode;
		title.removeChild(x);
		text=document.createTextNode(value);
		title.appendChild(text);

		div=title.parentNode.getElementsByTagName("div")[0];
		div.style.visibility='visible';
		div.style.position  ='static';
	}
	else
	{
		//概要表示を閉じる処理
		div=x.parentNode.parentNode;
		div.style.visibility='hidden';
		div.style.position  ='absolute';

		title=div.parentNode.getElementsByTagName("h3")[0];
		value=title.firstChild.nodeValue;
		a    =document.createElement('a');
		a.setAttribute('href','javascript:;');
		a.onclick=function(){news(this,1);}
		text=document.createTextNode(value);
		a.appendChild(text);
		title.removeChild(title.firstChild);
		title.appendChild(a);
	}
}

//プルダウンからリンク
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_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


//ポップアップウィンドウ
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//記事の表示・非表示
function showhide(id){
    if(document.getElementById){
      if(document.getElementById(id).style.display == "none")
        document.getElementById(id).style.display = "block";
        else
        document.getElementById(id).style.display = "none";
    }
  }
  
 