window.onload = function (){;
	//クッキー読み込み
	var cookie    = new HTTP.Cookies;
	var textsize = cookie.read('changeText');
	if(textsize){
	  changeText(textsize);
	}

	
  //イベントハンドラ仕込み
  var DL = document.getElementById('c-txt');
  
  for(var i = 0; i < DL.childNodes.length; i++){
	  /*dlの子要素の数（dd）を調べてる*/
    if(DL.childNodes[i].nodeName == 'DD'){
		/*dlの子要素(i)の名前がddだったら*/
      var anc = DL.childNodes[i].firstChild;
	  　/*dlの子要素(i)の子ノート（ここでは<a href="～" class="~">です）を変数ancに入れてる*/
      anc.onclick = function () { 
      	return changeText(this.getAttribute('className') || this.getAttribute('class')) 
		/*changeText（textsize）の（textsize）がfont-n（またはfont-l）に変更される*/
      }
    }
  }

  
}

function changeText(textsize){
	
  var style = document.getElementById('styleChangeText');
  style.href = '/common/css/' + textsize + '.css';
  
  //クッキー書き込み
  var cookie    = new HTTP.Cookies;
  cookie.write('changeText', textsize, '+1d','/');
  return false;
}


