﻿window.onload=function(){
mres = new Array();
mcom = new Array();

mres[0] = '大吉'; mcom[0] = '今日はラッキーな日';
mres[1] = '中吉'; mcom[1] = 'いいことあるかも？';
mres[2] = '小吉'; mcom[2] = 'そこそこ良い日かも';
mres[3] = ' 吉 '; mcom[3] = '頑張れば報われる？';
mres[4] = '末吉'; mcom[4] = 'まあまあでしょう。';
mres[5] = ' 凶' ; mcom[5] = '今日はおとなしくしてましょう';
mres[6] = '中凶'; mcom[6] = 'のんびりたまには自宅でクラシックでも';
mres[7] = '大凶'; mcom[7] = 'まぁ、こう言うときもあるさ';
var c;
/*check1();
    Event.observe($("mn0"),"click",check,false);
    Event.observe($("mn2"),"click",check,false);
    Event.observe($("mn4"),"click",check,false);
    Event.observe($("mn0"),"mouseover",mouseover,false);
    Event.observe($("mn2"),"mouseover",mouseover,false);
    Event.observe($("mn4"),"mouseover",mouseover,false);
    Event.observe($("mn0"),"mouseout",mouseout,false);
    Event.observe($("mn2"),"mouseout",mouseout,false);
    Event.observe($("mn4"),"mouseout",mouseout,false);
    Event.observe($("mdsp1"),"click",mdsp1,false);
    Event.observe($("mdsp2"),"click",mdsp2,false);
    Event.observe($("mdsp3"),"click",mdsp3,false);
    Event.observe($("mdsp4"),"click",mdsp4,false);
    Event.observe($("mdsp5"),"click",mdsp5,false);
    Event.observe($("mdsp6"),"click",mdsp6,false);
    Event.observe($("mdsp7"),"click",mdsp7,false);
    Event.observe($("mdsp8"),"click",mdsp8,false);

    Event.observe($("mdsp9"),"click",mdsp9,false);
*/
}
function check(event){
	var eID=Event.element(event);
	c=eID.id;
/*	$("mn0").style.color='#000099';
	$("mn0").style.backgroundColor='#F0F0FA';
	$("mn2").style.color='#000099';
	$("mn2").style.backgroundColor='#F0F0FA';
	$("mn4").style.color='#000099';
	$("mn4").style.backgroundColor='#F0F0FA';
	$(eID.id).style.color='#F0F0FA';
	$(eID.id).style.backgroundColor='#000099';
	if (eID.id == "mn0"){fname="./data/news.txt?cache="+(new Date()).getTime();}
	if (eID.id == "mn2"){fname="./data/hosyu.txt?cache="+(new Date()).getTime();}	
	if (eID.id == "mn4"){fname="./data/siro.txt?cache="+(new Date()).getTime();}	
	new Ajax.Request(fname,{method: "get", onComplete: displayData,onFailure: displayError});
*/
}
function check1(){
/*
    var wdate= new Date();
    var hh= wdate.getHours();

    if (hh > 7 && hh < 18){
    	var fname="./data/toriatukai.txt?cache="+(new Date()).getTime();
    }else{
	    if (hh == 0 || hh == 12){var fname="./data/news.txt?cache="+(new Date()).getTime();}
	    if (hh == 1 || hh == 13){var fname="./data/news1.txt?cache="+(new Date()).getTime();}
	    if (hh == 2 || hh == 14){var fname="./data/news.txt?cache="+(new Date()).getTime();}
	    if (hh == 3 || hh == 15){var fname="./data/news1.txt?cache="+(new Date()).getTime();}
	    if (hh == 4 || hh == 16){var fname="./data/news.txt?cache="+(new Date()).getTime();}
	    if (hh == 5 || hh == 17){var fname="./data/news1.txt?cache="+(new Date()).getTime();}
	    if (hh == 6 || hh == 18){var fname="./data/news.txt?cache="+(new Date()).getTime();}
	    if (hh == 7 || hh == 19){var fname="./data/news1.txt?cache="+(new Date()).getTime();}
	    if (hh == 8 || hh == 20){var fname="./data/news.txt?cache="+(new Date()).getTime();}
	    if (hh == 9 || hh == 21){var fname="./data/news1.txt?cache="+(new Date()).getTime();}
	    if (hh == 10 || hh == 22){var fname="./data/news.txt?cache="+(new Date()).getTime();}
	    if (hh == 11 || hh == 23){var fname="./data/news1.txt?cache="+(new Date()).getTime();}
    }
    var fname="./data/siro.txt?cache="+(new Date()).getTime();
	new Ajax.Request(fname,{method: "get", onComplete: displayData1,onFailure: displayError});
*/
}
function displayData(httpObj){
/*    document.write(encodeURI(httpObj.responseText));*/
/*	$("f1").innerHTML=httpObj.responseText;*/
}
function displayData1(httpObj){
/*
	$("f1").innerHTML=httpObj.responseText;
	$("mn0").style.color='#000099';
	$("mn0").style.backgroundColor='#F0F0FA';
	$("mn2").style.color='#000099';
	$("mn2").style.backgroundColor='#F0F0FA';
	$("mn4").style.color='#000099';
	$("mn4").style.backgroundColor='#F0F0FA';
    var wdate= new Date();
    var hh= wdate.getHours();
	$("mn4").style.color='#F0F0FA';
	$("mn4").style.backgroundColor='#000099';
*/
}
function displayError(httpObj){
	$("f1").innerHTML="ファイルがありません";
}
/*
function mdsp1(event) {
	var eID=Event.element(event);
    location.href="http://www.takamuro.com/index.cgi";
}
function mdsp2(event) {
	var eID=Event.element(event);
    location.href="http://www.takamuro.com/blog/soft/index.cgi";
}
function mdsp3(event) {
	var eID=Event.element(event);
    location.href="http://www.takamuro.com/blog/soft/index.cgi";
}
function mdsp4(event) {
	var eID=Event.element(event);
    location.href="http://www.takamuro.com/blog/soft/index.cgi";

}
function mdsp5(event) {
	var eID=Event.element(event);
    location.href="http://www.takamuro.com/blog/soft/index.cgi";
}

function mdsp6(event) {
	var eID=Event.element(event);
    location.href="http://www.takamuro.com/blog/soft/index.cgi";
}

function mdsp7(event) {
	var eID=Event.element(event);
    location.href="http://www.takamuro.com/blog/soft/index.cgi";
}

function mdsp8(event) {
	var eID=Event.element(event);
    	location.href="http://www.takamuro.com/tsgroup/";
}
*/
function mdsp9(event) {
    var eID=Event.element(event);
    location.href="http://www.takamuro.com/blog/soft/index.cgi";
}

function mouseover(event){
	var eID=Event.element(event);
	$(eID.id).style.color='#F0F0FA';
	$(eID.id).style.backgroundColor='#000099';
}
function mouseout(event){
	var eID=Event.element(event);
	$(eID.id).style.color='#000099';
	$(eID.id).style.backgroundColor='#F0F0FA';
	$(c).style.color='#F0F0FA';
	$(c).style.backgroundColor='#000099';

}
function ShowKuji(kRes,kCom) {
   var kuji = Math.floor(Math.random()*mres.length);
   document.getElementById(kRes).innerHTML = mres[kuji];
   document.getElementById(kCom).innerHTML = mcom[kuji];
}
function mover(obj){
	obj.style.backgroundColor='#BED0FC';
	obj.style.cursor='pointer';
}
function mout(obj){
	obj.style.backgroundColor='#FFC040';
	obj.style.cursor='nomal';
}
