



function check_review(frm){


    var firstname = frm.tx_name.value
    var surname = frm.tx_lastname.value
    var town = frm.tx_town.value
    var email = frm.tx_email.value
    var comments = frm.tx_comments.value


    if (firstname == ""){
        alert("Please enter your firstname")
        frm.tx_name.focus()
        return false
    }

    if (surname == ""){
        alert("Please enter your surname")
        frm.tx_lastname.focus()
        return false
    }

    if (town == ""){
        alert("Please enter your town")
        frm.tx_town.focus()
        return false
    }

    if (!checkEmail(email)){
        alert("Please enter a valid email address")
        frm.tx_email.focus()
        return false
    }

    if (comments == ""){
        alert("Please enter your comments about the hotel")
        frm.tx_comments.focus()
        return false
    }


    if (!frm.r_rating[0].checked && !frm.r_rating[1].checked && !frm.r_rating[2].checked && !frm.r_rating[3].checked && !frm.r_rating[4].checked){
        alert("Please enter how you would rate this hotel by clicking on one of the radio buttons underneath the comment box")
        return false 
    }

return true



}


function checkEmail(x){

	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)){
		return true
	}
	return false
}



function addBookmark(){
  bookmarkurl = location.href
  bookmarktitle = "Pureshores.com - " + document.title
  if (document.all) {
    window.external.AddFavorite(bookmarkurl,bookmarktitle);
  }
}
