﻿$(document).ready(function() {
    $(".photocont3 a").lightBox();
    $(".photocont4 a").lightBox();
});

$(document).ready(function() {
    $(".rightCol td a").click(function(event){
        event.preventDefault();
        var index = this.href.lastIndexOf("?");
        var userId = this.href.substr(index);
        $(".mainContainer").html("");
        $.get("GalleryHandler.ashx" + userId, function(data, textStatus){
            $(".mainContainer").html(data);
            $(".photocont3 a").lightBox();
        });
        
    });
    $(".rightCol .pagesmenu a").click(function(event){
        event.preventDefault();
        $.get($(this).attr("href"),function(data, textStatus){
            $(".users_table").remove();
            $(".rightCol").prepend(data);
            /*da rivedere*/
            $(".rightCol td a").click(function(event){
                event.preventDefault();
                var index = this.href.lastIndexOf("?");
                var userId = this.href.substr(index);
                $(".mainContainer").html("");
                $.get("GalleryHandler.ashx" + userId, function(data, textStatus){
                    $(".mainContainer").html(data);
                    $(".photocont3 a").lightBox();
                });
            });
        });
    });
});
