$(document).ready(function() {

	$('#portfolio_single').cycle({
                timeout: 0,
		fx: 'fade', 
                pause: 1,
                pauseOnPagerHover: 1, 
                prev: '#portfolio_previous',
                next: '#portfolio_next',
                pager: '#portfolio_grid_single',
                pagerAnchorBuilder: function(idx, slide) { 
                    // return selector string for existing anchor 
                    return '#portfolio_grid_single li:eq(' + idx + ') a'; 
                }
	});

//	$('figure.gallery-item a').attr('rel','gallery');
//	$('figure.gallery-item a[rel="gallery"]').fancybox();

        $('#portfolio_grid_home').cycle({
		fx: 'fade',
                pause: 1,
                next: '#portfolio_home_next'
	});
        
        /*
        // Match all link elements with href attributes within the content div
        $('.portfolio_item a img[title]').qtip(
        {
           //content: 'Some basic content for the tooltip'  Give it some content, in this case a simple string
        });
        */
        
        $('.portfolio_item a img[title]').qtip({
                position: {
                    target: 'mouse',
                    corner: { tooltip: 'bottomLeft' }
                },
                show: {
                   when: { event: 'mouseover' },
                   // when: false, // Don't specify a show event
                   ready: false // Show the tooltip when ready
                },
                hide: {
                    when: { event: 'mouseout' } // false,  Don't specify a hide event
                },
                style: {
                   border: {
                      width: 5
                   },
                   padding: 10, 
                   textAlign: 'center',
                   tip: {
                        corner: 'bottomLeft', // Give it a speech bubble tip with automatic corner detection
                        offset: 100
                   },
                   name: 'light' // Style it according to the preset 'cream' style
                }
        });

});
