﻿onload = function(){mouse()};



function mouse(){
  var target = document.getElementById('change').getElementsByTagName('button');
  
  target[0].onclick = function(){text_change(100);}
  target[1].onclick = function(){text_change(105);}  
  target[2].onclick = function(){text_change(110);}  
  target[3].onclick = function(){color_change(-34);}
  target[4].onclick = function(){color_change(-68);}  
  target[5].onclick = function(){color_change(-102);}

  var ul = document.getElementById('menus').getElementsByTagName('ul');
  var li = ul[0].getElementsByTagName('li');
  if(navigator.appVersion.indexOf("MSIE 6") != -1){
	var list = [1,7,11,14,15];
	li[list[0]].onmouseover = function(){menu_open(this,'block');}
	li[list[0]].onmouseout = function(){menu_open(this,'none');}
	li[list[1]].onmouseover = function(){menu_open(this,'block');}
	li[list[1]].onmouseout = function(){menu_open(this,'none');}
	li[list[2]].onmouseover = function(){menu_open(this,'block');}
	li[list[2]].onmouseout = function(){menu_open(this,'none');}
	li[list[3]].onmouseover = function(){menu_open(this,'block');}
	li[list[3]].onmouseout = function(){menu_open(this,'none');}
	li[list[4]].onmouseover = function(){menu_open(this,'block');}
	li[list[4]].onmouseout = function(){menu_open(this,'none');}
  }
  
  //クリッカブル制御（自ページリンク）
  if(document.getElementById('home')){
	  li[0].getElementsByTagName('a')[0].removeAttribute('href');
	  document.getElementsByTagName('a')[1].removeAttribute('href');
  }
  if(document.title.match(/サイトマップ/)){
	  document.getElementsByTagName('a')[2].removeAttribute('href');
  }
  if(document.title.match(/Q&A/)){
	  document.getElementsByTagName('a')[3].removeAttribute('href');
  }
  if(document.title.match(/お問い合わせ/)){
	  document.getElementsByTagName('a')[4].removeAttribute('href');
  }



}


//IE6
function menu_open(li,mode){
  li.getElementsByTagName('ul')[0].style.display = mode;
}

function img_open(src,mode){
  var html = window.open(src,'_blank',mode);
  html.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'+"\n");
  html.document.write('<html xmlns="http://www.w3.org/1999/xhtml">'+"\n");
  html.document.write('<head>'+"\n");
  html.document.write('</head>'+"\n");
  html.document.write('<body style="margin:0; padding:0;">\n');
  html.document.write('<p><img src="'+src+'" /></p>'+"\n");
  html.document.write('<p align="center"><input type="button" value="close" onclick="window.close()" /></p>'+"\n");
  html.document.write('</body>'+"\n");
  html.document.write('</html>');
}


function text_change(size){

  var tags = ['span','p','dd','a','li','td'];
  var base = document.getElementById('content');

  for(var i=0; i<tags.length; i++){
    if(base.getElementsByTagName(tags[i]).length>0){
      var len = base.getElementsByTagName(tags[i]).length;
      for(var j=0;j<len;j++){
        base.getElementsByTagName(tags[i])[j].style.fontSize = size+"%";
	  }
    }
  }

}


function color_change(y){
  ID = document.getElementsByTagName('body')[0].id;
  H2 = document.getElementsByTagName('h2');
  
  switch(ID){
	  
	case "home":
	H2[0].style.backgroundPosition = "0px "+y+"px";
	H2[1].style.backgroundPosition = "0px "+y+"px";
	H2[2].style.backgroundPosition = "0px "+y+"px";
	H2[3].style.backgroundPosition = "0px "+y+"px";
	H2[4].style.backgroundPosition = "0px "+y+"px";
	H2[5].style.backgroundPosition = "0px "+y+"px";
	break;
	
	default:
	
	break;
  }
}



function html_open(HTML,A,B){
  window.open(HTML,A,B);
}


