<!--

function viewImg(itemTitle,imageSrc,tnWidth,tnHeight)
{	
	var imgWidth;
	if(tnWidth == 120)
	{
		imgWidth = 600;
	}
	else
	{	
		imgWidth = 477;
	}
	var border = 90;
	var winWidth = imgWidth + border;
	var winHeight = ((1+((imgWidth - tnWidth)/tnWidth))*tnHeight) + border;
	winimg = window.open('','','width='+winWidth+',height='+winHeight+'');
	winimg.document.write('<html><head><title>'+itemTitle+'</title><link rel="STYLESHEET" type="text/css" href="css/main.css"></head><body><div align="center"><h2>'+itemTitle+'</h2>');
	winimg.document.write('<img src="images/'+ imageSrc +'" border="0" class="photo" alt="'+itemTitle+'">');
	winimg.document.write('<br><br><input class="inputButton" onClick="self.close()" type="button" value=" Close Window "></div></body></html>');
	return false;
}

function printerFriendly(pageURL)
{
	printwin = window.open(pageURL,'','width=400,height=550,scrollbars=yes');
	return false;
}


function confirmLink(theLink, confirmMsg)
{
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = confirm(confirmMsg);
    if (is_confirmed) {
        return true;
    }
	else
	{
		return false;
	}
}

function changeVisible()
{
 if(document.wine.hlfbtl.checked == true)
 {
 document.getElementById('hlfbtlarea').style.visibility = 'visible';
 document.wine.hbtlprice.style.visibility = 'visible';
 }
 else
 {
 document.getElementById('hlfbtlarea').style.visibility = 'hidden'; 
 document.wine.hbtlprice.style.visibility = 'hidden';
 }
}


function validateBooking()
{
 var validated = false;
 var error = 0;
 var msg = "ERROR IN FORM\nThe form cannot be processed as due to the following errors:\n\n";
 var thisForm = this.document.bookingForm;
 var strEmail=thisForm.email.value;
 var strDate=thisForm.bdate.value;
 var emailFilter=/^.+@.+\..{2,3}$/;
 var dateFilter=/^(\d){2}-(\d){2}-(\d){4}$/;
 var timeFilter=/^(\d){2}:(\d){2}$/;
 
 if(thisForm.firstname.value == '')
 {
  msg += ">> First Name not specified\n";
  error ++;
 }
 if(thisForm.lastname.value == '')
 {
  msg += ">> Last Name not specified\n";
  error ++;
 }
 if(thisForm.phone.value == '')
 {
  msg += ">> Phone Number not specified\n";
  error ++;
 }
  if(thisForm.email.value == '')
 {
  msg += ">> E-mail Address not specified\n";
  error ++;
 }
 else if(!emailFilter.test(strEmail))
 {
  msg += ">> The e-mail address entered is invalid.\n";
  error ++;
 }
 if(thisForm.bdate.value == '')
 {
  msg += ">> Booking Date not specified\n";
  error ++;
 }
  else if(!dateFilter.test(strDate))
 {
  msg += ">> The booking date entered is invalid.\n   Please format the date dd-mm-yyyy to comply with our database.\n";
  error ++;
 }
 if(thisForm.days.value == '')
 {
  msg += ">> Booking Time not specified\n";
  error ++;
 }
 if(thisForm.guests.value == '')
 {
  msg += ">> Number of Guests not specified\n";
  error ++;
 }
 

if(error > 0)
 {
  msg += "\nPlease correct the form and resubmit it.";
  alert(msg);
 }
 else
 {
  validated = true;
 } 
return validated; 
}
//-->
