function init(){
    guestParsing();
}

var currentGuest = 0;
var currentGuestEdito = 0;
var currentGuestProg = 0;

function guestParsing(){
    $("#guests .guest").hide();
    var guests = $("#guests .guest");
    var links = $("#guestList a");

    $(guests[parseInt(currentGuest)]).show();
    $(links[parseInt(currentGuest)]).parent().addClass("currentLinksImg");

    for(i=0;i<links.length;i++)
        {
            $(links[i]).attr("name",i);

            $(links[i]).click(function(e)
                {
                   e.preventDefault();
                   $(guests[parseInt(currentGuest)]).hide();
                   $(links[parseInt(currentGuest)]).parent().removeClass("currentLinksImg");
                   currentGuest = $(this).attr("name");
                   $(guests[parseInt(currentGuest)]).show();
                   $(this).parent().addClass("currentLinksImg");
                })
        }


    $("#guestsEdito .guestEdito").hide();
    var guestsEdito = $("#guestsEdito .guestEdito");
    var linksEdito = $("#guestListEdito a");

    $(guestsEdito[parseInt(currentGuestEdito)]).show();
    $(linksEdito[parseInt(currentGuestEdito)]).addClass("currentLinksEdito");

    for(i=0;i<linksEdito.length;i++)
        {
            $(linksEdito[i]).attr("name",i);

            $(linksEdito[i]).click(function(e)
                {
                   e.preventDefault();
                   $(guestsEdito[parseInt(currentGuestEdito)]).hide();
                   $(linksEdito[parseInt(currentGuestEdito)]).removeClass("currentLinksEdito");
                   currentGuestEdito = $(this).attr("name");
                   $(guestsEdito[parseInt(currentGuestEdito)]).show();
                   $(this).addClass("currentLinksEdito");
                })
        }

    $("#guestsProg .guestProg").hide();
    $("#guestListProg span").hide();
    var guestsProg = $("#guestsProg .guestProg");
    var linksProg = $("#guestListProg a");
    var dateProg = $("#guestListProg span");

    $(guestsProg[parseInt(currentGuestProg)]).show();
    $(dateProg[parseInt(currentGuestProg)]).show();
    $(linksProg[parseInt(currentGuestProg)]).addClass("currentLinksProg");

    for(i=0;i<linksProg.length;i++)
        {
            $(linksProg[i]).attr("name",i);
            $(dateProg[i]).attr("name",i);

            $(linksProg[i]).click(function(e)
                {
                   e.preventDefault();
                   $(guestsProg[parseInt(currentGuestProg)]).hide();
                   $(dateProg[parseInt(currentGuestProg)]).hide();
                   $(linksProg[parseInt(currentGuestProg)]).removeClass("currentLinksProg");
                   currentGuestProg = $(this).attr("name");
                   $(guestsProg[parseInt(currentGuestProg)]).show();
                   $(dateProg[parseInt(currentGuestProg)]).show();
                   $(this).addClass("currentLinksProg");
                })
        }
}

$(document).ready(init);
