/*
 *
 * jQuery Functions 
 * Resto Pub City (2009)
 *
 * Powered by jQuery (http://www.jquery.com)
 * Written by Simon Bouchard (http://www.simonbouchard.com)
 *
*/

$(document).ready(function(){	
		
		/* SHOWCASE */
		$(function() {
			$("#showcase").jCarouselLite({
				visible: 1,
				start: 0,
				vertical: true,
				auto: 5000,
				speed: 1000
			});
		});
		
		/* BACKGROUND */
		$(function() {
			$("#background .images").jCarouselLite({
				btnNext: ".next",
				btnPrev: ".prev",
				visible: 3,
				start: -1,
				auto: 5000,
				speed: 1000
			});
		});
		
		/* PRELOAD */
		var imageArray = [
			'/images/bg_desserts.jpg', 
			'/images/bg_body_0.jpg', 
			'/images/bg_body_1.jpg', 
			'/images/bg_body_2.jpg', 
			'/images/bg_body_3.jpg', 
			'/images/bg_body_4.jpg', 
			'/images/bg_body_5.jpg', 
			'/images/bg_body_6.jpg', 
			'/images/bg_body_7.jpg', 
			'/images/bg_body_8.jpg', 
			'/images/bg_body_9.jpg', 
			'/images/bg_body_10.jpg', 
			'/images/bg_body_11.jpg', 
			'/images/bg_body_12.jpg',
			'/images/bg_body_13.jpg',
			'/images/bg_body_14.jpg',   
			'/images/bg_body_wine.jpg', 
			'/images/bg_gastronomie_1.jpg',
			'/images/bg_gastronomie_1.jpg',
			'/images/bg_viandes.jpg', 
			'/images/bg_viandes_2.jpg',
			'/images/bg_viandes_3.jpg',
			'/images/bg_viandes_4.jpg',
			'/images/bg_evenements.jpg',   
			'/images/bg_desserts.jpg',
			'/images/tablehote_midi.png',
			'/images/tablehote_soir.png',
			'/images/tablehote_groupe1.png',
			'/images/tablehote_groupe2.png',
			'/images/prog_nightclub.png',
			'/images/prog_lundi_mardi.png',
			'/images/prog_mercredi.png',
			'/images/prog_jeudi.png',
			'/images/prog_vendredi.png',
			'/images/prog_samedi.png',
			'/images/prog_dimanche.png'		
		];
	 
		// Add hidden element
		var hidden = $('body').append('<div id="img-cache" style="display:none/>').children('#img-cache');
	 
		// Add images to hidden element.
		$.each(imageArray, function (i, val) {
	  		$('<img/>').attr('src', val).appendTo(hidden);
		});

		/* CUFON */
		Cufon.now();

});