		$(document).ready(function() {
			// page load
			$('#contentarea2').fadeIn(1200);
			
		});			
	
	
		function mycarousel_itemLoadCallback(carousel, state)
			{
				for (var i = carousel.first; i <= carousel.last; i++) {
					if (carousel.has(i)) {
						continue;
					}
			
					if (i > mycarousel_itemList.length) {
						break;
					}
			
					// Create an object from HTML
					var item = jQuery(mycarousel_getItemHTML(mycarousel_itemList[i-1])).get(0);
			
					// Apply thickbox
					tb_init(item);
			
					carousel.add(i, item);
				}
			};
			
			/**
			 * Item html creation helper.
			 */
			function mycarousel_getItemHTML(item)
			{
				var url_m = item.url.replace(/_s.jpg/g, '_m.jpg');
				if (item.type == 'image') {
					return '<a href="' + url_m + '" title="' + item.title + '"><img src="' + item.url + '" width="136" height="136" border="0" alt="' + item.title + '" /></a>';
				} else if (item.type == 'video') {
					return '<a class="thickbox" href="' + item.url2 + '" title="' + item.title + '"><img src="' + item.url + '" width="136" height="136" border="0" alt="' + item.title + '" /></a>';
				}
			};
			
			jQuery(document).ready(function() {
				jQuery('#gallery').jcarousel({
					size: mycarousel_itemList.length,
					itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback}
				});
			});