

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;
        }

        carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[i-1]));
    }
};

/**
 * Item html creation helper.
 */

var sPath = window.location.pathname;
if(sPath.indexOf("viewgallery") != -1){
	
jQuery(document).ready(function() {
$("#placeholder").remove();
   jQuery('#mycarousel').jcarousel({
       size: mycarousel_itemList.length,
       
      itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback}
    });
});
}





function mycarousel_getItemHTML(item)
{
    return '<div  onclick=\"changediv(\''+item.image+'\', \''+item.caption+'\', \''+item.hits+'\',\''+item.theid+'\');\" style="width:75px; height:75px; cursor:pointer; display:block; background:url(\''+item.url+'\') #000000 center top no-repeat;"></div>';
};
//<img border=\"0\" src=\"' + item.url + '\" width=\"75\" height=\"75\" alt=\"' + item.url + '\" />
function changediv(image, caption, hits,theid){


$('#myid').fadeOut(500,function(){
   $('#myid').fadeIn(500).html('<img style=\"border:#ffffff solid 1px;\"  id=\"theone\" align=\"middle\" src=\"'+image+'\" />');
    //$('#theone').rotateRight(78); 
 });
$('#caption').html(caption);
$('#hits').html('Views:'+hits);
$('#sendfriend').html('');
$.post("ajax/hits.asp", { id: theid } );
var currentimageid = theid;

}

