var frmWindow  = null;
var intDisp = 1;

function fcMouseOver(strId,strSrc) {
    eval("document."+strId+".src='"+strSrc+"';");
}

function fcMenuBold(strId) {

   var intMax=top.left.pNum.value

   for(i=1;i<=intMax;i++) {
      top.left.document.all("cp"+i).style.fontWeight = "normal";
   }

   top.left.document.all(strId).style.fontWeight = "bold";

}

function fcDialogPageWindow(strSource) {
//for Parody Dialog
    frmWindow=window.open(strSource,"parody","width=520,height=360,scrollbars=no,status=no,menubar=no");
    if (frmWindow != null){
        frmWindow.opener = self;
    }
}

function fcOpenWindow(strSource,intWidth,ingHeight) {
//Common Function
    frmWindow=window.open(strSource,"child","width="+intWidth+",height="+ingHeight+",scrollbars=yes,status=no,menubar=no");
    if (frmWindow != null){
        frmWindow.opener = self;
    }
}

function closeChild(remote){
    if(remote==null) return;
    if(remote.closed)return;

    if(remote.opener==null || remote.opener!=self){
        remote=null;
        return;
    }
    if(!remote.closed){
        remote.close();
        remote=null;
    }
}

function fcAddFavorites() {
    window.external.addFavorite('http://www.happy2-island.com/','Happy! Happy! Island');
}

function fcTopMessage() {

    if (intDisp==1) {
        document.all("objInfo").innerHTML=getMessage();
        intDisp=2;
    } else {
        document.all("objInfo").innerHTML=getUpdateInfo();
        intDisp=1;
    }

    window.setTimeout("fcTopMessage()", 15000);

}

function getMessage() {

    var  strTemp="";

    strTemp+="<span class=topinfoW>";
    strTemp+="<center><font color=\"#FFFF00\"><strong>Happy! Happy! Island</strong></font>へようこそ！各コーナーは<font color=\"#FFFF00\"><strong>上のメニュー</strong></font>から！</center>";
    strTemp+="<span style=\"font-size:4pt\"><br></span>";
    strTemp+="当サイトは<font color=\"#FFB836\"><strong>技術情報＋α系サイト</strong></font>です。ＶＢＡを使ったＡｃｃｅｓｓ・エクセルの<font color=\"#FFB836\"><strong>アプリケーション開発講座</strong></font>、ＶＢＳｃｒｉｐｔの<font color=\"#FFB836\"><strong>Ｔｉｐｓ集</strong></font>、<font color=\"#FFB836\"><strong>ＨＴＭＬ入門講座</strong></font>、これからプログラミングを始めたい方には<font color=\"#FFB836\"><strong>プログラミング入門講座</strong></font>、質問もＯＫの<font color=\"#FFB836\"><strong>掲示板</strong></font>等々のコーナーをご用意し、２４時間年中無休（？）でオンエアー！<br>";
    strTemp+="</span>";

    return  strTemp;

}

function getUpdateInfo() {

    var  strTemp="";

    strTemp+="<span class=topinfo>";
    strTemp+="【更新のお知らせ】<br>";
    strTemp+="2005/03/21:<span class=blink><a href=\"./access/index.html\" target=\"_blank\"><strong>Access Tips</strong></a></span>にネタ追加！<br>";
    strTemp+="2005/02/12:<span class=blink><a href=\"./cgi/annex/annex.cgi\" target=\"_blank\"><strong>雑談掲示板</strong></a></span>を設置！<br>";
    strTemp+="2005/01/22:<span class=blink><a href=\"./parody/index.html\" target=\"_blank\"><strong>パロディーダイアログ</strong></a></span>に新作を追加！<br>";
    strTemp+="2004/11/28:<span class=blink><a href=\"./paradise/index.html\" target=\"_blank\"><strong>SPACE FLY TYPE-R(完成版)</strong></a></span>を公開！<br>";
    strTemp+="2004/11/06:<span class=blink><a href=\"./paradise/index.html\" target=\"_blank\"><strong>BLOCK DESTROYER V1.0</strong></a></span>を公開！<br>";
    strTemp+="</span>";

    return  strTemp;

}

function doBannerOn(strTemp,intWidth,intHeight) {

    top.document.all(strTemp).width=intWidth;
    top.document.all(strTemp).style.height=intHeight;

}

function doBannerOnIfr(strTemp,intWidth,intHeight) {

    parent.document.all(strTemp).width=intWidth;
    parent.document.all(strTemp).style.height=intHeight;

}

function doMouseOver(strId,strSrc) {
    eval("document."+strId+".src='"+strSrc+"';");
}

function setCookie(strCookie,strValue,lngDay){
   myExp = new Date();
   myExp.setTime(myExp.getTime()+(lngDay*24*60*60*1000));
   myItem = "@" + strCookie + "=" + escape(strValue) + ";";
   myExpires = "expires="+myExp.toGMTString();
   document.cookie =  myItem + myExpires;
}

function getCookie(strCookie){
   strCookie = "@" + strCookie + "=";
   strValue = null;
   myStr = document.cookie + ";" ;
   myOfst = myStr.indexOf(strCookie);
   if (myOfst != -1){
      myStart = myOfst + strCookie.length;
      myEnd   = myStr.indexOf(";" , myStart);
      strValue = unescape(myStr.substring(myStart,myEnd));
   }
   return strValue;
}

function getPageCT(strName){
    lngCount = getCookie(strName);
    if (lngCount == null){
        setCookie(strName,0,999);
    }
    lngCount = Number(lngCount)+1;
    setCookie(strName,lngCount,999);

    return lngCount

}
function getPageCT2(strName){

    var cDATE = 'DATE';
    var objDate = new Date();
    var lngTimes = objDate.getTime();
    var lngDate = getCookie(cDATE);
    if (lngDate == null){
       lngDate = lngTimes;
       setCookie(strName,1,999);
    }
    setCookie(cDATE,lngTimes,999);
    lngDate = Number(lngDate)+14400000;
    lngCount = Number(getCookie(strName));
    if (lngTimes >= lngDate) {
       lngCount = Number(lngCount)+1;
       setCookie(strName,lngCount,999);
    }
    return lngCount;

}

function fcRankingReload() {
    top.list1.location.href="http://www.happy2-island.com/link/html/index.html";
    top.list2.location.href="http://www.happy2-island.com/link/html/in2.html";
}

function fcStatusBarMsg(tmpMsg) {
    window.status = tmpMsg;
    return true;
}

function fcNewWindow(url) {
    window.open(url);
    return true;
}