﻿//alert(document.cookie);
/*        クッキーに登録する汎用関数              */
/* 書式 : mySetCookie(クッキー名,値,有効期限日数) */
/* 戻り値 : なし(void)                            */
function mySetCookie(myCookie,myValue,myDay){
   myExp = new Date();
   myExp.setTime(myExp.getTime()+(myDay*60*60*24*1000));
   myItem = "@" + myCookie + "=" + escape(myValue) + ";";
   myExpires = "expires="+myExp.toGMTString();
   document.cookie =  myItem + myExpires;
}

/*        クッキーを取り込む汎用関数              */
/* 書式 : myGetCookie(クッキー名)                 */
/* 戻り値 : 値(string)  null:該当なし             */
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 GetHeight(ID,NAME){




var filename = location.pathname + "TIME";

date = new Date();
var now_time= date.getTime();
last = myGetCookie( filename );      // 読込

if (last == null){                    // 初めての訪問
   mySetCookie( filename , now_time,365); // 時間保存
//   location.reload();  //リロード
}else{                                  // ２度以上の訪問
  if(now_time-last > 1*24*60*60*1000 ){
   mySetCookie( filename , now_time,365); // 時間保存
           location.reload();  //リロード
  }else{
  }   
}





  if (document.height){
    document.getElementById(ID).style.height = 200;
    document.getElementById(ID).style.height = parent.frames[NAME].document.height +20 +"px" ;
  }else{
    document.getElementById(ID).style.height = 200;
    document.getElementById(ID).style.height = parent.frames[NAME].document.body.scrollHeight +20 +"px";
  }
}

