﻿var _MIN_TIP_NUMBER = 1;
var _MAX_TIP_NUMBER = 4;
var _currentTipNum = 1;  //Math.floor(Math.random() * _MAX_TIP_NUMBER + _MIN_TIP_NUMBER)
var _tip_content_element = document.getElementById('tip_content');


function tst_previous() {
    showTip(getPreviousTipNum());
}
function tst_next() {
    showTip(getNextTipNum());
}
function tst_select(tipNum) {
    showTip(tipNum);
}
function tst_off(tDot) {
    if (tDot.id == 'tip_dot' + _currentTipNum) return;
    tDot.src = '/Images/products/toasterStrudel/btn_FlipperCircleEmpty.gif';
}
function tst_over(tDot) {
    tDot.src = '/Images/products/toasterStrudel/btn_FlipperCircleFull.gif';
}


function showTip(tipNum) {
    _currentTipNum = tipNum
    _tip_content_element.innerHTML = getTipContent(_currentTipNum);
    clearDots()
    tst_over(document.getElementById('tip_dot' + _currentTipNum));
}

function getNextTipNum() {
    if (_currentTipNum >= _MIN_TIP_NUMBER && _currentTipNum < _MAX_TIP_NUMBER)
        ++_currentTipNum;
    else
        _currentTipNum = _MIN_TIP_NUMBER;
    return _currentTipNum;
}

function getPreviousTipNum() {
    if (_currentTipNum <= _MAX_TIP_NUMBER && _currentTipNum > _MIN_TIP_NUMBER)
        --_currentTipNum;
    else
        _currentTipNum = _MAX_TIP_NUMBER;
    return _currentTipNum;
}

function getTipContent(tipNum){
    switch (tipNum) {
        case 1: return "<span style='font-weight:bold;'>Take a Coffee Break</span><br /><br />No matter how sleepy you are, your last act before bedtime should be setting up that coffee maker.  Treat yourself to something a little special in the filter to be brewed while you sleep.  Just wake, pour, and dunk a flakey Toaster Strudel.";
        case 2: return "<span style='font-weight:bold;'>Don't Break-fast, Break-fresh</span><br /><br />Studies show skipping breakfast is bad news, but skipping a good, sweet, delicious breakfast is even worse.  So take just a minute to make something simple but sweet for yourself in the morning.  Toaster Strudel is flakey and warm and easy to make.  You just can't have a bad day when you start it with pastry.";
        case 3: return "<span style='font-weight:bold;'>Feng Shui your Kitchen</span><br /><br />Position you kitchen table to look out a window or seat yourself in a room with natural light.  Enjoying your Toaster Strudel and coffee in a calm environment lets you reflect just a little before the day's madness begins.";
        case 4: return "<span style='font-weight:bold;'>Take a Seat</span><br /><br />Pull that pastry from the toaster and saddle up with that piping hot cup of cofee.  Give yourself a little break to really savor your morning.  You're going to be rushing around all day, why get started earlier than you have to?";
        default: return '';
       }
}

function clearDots() {
    for(var i = _MIN_TIP_NUMBER; i <= _MAX_TIP_NUMBER; i++)
    {
        document.getElementById('tip_dot' + i.toString()).src = '/Images/products/toasterStrudel/btn_FlipperCircleEmpty.gif';
    }
}
