/*** SPINAL FRACTURE JS ***/

$(window).load(function () {
    
    // Main Nav Mouseovers
    $("#main-nav li:not(.on) .nav-item").each(function () {
        $(this).bind("mouseover", function () {
            $(this)
                .parent().addClass("on")
                .children("img:first").attr("src", "assets/images/nav-bg-left.gif")
                .siblings("img").attr("src", "assets/images/nav-bg-right.gif");
        });
        
        $(this).bind("mouseout", function () {
            $(this)
                .parent().removeClass("on")
                .children("img").attr("src", "assets/images/1x1-invs.gif")
        });
    });


 /*    // Bind button text links to full button
    $("#main-nav .nav-item").add(".button-dark").add(".button-light").each(function () {
        $(this).bind("click", function () {
            document.location = $(this).children("a").attr("href");
        });
    });
	*/
    
    
    // Remove default text and restyle input fields, replace it if user doesn't enter text
    $("input[type=text]").each(function () {
        $(this).bind("focus", function () {
            if (!$(this).hasClass("on")) {
                $(this).data("default", $(this).val()).val("").addClass("on");
            }
        });
       
        $(this).bind("blur", function () {
            if (!$(this).val()) {
                $(this).val($(this).data("default")).removeClass("on");
            }
        });
    });
    
});
