jQuery(document).ready(function ($) {
    $(function () {
        $("a#next_profile").click(function () {
            $('div#slider_container>*').fadeOut('250');
            $('a#next_profile_loading_image').css({
                visibility: "visible",
                display: "block"
            });
            var post_id = $("a#the_next_page_id").attr("rel");
            $('#slider_container').load(document.domain + "/load-next-profile/?id=" + post_id, function () {
                $('a#next_profile_loading_image').css({
                    visibility: "visible",
                    display: "none"
                });
            });
            return false;
        });
        $("a#play_video_button").click(function () {
            var video_location = $("a#the_video_url").attr("rel");
            $("#play_video_button").colorbox({
                iframe: true,
                innerWidth: 600,
                innerHeight: 380,
                href: video_location
            });
        });
        $("a#view_profile_button").click(function () {
            var profile_location = $("a#profile_link_address").attr("rel");
            $("a#view_profile_button").colorbox({
                iframe: true,
                innerWidth: 800,
                innerHeight: 650,
                href: profile_location
            });
        });
    });
});
