﻿// -------------------------------------------------------------------
// Copyright AspDotNetStorefront.com, 2011.  All Rights Reserved.
// Lost Battalion Publishing, LLC
// -------------------------------------------------------------------

function SMGOpenDialog(bName) {
    SMGCloseDialog();
    document.getElementById('SMGDialog').style.visibility = "visible";
    document.getElementById('SMGClose').style.visibility = "visible";
    document.getElementById(bName).style.visibility = "visible";
}

function SMGShowHide(eName, showIt) {
    document.getElementById(eName).style.visibility = showIt;
}

function SMGCloseDialog() {
    document.getElementById('SMGDialog').style.visibility = "hidden";
    document.getElementById('SMGClose').style.visibility = "hidden";
    document.getElementById('MapText').style.visibility = "hidden";
    document.getElementById('MiniaturesText').style.visibility = "hidden";
    document.getElementById('LandmarksText').style.visibility = "hidden";
    document.getElementById('SoldiersText').style.visibility = "hidden";
    document.getElementById('PhasesText').style.visibility = "hidden";
    document.getElementById('EventText').style.visibility = "hidden";
    document.getElementById('CardsText').style.visibility = "hidden";
}

function hideQuestion() {
    document.getElementById('question1').style.visibility = "hidden";
    document.getElementById('question1lbl').style.visibility = "hidden";
    document.getElementById('questionMap').style.visibility = "visible";
    document.getElementById('questionMiniatures').style.visibility = "visible";

    document.getElementById('questionLandmarks').style.visibility = "visible";
    document.getElementById('questionSoldiers').style.visibility = "visible";
    document.getElementById('questionPhases').style.visibility = "visible";
    document.getElementById('questionEvents').style.visibility = "visible";
    document.getElementById('questionCards').style.visibility = "visible";
}

var smgTimerId = 0;
var smgSequence = 0;
var idClick = "";
var urlClick = "";
var urlReset = "";

function smgSetImage(e, url) {
    if (e != idClick)
        document.getElementById(e).src = url;
}

function smgDoClick(e, url, r, seq) {
    var d_off = "";
    var d_on = e + "Div";

    if (idClick != "" && urlReset != "") {
        d_off = idClick + "Div";
        document.getElementById(idClick).src = urlReset;
    }
    smgStart();
    idClick = e;
    urlClick = url;
    urlReset = r;
    document.getElementById(e).src = url;
    smgSequence = seq;
    smgNext();
}

function smgStart() {
    if (smgSequence == 0) {
        // Start the timer
        alertTimerId = setTimeout("smgNext()", 17000);
    }
}

function smgSeqClick() {
    if (smgSequence != 0) {
        if (idClick == "smgBG") {
            if (smgSequence == 1)
                window.location = "http://www.lostbattaliongames.com/default.aspx";
            if (smgSequence == 2)
                window.location = "http://www.lostbattaliongames.com/default.aspx";
            if (smgSequence == 3)
                window.location = "http://www.lostbattaliongames.com/default.aspx";
            if (smgSequence == 4)
                window.location = "http://www.lostbattaliongames.com/default.aspx";
            if (smgSequence == 5)
                window.location = "http://www.lostbattaliongames.com/default.aspx";
            clearTimeout(smgTimerId);
        }
        if (idClick == "smgMini") {
            if (smgSequence == 1)
                window.location = "http://www.lostbattaliongames.com/default.aspx";
            if (smgSequence == 2)
                window.location = "http://www.lostbattaliongames.com/default.aspx";
            if (smgSequence == 3)
                window.location = "http://www.lostbattaliongames.com/default.aspx";
            if (smgSequence == 4)
                window.location = "http://www.lostbattaliongames.com/default.aspx";
            if (smgSequence == 5)
                window.location = "http://www.lostbattaliongames.com/default.aspx";
            clearTimeout(smgTimerId);
        }
        if (idClick == "smgCard") {
            if (smgSequence == 1)
                window.location = "http://www.lostbattaliongames.com/default.aspx";
            if (smgSequence == 2)
                window.location = "http://www.lostbattaliongames.com/default.aspx";
            if (smgSequence == 3)
                window.location = "http://www.lostbattaliongames.com/default.aspx";
            if (smgSequence == 4)
                window.location = "http://www.lostbattaliongames.com/default.aspx";
            if (smgSequence == 5)
                window.location = "http://www.lostbattaliongames.com/default.aspx";
            clearTimeout(smgTimerId);
        }
    }
}

function smgNext() {
    if (smgTimerId != null)
        clearTimeout(smgTimerId);
    if (smgSequence == 5)
        smgSequence = 0;
    smgSequence += 1;

   if (idClick == "smgBG") {
        if (smgSequence == 1)
            document.getElementById("mainSMG").src = "images/LBG/smgMapCard.jpg";
        if (smgSequence == 2)
            document.getElementById("mainSMG").src = "images/LBG/smgMapAerial.jpg";
        if (smgSequence == 3)
            document.getElementById("mainSMG").src = "images/LBG/smgMapDurability.jpg";
        if (smgSequence == 4)
            document.getElementById("mainSMG").src = "images/LBG/smgMapDYO.jpg";
        if (smgSequence == 5)
            document.getElementById("mainSMG").src = "images/LBG/smgMapMinis.jpg";
        smgTimerId = setTimeout("smgNext()", 17000);
    }
    if (idClick == "smgMini") {
        if (smgSequence == 1)
            document.getElementById("mainSMG").src = "images/LBG/smgMapMinis.jpg";
        if (smgSequence == 2)
            document.getElementById("mainSMG").src = "images/LBG/smgMinisUSPara.jpg";
        if (smgSequence == 3)
            document.getElementById("mainSMG").src = "images/LBG/smgMinisGerLuft.jpg";
        if (smgSequence == 4)
            document.getElementById("mainSMG").src = "images/LBG/smgMinisSkirmish.jpg";
        if (smgSequence == 5)
            document.getElementById("mainSMG").src = "images/LBG/smgMinisCard.jpg";
        smgTimerId = setTimeout("smgNext()", 17000);
    }
    if (idClick == "smgCard") {
        if (smgSequence == 1)
            document.getElementById("mainSMG").src = "images/LBG/smgMinisCard.jpg";
        if (smgSequence == 2)
            document.getElementById("mainSMG").src = "images/LBG/smgCardsFastCombat.jpg";
        if (smgSequence == 3)
            document.getElementById("mainSMG").src = "images/LBG/smgCardsUniqueAction.jpg";
        if (smgSequence == 4)
            document.getElementById("mainSMG").src = "images/LBG/smgCardsUniqueStories.jpg";
        if (smgSequence == 5)
            document.getElementById("mainSMG").src = "images/LBG/smgMapCard.jpg";
        smgTimerId = setTimeout("smgNext()", 17000);
    }
}

