// JavaScript Document

    $(document).ready(function(){
				
		$('#slider').jqFancyTransitions({
			effect: 'wave', // wave, zipper, curtain
			width: 742,
			height: 388,
			strips: 10, // number of strips
			delay: 3000, // delay between images in ms
			stripDelay: 50, // delay beetwen strips in ms
			titleOpacity: 0.7, // opacity of title
			titleSpeed: 1000, // speed of title appereance in ms
			position: 'top', // top, bottom, alternate, curtain
			direction: 'left', // left, right, alternate, random, fountain, fountainAlternate
			navigation: true, // prev and next navigation buttons
			links: false // show images as links
		});
		
		$('#container_slideshow .ft-prev').hide().html('&laquo;');
		$('#container_slideshow .ft-next').hide().html('&raquo;');

		$('#container_slideshow').hover(
		  function () {
			$('.ft-prev').fadeIn('slow');
			$('.ft-next').fadeIn('slow');
		  }, 
		  function () {
			$('.ft-prev').fadeOut('slow');
			$('.ft-next').fadeOut('slow');
		});
		
		$('#quotes').cycle({
			speed: 10,
			cleartype:  1,
			random: 1
		})
		
		
		$('.jd_menu').jdMenu({
			showDelay:0,
			hideDelay:500,
			onAnimate: onAnimate
		});
	
		function onAnimate(show) {
			//$(this).fadeIn('slow').show();
			if (show) {
				$(this)
					.css('visibility', 'hidden').show()
						.css('width', $(this).innerWidth())
					.hide().css('visibility', 'visible')
				.fadeIn(250);
			} else {
				$(this).fadeOut(0);
			}
		}
		
		
		
		function alignContainers () {
			last_panel_top = $('.container_right .panel_right:last').position().top;
			container_left_top = $('#container_content').position().top;
			container_left_height = $('#container_content').height();
			container_content_top = $('.container_left #container_content').position().top;
			container_right_top = $('.container_right').position().top;
			container_right_height = $('.container_right').height();
			
			if (container_left_top + container_left_height > container_right_top + container_right_height) {
				$('.container_right .panel_right:last').css('height',(container_left_top + container_left_height - last_panel_top) + 'px');
			}
			else {
				$('.container_left #container_content').css('height',(container_right_top + container_right_height - container_content_top - 12 ) + 'px');
			}
		}

		alignContainers ()
		checkWindowHeight()

		$('#quotes').show();
    })
		
	$('#menu').css('z-index','9999999');

