$(document).ready(function() {
	
	// Initial Open/Close
    $("#thumbs .close_me").toggle(
      function() {
          $("#thumbs").animate({ 'bottom': '-135px' }, 'slow'),
		  $(this).html('Open');
      },
      function() {
          $("#thumbs").animate({ 'bottom': '0px' }, 'slow'),
		  $(this).html('Close');
      });
	
	// Link to larger pic
	$(".thumb_holder a").click(function(event){
		event.preventDefault();
		$('img#pic').fadeOut(1000).hide();
		var newSRC = $(this).attr("href");
		$("img#pic").attr("src", newSRC);
		$('img#pic').fadeIn();
	});
	
	// Link to Standard Features
      $(".features").click(function(event){
            event.preventDefault();
			$("#text").hide();
			$("#features").show();

            // Back to Main text
            $(".back_to_main").click(function(event){
            event.preventDefault();
			$("#text").show();
			$("#features").hide();
            });
      });
	
// BATHROOM *******************
	
	// If Bathroom is clicked
	$("#thumbs a.bathroom").click(function(event){
		$("#text").show();
		$("#features").hide();
		$('#text').html("<h3>Bathroom</h3><p>Well fitted bathroom with thermostatic controlled shower and heating. There is a modern ceramic basin which has a mixer lever tap.</p><p>Extractor fan fitted as standard.</p>");
	});	
	
// LOUNGE *******************
	
    //Lounge Open/Close
    $("#lounge .close_me_up").toggle(
      function() {
          $("#lounge").animate({ 'bottom': '-135px' }, 'slow'),
		  $(this).html('Open');
      },
      function() {
          $("#lounge").animate({ 'bottom': '0px' }, 'slow'),
		  $(this).html('Close');
      });
	
	// If Lounge is clicked
	$("#thumbs a.lounge").click(function(event){
		$("#text").show();
		$("#features").hide();
		$("#thumbs").animate({ 'bottom': '-161px' }, 'slow'),
		$("#lounge").animate({ 'bottom': '0' }, 'slow');
		$('#text').html("<h3>Lounge</h3><p>Comfort and luxury are all part of Clipper style and in the lounge you have an ash finish for the furniture, complimented by the comfortable seating and attractive colour schemes.</p>");
	});	
	
	// Lounge Back Button
	$("#lounge .back_up").click(function(event){
		$("#text").show();
		$("#features").hide();
		$("#lounge").animate({ 'bottom': '-161px' }, 'slow'),
		$("#thumbs").animate({ 'bottom': '0' }, 'slow');
		event.preventDefault();
		$('img#pic').fadeOut().hide();
		$("img#pic").attr("src", "/images/clipper/exterior.jpg");
		$('img#pic').fadeIn();
		$('#text').html("<p>The Elegant Clipper is an impressive holiday home.</p><p>The generous living area has an instant and welcoming appeal.</p><p>The Clipper range has everything you could want and more, ideal for those wonderful family holidays.</p>");
	});
	
// BEDROOM *******************
	
    //Bedroom Open/Close
    $("#bedroom .close_me_up").toggle(
      function() {
          $("#bedroom").animate({ 'bottom': '-135px' }, 'slow'),
		  $(this).html('Open');
      },
      function() {
          $("#bedroom").animate({ 'bottom': '0px' }, 'slow'),
		  $(this).html('Close');
      });
	
	// If Bedroom is clicked
	$("#thumbs a.bedroom").click(function(event){
		$("#text").show();
		$("#features").hide();
		$("#thumbs").animate({ 'bottom': '-161px' }, 'slow'),
		$("#bedroom").animate({ 'bottom': '0' }, 'slow');
		$('#text').html("<h3>Bedroom</h3><p>The comfortable bedrooms all have fully sprung mattresses and plenty of wardrobe and cupboard space.</p>");
	});	
	
	// Bedroom Back Button
	$("#bedroom .back_up").click(function(event){
		$("#text").show();
		$("#features").hide();
		$("#bedroom").animate({ 'bottom': '-161px' }, 'slow'),
		$("#thumbs").animate({ 'bottom': '0' }, 'slow');
		event.preventDefault();
		$('img#pic').fadeOut().hide();
		$("img#pic").attr("src", "/images/clipper/exterior.jpg");
		$('img#pic').fadeIn();
		$('#text').html("<p>The Elegant Clipper is an impressive holiday home.</p><p>The generous living area has an instant and welcoming appeal.</p><p>The Clipper range has everything you could want and more, ideal for those wonderful family holidays.</p>");
	});
	
// KITCHEN *******************
	
    //Kitchen Open/Close
    $("#kitchen .close_me_up").toggle(
      function() {
          $("#kitchen").animate({ 'bottom': '-135px' }, 'slow'),
		  $(this).html('Open');
      },
      function() {
          $("#kitchen").animate({ 'bottom': '0px' }, 'slow'),
		  $(this).html('Close');
      });
	
	// If Kitchen is clicked
	$("#thumbs a.kitchen").click(function(event){
		$("#text").show();
		$("#features").hide();
		$("#thumbs").animate({ 'bottom': '-161px' }, 'slow'),
		$("#kitchen").animate({ 'bottom': '0' }, 'slow');
		$('#text').html("<h3>Kitchen</h3><p>A well fitted kitchen to cater for all occasions with plenty of easy storage space featuring a 600mm wide domestic built-in cooker as standard and 600mm wide stainless steel cooker canopy on some 12ft models only. The integral fridge is also a standard feature.</p>");
	});	
	
	// Kitchen Back Button
	$("#kitchen .back_up").click(function(event){
		$("#text").show();
		$("#features").hide();
		$("#kitchen").animate({ 'bottom': '-161px' }, 'slow'),
		$("#thumbs").animate({ 'bottom': '0' }, 'slow');
		event.preventDefault();
		$('img#pic').fadeOut().hide();
		$("img#pic").attr("src", "/images/clipper/exterior.jpg");
		$('img#pic').fadeIn();
		$('#text').html("<p>The Elegant Clipper is an impressive holiday home.</p><p>The generous living area has an instant and welcoming appeal.</p><p>The Clipper range has everything you could want and more, ideal for those wonderful family holidays.</p>");
	});
	
// DINING *******************
	
    //Dining Open/Close
    $("#dining .close_me_up").toggle(
      function() {
          $("#dining").animate({ 'bottom': '-135px' }, 'slow'),
		  $(this).html('Open');
      },
      function() {
          $("#dining").animate({ 'bottom': '0px' }, 'slow'),
		  $(this).html('Close');
      });
	
	// If Dining is clicked
	$("#thumbs a.dining").click(function(event){
		$("#text").show();
		$("#features").hide();
		$("#thumbs").animate({ 'bottom': '-161px' }, 'slow'),
		$("#dining").animate({ 'bottom': '0' }, 'slow');
		$('#text').html("<h3>Dining</h3><p>As you would expect in the Clipper its dining area consists of four solid beech chairs with wooden pedestal and quality MDF round table top. Chairs and table are superbly colour co-ordinated to match the style of the interior. The 24 &amp; 26 x 10 Clipper along with the 24 &amp; 26 x 12ft models feature a space saving metal drop leaf table with 2 stools supplied.</p>");
	});	
	
	// Dining Back Button
	$("#dining .back_up").click(function(event){
		$("#text").show();
		$("#features").hide();
		$("#dining").animate({ 'bottom': '-161px' }, 'slow'),
		$("#thumbs").animate({ 'bottom': '0' }, 'slow');
		event.preventDefault();
		$('img#pic').fadeOut().hide();
		$("img#pic").attr("src", "/images/clipper/exterior.jpg");
		$('img#pic').fadeIn();
		$('#text').html("<p>The Elegant Clipper is an impressive holiday home.</p><p>The generous living area has an instant and welcoming appeal.</p><p>The Clipper range has everything you could want and more, ideal for those wonderful family holidays.</p>");
	});
	
});