﻿
/**
* We use the initCallback callback
* to assign functionality to the controls
*/
function carousel_initCallback(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });
};

function callback(carousel, state) {
    jQuery(".jcarousel-control > a").removeClass("btnOn").addClass("btnOff");
    jQuery("#btn" + (parseInt(carousel.first) - 1)).removeClass("btnOff").addClass("btnOn");
};

jQuery(document).ready(function() {
    jQuery("#carousel").jcarousel({
        scroll: 1,
        initCallback: carousel_initCallback,
        auto: 5,
        wrap: 'last',
        itemVisibleInCallback: {
            onBeforeAnimation: null,
            onAfterAnimation: callback
        },
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
    jQuery("#btn0").removeClass("btnOff").addClass("btnOn");
    jQuery("#carousel img").removeClass("hide");


    // home page scroller
    var maxPos = parseInt($("#servicesScrollContent").height());
    maxPos = maxPos - 150;
    var step = 150;
    var currPos = 0;
    var newPos;
    jQuery('#up').bind('click', function() {
        newPos = currPos + step;
        if (newPos > maxPos) { newPos = maxPos }
        jQuery('#servicesScrollContent').animate({ top: -newPos }, 'slow');
        currPos = newPos;
        return false;
    });
    jQuery('#down').bind('click', function() {
        newPos = (currPos - step);
        if (newPos <= 0) { newPos = 0 }
        jQuery('#servicesScrollContent').animate({ top: -newPos }, 'slow')
        currPos = newPos;
        return false;
    });

    // print & design page

    $('#gallery a').lightBox();
    $('#gallery2 a').lightBox();
    $('#gallery3 a').lightBox();
    $('#gallery4 a').lightBox();
    $('#gallery5 a').lightBox();
    $('#gallery6 a').lightBox();
    $('#gallery7 a').lightBox();
    $('#gallery8 a').lightBox();
    $('#gallery9 a').lightBox();
    $('#gallery10 a').lightBox();
    $('#gallery11 a').lightBox();
    $('#gallery0 a').lightBox();
    //advertising page
    
    $('#gallery20 a').lightBox();
    $('#gallery21 a').lightBox();
    $('#gallery22 a').lightBox();
    $('#gallery23 a').lightBox();
    $('#gallery24 a').lightBox();
    $('#gallery25 a').lightBox();
    $('#gallery19 a').lightBox();
    
    //ColorBox - email marketing page
   	$('#PasticheCouture1').colorbox({width:"750px", height:"500px", iframe:true});
    $('#klopman1').colorbox({width:"605px", height:"500px", iframe:true});
    $('#giftedoriginals1').colorbox({width:"690px", height:"500px", iframe:true});
   	$('#alsico1').colorbox({width:"755px", height:"500px", iframe:true});
   	$('#totheprom1').colorbox({width:"750px", height:"500px", iframe:true});

    
});


