﻿$(document).ready(function() {

    // primarynav rollover effects
    $("div#primarynav > ul > li").hover(function() {
        $(this).addClass("over");
    }, function() {
        $(this).removeClass("over");
    });

    // stay connected text
    var strInput = "";
    $("div.stay-connected input.text").each(function() {
        switch ($(this).attr("class")) {
            case "text email":
                $(this).val("Email address");
                break;
            case "text cell":
                $(this).val("Cell # (for txts)");
                break;
            case "text zip":
                $(this).val("Zip");
                break;
        }
    });

    $("div.stay-connected input.text").click(function() {
        switch ($(this).attr("class")) {
            case "text email":
                strInput = "Email address";
                break;
            case "text cell":
                strInput = "Cell # (for txts)";
                break;
            case "text zip":
                strInput = "Zip";
                break;
        }
        if ($(this).val() == strInput)
            $(this).val("");
    });

    $("div.stay-connected input.text").blur(function() {
        switch ($(this).attr("class")) {
            case "text email":
                strInput = "Email address";
                break;
            case "text cell":
                strInput = "Cell # (for txts)";
                break;
            case "text zip":
                strInput = "Zip";
                break;
        }
        if ($(this).val() == "")
            $(this).val(strInput);
    });

    // schedule-viewer tabs
    $("div.schedule-viewer").tabs();

    // feature-viewer slide show
    var rotator = $('div#feature-viewer ul');
    $(rotator).cycle({
        fx: 'scrollHorz',
        timeout: 16000,
        speed: 750,
        prev: 'div#feature-viewer div.feature-nav a.previous',
        next: 'div#feature-viewer div.feature-nav a.next'
    });

});

ddaccordion.init({
    headerclass: "schedule_header", //Shared CSS class name of headers group
    contentclass: "details-view-schedule", //Shared CSS class name of contents group
    collapseprev: false, //Collapse previous content (so only one open at any time)? true/false 
    defaultexpanded: [], //index of content(s) open by default [index1, index2, etc]. [] denotes no content.
    animatedefault: false, //Should contents open by default be animated into view?
    persiststate: false, //persist state of opened contents within browser session?
    toggleclass: ["anchor-closed", "anchor-open"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
    togglehtml: ["prefix", "Show ", "Hide "], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
    animatespeed: "fast" //speed of animation: "fast", "normal", or "slow"
})
