function mycarousel_initCallback(carousel, state)
{
    // Lock until all items are loaded. That prevents jCarousel from
    // setup correctly and we have to do that in the ajax callback
    // function with carousel.setup().
    // We're doing that because we don't know the exact height of each
    // items until they are added to the list.
    carousel.lock();

    jQuery.get(
        'special_textscroller.php',
        {
            'feed': 'http://jquery.com/blog/feed/atom/'
        },
        function(xml) {
            mycarousel_itemAddCallback(carousel, xml);
        },
        'xml'
    );


};

function myJquery(carousel, state){
	carousel.lock();


	$.ajax({
   type: "POST",
   url: "test_jquery.php",
   data: "name=John&location=Boston",
   success:function(xml) {
	  mycarousel_itemAddCallback(carousel, xml);
	}
	});


};

function myfunction(carousel, state)
{

	carousel.lock();
	$.ajax({
   type: "POST",
   url: "test_jquery.php",
   data: "name=John&location=Boston",
   success: function(msg){
	 document.getElementById('mydiv').innerHTML = msg;
   }
 });
}

function mycarousel_itemAddCallback(carousel, xml)
{
    var $items = jQuery('item', xml);
    $items.each(function(i) {
        carousel.add(i + 1, mycarousel_getItemHTML(this));
    });

    carousel.size($items.size());

    // Unlock and setup.
    carousel.unlock();
    carousel.setup();
};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(item)
{
	

    return '<h3><a href="'+$('link', item).text()+'">'+$('title', item).text()+'</a></h3><p>'+$('description', item).text();
		//mycarousel_truncate($('description', item).text(), 300)+'</p>';
};

/**
 * Utility function for truncating a string without breaking words.
 */
function mycarousel_truncate(str, length, suffix) {
    if (str.length <= length) {
        return str;
    }

    if (suffix == undefined) {
        suffix = '...';
    }

    return str.substr(0, length).replace(/\s+?(\S+)?$/g, '') + suffix;
};
