function f_size(cnv_to, ids)
{
  var obj = document.getElementsByTagName('link');
  var maxv = obj.length;
  for(var i = 0; i < maxv; i++){
    if(obj[i].getAttribute('rel',0) == 'stylesheet') {
		h= obj[i].getAttribute('href',0);
    	h = h.replace(/css\/(large\/|ex-large\/|)([-a-zA-Z0-9]+)\.css$/, "css/"+cnv_to+"$2.css");
    	obj[i].href = h;
    }
  }
if(ids == "fs") {
 document.getElementById("fs").src="http://www.accumu.jp/images/common/font-size/regular02.png";
 FmySetCookie('zoom',1,10);
} else {
 document.getElementById("fs").src="http://www.accumu.jp/images/common/font-size/regular01.png";
}
if(ids == "fsb") {
 document.getElementById("fsb").src="http://www.accumu.jp/images/common/font-size/large02.png";
 FmySetCookie('zoom',2,10);
} else {
 document.getElementById("fsb").src="http://www.accumu.jp/images/common/font-size/large01.png";
}
if(ids == "fse") {
 document.getElementById("fse").src="http://www.accumu.jp/images/common/font-size/ex-large02.png";
 FmySetCookie('zoom',3,10);
} else {
 document.getElementById("fse").src="http://www.accumu.jp/images/common/font-size/ex-large01.png";
}
}


function FmySetCookie(myCookie,myValue,myDay){

   myExp = new Date();

   myExp.setTime(myExp.getTime()+(myDay*24*60*60*1000));

   myItem = "@" + myCookie + "=" + escape(myValue) + ";";

   myExpires = "expires="+myExp.toGMTString();

   document.cookie =  myItem + myExpires + ";path=/";

}



function FmyGetCookie(myCookie){

   myCookie = "@" + myCookie + "=";

   myValue = null;

   myStr = document.cookie + ";" ;

   myOfst = myStr.indexOf(myCookie);

   if (myOfst != -1){

      myStart = myOfst + myCookie.length;

      myEnd   = myStr.indexOf(";" , myStart);

      myValue = unescape(myStr.substring(myStart,myEnd));

   }

   return myValue;

}

window.onload=function () {
        s = FmyGetCookie('zoom');
	if(s == 1) {
         f_size('','fs');
	}
	if(s == 2) {
         f_size('large/','fsb');
	}
	if(s == 3) {
         f_size('ex-large/','fse');
	}
}

