function check_booking1() {
  if ((document.booking.initial.value == "") || (document.booking.surname.value == "")) {
    alert("You must enter both you first initial, and your surname.");
    document.booking.initial.focus();
  }
  else if (((document.booking.address1.value == "") && (document.booking.address2.value == "") && (document.booking.address3.value == "")) || (document.booking.postal_town.value == "") || (document.booking.post_code.value == "")) {
    alert("You must enter your full address, Postal Town and Post Code.");
    document.booking.address1.focus();
  }
  else if ((document.booking.daytime_tel.value == "") && (document.booking.evening_tel.value == "") && (document.booking.mobile_tel.value == "")) {
    alert("You must provide at least one phone number that we can contact you on.");
    document.booking.daytime_tel.focus();
  }
  else if ((document.booking.num_adults.value == "") && (document.booking.address1.value == "")) {
    alert("Please specify the number of adults and children in your party.");
    document.booking.num_adults.focus();
  }
  else if ((document.booking.num_cottages.value == "") || (document.booking.num_nights.value == "") ||(document.booking.num_cars.value == "")) {
    alert("You must complete all fields in the Holiday Details section.");
    document.booking.date_arrival.focus();
  }
  else if (document.booking.read_terms.checked == false) {
    alert("You must tick the checkbox to confirm that you have read and agreed to our Terms and Conditions.");
  }
  else {
    document.booking.submit();
  }
}


function full_image(img) {


  full_img = window.open(img,'image','toolbar=no,status=no,scrollbars=no,width=800,height=600');
  full_img.focus();
}


function show_img(img) {
  cur_img = "images/gallery/thumb2/" + img;
  cur_full_img = "images/gallery/large/" + img;
  document.images["photo"].src = cur_img;
}

function show_full_img() {
  img = cur_full_img;
  full_image = window.open(img,'image','toolbar=no,status=no,scrollbars=no,left=2,top=2,width=790,height=580');
  full_image.focus();
}


function launch_help(help_page) {
  window.open(help_page,"help","width=400,height=400, scrollbars=yes");
}


function confirm_price_delete(price_id) {
  answer = confirm("Are you sure you want to delete this price entry?");

  if (answer != 0) {
    window.location = "admin_pricing_delete.php?id=" + price_id;
  }
}


function confirm_comment_delete(com_id) {
  answer = confirm("Are you sure you want to delete this comment?");

  if (answer != 0) {
    window.location = "admin_comments_delete.php?id=" + com_id;
  }
}


function confirm_image_delete(image_id) {
  answer = confirm("Are you sure you want to delete this image from the gallery?");

  if (answer != 0) {
    window.location = "admin_gallery_delete.php?id=" + image_id;
  }
}


function confirm_image_cancel(imagename) {
  answer = confirm("Are you sure you want to cancel adding this image to the gallery?");

  if (answer != 0) {
    window.location = "admin_gallery_add_cancel.php?image_name=" + imagename;
  }
}