
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.rel;
    var flash_var = item.bollean_flash;
    return '<a href="javascript:changeContent(\'' + url_m + '\',\'' + flash_var + '\');"><img src="' + item.url + '" width="109" height="45" border="0" alt="' + item.title + '" /></a>';
};

function changeContent(url,is_flash){
	if (is_flash==1){
	    $('.big_picture').flash(
        { src: url,
          width: 572,
          height: 237 },
		{ expressInstall: true }
    );
	}
	else{
	$(".big_picture").html('<img src="' + url + '" border="0" />');
	};
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        size: mycarousel_itemList.length,
        itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback}
    });
});

	function clearText(theField)
	{
		if (theField.defaultValue == theField.value)
		theField.value = '';
	}
	
	function addText(theField)
	{
		if (theField.value == '')
		theField.value = theField .defaultValue;
	}