$(document).ready(function(){
var gallery = new Array();
	gallery[1] = new Array ();
	gallery[1]["image"]				= "/_assets/images/gallery/1.jpg";
	gallery[1]["thumbnail"]		= "/_assets/images/gallery/thumbnail_1.jpg";
	gallery[1]["description"]	= '<p>Front Garden</p>';

	gallery[2] = new Array ();
	gallery[2]["image"]				= "/_assets/images/gallery/2.jpg";
	gallery[2]["thumbnail"]		= "/_assets/images/gallery/thumbnail_2.jpg";
	gallery[2]["description"]	= '<p>Pool Area</h1>';

	gallery[3] = new Array ();
	gallery[3]["image"]				= "/_assets/images/gallery/3.jpg";
	gallery[3]["thumbnail"]		= "/_assets/images/gallery/thumbnail_3.jpg";
	gallery[3]["description"]	= '<p>Balcony Area</h1>';

	gallery[4] = new Array ();
	gallery[4]["image"]				= "/_assets/images/gallery/4.jpg";
	gallery[4]["thumbnail"]		= "/_assets/images/gallery/thumbnail_4.jpg";
	gallery[4]["description"]	= '<p>Master bedroom (Ensuite)</p>';

	gallery[5] = new Array ();
	gallery[5]["image"]				= "/_assets/images/gallery/5.jpg";
	gallery[5]["thumbnail"]		= "/_assets/images/gallery/thumbnail_5.jpg";
	gallery[5]["description"]	= '<p>Lounge</p>';

	gallery[6] = new Array ();
	gallery[6]["image"]				= "/_assets/images/gallery/6.jpg";
	gallery[6]["thumbnail"]		= "/_assets/images/gallery/thumbnail_6.jpg";
	gallery[6]["description"]	= '<p>Pool Area</p>';

	gallery[7] = new Array ();
	gallery[7]["image"]				= "/_assets/images/gallery/7.jpg";
	gallery[7]["thumbnail"]		= "/_assets/images/gallery/thumbnail_7.jpg";
	gallery[7]["description"]	= '<p>Rear Patio area with Balcony Area</p>';

	gallery[8] = new Array ();
	gallery[8]["image"]				= "/_assets/images/gallery/8.jpg";
	gallery[8]["thumbnail"]		= "/_assets/images/gallery/thumbnail_8.jpg";
	gallery[8]["description"]	= '<p>House Front</p>';

	gallery[9] = new Array ();
	gallery[9]["image"]				= "/_assets/images/gallery/9.jpg";
	gallery[9]["thumbnail"]		= "/_assets/images/gallery/thumbnail_9.jpg";
	gallery[9]["description"]	= '<p>Balcony Area & Terrace</p>';

	gallery[10] = new Array ();
	gallery[10]["image"]				= "/_assets/images/gallery/10.jpg";
	gallery[10]["thumbnail"]		= "/_assets/images/gallery/thumbnail_10.jpg";
	gallery[10]["description"]	= '<p>Garden View</p>';

	gallery[11] = new Array ();
	gallery[11]["image"]				= "/_assets/images/gallery/11.jpg";
	gallery[11]["thumbnail"]		= "/_assets/images/gallery/thumbnail_11.jpg";
	gallery[11]["description"]	= '<p>Kitchen leading to Dining Room</p>';

	gallery[12] = new Array ();
	gallery[12]["image"]				= "/_assets/images/gallery/12.jpg";
	gallery[12]["thumbnail"]		= "/_assets/images/gallery/thumbnail_12.jpg";
	gallery[12]["description"]	= '<p>Front View and Gites</p>';

	gallery[13] = new Array ();
	gallery[13]["image"]				= "/_assets/images/gallery/13.jpg";
	gallery[13]["thumbnail"]		= "/_assets/images/gallery/thumbnail_13.jpg";
	gallery[13]["description"]	= '<p>New Roof Rear View</p>';

	gallery[14] = new Array ();
	gallery[14]["image"]				= "/_assets/images/gallery/14.jpg";
	gallery[14]["thumbnail"]		= "/_assets/images/gallery/thumbnail_14.jpg";
	gallery[14]["description"]	= '<p>Steps to House Front</p>';

	gallery[15] = new Array ();
	gallery[15]["image"]				= "/_assets/images/gallery/15.jpg";
	gallery[15]["thumbnail"]		= "/_assets/images/gallery/thumbnail_15.jpg";
	gallery[15]["description"]	= '<p>House and surroundings</p>';

	gallery[16] = new Array ();
	gallery[16]["image"]				= "/_assets/images/gallery/16.jpg";
	gallery[16]["thumbnail"]		= "/_assets/images/gallery/thumbnail_16.jpg";
	gallery[16]["description"]	= '<p>Kitchen leading to Lounge</p>';

	gallery[17] = new Array ();
	gallery[17]["image"]				= "/_assets/images/gallery/17.jpg";
	gallery[17]["thumbnail"]		= "/_assets/images/gallery/thumbnail_17.jpg";
	gallery[17]["description"]	= '<p>Pool side area</p>';

	gallery[18] = new Array ();
	gallery[18]["image"]				= "/_assets/images/gallery/18.jpg";
	gallery[18]["thumbnail"]		= "/_assets/images/gallery/thumbnail_18.jpg";
	gallery[18]["description"]	= '<p>Bedroom with French windows leading to Garden</p>';

	gallery[19] = new Array ();
	gallery[19]["image"]				= "/_assets/images/gallery/19.jpg";
	gallery[19]["thumbnail"]		= "/_assets/images/gallery/thumbnail_19.jpg";
	gallery[19]["description"]	= '<p>Lounge leading to Kitchen</p>';

// 11.5
	gallery[20] = new Array ();
	gallery[20]["image"]				= "/_assets/images/gallery/11.5.jpg";
	gallery[20]["thumbnail"]		= "/_assets/images/gallery/thumbnail_11.5.jpg";
	gallery[20]["description"]	= '<p>Dining Room</p>';
	
	gallery[21] = new Array ();
	gallery[21]["image"]				= "/_assets/images/gallery/21.jpg";
	gallery[21]["thumbnail"]		= "/_assets/images/gallery/thumbnail_21.jpg";
	gallery[21]["description"]	= '<p>New Attic with Ensuite Bedroom</p>';
	
	gallery[22] = new Array ();
	gallery[22]["image"]				= "/_assets/images/gallery/22.jpg";
	gallery[22]["thumbnail"]		= "/_assets/images/gallery/thumbnail_22.jpg";
	gallery[22]["description"]	= '<p>New Attic with Ensuite Bedroom</p>';
	
	gallery[23] = new Array ();
	gallery[23]["image"]				= "/_assets/images/gallery/23.jpg";
	gallery[23]["thumbnail"]		= "/_assets/images/gallery/thumbnail_23.jpg";
	gallery[23]["description"]	= '<p>New Attic with Ensuite Bedroom</p>';
	
	gallery[24] = new Array ();
	gallery[24]["image"]				= "/_assets/images/gallery/24.jpg";
	gallery[24]["thumbnail"]		= "/_assets/images/gallery/thumbnail_24.jpg";
	gallery[24]["description"]	= '<p>The Gite</p>';
	
	gallery[25] = new Array ();
	gallery[25]["image"]				= "/_assets/images/gallery/25.jpg";
	gallery[25]["thumbnail"]		= "/_assets/images/gallery/thumbnail_25.jpg";
	gallery[25]["description"]	= '<p>The Gite</p>';
	
	gallery[26] = new Array ();
	gallery[26]["image"]				= "/_assets/images/gallery/26.jpg";
	gallery[26]["thumbnail"]		= "/_assets/images/gallery/thumbnail_26.jpg";
	gallery[26]["description"]	= '<p>The House with Gite to the left</p>';
	
	gallery[27] = new Array ();
	gallery[27]["image"]				= "/_assets/images/gallery/27.jpg";
	gallery[27]["thumbnail"]		= "/_assets/images/gallery/thumbnail_27.jpg";
	gallery[27]["description"]	= '<p>The Gite</p>';

	// Cache the thumbnails...
/*
	cacheTN = new Array(gallery.length);
	for (i=1; i<=gallery.length-1; i++)	{
		cacheTN[i] = new Image(42, 42);
		cacheTN[i].src = gallery[i]["image"];
	}
*/
	// and now the main images
	cache = new Array(gallery.length);
	for (i=1; i<=gallery.length-1; i++)	{
		cache[i] = new Image(420, 420);
		cache[i].src = gallery[i]["image"];
	}
	$(".gallery-navigation A.thumbnail IMG").each(function(i){
		$(this).fadeTo("fast", 0.50);	
	});
	
	var galleryIndex = 1;
	var idx = 1;
	
	$(".gallery-navigation A.thumbnail").click(function(a){
		$("#status").css({visibility: "visible"});
		idx = $(this).attr('tabindex');
		$("#illustration").fadeTo("fast", 0.15, function()	{
			$("#illustration").attr('src',gallery[idx]["image"]);
		});
		return false;
	});

		$("#illustration").load( function(){
			$("#illustration").fadeTo("slow", 1);
			$("#description").html(gallery[idx]["description"]);
			$("#status").css({visibility: "hidden"});
		});

	
	$(".gallery-navigation A.thumbnail IMG").mouseover(function(a){
		$(this).fadeTo("fast", 1);
	});
	
	$(".gallery-navigation A.thumbnail IMG").mouseout(function(a){
		$(this).fadeTo("slow", 0.50);
	});

});