var bigGameLink = undefined;
var flashSupported = 0;

function setGameLink(link) {
    bigGameLink = link;
}

function setGameImageOrFlash(sm_id, gameShort, link, langSuffix) {
    if (flashSupported) {
        getFlashMovieObject("flashIntro").selectGameBySMID(sm_id);
    }
    // update game images anyway, nothing serious happens and we need at least l_* for classic games
    document.images['l_' + gameShort].src = 'gfx/hp/games/l_' + gameShort + '.gif';
    if (document.images['sm'])
        document.images['sm'].src = 'gfx/hp/games/b_' + gameShort + langSuffix + '.gif'
    bigGameLink = link;
}

function setGameImage(gameShort, link, langSuffix) {
    document.images['l_' + gameShort].src = 'gfx/hp/games/' + gameShort + '.gif';
    if (document.images['sm'])
        document.images['sm'].src = 'gfx/hp/games/b_' + gameShort + langSuffix + '.gif'
    bigGameLink = link;
}

function unsetGameImage(gameShort) {
    document.images['l_' + gameShort].src = 'gfx/hp/games/l_x.gif';
}

function goToBigGameURL() {
    if (bigGameLink)
        top.location.href = bigGameLink;
}

function getFlashMovieObject(movieName) {
    return document[movieName];
    /* the reference code does not work somehow:
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName];
    } else {
        return document[movieName];
    }
    */
}

