//-------------------------------------------------------------------------------------------------------------------------------
// add text to elements of a form                                               
//-------------------------------------------------------------------------------------------------------------------------------
function insertAtCursor(myField, myValue) 
  {
          var SelectedText = "";
          if(document.selection)//ie
            {
              var selectedText = document.selection;
	      if (selectedText.type == 'Text') 
                {
		    var newRange = selectedText.createRange();
		    SelectedText = newRange.text;
                }
	    }
          else if(myField.selectionStart || myField.selectionStart == '0')
            {
                    var start = myField.selectionStart;
                    var end = myField.selectionEnd;
                    SelectedText = myField.value.substring(start,end);
            }
       
          switch(myValue)
            {
              case 1:myValue = "{linebreak}";break;
              case 2:myValue = "{bold}"+SelectedText+"{-bold}";break;
              case 3:myValue = "{italic}"+SelectedText+"{-italic}";break;
            }
          //IE support
          if (document.selection)
            {
              myField.focus();
              sel = document.selection.createRange();
              sel.text = myValue;
            }
          //MOZILLA/NETSCAPE support
          else if (myField.selectionStart || myField.selectionStart == '0')
            {
              var startPos = myField.selectionStart;
              var endPos = myField.selectionEnd;
              myField.value = myField.value.substring(0, startPos)
              + myValue
              + myField.value.substring(endPos, myField.value.length);
            }
          else
            {
              myField.value += myValue;
            }
  }

//-------------------------------------------------------------------------------------------------------------------------------
// rollover popup function for form.inc                                         
//-------------------------------------------------------------------------------------------------------------------------------
function popUp(evt,currElem)
{
  stdBrowser = (document.getElementById) ? true : false
  popUpWin = (stdBrowser) ? document.getElementById(currElem).style : eval("document." + currElem)
  if(document.all)
   {
     //popUpWin.pixelTop = parseInt(evt.y)-25
     //popUpWin.pixelLeft = Math.max(-25,parseInt(evt.x)+13)
     popUpWin.pixelTop = 50
     popUpWin.pixelLeft = 424
   }
  else
   {
    if(stdBrowser)
     {
       //popUpWin.pixelTop = parseInt(evt.pageY)-25 + "px"
       //popUpWin.pixelLeft = Math.max(-25,parseInt(evt.pageX)+13) + "px"
       popUpWin.pixelTop = 50 + "px"
       popUpWin.pixelLeft = 424 + "px"
     }
    else
     {
       //popUpWin.pixelTop = parseInt(evt.pageY)-25
       //popUpWin.pixelLeft = Math.max(-25,parseInt(evt.pageX)+13)
       popUpWin.pixelTop = 50
       popUpWin.pixelLeft = 424
     }
   }
  popUpWin.visibility = "visible"
}
function popDown(currElem)
{
 stdBrowser = (document.getElementById) ? true : false
 popUpWin = (stdBrowser) ? document.getElementById(currElem).style : eval("document." + currElem)
 popUpWin.visibility = "hidden"
}

//-------------------------------------------------------------------------------------------------------------------------------
// rollover popup function for forms included in the page                       
//-------------------------------------------------------------------------------------------------------------------------------
function popUp2(evt,currElem)
{
  stdBrowser = (document.getElementById) ? true : false
  popUpWin = (stdBrowser) ? document.getElementById(currElem).style : eval("document." + currElem)
  if(document.all)
   {
     popUpWin.pixelTop = parseInt(evt.y)+150
     popUpWin.pixelLeft = Math.max(-75,parseInt(evt.x)+13)
     //popUpWin.pixelTop = 545
     //popUpWin.pixelLeft = 547
   }
  else
   {
    if(stdBrowser)
     {
       popUpWin.pixelTop = parseInt(evt.pageY)+150 + "px"
       popUpWin.pixelLeft = Math.max(-75,parseInt(evt.pageX)+13) + "px"
       //popUpWin.pixelTop = 545 + "px"
       //popUpWin.pixelLeft = 547 + "px"
     }
    else
     {
       popUpWin.pixelTop = parseInt(evt.pageY)+150
       popUpWin.pixelLeft = Math.max(-75,parseInt(evt.pageX)+13)
      //popUpWin.pixelTop = 545
      //popUpWin.pixelLeft = 547
     }
   }
  popUpWin.visibility = "visible"
}
function popDown2(currElem)
{
 stdBrowser = (document.getElementById) ? true : false
 popUpWin = (stdBrowser) ? document.getElementById(currElem).style : eval("document." + currElem)
 popUpWin.visibility = "hidden"
}
//-------------------------------------------------------------------------------------------------------------------------------
// rollover popup function for accommodation form.inc - just sets the box lower 
//-------------------------------------------------------------------------------------------------------------------------------
function popUp3(evt,currElem)
{
  stdBrowser = (document.getElementById) ? true : false
  popUpWin = (stdBrowser) ? document.getElementById(currElem).style : eval("document." + currElem)
  if(document.all)
   {
     //popUpWin.pixelTop = parseInt(evt.y)-25
     //popUpWin.pixelLeft = Math.max(-25,parseInt(evt.x)+13)
     popUpWin.pixelTop = 175
     popUpWin.pixelLeft = 424
   }
  else
   {
    if(stdBrowser)
     {
       //popUpWin.pixelTop = parseInt(evt.pageY)-25 + "px"
       //popUpWin.pixelLeft = Math.max(-25,parseInt(evt.pageX)+13) + "px"
       popUpWin.pixelTop = 175 + "px"
       popUpWin.pixelLeft = 424 + "px"
     }
    else
     {
       //popUpWin.pixelTop = parseInt(evt.pageY)-25
       //popUpWin.pixelLeft = Math.max(-25,parseInt(evt.pageX)+13)
       popUpWin.pixelTop = 175
       popUpWin.pixelLeft = 424
     }
   }
  popUpWin.visibility = "visible"
}
function popDown(currElem)
{
 stdBrowser = (document.getElementById) ? true : false
 popUpWin = (stdBrowser) ? document.getElementById(currElem).style : eval("document." + currElem)
 popUpWin.visibility = "hidden"
}

//-------------------------------------------------------------------------------------------------------------------------------
// is it numeric function                                                       
//-------------------------------------------------------------------------------------------------------------------------------
function IsNumeric(sText)
{
  var ValidChars = "0123456789.";
  var IsNumber=true;
  var Char;
  for (i = 0; i < sText.length && IsNumber == true; i++) 
   { 
    Char = sText.charAt(i); 
    if (ValidChars.indexOf(Char) == -1) 
     {
       IsNumber = false;
     }
   }
  return IsNumber; 
}
//-------------------------------------------------------------------------------------------------------------------------------
// simple mail function to confuse harvesters/spamers                           
//-------------------------------------------------------------------------------------------------------------------------------

/*function sendMailTo(name, company, domain) {
      locationstring = 'mai' + 'lto:' + name + '@' + company + '.' + domain;
      window.location.replace(locationstring);
   }*/
  function sendMailTo(name) {
      locationstring = 'mai' + 'lto:' + name + '@travel-library.com';
      window.location.replace(locationstring);
   }
//-------------------------------------------------------------------------------------------------------------------------------
//add bookmark
//-------------------------------------------------------------------------------------------------------------------------------
function addBookmark(title,url) 
 {
         if(document.all)
           {
             window.external.AddFavorite(url,title);
           }
         else if (window.sidebar) 
	   { 
	     window.sidebar.addPanel(title, url,"");
	   } 
	 else if( window.opera && window.print ) 
	  { 
             return true; 
          }
 }
//-------------------------------------------------------------------------------------------------------------------------------
// displays a message in the status bar                                         
//-------------------------------------------------------------------------------------------------------------------------------
function statusMsg(msg) 
 {
   window.status=msg;
   return true
 }
//-------------------------------------------------------------------------------------------------------------------------------
// form validation                                                              
//-------------------------------------------------------------------------------------------------------------------------------

function AddLink()
{
  // validate name
  if (document.addlink.name.value == "")
   {
    alert('Please enter a name!');
    document.addlink.name.focus();
    return false;
   }
  // validate users country
  else if (document.addlink.ucountry.value == "Select a country" || document.addlink.ucountry.value == "")
   {
    alert("Please enter your Country!");
    document.addlink.ucountry.focus();
    return false;
   }
  // validate email
  else if (document.addlink.uemail.value == "")
   {
    alert("Please enter an email address!");
    document.addlink.uemail.focus();
    return false;
   }
  else if (! document.addlink.uemail.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.addlink.uemail.focus();
    return false;
   }
  /*else if(document.addlink.uemail.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.addlink.uemail.focus();
    return false;
   }*/
  else if (document.addlink.title.value == "" || document.addlink.title.length < 20)
   {
    alert("Please enter a valid Title more than 20 char!");
    document.addlink.title.focus();
    return false;
   }
  else if (document.addlink.url.value == "" || document.addlink.url.value == "http://")
   {
    alert("Please enter an website address!");
    document.addlink.url.focus();
    return false;
   }
  // validate text
  else if (document.addlink.review.value.length < 30 || document.addlink.review.value == "")
   {
    alert("Please enter a valid link description that is more than 30 chars");
    document.addlink.review.focus();
    return false;
   }
  /*validate equation
  else if (document.addlink.spamblock.value == '' || !IsNumeric(document.addlink.spamblock.value) )
   {
    alert("Please answer the simple equation, using numerics only!");
    document.addlink.spamblock.focus();
    return false;
   }*/
  //validate terms
  else if (!document.addlink.terms.checked)
   {
    alert("Please agree to our terms and conditions before submitting your review");
    document.addlink.terms.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }
}
function ValidTravelogueLinkForm()
{
  // validate name
  if (document.traveloguelink.name.value == "")
   {
    alert('Please enter a name!');
    document.traveloguelink.name.focus();
    return false;
   }
  // validate users country
  else if (document.traveloguelink.ucountry.value == "Select a country" || document.traveloguelink.ucountry.value == "")
   {
    alert("Please enter your Country!");
    document.traveloguelink.ucountry.focus();
    return false;
   }
  // validate email
  else if (document.traveloguelink.uemail.value == "")
   {
    alert("Please enter an email address!");
    document.traveloguelink.uemail.focus();
    return false;
   }
  else if (! document.traveloguelink.uemail.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.traveloguelink.uemail.focus();
    return false;
   }
  /*else if(document.traveloguelink.uemail.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.traveloguelink.uemail.focus();
    return false;
   }*/
  else if (document.traveloguelink.website.value == "" || document.traveloguelink.website.value == "http://")
   {
    alert("Please enter an website address!");
    document.traveloguelink.website.focus();
    return false;
   }
   // validate title
  else if (document.traveloguelink.title.value == "" || document.traveloguelink.title.length < 20)
   {
    alert("Please enter a valid Title more than 20 char!");
    document.traveloguelink.title.focus();
    return false;
   }
  // validate text
  else if (document.traveloguelink.review.value.length < 30 || document.traveloguelink.review.value == "")
   {
    alert("Please enter a valid link description that is more than 30 chars");
    document.traveloguelink.review.focus();
    return false;
   }
  //validate terms
   else if (!document.traveloguelink.terms.checked)
   {
    alert("Please agree to our terms and conditions before submitting your review");
    document.traveloguelink.terms.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }
}

function ValidTravelogueForm() 
{
  // validate name
  if (document.travelogue.name.value == "") 
   {
    alert('Please enter a name!');
    document.travelogue.name.focus();
    return false;
   }
  // validate users country
  else if (document.travelogue.ucountry.value == "Select a country" || document.travelogue.ucountry.value == "")
   {
    alert("Please enter your Country!");
    document.travelogue.ucountry.focus();
    return false;
   }
  // validate email
  else if (document.travelogue.uemail.value == "")
   {
    alert("Please enter an email address!");
    document.travelogue.uemail.focus();
    return false;
   }
  else if (! document.travelogue.uemail.value.match("^.+@.+\..+$")) 
   {
    alert("Please enter a valid email address!");
    document.travelogue.uemail.focus();
    return false;
   }
  /*else if(document.travelogue.uemail.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.travelogue.uemail.focus();
    return false;
   }*/
  // validate travelling country
  else if (document.travelogue.travelcountrycode.value == "Select a country" || document.travelogue.travelcountrycode.value == "")
   {
    alert("Please enter a Continent! or Country!");
    document.travelogue.travelcountrycode.focus();
    return false;
   }
  // validate travelling state
  else if ((document.travelogue.travelstatecode.value == "" || document.travelogue.travelstatecode.value == "Select One") && (document.travelogue.travelcountrycode.value == "gb" || document.travelogue.travelcountrycode.value == "au" || document.travelogue.travelcountrycode.value == "ca" || document.travelogue.travelcountrycode.value == "us"))
   {
    switch(document.travelogue.travelcountrycode.value)
     {
      case "gb":
      alert("Please choose either England,Northern Ireland,Scotland or Wales!");
      document.travelogue.travelstatecode.focus();
      return false;
      break;
      case "au":
      alert("Please choose a state!");
      document.travelogue.travelstatecode.focus();
      return false;
      break;
      case "ca":
      alert("Please choose a state!");
      document.travelogue.travelstatecode.focus();
      return false;
      break;
      case "us":
      alert("Please choose a state!");
      document.travelogue.travelstatecode.focus();
      return false;
      break;
     }
   }
    // validate if it is a link or travelogue
    var type = -1;
    for(i=0;i<document.travelogue.type.length;i++)
     {
      if(document.travelogue.type[i].checked)
       {
        type = i;
       }
      if(document.travelogue.type[0].checked)
       {
         var thetype = "travelogue";
       }
      else if(document.travelogue.type[1].checked)
       {
        thetype = "link"
       }
     }
    if(type == -1)
     {
      alert("Please enter if this is a Travelogue or a Link!");
      return false;
     }
    else if(thetype == "travelogue")
     {
       // validate title
       if (document.travelogue.title.value == "" || document.travelogue.title.length < 20)
        {
         alert("Please enter a valid Title more than 20 char!");
         document.travelogue.title.focus();
         return false;
        }
       // validate text
       else if (document.travelogue.review.value.length < 25 || document.travelogue.review.value == "")
        {
         alert("Please enter a valid review that is more than 25 chars");
         document.travelogue.review.focus();
         return false;
        }
       //validate terms
       else if (!document.travelogue.terms.checked)
        {
         alert("Please agree to our terms and conditions before submitting your review");
         document.travelogue.terms.focus();
         return false;
        }
     }
     else if(thetype == "link")
     {
       // validate link
       if (document.travelogue.website.value == "" || document.travelogue.website.value == "http://")
        {
         alert("Please enter a valid website link");
         document.travelogue.website.focus();
         return false;
        }
       else if (document.travelogue.backlink.value == "" || document.travelogue.backlink.value == "http://")
        {
         alert("Please enter a valid backlink");
         document.travelogue.backlink.focus();
         return false;
        }
       //validate terms
       else if (!document.travelogue.terms.checked)
        {
         alert("Please agree to our terms and conditions before submitting your review");
         document.travelogue.terms.focus();
         return false;
        }
     }
    // all is well
    else
    {
      return true;
    }
}

function ValidCarReviewForm()
{
  // validate name
  if (document.carreview.name.value == "")
   {
    alert('Please enter a name!');
    document.carreview.name.focus();
    return false;
   }
  // validate users country
  else if (document.carreview.ucountry.value == "Select a country" || document.carreview.ucountry.value == "")
   {
    alert("Please enter your Country!");
    document.carreview.ucountry.focus();
    return false;
   }
  // validate email
  else if (document.carreview.uemail.value == "")
   {
    alert("Please enter an email address!");
    document.carreview.uemail.focus();
    return false;
   }
  else if (! document.carreview.uemail.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.carreview.uemail.focus();
    return false;
   }
  /*else if(document.carreview.uemail.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.carreview.uemail.focus();
    return false;
   }*/
  // validate text
  else if (document.carreview.review.value.length < 25 || document.carreview.review.value == "")
   {
    alert("Please enter a valid review that is more than 25 chars");
    document.carreview.review.focus();
    return false;
   }
  //validate terms
   else if (!document.carreview.terms.checked)
   {
    alert("Please agree to our terms and conditions before submitting your review");
    document.carreview.terms.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }
}

function ValidSkiReviewForm()
{
  // validate name
  if (document.skireview.name.value == "")
   {
    alert('Please enter a name!');
    document.skireview.name.focus();
    return false;
   }
  // validate users country
  else if (document.skireview.ucountry.value == "Select a country" || document.skireview.ucountry.value == "")
   {
    alert("Please enter your Country!");
    document.skireview.ucountry.focus();
    return false;
   }
  // validate email
  else if (document.skireview.uemail.value == "")
   {
    alert("Please enter an email address!");
    document.skireview.uemail.focus();
    return false;
   }
  else if (! document.skireview.uemail.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.skireview.uemail.focus();
    return false;
   }
  else if(document.skireview.uemail.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.skireview.uemail.focus();
    return false;
   }
  // validate name
  else if (document.skireview.title.value == "")
   {
    alert('Please enter a slope name!');
    document.skireview.title.focus();
    return false;
   }
  // validate text
  else if (document.skireview.review.value.length < 25 || document.skireview.review.value == "")
   {
    alert("Please enter a valid review that is more than 25 chars");
    document.skireview.review.focus();
    return false;
   }
  //validate terms
  else if (!document.skireview.terms.checked)
   {
    alert("Please agree to our terms and conditions before submitting your review");
    document.skireview.terms.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }
}

function ValidHotelReviewForm()
{
  /* validate name
  if (document.hotelreview.name.value == "")
   {
    alert('Please enter a name!');
    document.hotelreview.name.focus();
    return false;
   }
  // validate type of traveller
  else if (document.hotelreview.typeoftraveller.value == "")
   {
    alert('Please tell us what type of traveller you are!');
    document.hotelreview.typeoftraveller.focus();
    return false;
   }
  // validate type of agegroup
  else if (document.hotelreview.uage.value == "")
   {
    alert('Please tell us your age group!');
    document.hotelreview.uage.focus();
    return false;
   }
  // validate users country
  else if (document.hotelreview.ucountry.value == "Select a country" || document.hotelreview.ucountry.value == "")
   {
    alert("Please enter your Country!");
    document.hotelreview.ucountry.focus();
    return false;
   }
  */
  // validate email
  if (document.hotelreview.uemail.value == "")
   {
    alert("Please enter an email address!");
    document.hotelreview.uemail.focus();
    return false;
   }
  else if (! document.hotelreview.uemail.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.hotelreview.uemail.focus();
    return false;
   }
  /*else if(document.hotelreview.uemail.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.hotelreview.uemail.focus();
    return false;
   }*/
  /* validate rating
  else if (document.hotelreview.rating.value == "")
   {
    alert('Please rate this hotel!');
    document.hotelreview.rating.focus();
    return false;
   }
  //ifuser rating is below 4 then get email address
  if (document.hotelreview.rating.value < 4)
   {
     // validate email
     if (document.hotelreview.uemail.value == "")
      {
       alert("Because your rating is below 4 - Please enter an email address!");
       document.hotelreview.uemail.focus();
       return false;
      }
     else if (! document.hotelreview.uemail.value.match("^.+@.+\..+$"))
      {
       alert("Please enter a valid email address!");
       document.hotelreview.uemail.focus();
       return false;
      }
   }*/
   // validate title
  else if (document.hotelreview.title.value == "" || document.hotelreview.title.length < 10)
   {
    alert("Please enter a valid Title more than 10 char!");
    document.hotelreview.title.focus();
    return false;
   }
  // validate text
  else if (document.hotelreview.review.value.length < 25 || document.hotelreview.review.value == "")
   {
    alert("Please enter a valid review that is more than 25 chars");
    document.hotelreview.review.focus();
    return false;
   }
  /*validate equation
  else if (document.hotelreview.spamblock.value == '' || !IsNumeric(document.hotelreview.spamblock.value) )
   {
    alert("Please answer the simple equation, using numerics only!");
    document.hotelreview.spamblock.focus();
    return false;
   }*/
  //validate terms
   else if (!document.hotelreview.terms.checked)
   {
    alert("Please agree to our terms and conditions before submitting your review");
    document.hotelreview.terms.focus();
    return false;
   }
  // all is well
  else
   {
    //window.open('/thanks.html','NewWindow','width=600,height=560,scrollbars=yes,resizable=no,toolbar=no');
    return true;
   }
}
function ValidHotelReviewForm2()
{
  /* validate provider
  if (document.hotelreview.provider.value == "")
   {
    alert('Please choose a provider!');
    document.hotelreview.provider.focus();
    return false;
   }
  // validate providerrating
  else if (document.hotelreview.prating.value == 0 || document.hotelreview.prating.value == "")
   {
    alert('Please rate this provider!');
    document.hotelreview.prating.focus();
    return false;
   }
  */
  //validate dates
  if(document.hotelreview.whenmonth.value == '')
   {
     alert('Please enter the month you stayed');
	 document.hotelreview.whenmonth.focus();
	 return false;
   }
  else if(document.hotelreview.whenyear.value == '' || document.hotelreview.whenyear.value == 'yyyy')
   {
     alert('Please enter the year you stayed');
	 document.hotelreview.whenyear.focus();
	 return false;
   }
  // validate picture
  else if (! document.hotelreview.userfile.value.match("jpg") && document.hotelreview.userfile.value != "")
   {
    alert('Please upload a jpg file!');
    document.hotelreview.userfile.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }
}
function AddAccomListing()
{
  // validate name
  if (document.addhotellisting.name.value == "")
   {
    alert('Please enter a name!');
    document.addhotellisting.name.focus();
    return false;
   }
  // validate email
  else if (document.addhotellisting.uemail.value == "")
   {
    alert("Please enter an email address!");
    document.addhotellisting.uemail.focus();
    return false;
   }
  else if (! document.addhotellisting.uemail.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.addhotellisting.uemail.focus();
    return false;
   }
 /*else if(document.addhotellisting.uemail.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.addhotellisting.uemail.focus();
    return false;
   }*/

 // validate  country
  else if (document.addhotellisting.pcountry.value == "Select a country" || document.addhotellisting.pcountry.value == "")
   {
    alert("Please enter a Country!");
    document.addhotellisting.pcountry.focus();
    return false;
   }
  // validate  state
  else if ((document.addhotellisting.pstate.value == "" || document.addhotellisting.pstate.value == "Select One") && (document.addhotellisting.pcountry.value =="gb" || document.addhotellisting.pcountry.value =="au" || document.addhotellisting.pcountry.value =="ca" || document.addhotellisting.pcountry.value =="us") )
   {
   switch(document.addhotellisting.pcountry.value)
    {
    case "gb":
    alert("Please choose either England,Northern Ireland,Scotland or Wales!");
    document.addhotellisting.pstate.focus();
    return false;
    break;
    case "au":
    alert("Please choose a state!");
    document.addhotellisting.pstate.focus();
    return false;
    break;
    case "ca":
    alert("Please choose a state!");
    document.addhotellisting.pstate.focus();
    return false;
    break;
    case "us":
    alert("Please choose a state!");
    document.addhotellisting.pstate.focus();
    return false;
    break;
    }
   }
  else if (document.addhotellisting.pcity.value == "")
   {
    alert('Please enter a City!');
    document.addhotellisting.pcity.focus();
    return false;
   }
  // validate name
  else if (document.addhotellisting.hotelname.value == "")
   {
    alert('Please enter a Property name!');
    document.addhotellisting.hotelname.focus();
    return false;
   }
  //phone
  else if (document.addhotellisting.phone.value == "")
   {
    alert('Please enter a Telephone number!');
    document.addhotellisting.phone.focus();
    return false;
   }
  //else if (document.addhotellisting.pstrnum.value == "" || !IsNumeric(document.addhotellisting.pstrnum.value))
   else if (document.addhotellisting.pstrnum.value == "")
  {
    alert('Please enter a numeric Street number only!');
    document.addhotellisting.pstrnum.focus();
    return false;
   }
  else if (document.addhotellisting.pstrname.value == "")
   {
    alert('Please enter an address!');
    document.addhotellisting.pstrname.focus();
    return false;
   }
  else if (document.addhotellisting.ppcode.value == "")
   {
    alert('Please enter a Post Code!');
    document.addhotellisting.ppcode.focus();
    return false;
   }
  // validate email
  else if (document.addhotellisting.email.value == "")
   {
    alert("Please enter an email address!");
    document.addhotellisting.email.focus();
    return false;
   }
  /*else if (! document.addhotellisting.email.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.addhotellisting.email.focus();
    return false;
   }*/
  //validate terms
  else if (!document.addhotellisting.terms.checked)
   {
    alert("Please agree to our terms and conditions before submitting your listing");
    document.addhotellisting.terms.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }
}

function AddHotelListing()
{
  // validate name
  if (document.addhotellisting.name.value == "")
   {
    alert('Please enter a name!');
    document.addhotellisting.name.focus();
    return false;
   }
  // validate email
  else if (document.addhotellisting.uemail.value == "")
   {
    alert("Please enter an email address!");
    document.addhotellisting.uemail.focus();
    return false;
   }
  else if (! document.addhotellisting.uemail.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.addhotellisting.uemail.focus();
    return false;
   }
  /*else if(document.addhotellisting.uemail.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.addhotellisting.uemail.focus();
    return false;
   }*/

 // validate  country
  else if (document.addhotellisting.pcountry.value == "Select a country" || document.addhotellisting.pcountry.value == "")
   {
    alert("Please enter a Country!");
    document.addhotellisting.pcountry.focus();
    return false;
   }
  // validate  state
  else if ((document.addhotellisting.pstate.value == "" || document.addhotellisting.pstate.value == "Select One") && (document.addhotellisting.pcountry.value =="gb" || document.addhotellisting.pcountry.value =="au" || document.addhotellisting.pcountry.value =="ca" || document.addhotellisting.pcountry.value =="us") )
   {
   switch(document.addhotellisting.pcountry.value)
    {
    case "gb":
    alert("Please choose either England,Northern Ireland,Scotland or Wales!");
    document.addhotellisting.pstate.focus();
    return false;
    break;
    case "au":
    alert("Please choose a state!");
    document.addhotellisting.pstate.focus();
    return false;
    break;
    case "ca":
    alert("Please choose a state!");
    document.addhotellisting.pstate.focus();
    return false;
    break;
    case "us":
    alert("Please choose a state!");
    document.addhotellisting.pstate.focus();
    return false;
    break;
    }
   }
  else if (document.addhotellisting.pcity.value == "")
   {
    alert('Please enter a City!');
    document.addhotellisting.pcity.focus();
    return false;
   }
  // validate name
  else if (document.addhotellisting.hotelname.value == "")
   {
    alert('Please enter a Hotel name!');
    document.addhotellisting.hotelname.focus();
    return false;
   }
  // star rating
  else if (document.addhotellisting.starrating.value == "")
   {
    alert('Please enter a Star Rating!');
    document.addhotellisting.starrating.focus();
    return false;
   }
  //phone
  else if (document.addhotellisting.phone.value == "")
   {
    alert('Please enter a Telephone number!');
    document.addhotellisting.phone.focus();
    return false;
   }
  //else if (document.addhotellisting.pstrnum.value == "" || !IsNumeric(document.addhotellisting.pstrnum.value))
   else if (document.addhotellisting.pstrnum.value == "") 
  {
    alert('Please enter a numeric Street number only!');
    document.addhotellisting.pstrnum.focus();
    return false;
   }
  else if (document.addhotellisting.pstrname.value == "")
   {
    alert('Please enter an address!');
    document.addhotellisting.pstrname.focus();
    return false;
   }
  else if (document.addhotellisting.ppcode.value == "")
   {
    alert('Please enter a Post Code!');
    document.addhotellisting.ppcode.focus();
    return false;
   }
  // validate email
  else if (document.addhotellisting.email.value == "")
   {
    alert("Please enter an email address!");
    document.addhotellisting.email.focus();
    return false;
   }
  /*else if (! document.addhotellisting.email.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.addhotellisting.email.focus();
    return false;
   }*/
  //validate terms
  else if (!document.addhotellisting.terms.checked)
   {
    alert("Please agree to our terms and conditions before submitting your listing");
    document.addhotellisting.terms.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }
}
function AddCarListing()
{
  // validate name
  if (document.addcarlisting.name.value == "")
   {
    alert('Please enter a name!');
    document.addcarlisting.name.focus();
    return false;
   }
  // validate email
  else if (document.addcarlisting.uemail.value == "")
   {
    alert("Please enter an email address!");
    document.addcarlisting.uemail.focus();
    return false;
   }
  else if (! document.addcarlisting.uemail.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.addcarlisting.uemail.focus();
    return false;
   }
  /*else if(document.addcarlisting.uemail.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.addcarlisting.uemail.focus();
    return false;
   }*/
 // validate  country
  else if (document.addcarlisting.pcountry.value == "Select a country" || document.addcarlisting.pcountry.value == "")
   {
    alert("Please enter a Country!");
    document.addcarlisting.pcountry.focus();
    return false;
   }
  // validate  state
  else if ((document.addcarlisting.pstate.value == "" || document.addcarlisting.pstate.value == "Select One") && (document.addcarlisting.pcountry.value =="gb" || document.addcarlisting.pcountry.value =="au" || document.addcarlisting.pcountry.value =="ca" || document.addcarlisting.pcountry.value =="us") )
   {
   switch(document.addcarlisting.pcountry.value)
    {
    case "gb":
    alert("Please choose either England,Northern Ireland,Scotland or Wales!");
    document.addcarlisting.pstate.focus();
    return false;
    break;
    case "au":
    alert("Please choose a state!");
    document.addcarlisting.pstate.focus();
    return false;
    break;
    case "ca":
    alert("Please choose a state!");
    document.addcarlisting.pstate.focus();
    return false;
    break;
    case "us":
    alert("Please choose a state!");
    document.addcarlisting.pstate.focus();
    return false;
    break;
    }
   }
  else if (document.addcarlisting.pcity.value == "")
   {
    alert('Please enter a City!');
    document.addcarlisting.pcity.focus();
    return false;
   }
  // validate name
  else if (document.addcarlisting.contactname.value == "")
   {
    alert('Please enter a name!');
    document.addcarlisting.contactname.focus();
    return false;
   }
  else if (document.addcarlisting.businessname.value == "")
   {
    alert('Please enter a businessname!');
    document.addcarlisting.businessname.focus();
    return false;
   }
  else if (document.addcarlisting.pstrnum.value == "" || !IsNumeric(document.addcarlisting.pstrnum.value))
   {
    alert('Please enter a numeric Street number only!');
    document.addcarlisting.pstrnum.focus();
    return false;
   }
  else if (document.addcarlisting.pstrname.value == "")
   {
    alert('Please enter an address!');
    document.addcarlisting.pstrname.focus();
    return false;
   }
  else if (document.addcarlisting.ppcode.value == "")
   {
    alert('Please enter a Post Code!');
    document.addcarlisting.ppcode.focus();
    return false;
   }
  // validate email
  else if (document.addcarlisting.email.value == "")
   {
    alert("Please enter an email address!");
    document.addcarlisting.email.focus();
    return false;
   }
  else if (! document.addcarlisting.email.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.addcarlisting.email.focus();
    return false;
   }
  /*else if(document.addcarlisting.email.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.addcarlisting.email.focus();
    return false;
   }*/
  //phone
  else if (document.addcarlisting.phone.value == "")
   {
    alert('Please enter a Telephone number!');
    document.addcarlisting.phone.focus();
    return false;
   }
  // validate text
  else if (document.addcarlisting.review.value.length < 25 || document.addcarlisting.review.value == "")
   {
    alert("Please enter a valid description that is more than 25 chars");
    document.addcarlisting.review.focus();
    return false;
   }
  //validate terms
  else if (!document.addcarlisting.terms.checked)
   {
    alert("Please agree to our terms and conditions before submitting your review");
    document.addcarlisting.terms.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }

}
function AddHolidayProvider()
{
  // validate name
  if (document.addprovider.name.value == "")
   {
    alert('Please enter a name!');
    document.addprovider.name.focus();
    return false;
   }
  else if (document.addprovider.businessname.value == "")
   {
    alert('Please enter a businessname!');
    document.addprovider.businessname.focus();
    return false;
   }
  else if (document.addprovider.pstrnum.value == "" || !IsNumeric(document.addprovider.pstrnum.value))
   {
    alert('Please enter a numeric Street number only!');
    document.addprovider.pstrnum.focus();
    return false;
   }
  else if (document.addprovider.pstrname.value == "")
   {
    alert('Please enter an address!');
    document.addprovider.pstrname.focus();
    return false;
   }
  else if (document.addprovider.ppcode.value == "")
   {
    alert('Please enter a Post Code!');
    document.addprovider.ppcode.focus();
    return false;
   }
  else if (document.addprovider.pcity.value == "")
   {
    alert('Please enter a City!');
    document.addprovider.pcity.focus();
    return false;
   }
 // validate  country
  else if (document.addprovider.pcountry.value == "Select a country" || document.addprovider.pcountry.value == "")
   {
    alert("Please enter a Country!");
    document.addprovider.pcountry.focus();
    return false;
   }
  // validate  state
  else if ((document.addprovider.pstate.value == "" || document.addprovider.pstate.value == "Select One") && (document.addprovider.pcountry.value =="gb" || document.addprovider.pcountry.value =="au" || document.addprovider.pcountry.value =="ca" || document.addprovider.pcountry.value =="us") )
   {
   switch(document.addprovider.pcountry.value)
    {
    case "gb":
    alert("Please choose either England,Northern Ireland,Scotland or Wales!");
    document.addprovider.pstate.focus();
    return false;
    break;
    case "au":
    alert("Please choose a state!");
    document.addprovider.pstate.focus();
    return false;
    break;
    case "ca":
    alert("Please choose a state!");
    document.addprovider.pstate.focus();
    return false;
    break;
    case "us":
    alert("Please choose a state!");
    document.addprovider.pstate.focus();
    return false;
    break;
    }
   }
  // validate email
  else if (document.addprovider.email.value == "")
   {
    alert("Please enter an email address!");
    document.addprovider.email.focus();
    return false;
   }
  else if (! document.addprovider.email.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.addprovider.email.focus();
    return false;
   }
  /*else if(document.addprovider.email.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.addprovider.email.focus();
    return false;
   }*/
  //phone
  else if (document.addprovider.phone.value == "")
   {
    alert('Please enter a Telephone number!');
    document.addprovider.phone.focus();
    return false;
   }
  // validate text
  else if (document.addprovider.review.value.length < 25 || document.addprovider.review.value == "")
   {
    alert("Please enter a valid description that is more than 25 chars");
    document.addprovider.review.focus();
    return false;
   }
  //validate terms
  else if (!document.addprovider.terms.checked)
   {
    alert("Please agree to our terms and conditions before submitting your review");
    document.addprovider.terms.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }

}
function AddCarProvider()
{
  // validate name
  if (document.addprovider.name.value == "")
   {
    alert('Please enter a name!');
    document.addprovider.name.focus();
    return false;
   }
  else if (document.addprovider.businessname.value == "")
   {
    alert('Please enter a businessname!');
    document.addprovider.businessname.focus();
    return false;
   }
  else if (document.addprovider.pstrnum.value == "" || !IsNumeric(document.addprovider.pstrnum.value))
   {
    alert('Please enter a numeric Street number only!');
    document.addprovider.pstrnum.focus();
    return false;
   }
  else if (document.addprovider.pstrname.value == "")
   {
    alert('Please enter an address!');
    document.addprovider.pstrname.focus();
    return false;
   }
  else if (document.addprovider.ppcode.value == "")
   {
    alert('Please enter a Post Code!');
    document.addprovider.ppcode.focus();
    return false;
   }
  // validate email
  else if (document.addprovider.email.value == "")
   {
    alert("Please enter an email address!");
    document.addprovider.email.focus();
    return false;
   }
  else if (! document.addprovider.email.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.addprovider.email.focus();
    return false;
   }
  /*else if(document.addprovider.email.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.addprovider.email.focus();
    return false;
   }*/
  //website
  else if (document.addprovider.website.value == "" || document.addprovider.website.value == "http://")
   {
    alert('Please enter your business website address!');
    document.addprovider.website.focus();
    return false;
   }
  //phone
  else if (document.addprovider.phone.value == "")
   {
    alert('Please enter a Telephone number!');
    document.addprovider.phone.focus();
    return false;
   }
  // validate text
  else if (document.addprovider.review.value.length < 25 || document.addprovider.review.value == "")
   {
    alert("Please enter a valid description that is more than 25 chars");
    document.addprovider.review.focus();
    return false;
   }
  //validate terms
  else if (!document.addprovider.terms.checked)
   {
    alert("Please agree to our terms and conditions before submitting your review");
    document.addprovider.terms.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }

}
function AddShortBreak()
{
  // validate name
  if (document.addshortbreak.name.value == "")
   {
    alert('Please enter a name!');
    document.addshortbreak.name.focus();
    return false;
   }
// validate users country
  else if (document.addshortbreak.ucountry.value == "Select a country" || document.addshortbreak.ucountry.value == "")
   {
    alert("Please enter your Country!");
    document.addshortbreak.ucountry.focus();
    return false;
   }
  // validate email
  else if (document.addshortbreak.uemail.value == "")
   {
    alert("Please enter an email address!");
    document.addshortbreak.uemail.focus();
    return false;
   }
  else if (! document.addshortbreak.uemail.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.addshortbreak.uemail.focus();
    return false;
   }
  /*else if(document.addshortbreak.uemail.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.addshortbreak.uemail.focus();
    return false;
   }*/
  //validate title
  else if (document.addshortbreak.title.value == "")
   {
    alert('Please enter a name!');
    document.addshortbreak.title.focus();
    return false;
   }
  // validate text
  else if (document.addshortbreak.review.value.length < 25 || document.addshortbreak.review.value == "")
   {
    alert("Please enter a valid review that is more than 25 chars");
    document.addshortbreak.review.focus();
    return false;
   }
  //validate terms
  else if (!document.addshortbreak.terms.checked)
   {
    alert("Please agree to our terms and conditions before submitting your review");
    document.addshortbreak.terms.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }
}
function AddHolidayGuide()
{
  // validate name
  if (document.addholidayguide.name.value == "")
   {
    alert('Please enter a name!');
    document.addholidayguide.name.focus();
    return false;
   }
// validate users country
  else if (document.addholidayguide.ucountry.value == "Select a country" || document.addholidayguide.ucountry.value == "")
   {
    alert("Please enter your Country!");
    document.addholidayguide.ucountry.focus();
    return false;
   }
  // validate email
  else if (document.addholidayguide.uemail.value == "")
   {
    alert("Please enter an email address!");
    document.addholidayguide.uemail.focus();
    return false;
   }
  else if (! document.addholidayguide.uemail.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.addholidayguide.uemail.focus();
    return false;
   }
  /*else if(document.addholidayguide.uemail.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.addholidayguide.uemail.focus();
    return false;
   }*/
  /*validate feature
  else if (document.addholidayguide.feature.value == "")
   {
    alert('Please enter a feature!');
    document.addholidayguide.feature.focus();
    return false;
   }
   */

  //validate title
  else if (document.addholidayguide.title.value == "")
   {
    alert('Please enter a title!');
    document.addholidayguide.title.focus();
    return false;
   }
  // validate text
  else if (document.addholidayguide.review.value.length < 25 || document.addholidayguide.review.value == "")
   {
    alert("Please enter a valid review that is more than 25 chars");
    document.addholidayguide.review.focus();
    return false;
   }
  //validate terms
  else if (!document.addholidayguide.terms.checked)
   {
    alert("Please agree to our terms and conditions before submitting your review");
    document.addholidayguide.terms.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }
}
function ValidContactForm()
{
  // validate name
  if (document.contactform.uname.value == "")
   {
    alert('Please enter a name!');
    document.contactform.uname.focus();
    return false;
   }
  // validate email
  else if (document.contactform.uemail.value == "")
   {
    alert("Please enter an email address!");
    document.contactform.uemail.focus();
    return false;
   }
  else if (! document.contactform.uemail.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.contactform.uemail.focus();
    return false;
   }
  /*else if(document.contactform.uemail.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.contactform.uemail.focus();
    return false;
   }*/
  //validate subject
  else if (document.contactform.subject.value == "")
   {
    alert('Please enter a Subject!');
    document.contactform.subject.focus();
    return false;
   }
  //validate title
  else if (document.contactform.message.value == "")
   {
    alert('Please enter a message!');
    document.contactform.subject.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }
}
//-------------------------------------------------------------------------------------------------------------------------------
//hotel addit validation
//-------------------------------------------------------------------------------------------------------------------------------
function hoteladditcheck()
{
 var x = document.hoteladdit.blankfields.value;
 var y = 0;
 // need to check thru six form fields if not populated the add y
 if(document.hoteladdit.starrating.value == "")
  {
   y = y+1;
  }
 if(document.hoteladdit.numrooms.value == "")
  {
   y = y+1;
  }
 if(document.hoteladdit.phone.value == "")
  {
   y = y+1;
  }
 if(document.hoteladdit.fax.value == "")
  {
   y = y+1;
  }
 if(document.hoteladdit.website.value == "http://")
  {
   y = y+1;
  }
 if(document.hoteladdit.email.value == "")
  {
   y = y+1;
  }

 if(x == y)
  {
   alert("Please fill in at least 1 of the "+x+" empty fields!");
   return false;
  }
 //validate terms
 else if (!document.hoteladdit.terms.checked)
  {
   alert("Please agree to our terms and conditions before submitting");
   document.hoteladdit.terms.focus();
   return false;
  }
 else
  {
   return true;
  }
 
}
//-------------------------------------------------------------------------------------------------------------------------------
//hotel update info validation
//-------------------------------------------------------------------------------------------------------------------------------
function hotelupdatecheck()
{ 
  //check whether the web has http in it
  if (! document.hotelupdateinfo.website.value.match("http://"))
   {
    alert("Please enter a web address beginning with 'http://' !");
    document.hotelupdateinfo.website.focus();
    return false;
   }
  /*check whether email address is ok for hotel
  else if (! document.hotelupdateinfo.email.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.hotelupdateinfo.email.focus();
    return false;
   }
  */

  //check whether email address is ok for user
  else if (document.hotelupdateinfo.uemail.value == "")
   {
    alert("Please enter an user email address!");
    document.hotelupdateinfo.uemail.focus();
    return false;
   }
  else if (! document.hotelupdateinfo.uemail.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.hotelupdateinfo.uemail.focus();
    return false;
   }
  //check whether user entered a relasionship
  else if (document.hotelupdateinfo.other.value == "")
   {
    alert("Please enter your relasionship with the hotel!");
    document.hotelupdateinfo.other.focus();
    return false;
   }
  //validate terms
  else if (!document.hotelupdateinfo.terms.checked)
   {
    alert("Please agree to our terms and conditions before submitting");
    document.hotelupdateinfo.terms.focus();
    return false;
   }
  else
   {
    return true;
   }
}
//-------------------------------------------------------------------------------------------------------------------------------
//tourowners section javascript
//-------------------------------------------------------------------------------------------------------------------------------
function CheckStepTour0()
 {  
  // validate accom type
  if (document.step1.submissiontype.value == "")
   {
    alert('Please choose the type of tour!');
    document.step1.submissiontype.focus();
    return false;
   }
  else
   {
    return true;
   }
 }
function CheckStepTour1()
 {
  // validate country type
  if (document.step1.countrycode.value == "" || document.step1.countrycode.value == "xx")
   {
    alert('Please choose a country!');
    document.step1.thecountryform.focus();
    return false;
   }
  //validate state if country with states is selected
  else if ((document.step1.countrycode.value == "gb" || document.step1.countrycode.value == "au" || document.step1.countrycode.value == "us" || document.step1.countrycode.value == "ca") && (document.step1.statecode.value == "") )
   {
    alert('Please choose a state!');
    document.step1.thestateform.focus();
    return false;
   }
  // validate city type
  else if (document.step1.cityname.value == "" && document.step1.citynamenew.value == "")
   {
    alert('Please choose a city!');
    document.step1.cityname.focus();
    return false;
   }
  // validate accom type
  else if (document.step1.tourname.value == "")
   {
    alert('Please add a tour name!');
    document.step1.tourname.focus();
    return false;
   }
  //validate property Description header
  else if (document.step1.descriptionheader.value == "")
   {
    alert('Please enter an Introductory header!');
    document.step1.descriptionheader.focus();
    return false;
   }
  //validate tour days
  else if (document.step1.durationdays.value == "")
   {
    alert('Please enter at least a 1 day tour!');
    document.step1.durationdays.focus();
    return false;
   }
  else
   {
    return true;
   }
 }
function CheckStepTour2()
{
  //validate local currency
  if (document.step2.localcurrency.value == "")
   {
    alert('Please enter the local currency!');
    document.step2.localcurrency.focus();
    return false;
   }
  //validate hiest and lowest prices
  else if (document.step2.lowestprice.value == "")
   {
    alert('Please enter your lowest Price');
    document.step2.lowestprice.focus();
    return false;
   }
  else if (!IsNumeric(document.step2.lowestprice.value))
   {
    alert('Please enter your lowest Price in Numerics Only ie 25.50');
    document.step2.lowestprice.focus();
    return false;
   }
  else if (document.step2.highestprice.value =="")
   {
    alert('Please enter your Highest Price');
    document.step2.highestprice.focus();
    return false;
   }
  else if (!IsNumeric(document.step2.highestprice.value))
   {
    alert('Please enter your Highest Price in Numerics Only ie 25.50');
    document.step2.highestprice.focus();
    return false;
   }
  //validate season rates
  else if(document.step2.numseason.value != 0 && document.step2.numseason.value != '')
   {
    if(document.step2.fromday1.value == 0 || document.step2.frommonth1.value == 0 || document.step2.fromyear1.value == 0)
     {
       alert('Please enter correct from dates');
       document.step2.fromday1.focus();
       return false;
     }
    if(document.step2.today1.value == 0 || document.step2.tomonth1.value == 0 || document.step2.toyear1.value == 0)
     {
      alert('Please enter correct to dates');
      document.step2.today1.focus();
      return false;
     }
   }
  else if(document.step2.pointstart.value == '')
   {
    alert('Please enter a starting point for your tour!');
    document.step2.pointstart.focus();
    return false;
   }
  else if(document.step2.pointend.value == '')
   {
    alert('Please enter an end point for your tour!');
    document.step2.pointend.focus();
    return false;
   }
  else if(document.step2.contactname.value == '')
   {
    alert('Please enter a contact name!');
    document.step2.contactname.focus();
    return false;
   }
// validate email
  else if (document.step2.email.value == "")
   {
    alert("Please enter an email address!");
    document.step2.email.focus();
    return false;
   }
  else if (! document.step2.email.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.step2.email.focus();
    return false;
   }
  /*else if(document.step2.email.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.step2.email.focus();
    return false;
   }*/
  // all is well
  else
   {
    return true;
   }
}
function CheckStepTour4()
{

  var x=0;
 //check if pictures have description and that the char do not exeed 60 char
  if(document.step4.userfile.value != '' && step4.elements['photodescription[]'][0].length > 50)
   {
     x=1;
   }
  if(x==1)
   {
     alert('Please provide a description that is shorter than 50 char!');
     return false;
   }
}
function CheckTourSpecial()
{
  if(document.special.tourid.value == '')
   {
    alert('Please choose a Tour!');
    document.special.tourid.focus();
    return false;
   }
  else if(document.special.description.value == '')
   {
    alert('Please enter a description!');
    document.special.description.focus();
    return false;
   }
  else if(document.special.validfor.value == '')
   {
    alert('Please enter a valid for option!');
    document.special.validfor.focus();
    return false;
   }                                                                                                                           else if(document.special.fromday.value == '' || document.special.frommonth.value == '' || document.special.fromyear.value == '')
   {
    alert('Please enter a valid from date!');
    document.special.fromday.focus();
    return false;
   }
  else if(document.special.today.value == '' || document.special.tomonth.value == '' || document.special.toyear.value == '')
   {
    alert('Please enter a valid to date!');
    document.special.today.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }
}
//-------------------------------------------------------------------------------------------------------------------------------
//new owners signup section
//-------------------------------------------------------------------------------------------------------------------------------
function PropertySubmission_1() {
    var myOption = false;
    for (var i= 0; document.addproperty.submissiontype.length > i ; i++) {
        if (document.addproperty.submissiontype[i].checked == true) {
            myOption = true;
        }
    }

    if(myOption == false) {//check for submission types
        alert('Please choose the type of accomodation!');
        return false;
    }
    else if(document.addproperty.location.value == "") {//city/state/country
        alert('Please add the location of the property, by typing your city and country');
        //document.addproperty.location.focus();
        return false;
    }
    else if (! document.addproperty.location.value.match("^.+,.+\..+$")) {//look for the , in the location
        alert('Please add the location of the property, by typing your city and country seperated by a comma');
        //document.addproperty.location.focus();
        return false;
   }
   else if(document.addproperty.pstrname.value == "") {//property address
        alert('Please add the property address, excluding the city');
        //document.addproperty.pstrname.focus();
        return false;
    }
    else if(document.addproperty.ppcode.value == "") {//property postcode
        alert('Please add the property Zipcode or Postcode');
        //document.addproperty.ppcode.focus();
        return false;
    }
    else if(document.addproperty.propertyname.value == "") {//property name
        alert('Please enter the name of your property!');
        //document.addproperty.propertyname.select();
        return false;
    }
     else if(document.getElementById('duplicate').value == "true") {//property name duplicate        
         alert('A duplicate property exists in our database. It has the same name and is in the same location!');
        //document.addproperty.propertyname.select();
        return false;
    }
    else if(document.addproperty.descriptionheader.value == "") {//introductory header
        alert('Please enter an introductory header, a brief description of your property!');
        //document.addproperty.descriptionheader.focus();
        return false;
    }
    else {//all is good
        return true;
    }
}
function PropertySubmission_1a() {
    if(document.getElementById('location').value == "" || document.getElementById('location').value == ",,") {//city/state/country
        alert('Please add the location of the property, by typing your city and country');
        return false;
    }
    else if (! document.getElementById('location').value.match("^.+,.+\..+$")) {//look for the , in the location
        alert('Please add the location of the property, by typing your city and country seperated by a comma');
        return false;
   }
   else if(document.getElementById('pstrname').value == "") {//property address
        alert('Please add the property address, excluding the city');
        return false;
    }
    else if(document.getElementById('ppcode').value == "") {//property postcode
        alert('Please add the property Zipcode or Postcode');
        return false;
    }
    else if(document.getElementById('propertyname').value == "") {//property name
        alert('Please enter the name of your property!');
        return false;
    }
     else if(document.getElementById('duplicate').value == "true") {//property name duplicate        
         alert('A duplicate property exists in our database. It has the same name and is in the same location!');
        return false;
    }
    else {//all is good
        return true;
    }
}
function PropertySubmission_1c() {
    if(document.getElementById('Description').value == "") {//introductory header
        alert('Please enter an introductory header, a brief description of your property!');
        //document.addproperty.descriptionheader.focus();
        return false;
    }
    else {//all is good
        return true;
    }
}
//-------------------------------------------------------------------------------------------------------------------------------
//old owners signup section javascript
//-------------------------------------------------------------------------------------------------------------------------------
function CheckStep0()
{
  // validate accom type
  if (document.step1.submissiontype.value == "")
   {
    alert('Please choose the type of accomodation!');
    document.step1.submissiontype.focus();
    return false;
   }
  else
   {
    return true;
   }
}
function CheckStep1()
{
  var x="";
  //validate property name
  if (document.step1.propertyname.value == "")
   {
    alert('Please enter the name of your establishment!');
    document.step1.propertyname.focus();
    return false;
   }
  //validate property Description header
  else if (document.step1.descriptionheader.value == "")
   {
    alert('Please enter an Introductory header!');
    document.step1.descriptionheader.focus();
    return false;
   }
  //validate bedrooms
  else if (document.step1.numbedrooms.value == "")
   {
    alert('Please enter number of bedrooms!');
    document.step1.numbedrooms.focus();
    return false;
   }
  //validate bathrooms
  else if (document.step1.numbathrooms.value == "")
   {
    alert('Please enter number of bathrooms!');
    document.step1.numbathrooms.focus();
    return false;
   }
  //validate how many it sleeps
  else if (document.step1.sleeps.value == "")
   {
    alert('Please enter number of people it sleeps! (This needs to be numerics only i.e 4)');
    document.step1.sleeps.focus();
    return false;
   }
  //validate how many it sleeps is numeric
  else if (!IsNumeric(document.step1.sleeps.value))
   {
    alert('Please enter numbers only for how many it sleeps i.e 4');
    document.step1.sleeps.focus();
    return false;
   }
  //validate local currency
  else if (document.step1.localcurrency.value == "")
   {
    alert('Please enter the local currency!');
    document.step1.localcurrency.focus();
    return false;
   }
  //validate lowest daily price
  else if (document.step1.ldp.value == "")
   {
    alert('Please enter the lowest daily price!');
    document.step1.ldp.focus();
    return false;
   }
  //validate highest daily price
  else if (document.step1.hdp.value == "")
   {
    alert('Please enter the highest daily price!');
    document.step1.hdp.focus();
    return false;
   }
  //validate lowest weekly price
  else if (document.step1.lwp.value == "")
   {
    alert('Please enter the lowest weekly price!');
    document.step1.lwp.focus();
    return false;
   }
  //validate highest weekly price
  else if (document.step1.hwp.value == "")
   {
    alert('Please enter the highest weekly price!');
    document.step1.hwp.focus();
    return false;
   }

  //validate currency if the folowing are selected
  else if ((document.step1.ldp.value != "" || document.step1.hdp.value != "" || document.step1.lwp.value != "" || document.step1.hwp.value != "" || document.step1.cleaningfee.value != "") && document.step1.localcurrency.value == "")
   {
    alert('Please enter the local currency!');
    document.step1.localcurrency.focus();
    return false;
   }
  else if(document.step1.ldp.value != "" && !IsNumeric(document.step1.ldp.value))
   {
    alert('Please enter numbers only for lowest daily price!');
    document.step1.ldp.focus();
    return false;
   }
  else if(document.step1.hdp.value != "" && !IsNumeric(document.step1.hdp.value))
   {
    alert('Please enter numbers only for highest daily price!');
    document.step1.hdp.focus();
    return false;
   }
  else if(document.step1.lwp.value != "" && !IsNumeric(document.step1.lwp.value))
   {
    alert('Please enter numbers only for lowest weekly price!');
    document.step1.lwp.focus();
    return false;
   }
  else if(document.step1.hwp.value != "" && !IsNumeric(document.step1.hwp.value))
   {
    alert('Please enter numbers only for highest weekly price!');
    document.step1.hwp.focus();
    return false;
   }
  else if(document.step1.cleaningfee.value != "" && !IsNumeric(document.step1.cleaningfee.value))
   {
    alert('Please enter numbers only for cleaning fee!');
    document.step1.cleaningfee.focus();
    return false;
   }

  //validate main description
  else if (document.step1.descriptionmain.value == "")
   {
    alert('Please enter the main description of your property!');
    document.step1.descriptionmain.focus();
    return false;
   }
  /*validate accomodation demographic 1
  else if (x == "")
   {
    x=0;
    y=0;
    z=0;
    //r x=document.getElementsByName("accomdemographic[]")
    for(i=0;i<=5;i++)
     {
      if(step1.elements['accomdemographic[]'][i].checked)
       {
        x=1;
       }
     }
    for(i=6;i<=10;i++)
     {
      if(step1.elements['accomdemographic[]'][i].checked)
       {
        y=1;
       }
     }
    for(i=11;i<=16;i++)
     {
      if(step1.elements['accomdemographic[]'][i].checked)
       {
        z=1;
       }
     }

    if (x==0)
     {
       alert('Please choose at least one field from section 1 - property is suited for');
       document.step1.elements['accomdemographic[]'][0].focus();
       return false;
     }
    else if (y==0)
     {
       alert('Please choose at least one field from section 2 - property is suited for');
       document.step1.elements['accomdemographic[]'][6].focus();
       return false;
     }
    else if (z==0)
     {
       alert('Please choose at least one field from section 3 - property is suited for');
       document.step1.elements['accomdemographic[]'][11].focus();
       return false;
     }
   }*/
  // all is well
  else
   {
    return true;
   }
}
function CheckStep1_1()
{
  var x="";
  //validate property name
  if (document.step1.propertyname.value == "")
   {
    alert('Please enter the name of your establishment!');
    document.step1.propertyname.focus();
    return false;
   }
  //validate property Description header
  else if (document.step1.descriptionheader.value == "")
   {
    alert('Please enter an Introductory header!');
    document.step1.descriptionheader.focus();
    return false;
   }
  //validate bedrooms
  else if (document.step1.numbedrooms.value == "")
   {
    alert('Please enter number of bedrooms!');
    document.step1.numbedrooms.focus();
    return false;
   }
  //validate local currency
  else if (document.step1.localcurrency.value == "")
   {
    alert('Please enter the local currency!');
    document.step1.localcurrency.focus();
    return false;
   }
  //validate lowest daily price
  else if (document.step1.ldp.value == "")
   {
    alert('Please enter the lowest daily price!');
    document.step1.ldp.focus();
    return false;
   }
  //validate highest daily price
  else if (document.step1.hdp.value == "")
   {
    alert('Please enter the highest daily price!');
    document.step1.hdp.focus();
    return false;
   }
  //validate lowest weekly price
  else if (document.step1.lwp.value == "")
   {
    alert('Please enter the lowest weekly price!');
    document.step1.lwp.focus();
    return false;
   }
  //validate highest weekly price
  else if (document.step1.hwp.value == "")
   {
    alert('Please enter the highest weekly price!');
    document.step1.hwp.focus();
    return false;
   }
  //validate currency if the folowing are selected
  else if ((document.step1.ldp.value != "" || document.step1.hdp.value != "" || document.step1.lwp.value != "" || document.step1.hwp.value != "" || document.step1.cleaningfee.value != "") && document.step1.localcurrency.value == "")
   {
    alert('Please enter the local currency!');
    document.step1.localcurrency.focus();
    return false;
   }
  else if(document.step1.ldp.value != "" && !IsNumeric(document.step1.ldp.value))
   {
    alert('Please enter numbers only for lowest daily price!');
    document.step1.ldp.focus();
    return false;
   }
  else if(document.step1.hdp.value != "" && !IsNumeric(document.step1.hdp.value))
   {
    alert('Please enter numbers only for highest daily price!');
    document.step1.hdp.focus();
    return false;
   }
  else if(document.step1.lwp.value != "" && !IsNumeric(document.step1.lwp.value))
   {
    alert('Please enter numbers only for lowest weekly price!');
    document.step1.lwp.focus();
    return false;
   }
  else if(document.step1.hwp.value != "" && !IsNumeric(document.step1.hwp.value))
   {
    alert('Please enter numbers only for highest weekly price!');
    document.step1.hwp.focus();
    return false;
   }
  else if(document.step1.cleaningfee.value != "" && !IsNumeric(document.step1.cleaningfee.value))
   {
    alert('Please enter numbers only for cleaning fee!');
    document.step1.cleaningfee.focus();
    return false;
   }
  //validate main description
  else if (document.step1.descriptionmain.value == "")
   {
    alert('Please enter the main description of your property!');
    document.step1.descriptionmain.focus();
    return false;
   }
  else
   {
    return true;
   }
}

function CheckStep2()
{
  var x="";
  // validate country type
  if (document.step2.countrycode.value == "" || document.step2.countrycode.value == "xx")
   {
    alert('Please choose a country!');
    document.step2.thecountryform.focus();
    return false;
   }
  //validate state if country with states is selected
  else if ((document.step2.countrycode.value == "gb" || document.step2.countrycode.value == "au" || document.step2.countrycode.value == "us" || document.step2.countrycode.value == "ca") && (document.step2.statecode.value == "") )
   {
    alert('Please choose a state!');
    document.step2.thestateform.focus();
    return false;
   }
  // validate city type
  else if (document.step2.cityname.value == "" && document.step2.citynamenew.value == "")
   {
    alert('Please choose a city!');
    document.step2.cityname.focus();
    return false;
   }
  // validate address 
  else if (document.step2.pstrnum.value == "" || !IsNumeric(document.step2.pstrnum.value))
   {
    alert('Please enter a number in the Street # field. - NUMERICS ONLY (If no number please add a 0)');
    document.step2.pstrnum.focus();
    return false;
   }
  else if (document.step2.pstrname.value == "")
   {
    alert('Please add the property address');
    document.step2.pstrname.focus();
    return false;
   }
  else if (document.step2.ppcode.value == "")
   {
    alert('Please add the property postcode');
    document.step2.ppcode.focus();
    return false;
   }
  // validate description
  else if (document.step2.descriptionlocal.value == "")
   {
    alert('Please enter a location description for the property!');
    document.step2.descriptionlocal.focus();
    return false;
   }
  /*validate accomodation location 
  else if (x == "")
   {
    x=0;
    y=0;
    z=0;
    //r x=document.getElementsByName("accomdemographic[]")
    for(i=0;i<=2;i++)
     {
      if(step2.elements['accomlocation[]'][i].checked)
       {
        x=1;
       }
     }
    for(i=3;i<=14;i++)
     {
      if(step2.elements['accomlocation[]'][i].checked)
       {
        y=1;
       }
     }
    for(i=15;i<=23;i++)
     {
      if(step2.elements['accomlocation[]'][i].checked || step2.elements['accomlocation[]'][24].value != "")
       {
        z=1;
       }
     }

    if (x==0)
     {
       alert('Please choose at least one field from section 1 - property location');
       document.step2.elements['accomlocation[]'][0].focus();
       return false;
     }
    else if (y==0)
     {
       alert('Please choose at least one field from section 2 - property location');
       document.step2.elements['accomlocation[]'][3].focus();
       return false;
     }
    else if (z==0)
     {
       alert('Please choose at least one field from section 3 or add a new option - property location');
       document.step2.elements['accomlocation[]'][15].focus();
       return false;
     }
   }*/
  // all is well
  else
   {
    return true;
   }
}

function CheckStep3()
{
  /*
  var x="";

   validate description
  if (document.step3.descriptionfacility.value == "")
   {
    alert('Please enter a facility description for the property!');
    document.step3.descriptionfacility.focus();
    return false;
   }
  
  //validate meal prices
  if(step3.elements['mealoption[]'][0].checked && document.step3.pricebreakfast.value == "")
   {
    alert('You selected breakfast - please enter a price and the currency');
    document.step3.pricebreakfast.focus();
    return false;
   }
  else if(step3.elements['mealoption[]'][1].checked && document.step3.pricelunch.value == "")
   {
    alert('You selected lunch - please enter a price and the currency');
    document.step3.pricelunch.focus();
    return false;
   }
  else if(step3.elements['mealoption[]'][2].checked && document.step3.pricedinner.value == "")
   {
    alert('You selected dinner - please enter a price and the currency');
    document.step3.pricedinner.focus();
    return false;
   }
  else if((step3.elements['mealoption[]'][2].checked || step3.elements['mealoption[]'][1].checked || step3.elements['mealoption[]'][0].checked) && (document.step3.mealcurrency.value == ""))
   {
    alert('Please select a currency');
    document.step3.mealcurrency.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }
  */
  return true;
}
function CheckStep4()
{
  /*check for at least one picture
  if(step4.elements['userfile[]'][0].value == '')
   {
    alert('Please provide at least on picture for your property!');
    document.step4.elements['userfile[]'][0].focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }
  */
  var x=0;
 //loop to check if pictures have description
    for(i=0;i<6;i++)
     {
      if(step4.elements['userfile[]'][i].value != '' && step4.elements['photodescription[]'][i].length > 50)
       {
        x=1;
       }
     }
    if(x==1)
     {
      alert('Please provide a description that is shorter than 50 char!');
      return false;
     }
}
function CheckStep4New()
{
 
  var x=0;
 //check if pictures have description and that the char do not exeed 60 char
  if(document.step4.userfile.value != '' && step4.elements['photodescription[]'][0].length > 50)
   {
     x=1;
   }
  if(x==1)
   {
     alert('Please provide a description that is shorter than 50 char!');
     return false;
   }
}
function CheckStep5()
{
  if(document.step5.contactname.value == '')
   {
    alert('Please enter a contact name!');
    document.step5.contactname.focus();
    return false;
   }
  /*else if(document.step5.phone.value == '')
   {
    alert('Please enter a contact phone number!');
    document.step5.phone.focus();
    return false;
   }*/
// validate email
  else if (document.step5.email.value == "")
   {
    alert("Please enter an email address!");
    document.step5.email.focus();
    return false;
   }
  else if (! document.step5.email.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.step5.email.focus();
    return false;
   }
  /*else if(document.step5.email.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.step5.email.focus();
    return false;
   }*/
 
  // all is well
  else
   {
    return true;
   }
}
//-------------------------------------------------------------------------------------------------------------------------------
//end of old owners signup section
//-------------------------------------------------------------------------------------------------------------------------------
function CheckSpecial()
{
  if(document.special.propertyid.value == '')
   {
    alert('Please choose a Property!');
    document.special.propertyid.focus();
    return false;
   }
  else if(document.special.description.value == '')
   {
    alert('Please enter a description!');
    document.special.description.focus();
    return false;
   }
  else if(document.special.validfor.value == '')
   {
    alert('Please enter a valid for option!');
    document.special.validfor.focus();
    return false;
   }
  else if(document.special.fromday.value == '' || document.special.frommonth.value == '' || document.special.fromyear.value == '')
   {
    alert('Please enter a valid from date!');
    document.special.fromday.focus();
    return false;
   }
  else if(document.special.today.value == '' || document.special.tomonth.value == '' || document.special.toyear.value == '')
   {
    alert('Please enter a valid to date!');
    document.special.today.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }
}
//-------------------------------------------------------------------------------------------------------------------------------
// refer these friends
//-------------------------------------------------------------------------------------------------------------------------------
function referthesefriends()
{
  
  if(document.referafriend.numfriends.value == '0')
   {
    alert('Please choose at least one person to send to!');
    document.referafriend.numfriends.focus();
    return false;
   }
  else if(document.referafriend.sendername.value == '')
   {
    alert('Please enter your name!');
    document.referafriend.sendername.focus();
    return false;
   }
  else if(document.referafriend.senderemail.value == '')
   {
    alert('Please enter your email address!');
    document.referafriend.senderemail.focus();
    return false;
   }
  else if (! document.referafriend.senderemail.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.referafriend.senderemail.focus();
    return false;
   }
  /*else if(document.referafriend.senderemail.value.match("@aol"))//this is for the aol email addresses we can't send to
   {
  	alert("Unfortunately, we are unable to accept AOL email addresses at the moment. Please use an alternate email address, if you have one. We apologize for the inconvenience.");
    document.referafriend.senderemail.focus();
    return false;
   }*/
  else
   {
    return true;
   }
  /*for(i=1;i<7;i++)
     {
      if(document.referafriend.email"+i+".value != '')
       {
        if (! document.referafriend.email"+i+".value.match("^.+@.+\..+$"))
         {
          alert("Please enter a valid email address!");
          document.referafriend.email"+i+".focus();
          return false;
         }
       }
     }*/
}
//-------------------------------------------------------------------------------------------------------------------------------
// accomoadation request check
//-------------------------------------------------------------------------------------------------------------------------------
function AccomRequest()
{
  if(document.accomrequest.uname.value == '')
   {
    alert('Please enter your name!');
    document.accomrequest.uname.focus();
    return false;
   }
  /*else if(document.accomrequest.uaddress.value == '')
   {
    alert('Please enter your address!');
    document.accomrequest.uaddress.focus();
    return false;
   }
  else if(document.accomrequest.upostcode.value == '')
   {
    alert('Please enter your postcode!');
    document.accomrequest.upostcode.focus();
    return false;
   }*/
  else if(document.accomrequest.ucountry.value == '')
   {
    alert('Please enter your country!');
    document.accomrequest.ucountry.focus();
    return false;
   }
  else if(document.accomrequest.ucityname.value == '')
   {
    alert('Please enter your city name!');
    document.accomrequest.ucityname.focus();
    return false;
   }
  // validate email
  else if (document.accomrequest.uemail.value == "")
   {
    alert("Please enter an email address!");
    document.accomrequest.uemail.focus();
    return false;
   }
  else if (! document.accomrequest.uemail.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.accomrequest.uemail.focus();
    return false;
   }
  else if (document.accomrequest.uemail.value != document.accomrequest.uemail2.value)
   {
    alert("Your email adresses do not match!");
    document.accomrequest.uemail2.focus();
    return false;
   }
  else if(document.accomrequest.uphone.value == '')
   {
    alert('Please enter your telephone number!');
    document.accomrequest.uphone.focus();
    return false;
   }
  else if(document.accomrequest.request.value == '')
   {
    alert('Please submit what this request is for!');
    document.accomrequest.request.focus();
    return false;
   }
  else if(!document.accomrequest.contactphone.checked && !document.accomrequest.contactemail.checked)
   {
    alert('Please select how you would like to be contacted!');
    document.accomrequest.contactphone.focus();
    return false;
   }
  //validate terms
  else if (!document.accomrequest.terms.checked)
   {
    alert("Please agree to our terms and conditions before submitting your review");
    document.accomrequest.terms.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }
}
//-------------------------------------------------------------------------------------------------------------------------------
// owners delete property check
//-------------------------------------------------------------------------------------------------------------------------------
function DeleteCheck()
 {
  var name=confirm("Are you sure you want to DELETE");
  if (name==true)
   {
    return true;
   }
  else
   {
    return false;
   }
 }
//-------------------------------------------------------------------------------------------------------------------------------
// owners property delete check
//-------------------------------------------------------------------------------------------------------------------------------
function DeleteProperty()
 {
   if (document.deleteproperty.propertyname.value == '' || document.deleteproperty.propertyname.value == 0)
     {
        alert("Please choose a Property to delete");
        document.deleteproperty.propertyname.focus();
        return false;
      }
  // validate reason
  else if (document.deleteproperty.reason.value == "")
     {
        alert("Please enter the reason why you would like this property deleted");
        document.deleteproperty.propertyname.focus();
        return false;
     }
  // all is well
  else
     { 
        var name=confirm("Are you sure you want to DELETE");
        if (name==true)
         {
            return true;
         }
        else
        {
            return false;
         }
     }
 }

//-------------------------------------------------------------------------------------------------------------------------------
// owners login check
//-------------------------------------------------------------------------------------------------------------------------------
function OwnerLogin()
 {
   if (document.ownerlogin.ownertype.value == '' || document.ownerlogin.ownertype.value == 0)
     {
        alert("Please choose a Owner Type");
        document.ownerlogin.ownertype.focus();
        return false;
      }
  // validate email username
  else if (document.ownerlogin.login.value == "")
     {
        alert("Please enter the email address you registered with!");
        document.ownerlogin.login.focus();
        return false;
     }
  else if (! document.ownerlogin.login.value.match("^.+@.+\..+$"))
     {
        alert("Please enter a valid email address!");
        document.ownerlogin.login.focus();
        return false;
     }
   // validate password
   else if (document.ownerlogin.password.value == "")
     {
        alert("Please enter your Password!");
        document.ownerlogin.password.focus();
        return false;
     }
  // all is well
  else
     { 
        return true;
     }
 }
//-------------------------------------------------------------------------------------------------------------------------------
// owners new signup check
//-------------------------------------------------------------------------------------------------------------------------------
function OwnerSignup()
 {
   if (document.ownersignup.name.value == '')
     {
        alert("Please enter your name");
        document.ownersignup.name.focus();
        return false;
      }  
   else if (document.ownersignup.phone.value == '' || !IsNumeric(document.ownersignup.phone.value))
     {
        alert("Please enter your Telephone Number (Numerics Only ie 004477123456)");
        document.ownersignup.phone.focus();
        return false;
      }
  // validate email
  else if (document.ownersignup.email.value == "")
     {
        alert("Please enter an email address!");
        document.ownersignup.email.focus();
        return false;
     }
  else if (! document.ownersignup.email.value.match("^.+@.+\..+$"))
     {
        alert("Please enter a valid email address!");
        document.ownersignup.email.focus();
        return false;
     }
   // validate password
   else if (document.ownersignup.password.value == "")
     {
        alert("Please enter a Password!");
        document.ownersignup.password.focus();
        return false;
     }
   else if (!document.ownersignup.terms.checked)
     {
        alert("Please agree to our terms and conditions before submitting your details");
        document.ownersignup.terms.focus();
        return false;
     }
  // all is well
  else
     { 
        return true;
     }
 }
//-------------------------------------------------------------------------------------------------------------------------------
// lost password
//------------------------------------------------------------------------------------------------------------------------------- 
function LostPassword()
 {
     if (document.lostpassword.ownertype.value == '' || document.lostpassword.ownertype.value == 0)
       {
          alert("Please choose a Owner Type");
          document.lostpassword.ownertype.focus();
          return false;
        }
     else if(document.lostpassword.email.value == '')
        {
           alert("Please enter the email you registered with!!");
           document.lostpassword.email.focus
            return false;
        }
     else if (! document.lostpassword.email.value.match("^.+@.+\..+$"))
       {
          alert("Please enter a valid email address!");
          document.lostpassword.email.focus();
          return false;
       }
     else
        {
            return true;
        }
 }
//-------------------------------------------------------------------------------------------------------------------------------
// competition review  check
//-------------------------------------------------------------------------------------------------------------------------------
function AddCompReview()
{
  if(document.addcompreview.name.value == '')
   {
    alert('Please enter your name!');
    document.addcompreview.name.focus();
    return false;
   }
  // validate email
  else if (document.addcompreview.email.value == "")
   {
    alert("Please enter an email address!");
    document.addcompreview.email.focus();
    return false;
   }
  else if (! document.addcompreview.email.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.addcompreview.email.focus();
    return false;
   }
  else if(document.addcompreview.hotelname.value == '')
   {
    alert('Please enter the hotel name!');
    document.addcompreview.hotelname.focus();
    return false;
   }
  else if(document.addcompreview.review.value == '')
   {
    alert('Please enter a review!');
    document.addcompreview.review.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }
}

//-------------------------------------------------------------------------------------------------------------------------------
// User photos  check
//-------------------------------------------------------------------------------------------------------------------------------
function ValidatePhotos()
 {
  if(document.photos.status.value == '')
   {
    alert('Please choose your status!');
    document.photos.status.focus();
    return false;
   }
  else if(!document.photos.confirm.checked)
   {
    alert('Please agree to the terms before submitting your photographs!');
    document.photos.confirm.focus();
    return false;
   }
  else if(document.photos.elements['userfile[]'][0].value == '')
   {
    alert('Please submit at least one photograph!');
    document.photos.elements['userfile[]'][0].focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }

 }
 //-------------------------------------------------------------------------------------------------------------------------------
// Management Response
//-------------------------------------------------------------------------------------------------------------------------------
function ValidateManResponse()
 {
  if(document.manresponse.review.value == '' || document.manresponse.review.value == 0)
   {
    alert('Please choose a Review to respond to!');
    document.manresponse.review.focus();
    return false;
   }
   else if(document.manresponse.hotelname.value == '')
   {
    alert('Please enter the Establishment you represent!');
    document.manresponse.hotelname.focus();
    return false;
   }
  else if(document.manresponse.status.value == '')
   {
    alert('Please enter your relashionship to the establsihment!');
    document.manresponse.status.focus();
    return false;
   }
  else if(document.manresponse.uname.value == '')
   {
    alert('Please enter your Name!');
    document.manresponse.uname.focus();
    return false;
   }
   // validate email
  else if (document.manresponse.uemail.value == "")
   {
    alert("Please enter an email address!");
    document.manresponse.uemail.focus();
    return false;
   }
  else if (! document.manresponse.uemail.value.match("^.+@.+\..+$"))
   {
    alert("Please enter a valid email address!");
    document.manresponse.uemail.focus();
    return false;
   }
  else if(document.manresponse.uphone.value == '')
   {
    alert('Please enter a valid Telephone Number!');
    document.manresponse.uphone.focus();
    return false;
   }
  else if(document.manresponse.response.value == '')
   {
    alert('Please enter a valid Response!');
    document.manresponse.response.focus();
    return false;
   }
  else if(!document.manresponse.terms.checked)
   {
    alert('Please agree to the terms before submitting your management response!');
    document.manresponse.terms.focus();
    return false;
   }
  // all is well
  else
   {
    return true;
   }

 }

