function mycarousel_initCallback(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });


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

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

$(document).ready(function() {
	$("#home-photo").scrollable({circular: true}).navigator().autoscroll({autoplay:true,autopause:true, interval: 6000});	

	// add classes to navs
	$("#nav li:first").addClass('first');
	$("#nav li:last").addClass('last');

	// use this to open in new windows... but here is html5...
	$('a.external').click(function() {
    	window.open(this.href);
    	return false;
	 });
	var segment = jQuery.url.segment(1);
	if(segment == 'portfolio') {
		$(".portfolio li a").hover(function(){
		    $(this).stop().animate({"opacity": .5});
		},function(){
		    $(this).stop().animate({"opacity": 1});
		});		
	}
	jQuery("#showPhoto").jcarousel({
	    visible: 1,
	    scroll: 1,
		noButtons: true,
        initCallback: mycarousel_initCallback
        // wrap: 'first'
	});
    
	jQuery("#mycarousels").jcarousel({
	    visible: 11, // tied to clipping
	    scroll: 5
        // itemFirstInCallback: mycarousel_initCallback
		// autoScroll: 3,
        // wrap: 'first'
	});
	// portfolio messaging
	$("#leftnav a").hover(function(){
		var here = '#' + $(this).attr("id") + 'c';
		// alert(here);
		$(here).fadeIn();
		},function(){
		var here = '#' + $(this).attr("id") + 'c';
		$(here).hide();
	});
	
});
window.onload = function () {
	$('#emilyPhoto').fadeIn(2000);
	$('#home-photo').fadeIn(2000);
}
/*
werwer
*/function mycarousel_initCallback(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });


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

    jQuery('#mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};
// Galleria.loadTheme('/emily/wp-content/themes/followill/src/themes/classic/galleria.classic.js');

$(document).ready(function() {
    // $('#galleria').galleria();
	// var galleries = $('.ad-gallery').adGallery();
	// galleries[0].settings.effect = 'fade';
	// main scroll
	$("#home-photo").scrollable({circular: true}).navigator().autoscroll({autoplay:true,autopause:true, interval: 6000});	

	// add classes to navs
	$("#nav li:first").addClass('first');
	$("#nav li:last").addClass('last');

	// use this to open in new windows... but here is html5...
	$('a.external').click(function() {
    	window.open(this.href);
    	return false;
	 });
	var segment = jQuery.url.segment(1);
	if(segment == 'portfolio') {
		$(".portfolio li a").hover(function(){
		    $(this).stop().animate({"opacity": .5});
		},function(){
		    $(this).stop().animate({"opacity": 1});
		});		
	}
	jQuery("#showPhoto").jcarousel({
	    visible: 1,
	    scroll: 2,
		noButtons: true,
        initCallback: mycarousel_initCallback,
        wrap: 'first'
	});
    
	jQuery("#mycarousels").jcarousel({
	    visible: 11, // tied to clipping
	    scroll: 5
        // itemFirstInCallback: mycarousel_initCallback
		// autoScroll: 3,
        // wrap: 'first'
	});
	// portfolio messaging
	$("#leftnav a").hover(function(){
		var here = '#' + $(this).attr("id") + 'c';
		// alert(here);
		$(here).fadeIn();
		},function(){
		var here = '#' + $(this).attr("id") + 'c';
		$(here).hide();
	});
	
});
window.onload = function () {
	$('#emilyPhoto').fadeIn(2000);
	$('#home-photo').fadeIn(2000);
}
/*
werwer
*/
