// JavaScript Document

$(window).bind('load', function () {

    $('.acc_first_close, .acc_first_open').click(function () {
        //alert(this.className);
        //if (this.className == "acc_first_close") {
        if (this.className.charAt(10) == "c") {
            $(this).removeClass();
            $(this).addClass("acc_first_open");
            $(this).next().slideToggle('slow');
            return false;
        }

        //if (this.className == "acc_first_open") {
        if (this.className.charAt(10) == "o") {
            $(this).removeClass();
            $(this).addClass("acc_first_close");
            $(this).next().slideToggle('slow');
            return false;
        }

        //alert(this.className)
    })//.next().hide();


    // Font Replacemnt
    Cufon.replace('h1, h2, #nav_phone_number, #footer_phone_number');


    // Drop Nav Animation
    $("#nav li").hover(function () {
        $("ul", this).css("display", "none");
        $("ul", this).slideDown("fast");
    }, function () {
        //$("ul",this).css("display", "none"); 
        $("ul", this).slideUp("fast");
    });
    if (document.all) {
        //$("#nav li").hoverClass("sfHover");
        $('#nav li').hover(function () {
            $(this).addClass('sfHover');
        }, function () {
            $(this).removeClass('sfHover');
        });
    }




    // Password
    $('#password-clear').show();
    $('#password-password').hide();

    $('#password-clear').focus(function () {
        $('#password-clear').hide();
        $('#password-password').show();
        $('#password-password').focus();
    });
    $('#password-password').blur(function () {
        if ($('#password-password').val() == '') {
            $('#password-clear').show();
            $('#password-password').hide();
        }
    });





    // Callout Accordian
    $('.co_demo').click(function () {
        $(this).toggleClass("co_demo_open");
        $(this).next().slideToggle('slow'); return false;
    })

    $('.co_newsletter').click(function () {
        $(this).toggleClass("co_newsletter_open");
        $(this).next().slideToggle('slow'); return false;
    })

    $('.co_forum').click(function () {
        $(this).toggleClass("co_forum_open");
        $(this).next().slideToggle('slow'); return false;
    })

    $('.co_demo_open').click(function () {
        $(this).toggleClass("co_demo");
        $(this).next().slideToggle('slow'); return false;
    })

    $('.co_newsletter_open').click(function () {
        $(this).toggleClass("co_newsletter");
        $(this).next().slideToggle('slow'); return false;
    })

    $('.co_forum_open').click(function () {
        $(this).toggleClass("co_forum");
        $(this).next().slideToggle('slow'); return false;
    })




});






// Son Of Sucker Fish
//sfHover = function() {
//  var sfEls = document.getElementById("nav").getElementsByTagName("LI");
//  for (var i=0; i<sfEls.length; i++) {
//      sfEls[i].onmouseover=function() {
//          this.className+=" sfhover";
//      }
//      sfEls[i].onmouseout=function() {
//          this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
//      }
//  }
//}
//if (window.attachEvent) window.attachEvent("onload", sfHover);
