$(function() {
    $('#slider').cycle({
        fx:     'scrollHorz',
        speed:   800, 
        timeout: 10000,
        next:   '#btn-next', 
		prev:   '#btn-prev'

    });
});

$(function() {
	$("map > area").tooltip({
		track: true, 
		delay: 0, 
		showURL: false,
		top: -15, 
		left: 5
	});
});

$(function(){
		$('img.captify').captify({
		speedOver: 'normal',
		speedOut: 'fast',
		hideDelay: 100,	
		animation: 'slide',		
		opacity: '0.9'			
	});
});

jQuery(document).ready(function() {
$("#artoretro").fancybox({
		'width'				: 640,
		'height'			: 512,
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'overlayOpacity'	: 0.8,
		'overlayColor'		: '#666'
	});

function toggleRotating(fromButton) {
      count = count + 1;
      if (fromButton == false) {
        clearInterval(rotatingInterval);
        rotatingInterval = false;
        count = 0;
      } else {
        if(count == 1)
            rotatingInterval = setInterval($.fancybox.next, 10000);
      }
   }


var rotatingInterval = false;
var count = 0;

$("#davidgonzalez").click(function() {
		$.fancybox([
			{ 'href'	: 'http://flipskateboards.com/team-page/david-04.jpg', 'title'	: 'David Gonzalez | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/david-01.jpg', 'title'	: 'David Gonzalez | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/david-02.jpg', 'title'	: 'David Gonzalez | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/david-03.jpg', 'title'	: 'David Gonzalez | ARTOFOTO' }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'titlePosition'		: 'inside',
			'changeFade'        : 0,
			'showNavArrows'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: '#000',
			'autoScale'			: true,
			'changeSpeed'		: 500,
			'cyclic'			: true, 
			'onStart': function(){ toggleRotating(true); }
		});
	});
	
$("#aliboulala").click(function() {
		$.fancybox([
			{ 'href'	: 'http://flipskateboards.com/team-page/ali-01.jpg', 'title'	: 'Ali Boulala | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/ali-02.jpg', 'title'	: 'Ali Boulala | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/ali-03.jpg', 'title'	: 'Ali Boulala | ARTOFOTO' }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'titlePosition'		: 'inside',
			'changeFade'        : 0,
			'showNavArrows'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: '#000',
			'autoScale'			: true,
			'changeSpeed'		: 500,
			'cyclic'			: true, 
			'onStart': function(){ toggleRotating(true); }
		});
	});

$("#louie").click(function() {
		$.fancybox([
			{ 'href'	: 'http://flipskateboards.com/team-page/louie-03.jpg', 'title'	: 'Louie Lopez | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/louie-01.jpg', 'title'	: 'Louie Lopez | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/louie-02.jpg', 'title'	: 'Louie Lopez | ARTOFOTO' }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'titlePosition'		: 'inside',
			'changeFade'        : 0,
			'showNavArrows'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: '#000',
			'autoScale'			: true,
			'changeSpeed'		: 500,
			'cyclic'			: true, 
			'onStart': function(){ toggleRotating(true); }
		});
	});

$("#geoff").click(function() {
		$.fancybox([
			{ 'href'	: 'http://flipskateboards.com/team-page/geoff-01.jpg', 'title'	: 'Geoff Rowley | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/geoff-02.jpg', 'title'	: 'Geoff Rowley | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/geoff-03.jpg', 'title'	: 'Geoff Rowley | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/geoff-04.jpg', 'title'	: 'Geoff Rowley | ARTOFOTO' }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'titlePosition'		: 'inside',
			'changeFade'        : 0,
			'showNavArrows'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: '#000',
			'autoScale'			: true,
			'changeSpeed'		: 500,
			'cyclic'			: true, 
			'onStart': function(){ toggleRotating(true); }
		});
	});

$("#lance").click(function() {
		$.fancybox([
			{ 'href'	: 'http://flipskateboards.com/team-page/lance-04.jpg', 'title'	: 'Lance Mountain | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/lance-05.jpg', 'title'	: 'Lance Mountain | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/lance-06.jpg', 'title'	: 'Lance Mountain | Anthony Acosta' },
			{ 'href'	: 'http://flipskateboards.com/team-page/lance-01.jpg', 'title'	: 'Lance Mountain | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/lance-02.jpg', 'title'	: 'Lance Mountain | ARTOFOTO' }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'titlePosition'		: 'inside',
			'changeFade'        : 0,
			'showNavArrows'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: '#000',
			'autoScale'			: true,
			'changeSpeed'		: 500,
			'cyclic'			: true, 
			'onStart': function(){ toggleRotating(true); }
		});
	});
	
$("#arto").click(function() {
		$.fancybox([
			{ 'href'	: 'http://flipskateboards.com/team-page/arto-01.jpg', 'title'	: 'Arto Saari | ARTOFOTO' }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'titlePosition'		: 'inside',
			'changeFade'        : 0,
			'showNavArrows'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: '#000',
			'autoScale'			: true,
			'changeSpeed'		: 500,
			'cyclic'			: true, 
			'onStart': function(){ toggleRotating(true); }
		});
	});
	
$("#tom").click(function() {
		$.fancybox([
			{ 'href'	: 'http://flipskateboards.com/team-page/tom-01.jpg', 'title'	: 'Tom Penny | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/tom-02.jpg', 'title'	: 'Tom Penny | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/tom-03.jpg', 'title'	: 'Tom Penny | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/tom-04.jpg', 'title'	: 'Tom Penny | ARTOFOTO' }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'titlePosition'		: 'inside',
			'changeFade'        : 0,
			'showNavArrows'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: '#000',
			'autoScale'			: true,
			'changeSpeed'		: 500,
			'cyclic'			: true, 
			'onStart': function(){ toggleRotating(true); }
		});
	});

$("#bob").click(function() {
		$.fancybox([
			{ 'href'	: 'http://flipskateboards.com/team-page/bob-03.jpg', 'title'	: 'Bob Burnquist | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/bob-02.jpg', 'title'	: 'Bob Burnquist | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/bob-01.jpg', 'title'	: 'Bob Burnquist | ARTOFOTO' }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'titlePosition'		: 'inside',
			'changeFade'        : 0,
			'showNavArrows'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: '#000',
			'autoScale'			: true,
			'changeSpeed'		: 500,
			'cyclic'			: true, 
			'onStart': function(){ toggleRotating(true); }
		});
	});
	
$("#luan").click(function() {
		$.fancybox([
			{ 'href'	: 'http://flipskateboards.com/team-page/luan-05.jpg', 'title'	: 'Luan Oliveira | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/luan-04.jpg', 'title'	: 'Luan Oliveira | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/luan-01.jpg', 'title'	: 'Luan Oliveira | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/luan-02.jpg', 'title'	: 'Luan Oliveira | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/luan-03.jpg', 'title'	: 'Luan Oliveira | ARTOFOTO' }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'titlePosition'		: 'inside',
			'changeFade'        : 0,
			'showNavArrows'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: '#000',
			'autoScale'			: true,
			'changeSpeed'		: 500,
			'cyclic'			: true, 
			'onStart': function(){ toggleRotating(true); }
		});
	});
	
$("#curren").click(function() {
		$.fancybox([
			{ 'href'	: 'http://flipskateboards.com/team-page/curren-05.jpg', 'title'	: 'Curren Caples | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/curren-04.jpg', 'title'	: 'Curren Caples | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/curren-01.jpg', 'title'	: 'Curren Caples | ARTOFOTO' },
			//{ 'href'	: 'http://flipskateboards.com/team-page/curren-02.jpg', 'title'	: 'Curren Caples | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/curren-03.jpg', 'title'	: 'Curren Caples | ARTOFOTO' }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'titlePosition'		: 'inside',
			'changeFade'        : 0,
			'showNavArrows'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: '#000',
			'autoScale'			: true,
			'changeSpeed'		: 500,
			'cyclic'			: true, 
			'onStart': function(){ toggleRotating(true); }
		});
	});
	
$("#rune").click(function() {
		$.fancybox([
			{ 'href'	: 'http://flipskateboards.com/team-page/rune-04.jpg', 'title'	: 'Rune Glifberg | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/rune-03.jpg', 'title'	: 'Rune Glifberg | ARTOFOTO' },
			//{ 'href'	: 'http://flipskateboards.com/team-page/rune-01.jpg', 'title'	: 'Rune Glifberg | SHUSTERMAN' },
			{ 'href'	: 'http://flipskateboards.com/team-page/rune-02.jpg', 'title'	: 'Rune Glifberg | BURNETT' }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'titlePosition'		: 'inside',
			'changeFade'        : 0,
			'showNavArrows'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: '#000',
			'autoScale'			: true,
			'changeSpeed'		: 500,
			'cyclic'			: true, 
			'onStart': function(){ toggleRotating(true); }
		});
	});
	
$("#andrew").click(function() {
		$.fancybox([
			{ 'href'	: 'http://flipskateboards.com/team-page/langi-05.jpg', 'title'	: 'Andrew Langi | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/langi-04.jpg', 'title'	: 'Andrew Langi | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/langi-01.jpg', 'title'	: 'Andrew Langi | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/langi-02.jpg', 'title'	: 'Andrew Langi | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/langi-03.jpg', 'title'	: 'Andrew Langi | ARTOFOTO' }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'titlePosition'		: 'inside',
			'changeFade'        : 0,
			'showNavArrows'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: '#000',
			'autoScale'			: true,
			'changeSpeed'		: 500,
			'cyclic'			: true, 
			'onStart': function(){ toggleRotating(true); }
		});
	});
	
$("#ben").click(function() {
		$.fancybox([
			{ 'href'	: 'http://flipskateboards.com/team-page/ben-04.jpg', 'title'	: 'Ben Nordberg | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/ben-01.jpg', 'title'	: 'Ben Nordberg | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/ben-02.jpg', 'title'	: 'Ben Nordberg | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/ben-03.jpg', 'title'	: 'Ben Nordberg | ARTOFOTO' }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'titlePosition'		: 'inside',
			'changeFade'        : 0,
			'showNavArrows'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: '#000',
			'autoScale'			: true,
			'changeSpeed'		: 500,
			'cyclic'			: true,  
			'onStart': function(){ toggleRotating(true); }
		});
	});
	
$("#mattberger").click(function() {
		$.fancybox([
			{ 'href'	: 'http://flipskateboards.com/team-page/matt-01.jpg', 'title'	: 'Matt Berger | Jay Delaney' },
			{ 'href'	: 'http://flipskateboards.com/team-page/matt-02.jpg', 'title'	: 'Matt Berger | Jay Delaney' },
			{ 'href'	: 'http://flipskateboards.com/team-page/matt-03.jpg', 'title'	: 'Matt Berger | Jay Delaney' }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'titlePosition'		: 'inside',
			'changeFade'        : 0,
			'showNavArrows'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: '#000',
			'autoScale'			: true,
			'changeSpeed'		: 500,
			'cyclic'			: true,  
			'onStart': function(){ toggleRotating(true); }
		});
	});
	
$("#alecmajerus").click(function() {
		$.fancybox([
			{ 'href'	: 'http://flipskateboards.com/team-page/alec-01.jpg', 'title'	: 'Alec Majerus | Joe Hammeke' },
			{ 'href'	: 'http://flipskateboards.com/team-page/alec-02.jpg', 'title'	: 'Alec Majerus | Joe Hammeke' },
			{ 'href'	: 'http://flipskateboards.com/team-page/alec-03.jpg', 'title'	: 'Alec Majerus | Joe Hammeke' }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'titlePosition'		: 'inside',
			'changeFade'        : 0,
			'showNavArrows'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: '#000',
			'autoScale'			: true,
			'changeSpeed'		: 500,
			'cyclic'			: true,  
			'onStart': function(){ toggleRotating(true); }
		});
	});
	
$("#oscarmeza").click(function() {
		$.fancybox([
			{ 'href'	: 'http://flipskateboards.com/team-page/oscar-01.jpg', 'title'	: 'Oscar Meza | ARTOFOTO' },
			{ 'href'	: 'http://flipskateboards.com/team-page/oscar-02.jpg', 'title'	: 'Oscar Meza | Brian Walnum' },
			{ 'href'	: 'http://flipskateboards.com/team-page/oscar-03.jpg', 'title'	: 'Oscar Meza | Brian Walnum' }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'titlePosition'		: 'inside',
			'changeFade'        : 0,
			'showNavArrows'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: '#000',
			'autoScale'			: true,
			'changeSpeed'		: 500,
			'cyclic'			: true,  
			'onStart': function(){ toggleRotating(true); }
		});
	});

});
