// JavaScript Document

$(document).ready(function() {
	
	logoChange();
	
	function logoChange() {
		var randomNumberW = Math.floor(Math.random() * 5) * -100;
		var randomNumberH = Math.floor(Math.random() * 2) * -100;
		
		$('.logo').css('backgroundPosition', randomNumberW + 'px' + ' ' + randomNumberH + 'px');
	}
	
	$('.logo_container').click(function() {
		logoChange();
	});
	
	$("a.fancybox").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true
	});
	
	var triangle_gallery = new simpleGallery({
		wrapperid: "triangle_gallery", //ID of main gallery container,
		dimensions: [900, 600], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
		imagearray: [
			["images/triangle_1.png"],
			["images/triangle_2.png"],
			["images/triangle_3.png"],
			["images/triangle_4.png"],
			["images/triangle_5.png"]
		],
		autoplay: [true, 5000, 2], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
		persist: true, //remember last viewed slide and recall within same session?
		fadeduration: 500, //transition duration (milliseconds)
	});
	
	var spider_gallery = new simpleGallery({
		wrapperid: "spider_gallery", //ID of main gallery container,
		dimensions: [900, 600], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
		imagearray: [
			["images/spider_1.png"],
			["images/spider_2.png"]
		],
		autoplay: [true, 5000, 2], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
		persist: true, //remember last viewed slide and recall within same session?
		fadeduration: 500, //transition duration (milliseconds)
	});
	
	var dcamp2011_gallery = new simpleGallery({
		wrapperid: "dcamp2011_gallery", //ID of main gallery container,
		dimensions: [900, 640], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
		imagearray: [
			["images/dcamp2011_1.png"]
		],
		autoplay: [true, 5000, 2], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
		persist: true, //remember last viewed slide and recall within same session?
		fadeduration: 500, //transition duration (milliseconds)
	});	
	
	var boh_gallery = new simpleGallery({
		wrapperid: "boh_gallery", //ID of main gallery container,
		dimensions: [700, 600], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
		imagearray: [
			["images/boh_1.png"],
			["images/boh_2.png"]
		],
		autoplay: [true, 5000, 2], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
		persist: true, //remember last viewed slide and recall within same session?
		fadeduration: 500, //transition duration (milliseconds)
	});	

	var palace_gallery = new simpleGallery({
		wrapperid: "palace_gallery", //ID of main gallery container,
		dimensions: [900, 600], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
		imagearray: [
			["images/palace_1.png"]
		],
		autoplay: [true, 5000, 2], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
		persist: true, //remember last viewed slide and recall within same session?
		fadeduration: 500, //transition duration (milliseconds)
	});	
	
	var laura_gallery = new simpleGallery({
		wrapperid: "laura_gallery", //ID of main gallery container,
		dimensions: [900, 535], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
		imagearray: [
			["images/laura_1.png"]
		],
		autoplay: [true, 5000, 2], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
		persist: true, //remember last viewed slide and recall within same session?
		fadeduration: 500, //transition duration (milliseconds)
	});		
	
	var potion_gallery = new simpleGallery({
		wrapperid: "potion_gallery", //ID of main gallery container,
		dimensions: [900, 600], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
		imagearray: [
			["images/potion_1.png"],
			["images/potion_2.png"],
			["images/potion_3.png"],
			["images/potion_4.png"],
			["images/potion_5.png"],
			["images/potion_6.png"]
		],
		autoplay: [true, 5000, 2], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
		persist: true, //remember last viewed slide and recall within same session?
		fadeduration: 500, //transition duration (milliseconds)
	});		
	
	var germs_gallery = new simpleGallery({
		wrapperid: "germs_gallery", //ID of main gallery container,
		dimensions: [900, 600], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
		imagearray: [
			["images/germs_1.png"]
		],
		autoplay: [true, 5000, 2], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
		persist: true, //remember last viewed slide and recall within same session?
		fadeduration: 500, //transition duration (milliseconds)
	});	
	
	var gary_gallery = new simpleGallery({
		wrapperid: "gary_gallery", //ID of main gallery container,
		dimensions: [900, 450], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
		imagearray: [
			["images/gary_1.png"]
		],
		autoplay: [true, 5000, 2], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
		persist: true, //remember last viewed slide and recall within same session?
		fadeduration: 500, //transition duration (milliseconds)
	});		
	
	
	
	$(".about_link").click(function() {
		$(".about").slideToggle(700);
	});
	
	$(".about").click(function() {
		$(".about").slideToggle(700);
	});
	
	$(".image div").animate({opacity: 0});
	
	$(".image").hover(function() {
		$("div", this).animate({top: "-44px", opacity: 1}, 500)
	}, function() {
		$("div", this).animate({top: "24px", opacity: 0}, 500)
	});
	
	
	
	
	
	
});
