$(document).ready(function() {

    // all js will be collected in external file for final...

    // init cycle plugin
    $('.slideshow').cycle({
		fx: 'fade',
		speed:  500,
		timeout: 5000,
		//easeOut: 'easeOutQuad',
		next: '#right_arrow',
		prev: '#left_arrow'
	});

	// init fancybox plugin
	$("#rating a").fancybox({

		overlayColor:		'#000000',
		overlayOpacity:		.85,
		transitionIn:		'fade',
		transitionOut:		'fade',
		centerOnScroll:		true,
		speedIn:			300,
		speedOut:			300,
		width:				552,
		height:				603,
		showCloseButton:	false,
		autoDimensions:		false,
		padding:			0,
		margin:				0,
		scrolling:			'no'

	});

	$("a.item_full").fancybox({
		showNavArrows:		true,
		overlayColor:		'#000000',
		overlayOpacity:		.85,
		transitionIn:		'fade',
		transitionOut:		'fade',
		centerOnScroll:		true,
		speedIn:			300,
		speedOut:			300,
		padding:			0,
		showCloseButton:	false,
		cyclic:				true,
		changeSpeed:		500,
		autoScale:			true,
		scrolling:			'yes'
		
	});

	function hideAll(){
		$('#footerSlideText').hide();
		$('#footer_logo').hide();
		$('#footerSlideButton').hide();
	}

	$('#footerSlideContent').animate({ height: '100px' });
	var open = true;
	$('#footerSlideButton').click(function() {
		if(open === false) {
			$('#footerSlideContent').animate({ height: '100px' });
			$(this).css('backgroundPosition', 'bottom left');
			$('#footerSlideButton').html("Close");
			$('#footerSlideButton').show();
			open = true;
		} else {
			$('#footerSlideContent').animate({ height: '0px' }, null , function(){
				hideAll();
			});
			$(this).css('backgroundPosition', 'top left');



			open = false;
		}
	});


    // fade on item hover
	$(".hoverfade").hover(function(){
		$(this).stop(true, true).fadeTo(500, .8);

	}, function(){
		$(this).fadeTo(500, 1);

	});

	$(".item").bind("mousedown", function(){

		$(this).fadeTo(500, 1);

	});




}); // on ready



