// JavaScript Document
jQuery.noConflict();
jQuery(document).ready(function(){
	Boxgrid();	
	Mycarousel();
	
});

function Boxgrid(){
	jQuery('.boxgrid.caption').hover(function(){
		jQuery(".cover", this).stop().animate({top:'65px'},{queue:false,duration:160});
	}, function() {
		jQuery(".cover", this).stop().animate({top:'100px'},{queue:false,duration:160});
	});
}


function Mycarousel(){
	jQuery('#mycarousel').jcarousel({		
        auto: 2,		
		scroll: 1,	
        wrap: 'last',
        initCallback: mycarousel_initCallback
	});
}




function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(1);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(1);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};


// /**
 // * Add classes to specified elements.
 // * Supported classes are: 'odd', 'even', 'first', 'last'
 // *
 // * @param elements - array of elements to be decorated
 // * [@param decorateParams] - array of classes to be set. If omitted, all available will be used

// function mw_decorateGeneric(elements, decorateParams)
// {
    // var allSupportedParams = ['odd', 'even', 'first', 'last'];
    // var _decorateParams = {};
    // var total = elements.length;

    // if (total) {
        // // determine params called
        // if (typeof(decorateParams) == 'undefined') {
            // decorateParams = allSupportedParams;
        // }
        // if (!decorateParams.length) {
            // return;
        // }
        // for (var k in allSupportedParams) {
            // _decorateParams[allSupportedParams[k]] = false;
        // }
        // for (var k in decorateParams) {
            // _decorateParams[decorateParams[k]] = true;
        // }

        // // decorate elements
        // // elements[0].addClassName('first'); // will cause bug in IE (#5587)
        // if (_decorateParams.first) {
            // Element.addClassName(elements[0], 'first');
        // }
        // if (_decorateParams.last) {
            // Element.addClassName(elements[total-1], 'last');
        // }
        // for (var i = 0; i < total; i++) {
            // if ((i + 1) % 2 == 0) {
                // if (_decorateParams.even) {
                    // Element.addClassName(elements[i], 'even');
                // }
            // }
            // else {
                // if (_decorateParams.odd) {
                    // Element.addClassName(elements[i], 'odd');
                // }
            // }
        // }
    // }
// }
 // */