﻿// BackgroundColor
if(!$('#eventframe').length) {
	$('body').css('backgroundColor', '#000');
}

$('document').ready(function() {	
	// Lightbox
	if($('#gallery').length > 0) {
		$('#gallery a').lightBox();
	}
	
	// Team
	if($('#team').length > 0) {
		
		$('.teamImg').children().each(function(index) {
			$(this).parent().children().first().css({ width: '0', right: '0' });
		});
		
		$('.teamImg').mouseenter(function() {
			$(this).children().clearQueue();
			
			$(this).children().last().animate({
				width: 0
			});
			$(this).children().first().animate({
				width: 150
			});
			console.log("mouseover");
		});
		
		$('.teamImg').mouseleave(function() {
			$(this).children().clearQueue();
			
			$(this).children().last().animate({
				width: 150
			});
			$(this).children().first().animate({
				width: 00
			});
			console.log("mouseout");
		});
	}
	
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// JUST FOR TESTING /////////////////////////////////////////////////////////////////////////////////////////////////////
	if(!$('#eventframe').length) {
		/*if($('#chicago').length) {
			var slideObj = [{image:'/eventframe/media/_gfx/chicago/bg_001.jpg'}]
		} else if($('#stageone').length) {
			var slideObj = [{image:'/eventframe/media/_gfx/stageone/bg_001.jpg'}]
		}*/

		/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

		// Backgroundimages
		jQuery(function($){
			$.supersized({
				
				// Functionality
				//autoplay: 1,				// Determines whether slideshow begins playing when page is loaded.
				//start_slide: 0,				// The slide the slideshow starts on. *In the Core version, it controls which image is loaded, 0 causes a random image to be loaded each time.
				random: 1,					// Slides are shown in a random order. start_slide is disregarded.
				
				slide_interval : 10000,		// Time between slide changes in milliseconds.
				transition : 1,				// Controls which effect is used to transition between slides.
												// 0 or 'none' - No transition effect
												// 1 or 'fade' - Fade effect (Default)
												// 2 or 'slideTop' - Slide in from top
												// 3 or 'slideRight' - Slide in from right
												// 4 or 'slideBottom' - Slide in from bottom
												// 5 or 'slideLeft' - Slide in from left
												// 6 or 'carouselRight' - Carousel from right to left
												// 7 or 'carouselLeft' - Carousel from left to right
				transition_speed : 700,	// Speed of transitions in milliseconds.
				
				//min_height: 0,			// Minimum height the image is allowed to be. If it is met, the image won't size down any further.
				//min_width: 0,				// Minimum width the image is allowed to be. If it is met, the image won't size down any further.
				
				//fit_always: 1,				// Prevents the image from ever being cropped. Ignores minimum width and height.
				//fit_landscape: 0,			// Prevents the image from being cropped by locking it at 100% width.
				//fit_portrait: 0,			// Prevents the image from being cropped by locking it at 100% height.
				
				//horizontal_center: 1,		// Centers image horizontally. When turned off, the images resize/display from the left of the page.
				//vertical_center: 1,			// Centers image vertically. When turned off, the images resize/display from the top of the page.
				
				image_protect: 1,			// Disables right clicking and image dragging using Javascript.
				//pause_hover: 0,				// Pauses slideshow while current image hovered over.
				
				//slideshow: 0,				// Turns the slideshow on/off. Disables navigation and transitions.	
				//keyboard_nav: 0,			// Allows control via keyboard.
												// Spacebar - Pause or play
												// Right arrow or Up Arrow - Next slide
												// Left arrow or Down Arrow - Previous slide)
				//stop_loop: 0,				// Pauses slideshow upon reaching the last slide.
				
				//thumb_links: 0,			// Generates a list of thumb links that jump to the corresponding slide. If the 'thumb' field for the slide is empty, it will simply scale down the full size image, which can slow performance.
				//thumbnail_navigation: 0,	// Toggles forward/backward thumbnail navigation. When on, thumbnails from the next/previous posts are generated and can be clicked to navigate. If the 'thumb' field for the slide is empty, it will simply scale down the full size image.

				performance: 1,				// Uses image rendering options in Firefox and Internet Explorer to adjust image quality. This can speed up/slow down transitions. Webkit does not yet support these options.
												// 0 - No adjustments
												// 1 - Hybrid, lowers image quality during transitions and restores after completed. (Default)
												// 2 - Higher image quality
												// 3 - Faster transition speed, lower image quality
				
				//slide_links: 0,			// Generates a list of links that jump to the corresponding slide.
												// 0 or false - Disables slide links
												// 'number' - Numbers (Default)
												// 'name' - Title of slide
												// 'empty' - Links are empty. Allows for background sprites.
				//new_window: 0,				// Slide links open in a new window.
				
				//slides : slideObj
				slides : slideObj
			});
		});
	}
});
