var optF = 1;
var optT = 0.6;
var optD = 0.3;

Event.observe(window, "load", function(){
$$(".onM").each(function(el){
	el.observe("mouseover",function(){
		new Effect.Opacity(el, { from:optF, to:optT, duration:optD });
	});
	el.observe("mouseout",function(){
		new Effect.Opacity(el, { from:optT, to:optF, duration:optD });
	});
});

$$(".onMr").each(function(el){
	el.observe("mouseover",function(){
		new Effect.Opacity(el, { from:optT, to:optF, duration:optD });
	});
	el.observe("mouseout",function(){
		new Effect.Opacity(el, { from:optF, to:optT, duration:optD });
	});
});

$$(".autoF").each(function(el){
	new Effect.Opacity(el, { from:optF, to:optT, duration:optD * 5 });
});

});


function view_onoff(did, BorN){
  if(BorN=='auto'){
   if($(did).getStyle('display')=='block'){
     BorN='none';
   }else{
     BorN='block';
   }
  }

  $(did).setStyle({'display':BorN});

}

function mailto(type, text, img, alt){
/* coded, key はメールアドレスごとに書き換える　*/
  coded = "jHIv@bvCJbjiCyK.7v.G6";
  key = "hjEAaz9mV5gHOpeST7kB2bGsUCxrMo3FlX6KfYqyuZiQJR0DdWvPnLt1NIcw84";
/* ↑書き換える */
  shift=coded.length;
  link="";
  for (i=0; i<coded.length; i++) {
    if (key.indexOf(coded.charAt(i))==-1) {
      ltr = coded.charAt(i);
      link += (ltr);
    }
    else {     
      ltr = (key.indexOf(coded.charAt(i))-shift+key.length) % key.length;
      link += (key.charAt(ltr));
    }
  }

  if(type == 'nolink'){
    document.write(link);
  } else if(type == 'text'){
    document.write("<a href='mailto:"+link+"'>"+text+"</a>");
  } else if(type == 'img'){
    document.write("<a href='mailto:"+link+"'><img src=\""+img+"\" border=\"0\" alt=\""+alt+"\" class=\"onM\" /></a>");
  } else {
    document.write("<a href='mailto:"+link+"'>"+link+"</a>");
  }
}


