﻿/*
    Client side javascript code for the tonic homepage
*/

var _current_dd_item = -1;

function ToggleDropDownMenu() {

    var menu = document.getElementById('dropdownmenu');
    var bottomcap = document.getElementById('dropdownmenubottom');
    
    if (menu.style.visibility == 'hidden' || menu.style.visibility == '') {
        menu.style.visibility = 'visible';
        bottomcap.style.visibility = 'visible';
    }
    else {
        menu.style.visibility = 'hidden';
        bottomcap.style.visibility = 'hidden';
    }
}

function SelectDropDownMenuItem(txt, id) {
    var menu = document.getElementById('dropdownmenu');
    var bottomcap = document.getElementById('dropdownmenubottom');
    
    menu.style.visibility = 'hidden';
    bottomcap.style.visibility = 'hidden';
    
    document.getElementById('TherapyTypePlaceholder').innerHTML = txt;
    _current_dd_item = id;
}

function GoToDropDownMenuItemSelection() {

    var href = '';

    switch (_current_dd_item) {
        case -1:
            window.location.href = 'aboutus.aspx';
            break;

        case 0:     //stress
            window.location.href = 'services_stresstonic.aspx';
            break;

        case 1:     //sleep
            window.location.href = 'services_sleeptonic.aspx';
            break;
            
        case 2:     //pain
            window.location.href = 'services_paintonic.aspx';
            break;
            
        case 3:     //age
            window.location.href = 'services_agetonic.aspx';
            break;

        case 4: //phobia
            window.location.href = 'services_phobiatonic.aspx';
            break;

        case 5: // dental
            window.location.href = 'services_dentaltonic.aspx';
            break;
    }

    if (href.length > 0) {
        window.location.href = href;
    }
}

function ShowLoginPanel() {
    document.getElementById('logininputbox').style.visibility = 'visible';
}
