/**
 * We use the initCallback callback
 * to assign functionality to the controls
 */
function mycarousel_initCallback(carousel) {
	//alert(carousel.attr("id"));
    jQuery('#mycarousel .jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
		//alert(jQuery(this));
		 jQuery('#mycarousel .jcarousel-control .control-width').removeClass("btn-active").addClass("btn-inactive");
		 
		 jQuery(this).find(".control-width").removeClass("btn-inactive").addClass("btn-active");
		 //alert(jQuery(this).find(".control-width").attr("class"));
		
        return false;
    });

    jQuery('#mycarousel .jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });

    jQuery('#mycarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};

// Ride the carousel...
jQuery(document).ready(function() {
	jQuery(".picshow").show();					
    jQuery("#mycarousel").jcarousel({
        scroll: 1,
        initCallback: mycarousel_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
	
	

});

function mycarousel_initCallback2(carousel) {
	//alert(carousel.attr("id"));
    jQuery('#mycarouse2 .jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
		//alert(jQuery(this));
		 jQuery('#mycarouse2 .jcarousel-control .control-width').removeClass("btn-active").addClass("btn-inactive");
		 
		 jQuery(this).find(".control-width").removeClass("btn-inactive").addClass("btn-active");
		 //alert(jQuery(this).find(".control-width").attr("class"));
		
        return false;
    });

    jQuery('#mycarouse2 .jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });

    jQuery('#mycarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};

// Ride the carousel...
jQuery(document).ready(function() {
	jQuery(".picshow").show();
	jQuery("#mycarouse2").jcarousel({
        scroll: 1,
        initCallback: mycarousel_initCallback2,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
});



$(document).ready(function(){

	$(window).bind("load", function() { 
									
		$(".over").each(function(){
			$this = $(this);
			start = 120 - $this.find(".over").height();
			stop = start - ($this.find(".over").height()+48);
			$this.css("top",start);
			
			$this.data("start", start);
			$this.data("stop", stop);
			$this.parents(".itemInner").addClass("rollAble");			
		});
		
		
		$("div.rollAble ").hover(
		
				function(){
					//alert("over");
					//$(this).find(".title").slideDown();
					$this = $(this).find(".over");
					//alert($this);
					//$this.find(".title_footer").show();
					//alert($this.data("stop"));
					//alert($this.data("stop"));
					$this.stop().animate({top: $this.data("stop")+ 'px'}, {queue: false, duration: 500});
				},
				function(){
					$this = $(this).find(".over");
					//$this.find(".title_footer").hide();
					$this.stop().animate({top:  $this.data("start") + 'px'}, {queue: false, duration: 500});
				}
			
			);
		
	}); 

});






