function power_friend_notice() {
    $("a[rel=facebox]").click(function() {
        $("#send_form_container").fadeIn("fast");
        return false;
    });
    $(".close").live("click", function() {
        $("#send_form_container").fadeOut("fast");
        return false;
    });
};



function power_calendar_highlighting() {
    if ($(".calendar_control").val()) {
        highlighted_dates = $(".calendar_control").val().split(',');
        for (var i = 0; i < highlighted_dates.length; i++) {
            $('td.calendar_day').not('.other_month').eq(highlighted_dates[i] - 1).addClass("calendar_selected");
        }

    }
    $('td.calendar_day').not('.calendar_selected').css("cursor", "auto").each(function() {
        var element = $(this);
        var cloned_element = element.clone();
        element.after(cloned_element).remove();
    });
}




$(document).ready(function() {
    $("div.panel_button").click(function() {
        $("div#panel").animate({
            width: "650px"
        }).animate({
            width: "600px"
        }, "fast");
        $("div.panel_button").toggle();
    });

    $("div#hide_button").click(function() {
        $("div#panel").animate({
            width: "50px"
        }, "fast");
    });
    power_friend_notice();
    power_calendar_highlighting();
});
