﻿        $("#menu a, #header a, .ajaxLink").address();

        $.address.externalChange(function () {
            var address = document.location.toString();
            var newUri = address.split('#');
            $.ajax(
    { type: "GET",
        url: newUri[1],
        cache: false,
        success: function (html) {
            $("#leftContent").replaceWith($("#leftContent", html));
        }
    })
        });



        $("#menu a, #header a, .ajaxLink").live("click", function () {
            var id = $(this).attr("tabindex");
            $.ajax({
                type: "GET",
                url: $(this).attr("href"),
                cache: false,
                success: function (result) {
                    $("#leftContent").replaceWith($("#leftContent", result));

                    if (id != 0) {
                        var oldImageSource = $("#banner").attr("src");
                        var newSource = oldImageSource.split('im')[0] + "im" + id + ".jpg";
                        $("#banner").attr("src", newSource);
                    }

                    document.title = "Parabéla Bt : " + $("h2", result).first().text();
                }
            });
            return false;
        });

        $(document).ready(function () {
            $("#easySlider").easySlider({
                prevId: "leftArrow",
                nextId: "rightArrow",
                controlsShow: false,
                continuous: true,
                auto: true
            });
        });

        $("#searchForm").live("submit", function () {
            $.ajax({
                type: "POST",
                url: $(this).attr("action"),
                cache: false,
                data:$(this).serialize(),
                success: function (result) {
                    $("#leftContent").replaceWith($("#leftContent", result));
                }
            });
            return false;
        });

