function checkNickName(nickname){
    $('#iscr_check_nickname').css('display','block');
    $("#iscr_img_nickname").attr({src: "/img/Community/ajaxload.gif"});


    $.ajax({
    type: 'POST',
    url: '/services/Frontend/check_username.php',
    dataType: 'xml',
    data: 'username='+nickname,
    success: function(xml) {

        if ($(xml).find('error').text())
        {
            $("#iscr_img_nickname").attr({src: "/img/Community/cross.gif"});
            $("#nickname").focus();
        }
        else
        {
            $("#iscr_img_nickname").attr({src: "/img/Community/check.gif"});
        }

    }
    });


}

function checkEmail(email){
    $('#iscr_check_email').css('display','block');
    $("#iscr_img_email").attr({src: "/img/Community/ajaxload.gif"});


    $.ajax({
    type: 'POST',
    url: '/services/Frontend/check_email.php',
    dataType: 'xml',
    data: 'email='+email,
    success: function(xml) {

        if ($(xml).find('error').text())
        {
            // è andata male
            $("#iscr_img_email").attr({src: "/img/Community/cross.gif"});
            $("#email").focus();
        }
        else
        {
            // è andata bene
            $("#iscr_img_email").attr({src: "/img/Community/check.gif"});
        }

    }
    });

}

function checkPassword(password){
    $('#iscr_check_password').css('display','block');
    $("#iscr_img_password").attr({src: "/img/Community/ajaxload.gif"});
    $.post('/services/Frontend/iscrizione_listener.php', {
            password: password
            },
            function(data) {
                //alert(data);
                if(data == "true") {
                    // è andata bene
                    document.getElementById('ripetipassword').value = document.getElementById('password').value;
                    $("#iscr_img_password").attr({src: "/img/Community/check.gif"});
                }
                else {
                    // è andata male
                    $("#iscr_img_password").attr({src: "/img/Community/cross.gif"});
                    $("#password").focus();
                }
            }
        );
}
