function mySetCookie(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 +"; path=/com/;"+ myExpires;
}

function myGetCookie(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;
}

function sizec() {
   fs = eval(myGetCookie("USER_NAME"));
	if(fs==1){
	 document.body.style.fontSize = "120%";
	}else if(fs==3){
	 document.body.style.fontSize = "60%";
	}else{
	 document.body.style.fontSize = "80%";}
}

function fonts(myValue) {
	mySetCookie("USER_NAME",myValue,365);
	if(myValue==1){
	 document.body.style.fontSize = "120%";
	}else if(myValue==3){
	 document.body.style.fontSize = "60%";
	}else{
	 document.body.style.fontSize = "80%";}
}

function main() {
 //モバイル端末の判定
 var agent = navigator.userAgent;

 if( agent.search(/iPhone/) != -1 ||agent.search(/iPad/) != -1 ||agent.search(/Win64; x64;/) != -1){
  //iPhone IE 64bitの場合
  document.write('<img name="top_r2_c4" alt="コミュニケーションスキル講座" src="image/topimage.jpg" width="800" height="362" border="0">');
 }else{
  //PC　32bitの場合
  document.write('<embed src="image/topimage.swf" quality="high" pluginspage="http://get.adobe.com/jp/flashplayer/" type="application/x-shockwave-flash" width="800" height="362"></embed>');
 }
}
