$(document).ready
(
	function()
	{
		// CAROUSEL LINE 409
		if ($("#imagecarousel").length != 0)
	    {
	      $("#imagecarousel > ul").html('');
	      
	      jQuery('#imagecarousel').jcarousel({
	        
	        itemLoadCallback: mycarousel_itemLoadCallback,
	        scroll: 8,
	        visible: 8
	      });
	    }
	}
);
		
// CAROUSEL LINE 1628
function mycarousel_itemLoadCallback(carousel, state)
{
  // Check if the requested items already exist
  if (carousel.has(carousel.first, carousel.last)) {
    return;
  }

  jQuery.get(
    'dynamic_image.php',
    {
      first: carousel.first,
      last: carousel.last
    },
    function(xml) {
      mycarousel_itemAddCallback(carousel, carousel.first, carousel.last, xml);
    },
    'xml'
  );
};

function mycarousel_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, mycarousel_getItemHTML(jQuery(this).text()));
  });
};

function mycarousel_getItemHTML(url)
{
  var array;
  array = url.split(';;;');
  return '<a href="comment.php?location=' + array[0] + '"><img src="' + array[1] + '" width="75" height="75" alt="Latest street art" /></a>';
}

