// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

// Pass in the div containing the spinner, will show it. If hide_div
// is supplied, will hide that
function switch_spinner_on (spinner_div, hide_div) {

    spinner = $(spinner_div);
    hide = $(hide_div);

    spinner.style.display = "";

    if (hide) {
        hide.style.display = "none";
    }

}

// Pass in the div containing the spinner, will hide it. If show_div
// is supplied will show that one
function switch_spinner_off (spinner_div, show_div) {

    spinner = $(spinner_div);
    show = $(show_div);

    spinner.style.display = "none";

    if (show) {
        show.style.display = "";
    }

}

// This routine will call google analytics to let it know a password has
// been generated. Called afer the form is submitted

function log_with_analytics() {

    pageTracker._trackPageview('/generated');

}
