	$(document).ready(function()
		{
			// Cookie stuff
			function setCookie(c_name,value,expiredays)
				{
					var exdate = new Date();
					exdate.setDate(exdate.getDate() + expiredays);
					document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toUTCString());
				}

			function getCookie(c_name)
				{
					if(document.cookie.length > 0)
				  		{
				  			c_start = document.cookie.indexOf(c_name + "=");

							if(c_start != -1)
							    {
								    c_start = c_start + c_name.length + 1;
								    c_end = document.cookie.indexOf(";", c_start);

									if(c_end == -1)
										c_end = document.cookie.length;

									return unescape(document.cookie.substring(c_start,c_end));
							    }
				  		}

					return "";
				}

			var slidePosition = getCookie("uslide");

			if(slidePosition == "")
				slidePosition = 0;

			// Fading banner
			$("#imageBox").cycle(
				{
					fx: 'fade',				// choose your transition type, ex: fade, scrollUp, shuffle, etc...
					timeout: 6000,
					speed: 2000,			// speed of the transition (any valid fx speed value)
					easing: null,
//					next: '#imageBox',
//					timeout: 0,
					startingSlide: slidePosition,
				    after: function(curr,next,opts)
						{
							slidePosition = opts.currSlide;
							setCookie("uslide", slidePosition, 7);		// Set a cookie for 7 day
						}
				});


			// Sidebox animation
			// Init box
/* temporary deactivated
			$(".sidepicbox .description").delay(1).animate({bottom: "-120px"},{queue: false, duration: 1, easing: 'easeOutQuad'});

			// Caption panel slides up/down on mouseenter/leave
			$(".sidepicbox").mouseenter(function()
				{
					$(".description", this).stop().animate({bottom: "0px"},{queue: false, duration: 600, easing: 'easeOutQuad'});
					$(".arrow", this).stop().animate({left: "-44px"},{queue: false, duration: 500, easing: 'easeOutQuad'});
					$(".image", this).stop().fadeTo(600, 0.75);

				}).mouseleave(function()
					{
						$(".description", this).stop().animate({bottom: "-120px"},{queue: false, duration: 600, easing: 'easeInQuad'});
						$(".arrow", this).stop().animate({left: "0px"},{queue: false, duration: 600, easing: 'easeInOutQuad'});
						$(".image", this).stop().fadeTo(600, 1);
					});
*/
			// Accordion
			$(function()
				{
					$("#accordion").accordion(
						{
							animated: 'easeInOutQuad',
							autoHeight: false,
							navigation: true
						});
				});


			// Team function "fade out all but the receipient"
			// Get all variables from URL into array and prepare for further call
			$.extend(
				{
					getUrlVars: function()
						{
							var vars = [], hash;
							var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');

							for(var i = 0; i < hashes.length; i++)
								{
									hash = hashes[i].split('=');
									vars.push(hash[0]);
									vars[hash[0]] = hash[1];
								}

							return vars;
						},
						getUrlVar: function(name)
							{
								return $.getUrlVars()[name];
							}
				});

			// Get variable in question
			var receipient = $.getUrlVar('email');

			if(receipient == undefined)
				{
					// do nothing
				}
				else
					{
						receipient = receipient.split("#");
						receipient = receipient[0];				// This is the one we send a email to

						// Fade out all picboxes except for the receipient
						$(".pic:not(#"+receipient+" .pic)").delay(500).fadeTo(2000, 0.3);
					}








		});
