$(document).ready(function() {    
	$('#makeup_artist_gallery2 a').lightBox({
		fixedNavigation:true,
		imageLoading: '../js/lightbox/images/lightbox-ico-loading.gif',
		imageBtnClose: '../js/lightbox/images/lightbox-btn-close.gif',
		imageBtnPrev: '../js/lightbox/images/lightbox-btn-prev.gif',
		imageBtnNext: '../js/lightbox/images/lightbox-btn-next.gif'  	
	});
	
	$.fn.image = function(src, f){
       return this.each(function(){
         $('<img />').appendTo(this).each(function(){
            this.src = src;
            this.onload = f;
         });
       });
    } 
    
    $('.jCarouselLite').jCarouselLite({
        btnNext: '.next',
        btnPrev: '.prev',
        vertical: true,
        visible: 7,
        scroll: 2,
        speed: 800
    });   
    
    $('#makeup_artist_gallery li:not(".current") img').css('opacity', 0.5);

    $('#makeup_artist_gallery li:not(".current") img').hover(
        function () {
            $(this).css('opacity', 1);
        }, 
        function () {
            if($(this).attr('class') != 'current') {
                $(this).css('opacity', 0.5);
            }
        }
    );
    
    var page = $('body').attr('id');
    
    $('#makeup_artist_gallery img').live('click', function() {
        var id = $(this).parent().parent().attr('id');
        $('#makeup_artist_gallery img').css('opacity', 0.5);
        $('#makeup_artist_gallery .current').removeClass('current');
        $(this).css('opacity', 1);
        $(this).addClass('current');
        $('#photo img').fadeOut('400', function() {
            $(this).remove();
        });
        $('#photo').image('/img/makeup_artist_portfolio/makeup_artist_photos/photo' + id + '.jpg');
        return false;
    });  
    
    $('#services #main_content p:not(:first)').hide();
    $('h2').click(function() {
        $(this).next().fadeToggle('slow'); 
    });
});

jQuery.fn.fadeToggle = function(speed, easing, callback) {
   return this.animate({opacity: 'toggle'}, speed, easing, callback);

}; 
