// フォントサイズ
function fs2( CMD ){
	uaName = navigator.userAgent;
	appName = navigator.appVersion;
	
  // FontSize: L
  if( CMD == "L" ){
	window.document.getElementById('FontSizeControl2').href = '../css/fsl.css';
	setCookie2("wordsize2","../css/fsl.css",true);
  }

  // FontSize: M
  else if ( CMD == "M" ){
	window.document.getElementById('FontSizeControl2').href = '../css/fsm.css';
	setCookie2("wordsize2","../css/fsm.css",true);
  }
  
  // FontSize: S
  else if ( CMD == "S" ){
	window.document.getElementById('FontSizeControl2').href = '../css/fss.css';
	setCookie2("wordsize2","../css/fss.css",true);
  }
  

  // === ::: 変更を加えるオブジェクトの判定 ::: ===
  //
  // NN4用エラーメッセージダイアログ
  if( document.layers ){
    window.alert( "このスクリプトはNetscape Communicator4.xでは動作しません" );
    return false;
  }
  
  // MacIE4用エラーメッセージダイアログ
  else if(( appName.indexOf("Mac",0) != -1 ) && ( uaName.indexOf("MSIE 4.0",0) != -1 )){
    window.alert( "このスクリプトはMacIE4.0では動作しません" );
    return false;
  }
}

function setCookie2(name,value,expire)
{
	//var str = name +"="+escape(value)+";domain="+location.hostname+";path=/;";
	var str = name +"="+escape(value)+";domain=yumekui.com;path=/;";
	if (expire)
	{
		var period = 7;	// 有効期限日数
		// 有効期限の作成
		var nowtime = new Date().getTime();
		var clear_time = new Date(nowtime + (60 * 60 * 24 * 1000 * period));
		var expires = clear_time.toGMTString();
		str+="expires=" + expires;
		//alert(str);
	}
	document.cookie2=str;
}
  
function initLoad2()
  {
  	cookieData = document.cookie2;
  	//alert(cookieData);
  	if (cookieData == "")
  	{
		window.document.getElementById('FontSizeControl2').href ="../css/fsm.css";
  		return;
  	}
  	var name = "wordsize2=";
  	start = cookieData.indexOf(name);
  	//alert(start);
  	if (start != -1)
	{
		cookieData=cookieData.substring(start+name.length,start+name.length+12);
		//alert(cookieData);
		window.document.getElementById('FontSizeControl2').href =cookieData;
	}
  	
  }
