// 殺しの７並べ、DashboardWidget関連処理

// iアイコン上にマウスカーソルが来た時のイベント処理
function infoover(id) {
    document.getElementById(id).style.display = "block";
}

// iアイコン上からマウスカーソルが離れた時のイベント処理
function infoout(id) {
    document.getElementById(id).style.display = "none";
}

// bodyにマウスが乗った時のイベント処理
app.overBody = function() {
    if (this.infoIcon) {
        this.infoIcon.start(true);
    }
}

// マウスカーソルがbodyから出た時のイベント処理
app.outBody = function() {
    if (this.infoIcon) {
        this.infoIcon.start(false);
    }
}

// 表面を表示する。
app.dispOmote = function() {
    if (window.widget) {
        widget.prepareForTransition("ToFront");
    }
    this.pause = false;
    document.getElementById("ura").style.display = "none";
    document.getElementById("omote").style.display = "block";
    if (window.widget) {
        setTimeout("widget.performTransition();", 0);
    }
}

// 裏面を表示する
app.dispUra = function() {
    if (window.widget) {
        widget.prepareForTransition("ToBack");
    }
    this.pause = true;
    document.getElementById("omote").style.display = "none";
    document.getElementById("ura").style.display = "block";
    infoout("ibuttonback");
    if (window.widget) {
        setTimeout("widget.performTransition();", 0);
    }
}

// widget表示時のイベント処理（pauseを解除）
function onshow() {
    app.pause = false;
}

// widget非表示時のイベント処理(pauseする)
function onhide() {
    app.pause = true;
}

function stopGame() {
    app.dispOmote();
    if (app.playtimer) {
        clearTimeout(app.playtimer);
        app.playtimer = null;
    }

    app.startGame();
}

function initialize() {
    app.setup();
    app.saveSetting();
    stopGame();
}

