function changearchivio() {
	$('#archivio_').removeClass('nodisplay');
	$('#archivio_').addClass('display');
	$('#new_').removeClass('display');
	$('#new_').addClass('nodisplay');
	$('#cooming_').removeClass('display');
	$('#cooming_').addClass('nodisplay');

}
function changenew() {
	$('#new_').removeClass('nodisplay');
	$('#new_').addClass('display');
	$('#archivio_').removeClass('display');
	$('#archivio_').addClass('nodisplay');
	$('#cooming_').removeClass('display');
	$('#cooming_').addClass('nodisplay');
}
function changecooming(changecooming) {
	$('#cooming_').removeClass('nodisplay');
	$('#cooming_').addClass('display');
	$('#archivio_').removeClass('display');
	$('#archivio_').addClass('nodisplay');
	$('#new_').removeClass('display');
	$('#new_').addClass('nodisplay');
}




//new

function new_itemLoadCallback(carousel, state)
{
    // Check if the requested items already exist
    if (carousel.has(carousel.first, carousel.last)) {
        return;
    }

    jQuery.get(
        'new.inc.php',
        {
            first: carousel.first,
            last: carousel.last
        },
        function(xml) {
            new_itemAddCallback(carousel, carousel.first, carousel.last, xml);
        },
        'xml'
    );
};

function new_itemAddCallback(carousel, first, last, xml)
{
    // Set the size of the carousel
    carousel.size(parseInt(jQuery('total', xml).text()));

    jQuery('image', xml).each(function(i) {
		carousel.add(first + i, new_getItemHTML(jQuery(this).text()));
    });
};

/**
 * Item html creation helper.
 */
function new_getItemHTML(url)
{
	return url;
};



//Archivio

function archivio_itemLoadCallback(carousel, state)
{
    // Check if the requested items already exist
    if (carousel.has(carousel.first, carousel.last)) {
        return;
    }

    jQuery.get(
        'archivio.inc.php',
        {
            first: carousel.first,
            last: carousel.last
        },
        function(xml) {
            archivio_itemAddCallback(carousel, carousel.first, carousel.last, xml);
        },
        'xml'
    );
};

function archivio_itemAddCallback(carousel, first, last, xml)
{
    // Set the size of the carousel
    carousel.size(parseInt(jQuery('total', xml).text()));

    jQuery('image', xml).each(function(i) {
		carousel.add(first + i, archivio_getItemHTML(jQuery(this).text()));
    });
};

/**
 * Item html creation helper.
 */
function archivio_getItemHTML(url)
{
	return url;
};

//cooming

function cooming_itemLoadCallback(carousel, state)
{
    // Check if the requested items already exist
    if (carousel.has(carousel.first, carousel.last)) {
        return;
    }

    jQuery.get(
        'cooming.inc.php',
        {
            first: carousel.first,
            last: carousel.last
        },
        function(xml) {
            cooming_itemAddCallback(carousel, carousel.first, carousel.last, xml);
        },
        'xml'
    );
};

function cooming_itemAddCallback(carousel, first, last, xml)
{
    // Set the size of the carousel
    carousel.size(parseInt(jQuery('total', xml).text()));

    jQuery('image', xml).each(function(i) {
		carousel.add(first + i, cooming_getItemHTML(jQuery(this).text()));
    });
};

/**
 * Item html creation helper.
 */
function cooming_getItemHTML(url)
{
	return url;
};

