/*
window.onload = function(){
getCookieFt3();
getCookieFt4();
}
*/
// フォントサイズを変更する対象エリア
var targets = new Array();
targets[0] = "headerArea"; // メインエリア
var fontSizeBtnSOn  = "library/new/header/site_initial_setting/font-size_s0.gif";
var fontSizeBtnSOff = "library/new/header/site_initial_setting/font-size_s.gif";
var fontSizeBtnMOn  = "library/new/header/site_initial_setting/font-size_m0.gif";
var fontSizeBtnMOff = "library/new/header/site_initial_setting/font-size_m.gif";
var fontSizeBtnLOn  = "library/new/header/site_initial_setting/font-size_l0.gif";
var fontSizeBtnLOff = "library/new/header/site_initial_setting/font-size_l.gif";

function textSizeUp() {
 textSizeUpFt3();
 textSizeUpFt4();
}
function textSizeDown() {
 textSizeDownFt3();
 textSizeDownFt4();
}
function textSizeDefault() {
 textSizeDefaultFt3();
 textSizeDefaultFt4();
}
// Cookieから現在選択しているfontSizeを取得
function getCookieFt3(){
 fontSize = "";
 cName = "FontRatio=";
 tmpCookie = document.cookie + ";";
 start = tmpCookie.indexOf(cName);
   if (start != -1)
 {
  end = tmpCookie.indexOf(";", start);
  fontSize = tmpCookie.substring(start + cName.length, end);
  // 文字サイズを変更（Cookieに保存されている値）
 } else { 
  // 文字サイズを変更（デフォルトの文字サイズ）
  fontSize = "100%";
 }
 // 文字サイズに応じてアイコンを変更
 changeFontSizeIcon(fontSize);
}

// Cookieへ現在選択しているfontSizeを保存
function setCookieFt3(s){
 cName = "FontRatio=";
 exp = new Date();
 exp.setTime(exp.getTime() + 31536000000);
 document.cookie = cName + s + "; path=/; expires=" + exp.toGMTString();
}

// 文字サイズ変更（大）
function textSizeUpFt3(){
 color = "blue";
 changeFontSizeIcon(color);
 setCookieFt3(color);
}

// 文字サイズ変更（小）
function textSizeDownFt3(){
 color = "red";
 changeFontSizeIcon(color);
 setCookieFt3(color);
}

// 文字サイズ変更（中）
function textSizeDefaultFt3(){
 color = "#fff";
 changeFontSizeIcon(color);
 setCookieFt3(color);
}



// 文字サイズに応じてアイコンを変更
function changeFontSizeIcon(color) {
 if(color == "red") {
  document.getElementById("fontSizeBtnS").src = pbGlobalAliasBase + fontSizeBtnSOn;
  document.getElementById("fontSizeBtnM").src = pbGlobalAliasBase + fontSizeBtnMOff;
  document.getElementById("fontSizeBtnL").src = pbGlobalAliasBase + fontSizeBtnLOff;
 }
 else if(color == "#fff") {
  document.getElementById("fontSizeBtnS").src = pbGlobalAliasBase + fontSizeBtnSOff;
  document.getElementById("fontSizeBtnM").src = pbGlobalAliasBase + fontSizeBtnMOn;
  document.getElementById("fontSizeBtnL").src = pbGlobalAliasBase + fontSizeBtnLOff;
 }
 else if(color == "blue") {
  document.getElementById("fontSizeBtnS").src = pbGlobalAliasBase + fontSizeBtnSOff;
  document.getElementById("fontSizeBtnM").src = pbGlobalAliasBase + fontSizeBtnMOff;
  document.getElementById("fontSizeBtnL").src = pbGlobalAliasBase + fontSizeBtnLOn;
 }
}
