/* stripedtable */
conf02 = {
	className : "stripedtable",
	oddlineClassName : "oddline",
	evenlineClassName : "evenline"
}

function setStripedTable(){
	var tables = $A(document.getElementsByClassName(conf02.className));
	tables.each(function (table){
		var lines = $A(table.getElementsByTagName("tr"));
		var row=0;
		lines.each(function (tr){
			row++;
			if(row%2==1) {
				tr.className = conf02.oddlineClassName;
			} else {
				tr.className = conf02.evenlineClassName;
			}
		});
	});
}
Event.observe(window, 'load', setStripedTable, false);

/* rollover */
conf = {
       className : 'btn',
       postfix : '_over'
};
function setMouseOverImages() {
       $A(document.getElementsByClassName(conf.className)).each(function (node){
               node.onmouseout = changeSrcFunction(node.src);
               node.onmouseover =
			    changeSrcFunction(node.src.replace(/(\.gif|\.jpg|\.png)/, conf.postfix+"$1"));
       });
}
function changeSrcFunction(data){
       return function(){ this.src = data; }
}
Event.observe(window, 'load', setMouseOverImages, false);

/* レイヤー */
function MenuOn(x){
obj=document.getElementById("subnavi"+x).style.visibility="visible";
}
function MenuOff(x){
obj=document.getElementById("subnavi"+x).style.visibility="hidden";
}

/* externalLink */
function externalLinks() {
  if (!document.getElementsByTagName) return;
  var anchors = document.getElementsByTagName("a");
  for (var i=0; i<anchors.length; i++) {
    var anchor = anchors[i];
    if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
      anchor.target = "_blank";
  }
}
window.onload = externalLinks;

/* scroll up */
var Mac = navigator.appVersion.indexOf('Mac',0) != -1;
var Win = navigator.appVersion.indexOf('Win',0) != -1;
var IE  = navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1;
var NN  = navigator.appName.indexOf("Netscape",0) != -1;
var GE  = navigator.userAgent.indexOf("Gecko") != -1;
function topposition(){
  if( IE ){
    position = document.body.scrollTop;
  } else {
    position = window.pageYOffset;
  } movePosition()
}
function movePosition(){
  position = Math.floor(position*0.8);
  if( position > 0.1 ){
    window.scrollTo(0,position)
    setTimeout("topposition()",20);
  } else { window.scrollTo(0,0) }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}