// CONFERENCES
// Set thickbox loading image
tb_pathToImage = "/images/loading-thickbox.gif";

var Cconferences_itemList = [
	{url: "/images/conferences/billing-world-excellence-awards.jpg", title: "Billing World"},
    {url: "/images/conferences/billing-world-poster.jpg", title: "Billing World"},
    {url: "/images/conferences/fashion-lanyard.jpg", title: "Fashion Show"},
    {url: "/images/conferences/fashion-agenda.png", title: "Fashion Show"},
    {url: "/images/conferences/revenue-management-tickets.jpg", title: "Revenue Management"},
    {url: "/images/conferences/revenue-management-cd.png", title: "Revenue Management"},
//    {url: "/images/conferences/defense-presentation-slide-1.jpg", title: "Flower7"},
 //   {url: "/images/conferences/defense-presentation-slide-2.jpg", title: "Flower8"},
    {url: "/images/conferences/rateintegration-booth-1.png", title: "Rate Integration"},
    {url: "/images/conferences/rateintegration-booth-2.png", title: "Rate Integration"}
];

function Cconferences_itemLoadCallback(carousel, state)
{
    for (var i = carousel.first; i <= carousel.last; i++) {
        if (carousel.has(i)) {
            continue;
        }

        if (i > Cconferences_itemList.length) {
            break;
        }

        // Create an object from HTML
        var item = jQuery(Cconferences_getItemHTML(Cconferences_itemList[i-1])).get(0);

        // Apply thickbox
        tb_init(item);

        carousel.add(i, item);
    }
};

/**
 * Item html creation helper.
 */
function Cconferences_getItemHTML(item)
{
    var url_m = item.url.replace(/_s.jpg/g, '_m.jpg');
    return '<a href="' + url_m + '" title="' + item.title + '"><img src="' + item.url + '" width="322px" height="471px" border="0" alt="' + item.title + '" /></a>';
};

jQuery(document).ready(function() {
    jQuery('#Cconferences').jcarousel({
        size: 8,
        itemLoadCallback: {onBeforeAnimation: Cconferences_itemLoadCallback},
        scroll: 2,
        visible: 2,
        wrap: "circular",
        buttonPrevHTML: null,
        animation: 0
    });
});




// WEBDESIGN

var Cwebdesign_itemList = [
	
    {url: "/images/webdesign/pat-rego.jpg", title: "Pat Rego"},
    {url: "/images/webdesign/democratic-voice-of-burma.jpg", title: "DVB"},
    {url: "/images/webdesign/advanced-network-services.jpg", title: "ANS"},
    {url: "/images/webdesign/guia-epicureo.jpg", title: "Epicureo"},
    {url: "/images/webdesign/hough-houston.jpg", title: "Houston"},
    {url: "/images/webdesign/iss-world.jpg", title: "ISS World"},
    {url: "/images/webdesign/nature-is-waiting.jpg", title: "Trails"},
    {url: "/images/webdesign/pistolina.jpg", title: "Pistolina"},
    {url: "/images/webdesign/taxi-gourmet.jpg", title: "Taxis Gourmet"}
];

function Cwebdesign_itemLoadCallback(carousel, state)
{
    for (var i = carousel.first; i <= carousel.last; i++) {
        if (carousel.has(i)) {
            continue;
        }

        if (i > Cwebdesign_itemList.length) {
            break;
        }

        // Create an object from HTML
        var item = jQuery(Cwebdesign_getItemHTML(Cwebdesign_itemList[i-1])).get(0);

        // Apply thickbox
        tb_init(item);

        carousel.add(i, item);
    }
};

/**
 * Item html creation helper.
 */
function Cwebdesign_getItemHTML(item)
{
    var url_m = item.url.replace(/_s.jpg/g, '_m.jpg');
    return '<a href="' + url_m + '" title="' + item.title + '"><img src="' + item.url + '" width="471px" height="323px" border="0" alt="' + item.title + '" /></a>';
};

jQuery(document).ready(function() {
    jQuery('#Cwebdesign').jcarousel({
        size: 8,
        itemLoadCallback: {onBeforeAnimation: Cwebdesign_itemLoadCallback},
        scroll: 1,
        visible: 1,
        wrap: "circular",
        buttonPrevHTML: null,
        animation: 0
    });
});


// SOCIAL

var Csocial_itemList = [

    {url: "/images/social/tmforum-blogs.jpg", title: "TM Forum"},
    {url: "/images/social/tmforum-discussions.jpg", title: "TM Forum"},
    {url: "/images/social/tmforum-groups.jpg", title: "TM Forum"},
    {url: "/images/social/epicureo-hp.jpg", title: "Epicureo"},
    {url: "/images/social/epicureo-socialhp.jpg", title: "Epicureo"},
    {url: "/images/social/epicureo-restaurant.jpg", title: "Epicureo"}

];

function Csocial_itemLoadCallback(carousel, state)
{
    for (var i = carousel.first; i <= carousel.last; i++) {
        if (carousel.has(i)) {
            continue;
        }

        if (i > Csocial_itemList.length) {
            break;
        }

        // Create an object from HTML
        var item = jQuery(Csocial_getItemHTML(Csocial_itemList[i-1])).get(0);

        // Apply thickbox
        tb_init(item);

        carousel.add(i, item);
    }
};

/**
 * Item html creation helper.
 */
function Csocial_getItemHTML(item)
{
    var url_m = item.url.replace(/_s.jpg/g, '_m.jpg');
    return '<a href="' + url_m + '" title="' + item.title + '"><img src="' + item.url + '" width="471px" height="323px" border="0" alt="' + item.title + '" /></a>';
};

jQuery(document).ready(function() {
    jQuery('#Csocial').jcarousel({
        size: 6,
        itemLoadCallback: {onBeforeAnimation: Csocial_itemLoadCallback},
        scroll: 1,
        visible: 1,
        wrap: "circular",
        buttonPrevHTML: null,
        animation: 0
    });
});




// MOBILE

var Cmobile_itemList = [
    {url: "/images/mobile/epicureo-loading.png", title: "Epicureo"},
    {url: "/images/mobile/epicureo-section.png", title: "Epicureo"},
    {url: "/images/mobile/epicureo-map.png", title: "Epicureo"}

];

function Cmobile_itemLoadCallback(carousel, state)
{
    for (var i = carousel.first; i <= carousel.last; i++) {
        if (carousel.has(i)) {
            continue;
        }

        if (i > Cmobile_itemList.length) {
            break;
        }

        // Create an object from HTML
        var item = jQuery(Cmobile_getItemHTML(Cmobile_itemList[i-1])).get(0);

        // Apply thickbox
        tb_init(item);

        carousel.add(i, item);
    }
};

/**
 * Item html creation helper.
 */
function Cmobile_getItemHTML(item)
{
    var url_m = item.url.replace(/_s.jpg/g, '_m.jpg');
    return '<a href="' + url_m + '" title="' + item.title + '"><img src="' + item.url + '" width="194px" height="291px" border="0" alt="' + item.title + '" /></a>';
};

jQuery(document).ready(function() {
    jQuery('#Cmobile').jcarousel({
        size: 3,
        itemLoadCallback: {onBeforeAnimation: Cmobile_itemLoadCallback},
        scroll: 1,
        visible: 1,
        wrap: "circular",
        buttonPrevHTML: null,
        animation: 0
    });
});


