<!--
<!--

function openScript(openScript)
{
var desktop=window.open(openScript,"_blank","toolbar=no,location=no,status=no,top=5,left=5,menubar=no,scrollbars=no,width=632,height=536");
}
//-->

<!--
<!--

function openCURScript(openCURScript)
{
var desktop=window.open(openCURScript,"_blank","toolbar=no,location=no,status=no,top=5,left=5,menubar=no,scrollbars=no,width=633,height=544");
}
//-->

<!--
<!--

function openMap(openMap)
{
var desktop=window.open(openMap,"_blank","toolbar=no,location=no,status=no,top=5,left=5,menubar=no,scrollbars=yes,width=652,height=536");
}
//-->


<!--
<!--

function openLayout(openLayout)
{
var desktop=window.open(openLayout,"_blank","toolbar=no,location=no,status=no,top=5,left=5,menubar=no,scrollbars=yes,width=610,height=450");
}
//-->


<!--
function mail()
{
mail_str="mailto:?subject=Accommodation "
mail_str= mail_str + "&body=I found accommodation in Cape Town, which I thought you might be interested in at Cape Rose Cottage in Camps Bay." 
mail_str=mail_str + ". Here is the website link: " + location.href 
location.href=mail_str
}
//-->


<!--  hiding this javascript

function SetStat(txt)
{
  window.status=txt;
}

function ClearStat()
{
  window.status='';
}

function Activate(imgName,mes)
{
  SetStat(mes);
  if(document.images)
  {
    img=eval(imgName+"on.src");
    document.images[imgName].src=img;
  }
}

function Deactivate(imgName)
{
  ClearStat();
  if(document.images)
  {
    img=eval(imgName+"off.src");
    document.images[imgName].src=img;
  }
}

if(document.images)
{
  button01on=new Image(41, 29);
  button01on.src="images/home-on.gif";
  button02on=new Image(96, 29);
  button02on.src="images/accommodation-on.gif";
  button03on=new Image(56, 29);
  button03on.src="images/facilities-on.gif";
  button04on=new Image(54, 29);
  button04on.src="images/location-on.gif";
  button05on=new Image(47, 29);
  button05on.src="images/gallery-on.gif";
  button06on=new Image(57, 29);
  button06on.src="images/bookings-on.gif";
  button07on=new Image(53, 29);
  button07on.src="images/contact-on.gif";
  button08on=new Image(66, 29);
  button08on.src="images/attractions-on.gif";

  button01off=new Image(41, 29);
  button01off.src="images/home-off.gif";
  button02off=new Image(96, 29);
  button02off.src="images/accommodation-off.gif";
  button03off=new Image(56, 29);
  button03off.src="images/facilities-off.gif";
  button04off=new Image(54, 29);
  button04off.src="images/location-off.gif";
  button05off=new Image(47, 29);
  button05off.src="images/gallery-off.gif";
  button06off=new Image(57, 29);
  button06off.src="images/bookings-off.gif";
  button07off=new Image(53, 29);
  button07off.src="images/contact-off.gif";
  button08off=new Image(66, 29);
  button08off.src="images/attractions-off.gif";
}


// ok now you may view the rest -->

<!-- Begin

if (parent.frames.length > 0) {
    parent.location.href = self.document.location
}

//  End -->

function validateEnquiries()
{
	fv = new formValidator();
	
	if (fv.isEmpty("realname"))
		fv.raiseError("Please specify your name.");
		
	if (fv.isEmpty("telephone"))
		fv.raiseError("Please specify your telephone number.");
	
	if (fv.isEmpty("email"))
		fv.raiseError("Please specify your email address.");
	else
	{
		if (!fv.isEmailAddress("email"))
			fv.raiseError("Please specify a valid email address.");
	}
	
	if (fv.isEmpty("repeatEmail"))
	{
		fv.raiseError("Please repeat your email address for verification.");
	}
	else
	{
		if (fv.findObj("repeatEmail").value != fv.findObj("email").value)
			fv.raiseError("The email address and verified email address do not match. Please re-enter.");
	}
	
	if (fv.isEmpty("country"))
		fv.raiseError("Please specify your country of residence.");
		
	if (fv.isEmpty("driverAge"))
		fv.raiseError("Please specify the driver's age.");
		
	if (fv.findObj("Vehicle").value == "Not Specified")
		fv.raiseError("Please specify the vehicle you would like to rent.");
	
	if (fv.findObj("pickupDay").value == "Not Specified" ||
		fv.findObj("pickupMonth").value == "Not Specified" ||
		fv.findObj("pickupYear").value == "Not Specified" ||
		fv.findObj("dropoffDay").value == "Not Specified" ||
		fv.findObj("dropoffMonth").value == "Not Specified" ||
		fv.findObj("dropoffYear").value == "Not Specified")
		fv.raiseError("Please specify the pick up and drop off dates.");
		
	if (fv.isEmpty("numberDays"))
		fv.raiseError("Please enter the total number of rental days.");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
		return true;
}