﻿var _MIN_TIP_NUMBER = 1;
var _MAX_TIP_NUMBER = 6;
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;'>Planning pays off</span><br /><br />As part of your going-to-bed ritual, get kids to help make sure everything is packed up and ready to roll in the morning. Double- check homework is in the backpack, shoes are lined up, a raincoat is handy if the forecast is wet and check the calendar to make sure there’s nothing special going on the next day. Do it EVERY night, and mornings will be calmer for all, and you’ll be getting kids into a habit that will help them forever.";
        case 2: return "<span style='font-weight:bold;'>Hand-held breakfast</span><br /><br />Sometimes, it’s a dash for the door. If you’re anticipating one of those mornings, be ready with a breakfast they can grab and eat on the road... Toaster Strudel® pastries, Grab and Go Eggs, Breakfast Quiches to Go , a carton of Yoplait® yogurt and Grands!(r) biscuits work well.<br /><br /><a href='/Recipes/ShowRecipe.aspx?rid=19736'>Grab and Go Eggs</a><br /><a href='/Recipes/ShowRecipe.aspx?rid=44952'>Breakfast Quiches To Go</a>";
        case 3: return "<span style='font-weight:bold;'>Speeding up kids on a slow day</span><br /><br />Kids (and grown-ups!) have mornings when they are just not ready to move at the pace needed to make it out the door on time. Be ready to make a game of it if you have a need for speed. Put on some energetic music, race them to the breakfast table, brush teeth in unison and challenge them to get dressed before you can finish a morning task. If it’s daily issue, encourage them with a star on the calendar for every day they are successful at getting ready.";
        case 4: return "<span style='font-weight:bold;'>Breakfast favorite</span><br /><br />On busy mornings, who has time for a breakfast battles? Serve up the one kids want to eat, warm Toaster Strudel® pastries, and get through the morning routine with nothing but smiles. (Ask kids to get dressed and all ready to go before they come to the table.)";
        case 5: return "<span style='font-weight:bold;'>Don’t forget!</span><br /><br />There are some things, like a lunch or an oversized school project, that you just can’t put in a backpack the night before, but it’s easy to walk out the door without them on a busy morning. Writing a note is the key – but where to put the note so you don’t miss it? Find the spot that works best for your family: on the bathroom mirror, clipped to a backpack or at the breakfast table, and use it consistently.";
        case 6: return "<span style='font-weight:bold;'>Post a schedule</span><br /><br />Older kids can keep an eye on the clock as they get ready. Post a schedule so that at a glance, they know what time to be dressed, head to breakfast and walk out the door. To get younger kids trained to keep on schedule, draw a clock face on the schedule so they can check it against the current time.";
        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';
    }
}
