
	// -------------------------------------------------------------- //
	// script.js

	// jquery innerfade slideshow ----------------------------------- //
	$(document).ready(function(){
		$('#innerfade').innerfade({
			animationtype: 'fade',
			type: 'random',
			speed: 2000,
			timeout: 7000,
			containerheight: '221px',
//			runningclass: 'innerfade',
		});
	});

	// jquery imageswitch slideshow --------------------------------- //
	// nothing

	// jquery slideshow --------------------------------------------- //
	function slideSwitch(switchSpeed) {
		var $active = $('#slideshow li.active');
	
		if ($active.length == 0) $active = $('#slideshow li:last');
	
		// ordered selection
	//	var $next = $active.next('li').length ? $active.next('li') : $('#slideshow li:first');

		// random selection
		var $sibs = $active.siblings();
		var rndNum = Math.floor(Math.random() * $sibs.length );
		var $next = $($sibs[ rndNum ]);

		$active.addClass('last-active');

		$next.css({opacity: 0.0})
			.addClass('active')
			.animate({opacity: 1.0}, switchSpeed, function() {
				$active.removeClass('active last-active');
			});
	}
		
	/*
	$(function() {
		setInterval("slideSwitch(1000)", 5000);
	});
	*/
		
	// pause when mouseover // does not work
	var playSlideshow = setInterval('slideSwitch(1000)', 4000);

	$('.slideshow li').hover(function() {
		clearInterval(playSlideshow);
	},
		
	function() {
		playSlideshow;
	});

	// jquery slider ------------------------------------------------ //
	$(document).ready(function(){
		$(".slide_toggle").click(function(){
			if ($("#slider").is(':hidden')){
				$("#slider").slideDown('slow');
			}
			else{
				$("#slider").slideUp('slow');
			}
		});
	});
            
	function closeForm(){
		$('#messageSent').show('slow');
		setTimeout('$("#messageSent").hide();$("#slider").slideUp("slow")', 2000);
   	}

	// cookies ------------------------------------------------------ //
	function createCookie(name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	}

	function readCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}
	
	function eraseCookie(name) {
		createCookie(name,"",-1);
	}
