// Contact Form
function blankInput(orgValue,newValue)
{

if(orgValue==newValue)
	return "";
else
	return newValue;
}
function sendForm()
{if($("#contact").val()=="" || $("#email").val()=="" || $("#phone").val()=="" || $("#people").val()=="" || $("#property").val()=="" || $("#budget").val()=="" || $("#date_from").val()=="" || $("#date_to").val()=="")
{alert('Have you filled in all the boxes?'); return;}

$.post("/cgi-sys/formmail.pl",
   {  recipient: $("#recipient").val(), subject: $("#subject").val(), name: $("#contact").val(), email: $("#email").val(), phone: $("#phone").val(), no_person: $("#people").val(), date_from: $("#date_from").val(), date_to: $("#date_to").val(), property_preference: $("#property").val(), budget: $("#budget").val(), additional_information: $("#message").val() },
   function(data){
     $("#mailform").remove();
		 $("#contactform").append("<p>Thank you for your enquiry. We will respond shortly.</p>");
   }
 );
}




// Welcome Scroll
$(function()
{$('.home-welcome,.tab').jScrollPane();});




// Slideshow and Contact Panel
$(document).ready(function() 
{
    $('#slideshow').cycle(
	{
		fx: 'scrollHorz',
		speed: '400', 
		timeout: 4000,
		next:   '#next', 
		prev:   '#prev',
		after: function() 
		{
			$('#caption').html( $(this).children()[0].title );
			$('#sleeps').html( '<span class="nbrsleeps">' + $(this).children()[0].id + '</span><span class="wordsleeps">sleeps</span>' );
		}
	});
	
	$('#contact-us').click(function()
	{$('#panel').slideToggle('fast');});
	
});

