<!--
// JavaScript Document


function disableButton(theButton) {
theButton.value="Processing Form";
theButton.disabled = true;
return Validate(document.formx)
} 

function Validate(form) {
checkEmail = form.email.value

 for(i=0; i<document.forms[0].elements.length; i++){
   document.forms[0].elements[i].style.backgroundColor = "#fff";
 }

if (document.formx.dateArrive.value=='') {
document.getElementById("noticeBox").style.display = "none";
alert("Arrival date must be filled in!  Click the Select Dates button at the top of the form.");
document.getElementById("checkin_day").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}
if (document.formx.dateDepart.value=='') {
document.getElementById("noticeBox").style.display = "none";
alert("Departure date must be filled in!  Click the Select Dates button at the top of the form.");
document.getElementById("checkout_day").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}
if (document.formx.adults.value < 1 ) { 
document.getElementById("noticeBox").style.display = "none";
alert("Number of adults must be filled in!");
document.getElementById("adults").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (document.formx.firstname.value =='') {
document.getElementById("noticeBox").style.display = "none";
alert("First Name must be entered!");
form.firstname.select();
document.getElementById("firstname").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (document.formx.lastname.value =='') {
document.getElementById("noticeBox").style.display = "none";
alert("Last Name or Surname must be entered!");
form.lastname.select();
document.getElementById("lastname").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (document.formx.address1.value=='') {
document.getElementById("noticeBox").style.display = "none";
alert("Street Address must be entered!");
form.address1.select();
document.getElementById("address1").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}
if (document.formx.city.value=='') {
document.getElementById("noticeBox").style.display = "none";
alert("City must be entered!");
form.city.select();
document.getElementById("city").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}
if (document.formx.zip.value=='') {
document.getElementById("noticeBox").style.display = "none";
alert("Zip/Post Code must be entered!");
form.zip.select();
document.getElementById("zip").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}
if (document.formx.country.value=='') {
document.getElementById("noticeBox").style.display = "none";
alert("Country must be selected!");
document.getElementById("country").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}
if (document.formx.mobilephone.value.length < 7) {
document.getElementById("noticeBox").style.display = "none";
alert("Mobile Phone number must be entered!");
form.mobilephone.select();
document.getElementById("mobilephone").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}
if ((checkEmail.indexOf('@') < 0) || ((checkEmail.charAt(checkEmail.length-4) != '.') && (checkEmail.charAt(checkEmail.length-3) != '.'))) {
document.getElementById("noticeBox").style.display = "none";
alert("Email Address field is empty or not valid!");
form.email.select();
document.getElementById("email").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}
if (document.formx.arriveby.value=='') {
document.getElementById("noticeBox").style.display = "none";
alert("Arrive By must be selected!");
document.getElementById("arriveby").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

myOption1 = -1;
for (i=form.transfers.length-1; i > -1; i--) {
if (form.transfers[i].checked) {
myOption1 = i; i = -1;

(radioVal1 = form.transfers[myOption1].value);
}
}

myOption = -1;
for (i=form.transferFrom.length-1; i > -1; i--) {
if (form.transferFrom[i].checked) {
myOption = i; i = -1;

(radioVal = form.transferFrom[myOption].value);
}
}

if (radioVal1 == 'No' & document.formx.apttimehour.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Apartment arrival time hour must be selected!");
document.getElementById("apttimehour").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (radioVal1 == 'No' & document.formx.apttimemin.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Apartment arrival time minute must be selected!");
document.getElementById("apttimemin").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (radioVal1 == 'No' & document.formx.apttimeampm.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Apartment arrival time Am/Pm must be selected!");
document.getElementById("apttimeampm").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (radioVal == 'Airport' & radioVal1 == 'Yes' & document.formx.airline.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Arriving airline name must be entered!");
form.airline.select();
document.getElementById("airline").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (radioVal == 'Airport' & radioVal1 == 'Yes' & document.formx.flightnum.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Airline flight number must be entered!");
form.flightnum.select();
document.getElementById("flightnum").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}
if (radioVal == 'Airport' & radioVal1 == 'Yes' & document.formx.flightfrom.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("City flight arrives to Prague from must be entered!");
form.flightfrom.select();
document.getElementById("flightfrom").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}
if (radioVal == 'Airport' & radioVal1 == 'Yes' & document.formx.arrivaltimehour.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Flight arrival time hour must be selected!");
document.getElementById("arrivaltimehour").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (radioVal == 'Airport' & radioVal1 == 'Yes' & document.formx.arrivaltimemin.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Flight arrival time minute must be selected!");
document.getElementById("arrivaltimemin").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (radioVal == 'Airport' & radioVal1 == 'Yes' & document.formx.arrivaltimeampm.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Flight arrival time ampm must be selected!");
document.getElementById("arrivaltimeampm").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (radioVal == 'Train Station' & radioVal1 == 'Yes' & document.formx.trainfrom.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("City where you will board the train must be entered!");
form.trainfrom.select();
document.getElementById("trainfrom").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (radioVal == 'Train Station' & radioVal1 == 'Yes' & document.formx.trainsta.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Arriving train station must be selected!");
document.getElementById("trainsta").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (radioVal == 'Train Station' & radioVal1 == 'Yes' & document.formx.arrivaltimehour.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Train arrival time hour must be selected!");
document.getElementById("arrivaltimehour").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (radioVal == 'Train Station' & radioVal1 == 'Yes' & document.formx.arrivaltimemin.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Train arrival time minute must be selected!");
document.getElementById("arrivaltimemin").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (radioVal == 'Train Station' & radioVal1 == 'Yes' & document.formx.arrivaltimeampm.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Train arrival time ampm must be selected!");
document.getElementById("arrivaltimeampm").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (radioVal == 'Other' & radioVal1 == 'Yes' & document.formx.otherCountry.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Other country must be selected!");
document.getElementById("otherCountry").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (radioVal == 'Other' & radioVal1 == 'Yes' & document.formx.otherCity.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Other Country - City must be entered!");
form.otherCity.select();
document.getElementById("otherCity").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}
if (radioVal == 'Other' & radioVal1 == 'Yes' & document.formx.otherAddr.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Other Country - Address must be entered!");
form.otherAddr.select();
document.getElementById("otherAddr").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}
if (radioVal == 'Other' & radioVal1 == 'Yes' & document.formx.arrivaltimehour.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Meeting time hour must be selected!");
document.getElementById("arrivaltimehour").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (radioVal == 'Other' & radioVal1 == 'Yes' & document.formx.arrivaltimemin.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Meeting time minute must be selected!");
document.getElementById("arrivaltimemin").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (radioVal == 'Other' & radioVal1 == 'Yes' & document.formx.arrivaltimeampm.value == ''){
document.getElementById("noticeBox").style.display = "none";
alert("Meeting time ampm must be selected!");
document.getElementById("arrivaltimeampm").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}

if (document.formx.deptype.value=='') {
document.getElementById("noticeBox").style.display = "none";
alert("Deposit payment method must be selected!");
document.getElementById("deptype").style.backgroundColor = "#feffa9";
form.submit.disabled = false;
form.submit.value = "Submit Reservation";
return false;
}
else
{
return true;
}
}

function data_copy()
{
if(document.formx.state.value != " "){
document.formx.country.value = "United States";
document.formx.mobilephone.value = "";
}
else {
document.formx.country.value = "";
}
}

function set_data()
{
if(document.formx.country.value != "United States"){
document.formx.state.value = "";
document.formx.mobilephone.value = "";
}
}

function set_ccode()
{
if(document.formx.country.value == "United States" && document.formx.mobilephone.value == ''){
document.formx.mobilephone.value = "+1-";
}
else{
if(document.formx.country.value == "United Kingdom" && document.formx.mobilephone.value == ''){
document.formx.state.value = "";
document.formx.mobilephone.value = "+44-";
}
else{
if(document.formx.country.value == "Canada" && document.formx.mobilephone.value == ''){
document.formx.state.value = "";
document.formx.mobilephone.value = "+1-";
}
else{
if(document.formx.country.value == "France" && document.formx.mobilephone.value == ''){
document.formx.state.value = "";
document.formx.mobilephone.value = "+33-";
}
else{
if(document.formx.country.value == "Germany" && document.formx.mobilephone.value == ''){
document.formx.state.value = "";
document.formx.mobilephone.value = "+49-";
}
else{
if(document.formx.country.value == "Italy" && document.formx.mobilephone.value == ''){
document.formx.state.value = "";
document.formx.mobilephone.value = "+39-";
}
else{
if(document.formx.country.value == "Japan" && document.formx.mobilephone.value == ''){
document.formx.state.value = "";
document.formx.mobilephone.value = "+81-";
}
else{
if(document.formx.country.value == "Netherlands" && document.formx.mobilephone.value == ''){
document.formx.state.value = "";
document.formx.mobilephone.value = "+31-";
}
else{
if(document.formx.country.value == "Norway" && document.formx.mobilephone.value == ''){
document.formx.state.value = "";
document.formx.mobilephone.value = "+47-";
}
else{
if(document.formx.country.value == "Russian Federation" && document.formx.mobilephone.value == ''){
document.formx.state.value = "";
document.formx.mobilephone.value = "+7-";
}
else{
if(document.formx.country.value == "Spain" && document.formx.mobilephone.value == ''){
document.formx.state.value = "";
document.formx.mobilephone.value = "+34-";
}
else{
if(document.formx.country.value == "Sweden" && document.formx.mobilephone.value == ''){
document.formx.state.value = "";
document.formx.mobilephone.value = "+46-";
}
else{
if(document.formx.country.value == "Switzerland" && document.formx.mobilephone.value == ''){
document.formx.state.value = "";
document.formx.mobilephone.value = "+41-";
}
else{
if(document.formx.country.value == "Czech Republic" && document.formx.mobilephone.value == ''){
document.formx.state.value = "";
document.formx.mobilephone.value = "+420-";
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}

function setCursorPos( x ) {
    var txtRange = x.createTextRange();
    txtRange.moveStart( "character", x.value.length - 0 );
    txtRange.moveEnd( "character", 0 );
    txtRange.select();
}

function capitalize(f,m) {

if (m) /*cap words*/ {
	var temp, tempC, pre, post, strlen;
	temp = f.value.toLowerCase();
	stringLen = temp.length;
	  if (stringLen > 0) {
		for (i = 0; i < stringLen; i++) {
		  if (i == 0) {
			tempC = temp.substring(0,1).toUpperCase();
			post = temp.substring(1,stringLen);
			temp = tempC + post;
		  } else {
			tempC = temp.substring(i,i+1);
			if (tempC == " " && i < (stringLen-1)) {
			tempC = temp.substring(i+1,i+2).toUpperCase();
			pre = temp.substring(0,i+1);
			post = temp.substring(i+2,stringLen);
			temp = pre + tempC + post;
		  }
		}
	  }
	}
  } else /*cap all*/ {
    var temp = f.value.toUpperCase();
  }
  f.value = temp;
}

// -->
