window.onload=initAll;window.onunload=function(){};var xhr=false;var sharedServer="http://ww11.aitsafe.com/cf/add.cfm";var sharedId="D229456";var privateServer="http://ww8.aitsafe.com/cf/add.cfm";var privateId="A5112580";var hotelsArray=[];var destino=" ";var ChosenHotel=" ";var roundDiscount=0.6;var oneWayDiscount=0.4;var oneWayTotal=0;var roundTotal=0;var roundPrice=0;var onePrice=0;var finalRound=0;var finalOne=0;var resType=" ";var exceptionState=" ";var sharedCoupon=0;var privateCoupon=0;var offerMsg=" ";var exception=["CLUB MED","CLUB MED CANCUN","CLUB MED CANCUN YUCATAN","CLUB MED RESORT","CLUB MED YUCATAN","CLUB MED YUCATAN CANCUN","CLUB MEDITERRANEO","MARRIOT COURTYARD","MOON PALACE CANCUN","MOON PALACE CANCUN NIZUC","MOON PALACE GOLF AND RESORT","MOON PALACE GOLF AND SPA","MOON PALACE GOLF AND SPA RESORT","MOON PALACE GOLF CLUB","MOON PALACE GOLF RESORT","MOON PALACE NIZUC","MOON PALACE RESORT","MOON PALACE SUNRISE"];var privateIncludesList="<h3>Includes:</h3> <ul><li>Private vehicle with A/C</li><li>Travel insurance</li><li>Meet & greet at the airport</li> <li>Flight monitoring</li><li>Professional bilingual driver</li><li>24 hrs transportation service</li><li>24 hrs customer service in Mexico</li><li>No fees for flight changes and delays</li><li>100% refundable 24 hrs prior to service</li><li>Spacious vehicle for passengers and luggage</li><li>All applicable taxes and Airport fees</li></ul>";var sharedIncludesList="<h3>Includes:</h3> <ul><li>Available from <span class='sharedAvailable'>8:00a.m. to 8:00 p.m. ONLY</span></li><li>Share vehicle with up to 10 passengers</li><li>Shuttles depart every hour</li><li>Multiple stops &#45; Up to 4 stops</li><li>Meet & Greet at the airport</li><li>Professional Drivers</li><li>24 hrs. customer service in Mexico</li><li>No fees for flight changes</li><li>100% refundable 24hrs. prior to service</li><li>Travel insurance</li><li>All applicable taxes & airport fees</li></ul>";var destMsgPart1="<div id='lng-msg'><p>Your place of lodging is located in";var destMsgPart2="from the airport. You have two options, Shared Shuttle and Private Transportation. Please be aware that Taxis are not available at the airport, only authorized transportation companies can pick you up and you must make reservations in advance. Below you can read about the two options and select the best service for your transportation needs. Take advantage of the discounts available for online reservations only. </p></div>";var CShuttlePList={"cancun":{"round":{"1-2 Pax":50,"3-7 Pax":65,"8-10 Pax":70},"oneway":{"1-2 Pax":30,"3-7 Pax":35,"8-10 Pax":40},"airportRound":{"1-2 Pax":65,"3-7 Pax":75,"8-10 Pax":95},"airportOneWay":{"1-2 Pax":45,"3-7 Pax":50,"8-10 Pax":55},"shared":{"oneway":14,"round":23},headerMsg:destMsgPart1+" <strong>Cancun</strong> about 40 minutes "+destMsgPart2},"isla mujeres":{"round":{"1-2 Pax":60,"3-7 Pax":70,"8-10 Pax":75},"oneway":{"1-2 Pax":35,"3-7 Pax":40,"8-10 Pax":40},"airportRound":{"1-2 Pax":70,"3-7 Pax":75,"8-10 Pax":95},"airportOneWay":{"1-2 Pax":45,"3-7 Pax":50,"8-10 Pax":55},"shared":{"oneway":18,"round":30},headerMsg:destMsgPart1+" <strong>Isla Mujeres</strong>. We will transfer you to the ferry dock in Puerto Juarez. Which is located about 30 minutes "+destMsgPart2},"puerto juarez":{"round":{"1-2 Pax":60,"3-7 Pax":70,"8-10 Pax":75},"oneway":{"1-2 Pax":35,"3-7 Pax":40,"8-10 Pax":45},"airportRound":{"1-2 Pax":70,"3-7 Pax":75,"8-10 Pax":95},"airportOneWay":{"1-2 Pax":45,"3-7 Pax":50,"8-10 Pax":55},"shared":{"oneway":18,"round":30},headerMsg:destMsgPart1+" <strong>Puerto Juarez</strong> about 30 minutes "+destMsgPart2},"playa mujeres":{"round":{"1-2 Pax":70,"3-7 Pax":80,"8-10 Pax":90},"oneway":{"1-2 Pax":40,"3-7 Pax":45,"8-10 Pax":50},"airportRound":{"1-2 Pax":90,"3-7 Pax":100,"8-10 Pax":110},"airportOneWay":{"1-2 Pax":60,"3-7 Pax":65,"8-10 Pax":70},"shared":{"oneway":0,"round":0},headerMsg:destMsgPart1+" <strong>Playa Mujeres</strong> about 30 minutes "+destMsgPart2},"puerto morelos":{"round":{"1-2 Pax":70,"3-7 Pax":80,"8-10 Pax":90},"oneway":{"1-2 Pax":40,"3-7 Pax":45,"8-10 Pax":50},"airportRound":{"1-2 Pax":90,"3-7 Pax":100,"8-10 Pax":110},"airportOneWay":{"1-2 Pax":60,"3-7 Pax":65,"8-10 Pax":70},"shared":{"oneway":23,"round":45},headerMsg:destMsgPart1+" <strong>Puerto Morelos</strong> about 25 minutes "+destMsgPart2},"paraiso beach":{"round":{"1-2 Pax":80,"3-7 Pax":90,"8-10 Pax":100},"oneway":{"1-2 Pax":40,"3-7 Pax":50,"8-10 Pax":55},"airportRound":{"1-2 Pax":95,"3-7 Pax":105,"8-10 Pax":115},"airportOneWay":{"1-2 Pax":65,"3-7 Pax":70,"8-10 Pax":75},"shared":{"oneway":23,"round":45},headerMsg:destMsgPart1+" <strong>Paraiso Beach</strong> about 25 minutes "+destMsgPart2},"playa del carmen":{"round":{"1-2 Pax":105,"3-7 Pax":110,"8-10 Pax":120},"oneway":{"1-2 Pax":50,"3-7 Pax":60,"8-10 Pax":65},"airportRound":{"1-2 Pax":125,"3-7 Pax":135,"8-10 Pax":145},"airportOneWay":{"1-2 Pax":80,"3-7 Pax":85,"8-10 Pax":90},"shared":{"oneway":23,"round":45},headerMsg:destMsgPart1+" <strong>Playa del Carmen</strong> about 1 hour "+destMsgPart2},"maroma beach":{"round":{"1-2 Pax":80,"3-7 Pax":90,"8-10 Pax":100},"oneway":{"1-2 Pax":40,"3-7 Pax":50,"8-10 Pax":55},"airportRound":{"1-2 Pax":95,"3-7 Pax":105,"8-10 Pax":115},"airportOneWay":{"1-2 Pax":65,"3-7 Pax":70,"8-10 Pax":75},"shared":{"oneway":23,"round":45},headerMsg:destMsgPart1+" <strong>Maroma Beach</strong> about 30 minutes "+destMsgPart2},"playacar":{"round":{"1-2 Pax":105,"3-7 Pax":110,"8-10 Pax":120},"oneway":{"1-2 Pax":50,"3-7 Pax":60,"8-10 Pax":65},"airportRound":{"1-2 Pax":125,"3-7 Pax":135,"8-10 Pax":145},"airportOneWay":{"1-2 Pax":80,"3-7 Pax":85,"8-10 Pax":90},"shared":{"oneway":23,"round":45},headerMsg:destMsgPart1+" <strong>Playacar</strong> about 1 hour and 10 minutes "+destMsgPart2},"cozumel":{"round":{"1-2 Pax":105,"3-7 Pax":110,"8-10 Pax":120},"oneway":{"1-2 Pax":55,"3-7 Pax":60,"8-10 Pax":65},"airportRound":{"1-2 Pax":125,"3-7 Pax":135,"8-10 Pax":145},"airportOneWay":{"1-2 Pax":80,"3-7 Pax":85,"8-10 Pax":90},"shared":{"oneway":23,"round":45},headerMsg:destMsgPart1+" <strong>Cozumel</strong>. We will transfer you to the ferry dock in Playa del Carmen which is located about 1 hour "+destMsgPart2},"xcaret":{"round":{"1-2 Pax":100,"3-7 Pax":110,"8-10 Pax":120},"oneway":{"1-2 Pax":60,"3-7 Pax":65,"8-10 Pax":70},"airportRound":{"1-2 Pax":135,"3-7 Pax":145,"8-10 Pax":165},"airportOneWay":{"1-2 Pax":90,"3-7 Pax":95,"8-10 Pax":105},"shared":{"oneway":23,"round":45},headerMsg:destMsgPart1+" <strong>Xcaret</strong> about 1 hour and 20 minutes "+destMsgPart2},"puerto aventuras":{"round":{"1-2 Pax":115,"3-7 Pax":130,"8-10 Pax":135},"oneway":{"1-2 Pax":65,"3-7 Pax":70,"8-10 Pax":70},"airportRound":{"1-2 Pax":150,"3-7 Pax":155,"8-10 Pax":165},"airportOneWay":{"1-2 Pax":95,"3-7 Pax":100,"8-10 Pax":105},"shared":{"oneway":28,"round":55},headerMsg:destMsgPart1+" <strong>Puerto Aventuras</strong> about 1 hour and 20 minutes "+destMsgPart2},"calica":{"round":{"1-2 Pax":115,"3-7 Pax":130,"8-10 Pax":135},"oneway":{"1-2 Pax":65,"3-7 Pax":70,"8-10 Pax":70},"airportRound":{"1-2 Pax":135,"3-7 Pax":145,"8-10 Pax":165},"airportOneWay":{"1-2 Pax":90,"3-7 Pax":95,"8-10 Pax":105},"shared":{"oneway":0,"round":0},headerMsg:destMsgPart1+" the <strong>Port of Calica</strong> about 1 hour and 25 minutes "+destMsgPart2},"paamul":{"round":{"1-2 Pax":115,"3-7 Pax":130,"8-10 Pax":135},"oneway":{"1-2 Pax":65,"3-7 Pax":70,"8-10 Pax":70},"airportRound":{"1-2 Pax":150,"3-7 Pax":155,"8-10 Pax":165},"airportOneWay":{"1-2 Pax":95,"3-7 Pax":100,"8-10 Pax":105},"shared":{"oneway":0,"round":0},headerMsg:destMsgPart1+" <strong>Paamul</strong> about 1 hour and 20 minutes "+destMsgPart2},"xpu ha":{"round":{"1-2 Pax":115,"3-7 Pax":130,"8-10 Pax":135},"oneway":{"1-2 Pax":65,"3-7 Pax":70,"8-10 Pax":70},"airportRound":{"1-2 Pax":150,"3-7 Pax":155,"8-10 Pax":165},"airportOneWay":{"1-2 Pax":95,"3-7 Pax":100,"8-10 Pax":105},"shared":{"oneway":35,"round":70},headerMsg:destMsgPart1+" <strong>Xpu Ha</strong> about 1 hour and 40 minutes "+destMsgPart2},"akumal":{"round":{"1-2 Pax":130,"3-7 Pax":145,"8-10 Pax":160},"oneway":{"1-2 Pax":75,"3-7 Pax":80,"8-10 Pax":85},"airportRound":{"1-2 Pax":170,"3-7 Pax":180,"8-10 Pax":195},"airportOneWay":{"1-2 Pax":105,"3-7 Pax":110,"8-10 Pax":115},"shared":{"oneway":35,"round":70},headerMsg:destMsgPart1+" <strong>Akumal</strong> about 1 hour and 30 minutes "+destMsgPart2},"tankah":{"round":{"1-2 Pax":145,"3-7 Pax":175,"8-10 Pax":190},"oneway":{"1-2 Pax":80,"3-7 Pax":95,"8-10 Pax":100},"airportRound":{"1-2 Pax":190,"3-7 Pax":195,"8-10 Pax":215},"airportOneWay":{"1-2 Pax":110,"3-7 Pax":115,"8-10 Pax":125},"shared":{"oneway":0,"round":0},headerMsg:destMsgPart1+" <strong>Tankah</strong> about 1 hour and 50 minutes "+destMsgPart2},"tulum":{"round":{"1-2 Pax":145,"3-7 Pax":175,"8-10 Pax":190},"oneway":{"1-2 Pax":80,"3-7 Pax":95,"8-10 Pax":100},"airportRound":{"1-2 Pax":190,"3-7 Pax":195,"8-10 Pax":215},"airportOneWay":{"1-2 Pax":110,"3-7 Pax":115,"8-10 Pax":125},"shared":{"oneway":35,"round":70},headerMsg:destMsgPart1+" <strong>Tulum</strong> about 1 hour and 45 minutes "+destMsgPart2},"tulum hotel zone":{"round":{"1-2 Pax":145,"3-7 Pax":175,"8-10 Pax":190},"oneway":{"1-2 Pax":80,"3-7 Pax":95,"8-10 Pax":100},"airportRound":{"1-2 Pax":195,"3-7 Pax":200,"8-10 Pax":220},"airportOneWay":{"1-2 Pax":115,"3-7 Pax":120,"8-10 Pax":130},"shared":{"oneway":35,"round":70},headerMsg:destMsgPart1+" <strong>Tulum Hotel Zone</strong> about 2 hours "+destMsgPart2},"holbox":{"round":{"1-2 Pax":430,"3-7 Pax":570,"8-10 Pax":680},"oneway":{"1-2 Pax":215,"3-7 Pax":285,"8-10 Pax":340},"airportRound":{"1-2 Pax":430,"3-7 Pax":570,"8-10 Pax":680},"airportOneWay":{"1-2 Pax":215,"3-7 Pax":285,"8-10 Pax":340},"shared":{"oneway":0,"round":0},headerMsg:destMsgPart1+" <strong>Holbox</strong> about 2 hours "+destMsgPart2},"chiquila":{"round":{"1-2 Pax":430,"3-7 Pax":570,"8-10 Pax":680},"oneway":{"1-2 Pax":215,"3-7 Pax":285,"8-10 Pax":340},"airportRound":{"1-2 Pax":430,"3-7 Pax":570,"8-10 Pax":680},"airportOneWay":{"1-2 Pax":215,"3-7 Pax":285,"8-10 Pax":340},"shared":{"oneway":0,"round":0},headerMsg:destMsgPart1+" <strong>Chiquila</strong> about 2 hours "+destMsgPart2},"valladolid":{"round":{"1-2 Pax":430,"3-7 Pax":570,"8-10 Pax":680},"oneway":{"1-2 Pax":215,"3-7 Pax":285,"8-10 Pax":340},"airportRound":{"1-2 Pax":430,"3-7 Pax":570,"8-10 Pax":680},"airportOneWay":{"1-2 Pax":215,"3-7 Pax":285,"8-10 Pax":340},"shared":{"oneway":0,"round":0},headerMsg:destMsgPart1+" <strong>Valladolid</strong> about 2 hours "+destMsgPart2},"boca paila":{"round":{"1-2 Pax":430,"3-7 Pax":570,"8-10 Pax":680},"oneway":{"1-2 Pax":215,"3-7 Pax":285,"8-10 Pax":340},"airportRound":{"1-2 Pax":430,"3-7 Pax":570,"8-10 Pax":680},"airportOneWay":{"1-2 Pax":215,"3-7 Pax":285,"8-10 Pax":340},"shared":{"oneway":0,"round":0},headerMsg:destMsgPart1+" <strong>Boca Paila</strong> about 2 hours and 10 minutes "+destMsgPart2},"chichen itza":{"round":{"1-2 Pax":540,"3-7 Pax":760,"8-10 Pax":860},"oneway":{"1-2 Pax":270,"3-7 Pax":380,"8-10 Pax":430},"airportRound":{"1-2 Pax":540,"3-7 Pax":760,"8-10 Pax":860},"airportOneWay":{"1-2 Pax":270,"3-7 Pax":380,"8-10 Pax":430},"shared":{"oneway":0,"round":0},headerMsg:destMsgPart1+" <strong>Chichen Itza</strong> about 2 hours and 30 minutes "+destMsgPart2},"merida":{"round":{"1-2 Pax":810,"3-7 Pax":1030,"8-10 Pax":1140},"oneway":{"1-2 Pax":405,"3-7 Pax":515,"8-10 Pax":570},"airportRound":{"1-2 Pax":810,"3-7 Pax":1030,"8-10 Pax":1140},"airportOneWay":{"1-2 Pax":405,"3-7 Pax":515,"8-10 Pax":570},"shared":{"oneway":0,"round":0},headerMsg:destMsgPart1+" <strong>Merida</strong> about 4 hours "+destMsgPart2},"chetumal":{"round":{"1-2 Pax":810,"3-7 Pax":1030,"8-10 Pax":1140},"oneway":{"1-2 Pax":405,"3-7 Pax":515,"8-10 Pax":570},"airportRound":{"1-2 Pax":810,"3-7 Pax":1030,"8-10 Pax":1140},"airportOneWay":{"1-2 Pax":405,"3-7 Pax":515,"8-10 Pax":570},"shared":{"oneway":0,"round":0},headerMsg:destMsgPart1+" <strong>Chetumal</strong> about 5 hours "+destMsgPart2},"costa maya":{"round":{"1-2 Pax":730,"3-7 Pax":920,"8-10 Pax":1030},"oneway":{"1-2 Pax":365,"3-7 Pax":460,"8-10 Pax":515},"airportRound":{"1-2 Pax":730,"3-7 Pax":920,"8-10 Pax":1030},"airportOneWay":{"1-2 Pax":365,"3-7 Pax":460,"8-10 Pax":515},"shared":{"oneway":0,"round":0},headerMsg:destMsgPart1+" <strong>Costa Maya</strong> about 5 hours "+destMsgPart2}};function initAll(){destino=document.getElementById("destino").value;document.getElementById("searchField").onkeyup=searchSuggest;if(window.XMLHttpRequest){xhr=new XMLHttpRequest();}else{if(window.ActiveXObject){try{xhr=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}if(xhr){xhr.onreadystatechange=setHotelsArray;xhr.open("GET","scripts/hlist.xml",true);xhr.send(null);}else{alert("Sorry, but I couldn't create an XMLHttpRequest");}$("#shared-warning").hide();$("#reserve-shared").bind("click",function(e){if($("#tripType").css("display")=="block"){resType="shared shuttle";$("#shared-warning").show();var tripTypeIndex=document.getElementById("tripMenuID").selectedIndex;removeAllChildren("tripType");if(document.getElementById("CarInfoId")){deleteElementByID("CarInfoId");}if(offerMsg!==" "){}var tMenu=populateTripMenu(roundTotal,oneWayTotal);document.getElementById("tripType").appendChild(tMenu);$("#tripType").fadeIn("slow");$("#tenPercent").fadeIn("slow");document.getElementById("tripType").className="tripshow";document.getElementById("tenPercent").className="tshow";document.getElementById("tripMenuID").selectedIndex=tripTypeIndex;document.getElementById("tripMenuID").onchange=genLastSection;document.getElementById("carType").innerHTML="<img src='images/daffyImgs/shared-img-bottom.jpg' />";document.getElementById("dynform").action=sharedServer;document.getElementById("userid").value=sharedId;if(document.getElementById("resTypeHeader")){if(tripTypeIndex==1){var hmsg="You are making a "+resType+" round trip reservation";}else if(tripTypeIndex==2){var hmsg="You are making a "+resType+" one way reservation";}document.getElementById("resTypeHeader").innerHTML=hmsg;}}else{resType="shared shuttle";$("#shared-warning").show();if(document.getElementById("CarInfoId")){deleteElementByID("CarInfoId");}var tMenu=populateTripMenu(roundTotal,oneWayTotal);document.getElementById("tripType").appendChild(tMenu);$("#tripType").fadeIn("slow");$("#tenPercent").fadeIn("slow");document.getElementById("tripType").className="tripshow";document.getElementById("tenPercent").className="tshow";document.getElementById("tripMenuID").selectedIndex=0;document.getElementById("tripMenuID").onchange=genLastSection;document.getElementById("carType").innerHTML="<img src='images/daffyImgs/shared-img-bottom.jpg' />";document.getElementById("dynform").action=sharedServer;document.getElementById("userid").value=sharedId;}});$("#reserve-private").bind("click",function(e){if($("#tripType").css("display")==="block"){resType="private";$("#shared-warning").hide();var tripTypeIndex=document.getElementById("tripMenuID").selectedIndex;removeAllChildren("tripType");var tMenu=populateTripMenu(finalRound,finalOne);document.getElementById("tripType").appendChild(tMenu);document.getElementById("tripType").className="tripshowpriv";document.getElementById("tenPercent").className="tshowpriv";$("#tripType").fadeIn("slow");$("#tenPercent").fadeIn("slow");document.getElementById("tripMenuID").selectedIndex=tripTypeIndex;document.getElementById("tripMenuID").onchange=genLastSection;document.getElementById("carType").innerHTML="<img src='images/daffyImgs/private-img-bottom.jpg' />";document.getElementById("dynform").action=privateServer;document.getElementById("userid").value=privateId;if(document.getElementById("resTypeHeader")){if(tripTypeIndex===1){var hmsg="You are making a "+resType+" round trip reservation";}else if(tripTypeIndex==2){var hmsg="You are making a "+resType+" one way reservation";}document.getElementById("resTypeHeader").innerHTML=hmsg;}}else{resType="private";$("#shared-warning").hide();var tMenu=populateTripMenu(finalRound,finalOne);document.getElementById("tripType").appendChild(tMenu);document.getElementById("tripType").className="tripshowpriv";document.getElementById("tenPercent").className="tshowpriv";$("#tripType").fadeIn("slow");$("#tenPercent").fadeIn("slow");document.getElementById("tripMenuID").selectedIndex=0;document.getElementById("tripMenuID").onchange=genLastSection;document.getElementById("carType").innerHTML="<img src='images/daffyImgs/private-img-bottom.jpg' />";document.getElementById("dynform").action=privateServer;document.getElementById("userid").value=privateId;}});function kH(e){var pK=e?e.which:window.event.keyCode;return pK!=13;}document.onkeypress=kH;if(document.layers){document.captureEvents(Event.KEYPRESS);}if(ChosenHotel!="")if(destino!=""){fillDestInfo();document.getElementById("foldingContent").className="hide";}}function setHotelsArray(){if(xhr.readyState===4){if(xhr.status===200){if(xhr.responseXML){var allHotels=xhr.responseXML.getElementsByTagName("item");for(var i=0;i<allHotels.length;i++){hotelsArray[i]=allHotels[i].getElementsByTagName("label")[0].firstChild;}}}else{alert("There was a problem with the request "+xhr.status);}}}function BuscameloJEJE(){if(document.getElementById("searchField").value==""){ChosenHotel=document.getElementById("searchField").value;destino=getValue(ChosenHotel);document.getElementById("paxMenuID").onchange=checkConditions;}}function searchSuggest(){var str=document.getElementById("searchField").value;document.getElementById("searchField").className="";if(str!==""){document.getElementById("popups").innerHTML="";for(var i=0;i<hotelsArray.length;i++){var thisHotel=hotelsArray[i].nodeValue;if(thisHotel.toLowerCase().indexOf(str.toLowerCase())===0){var tempDiv=document.createElement("div");tempDiv.innerHTML=thisHotel;tempDiv.onclick=makeChoice;tempDiv.className="suggestions";document.getElementById("popups").appendChild(tempDiv);}}var foundCt=document.getElementById("popups").childNodes.length;if(foundCt===0){document.getElementById("searchField").className="error";}}document.getElementById("foldingContent").className="hide";document.getElementById("paxMenuID").onchange=checkConditions;if(ChosenHotel==="other"){if(document.getElementById("otherHotel").className!=="othershow"){if($("#destInfo").css("display")==="block"){$("#destInfo").css({display:"none"});}if($("#tripType").css("display")==="block"){removeAllChildren("tripType");$("#tripType").css({display:"none"});$("#tenPercent").css({display:"none"});}if($("#flightInfo").css("display")==="block"){removeAllChildren("flightInfo");$("#flightInfo").css({display:"none"});document.getElementById("carType").className="";document.getElementById("formSubmit").className="";}document.getElementById("otherHotel").className="othershow";genLabel("otherHotelInput","Hotel Name/Lodging: ");var hotelNode=document.createElement("input");hotelNode.name="product[]";hotelNode.type="text";hotelNode.size="31";document.getElementById("otherHotelInput").appendChild(hotelNode);genBreakLine("otherHotelInput");genLabel("otherHotelInput","Destination:");var dMenu=populateDestinationMenu();document.getElementById("otherHotelInput").appendChild(dMenu);genBreakLine("otherHotelInput");document.getElementById("destMenu").selectedIndex=0;document.getElementById("destMenu").onchange=storeDest;}}else if(document.getElementById("paxMenuID").selectedIndex!==0&&ChosenHotel!==" "){if($("#destInfo").css("display")==="block"){removeAllChildren("sharedPrices");removeAllChildren("sharedIncludes");removeAllChildren("privatePrices");removeAllChildren("privateIncludes");}fillDestInfo();}}function makeChoice(evt){var thisDiv=(evt)?evt.target:window.event.srcElement;document.getElementById("searchField").value=thisDiv.innerHTML;ChosenHotel=thisDiv.innerHTML;document.getElementById("popups").innerHTML="";destino=getValue(ChosenHotel);document.getElementById("foldingContent").className="hide";document.getElementById("paxMenuID").onchange=checkConditions;if(ChosenHotel==="other"){if(document.getElementById("otherHotel").className!=="othershow"){if($("#destInfo").css("display")==="block"){$("#destInfo").css({display:"none"});}if($("#tripType").css("display")==="block"){removeAllChildren("tripType");$("#tripType").css({display:"none"});$("#tenPercent").css({display:"none"});}if($("#flightInfo").css("display")==="block"){removeAllChildren("flightInfo");$("#flightInfo").css({display:"none"});document.getElementById("carType").className="";document.getElementById("formSubmit").className="";}document.getElementById("otherHotel").className="othershow";genLabel("otherHotelInput","Hotel Name/Lodging: ");var hotelNode=document.createElement("input");hotelNode.name="product[]";hotelNode.type="text";hotelNode.size="31";document.getElementById("otherHotelInput").appendChild(hotelNode);genBreakLine("otherHotelInput");genLabel("otherHotelInput","Destination:");var dMenu=populateDestinationMenu();document.getElementById("otherHotelInput").appendChild(dMenu);genBreakLine("otherHotelInput");document.getElementById("destMenu").selectedIndex=0;document.getElementById("destMenu").onchange=storeDest;}}else if(document.getElementById("paxMenuID").selectedIndex!==0&&ChosenHotel!==" "){if($("#destInfo").css("display")==="block"){removeAllChildren("sharedPrices");removeAllChildren("sharedIncludes");removeAllChildren("privatePrices");removeAllChildren("privateIncludes");}fillDestInfo();}}function checkConditions(){if(document.getElementById("otherHotel").className==="othershow"&&document.getElementById("destMenu").selectedIndex===0){$("#otherValidation").css({display:"block"});document.getElementById("otherValidation").innerHTML="You must enter a destination to continue";}else{if($("#more-than-ten").css("display")==="block"){$("#more-than-ten").css({display:"none"});if($("#destInfo").css("display")==="block"){$("#destInfo").css({display:"none"});}cleanBelowFlightInfo();}if(($("#destInfo").css("display")==="block")&&(document.getElementById("paxMenuID").selectedIndex===0)){alert("You need to choose a number of passengers");document.getElementById("paxMenuID").selectedIndex=1;}if($("#destInfo").css("display")==="block"){removeAllChildren("sharedPrices");removeAllChildren("sharedIncludes");removeAllChildren("privatePrices");removeAllChildren("privateIncludes");}if(ChosenHotel!=" "){fillDestInfo();}}}function fillDestInfo(){if(document.getElementById("paxMenuID").selectedIndex===11){$("#more-than-ten").css({display:"block"});if($("#destInfo").css("display")==="block"){$("#destInfo").css({display:"none"});}cleanBelowFlightInfo();}else{$("#destInfo").fadeIn("slow");$("#logos-wrap").fadeIn("slow");exceptionState=checkExceptions();if(CShuttlePList[destino].shared.oneway!==0&&exceptionState){addSharedPriceInfo();document.getElementById("sharedIncludes").className="showBak";document.getElementById("sResButton").className="";}else{removeAllChildren("sharedPrices");removeAllChildren("sharedIncludes");document.getElementById("sResButton").className="noShow";document.getElementById("sharedIncludes").className="";document.getElementById("sharedPrices").innerHTML="<h3>Shared Shuttle Service is not available at this hotel</h3>";}addPrivatePriceInfo();addIncludesInfo();if($("#more-than-ten").css("display")==="block"){$("#more-than-ten").css({display:"none"});if($("#destInfo").css("display")==="block"){$("#destInfo").css({display:"none"});}cleanBelowFlightInfo();}}}function addIncludesInfo(){document.getElementById("dest-msg").innerHTML=CShuttlePList[destino].headerMsg;document.getElementById("privateIncludes").innerHTML=privateIncludesList;if(CShuttlePList[destino].shared.oneway!==0&&exceptionState){document.getElementById("sharedIncludes").innerHTML=sharedIncludesList;}}function addPrivatePriceInfo(){var paxmenu=document.getElementById("paxMenuID");var paxno=paxmenu.options[paxmenu.selectedIndex].innerHTML;var vehicleType=processPaxNum(paxno);roundPrice=CShuttlePList[destino].round[vehicleType];onePrice=CShuttlePList[destino].oneway[vehicleType];var oneAirPrice=CShuttlePList[destino].airportOneWay[vehicleType]+25;var roundAirPrice=CShuttlePList[destino].airportRound[vehicleType]+50;var roundSave=CShuttlePList[destino].airportRound[vehicleType];var oneSave=CShuttlePList[destino].airportOneWay[vehicleType];var carImg=" ";switch(vehicleType){case"1-2 Pax":carImg='<img src="images/daffyImgs/vehicle1to2.jpg"/>';break;case"3-7 Pax":carImg='<img src="images/daffyImgs/vehicle3to7.jpg"/>';break;case"8-10 Pax":carImg='<img src="images/daffyImgs/vehicle8to10.jpg"/>';break;default:alert("error on addPrivatePriceInfo");}var beSafeOne=0;var beSafeRound=0;finalOne=onePrice;finalRound=roundPrice;var priceContent="<div id='small-cars'>"+carImg+"</div><h3>Private Transportation<br/>(Price Per Vehicle in US Dollars)</h3><table width='100%'border='0'><tr><td width='35%'></td><th width='15%'>One Way</th><th width='15%'>Round Trip</th><td width='35%'></td></tr><tr><td class='tText'><span class='pricePer'>Airport Price:</span></td><td class='demPrice'>"+"$"+oneAirPrice.toFixed(2)+"</td><td class='demPrice'>"+"$"+roundAirPrice.toFixed(2)+"</td><td></td></tr>"+"</tr><tr><td class='tText rPrice'>Online Price:</td><td class='rPrice emPrice'>"+"$"+oneSave.toFixed(2)+"</td><td class='rPrice emPrice'>"+"$"+roundSave.toFixed(2)+"</td><td class='promo-msg'>(Your Best Option)</td></tr>"+"<tr><td class='tText rText'>Reserve Now for Only:</td><td class='online-discount'>"+"$"+finalOne.toFixed(2)+"</td><td class='online-discount'>"+"$"+finalRound.toFixed(2)+"</td><td></td></tr></table>";document.getElementById("privatePrices").innerHTML=priceContent;if(oneWayTotal>onePrice){document.getElementById("priv-recommend").className="show";$("td.promo-msg").css("display","block");$("#departs").css("display","none");}else{document.getElementById("priv-recommend").className="";$("#departs").css("display","block");}if((onePrice>=100)&&(roundPrice>=100)){$("#pResMsg").addClass("show");$("#priv-recommend").addClass("showPromo");if($("#priv-recommend").hasClass("show")){$("#priv-recommend").removeClass("show");$("#priv-recommend").addClass("showPromo");}}else if($("#pResMsg").hasClass("show")){$("#pResMsg").removeClass("show");if($("#priv-recommend").hasClass("showPromo"))$("#priv-recommend").removeClass("showPromo");}if((onePrice<100)&&(roundPrice>=100)){$("#rResMsg").addClass("show");$("#priv-recommend").addClass("showPromo");if($("#priv-recommend").hasClass("show")){$("#priv-recommend").removeClass("show");$("#priv-recommend").addClass("showPromo");}}else if($("#rResMsg").hasClass("show")){$("#rResMsg").removeClass("show");if($("#priv-recommend").hasClass("showPromo"))$("#priv-recommend").removeClass("showPromo");}if(resType=="private"){rePopulateTripMenu(finalRound,finalOne);}}function addSharedPriceInfo(){var paxmenu=document.getElementById("paxMenuID");var paxStr=paxmenu.options[paxmenu.selectedIndex].innerHTML;var paxno=processString(paxStr);findDiscount(paxno);if(paxno==2&&destino=="cancun"){var oneWayShared=14;var roundShared=17;oneWayTotal=14*paxno;roundTotal=17*paxno;}else{var oneWayShared=CShuttlePList[destino].shared.oneway;var roundShared=CShuttlePList[destino].shared.round;oneWayTotal=CShuttlePList[destino].shared.oneway*paxno;roundTotal=CShuttlePList[destino].shared.round*paxno;}attachOffer(paxno);var priceContent="<div id='departs'><!--<img src='images/daffyImgs/departs-every-20.png' />--></div><h3>Shared Shuttle</h3><table width='100%' border='0'><tr><th width='30%'></th><th width='15%'>One Way</th><th width='15%'>Round Trip</th><th width='40%'></th></tr><tr><td class='tText'><span class='pricePer'>Price Per Person:</span></td><td>"+"$"+oneWayShared+".00"+"</td><td>"+"$"+roundShared+".00"+"</td><td>&nbsp;</td></tr><tr><td class='rPrice tText'>Total Online Price:</td><td class='rPrice emPrice'>"+"$"+oneWayTotal+".00"+"</td><td class='rPrice emPrice'>"+"$"+roundTotal+".00"+"</td><td class='promo-msg'>See Private Option<img src='images/daffyImgs/sm-red-arrow.png' /></td></tr><tr></table>";document.getElementById("sharedPrices").innerHTML=priceContent;if(resType=="shared shuttle"){rePopulateTripMenu(roundTotal,oneWayTotal);}}function rePopulateTripMenu(rPrice,oPrice){if(document.getElementById("tripMenuID")){var savedIndex=document.getElementById("tripMenuID").selectedIndex;removeAllChildren("tripType");var tripmenu=populateTripMenu(rPrice,oPrice);tripmenu.selectedIndex=savedIndex;document.getElementById("tripType").appendChild(tripmenu);document.getElementById("tripMenuID").onchange=genLastSection;}}function storeDest(){if($("#otherValidation").css("display")=="block"){$("#otherValidation").css({display:"none"});document.getElementById("otherValidation").innerHTML="";}var dMenu=document.getElementById("destMenu");destino=dMenu.options[dMenu.selectedIndex].value;if(document.getElementById("paxMenuID").selectedIndex!==0){fillDestInfo();}}function populateTripMenu(rPrice,owayPrice){var tripMenu=document.createElement("select");tripMenu.name="productpr";tripMenu.id="tripMenuID";var optionToAdd=document.createElement("option");optionToAdd.selected="selected";optionToAdd.innerHTML="Please Select One";tripMenu.appendChild(optionToAdd);if(resType==="private"){createTripOption(tripMenu,"Round Trip",rPrice,"",roundPrice);createTripOption(tripMenu,"One Way",owayPrice,"",onePrice);}else if(resType==="shared shuttle"){createTripOption(tripMenu,"Round Trip",rPrice,"",rPrice);createTripOption(tripMenu,"One Way",owayPrice,"",owayPrice);}return tripMenu;}function createTripOption(menu,kind,price,savings,priceSent){var optionToAdd=document.createElement("option");optionToAdd.value=":"+priceSent;optionToAdd.innerHTML=kind+": $"+price.toFixed(2)+savings;menu.appendChild(optionToAdd);}function genLastSection(){if($("#flightInfo").css("display")==="block"){removeAllChildren("flightInfo");if(document.getElementById("tripMenuID").selectedIndex===1){generateRound();document.getElementById("formSubmit").className="subShow";if(resType=="private"){document.getElementById("tenPercent").className="tshowprivGif";}else{document.getElementById("tenPercent").className="tshow";}$("#one-message").hide();$("#round-message").show();}else if(document.getElementById("tripMenuID").selectedIndex===2){generateOneWay();document.getElementById("formSubmit").className="subShow";if(resType=="private"){document.getElementById("tenPercent").className="tshowprivGif";}else{document.getElementById("tenPercent").className="tshow";}$("#round-message").hide();$("#one-message").show();}else if(document.getElementById("tripMenuID").selectedIndex===0){if(document.getElementById("formSubmit").className==="subShow"){document.getElementById("formSubmit").className="";}if(($("#flightInfo").css("display:block"))){}addH3("flightInfo","You need to choose a round trip or one way to continue","warningMsg");$("#carType").removeClass("show");document.getElementById("tenPercent").className="tshowpriv";$("#round-message").hide();$("#one-message").hide();}else{alert("error on genLastSection");}}else{$("#flightInfo").fadeIn("slow");if(document.getElementById("tripMenuID").selectedIndex===1){generateRound();document.getElementById("formSubmit").className="subShow";if(resType=="private"){document.getElementById("tenPercent").className="tshowprivGif";}else{document.getElementById("tenPercent").className="tshow";}$("#one-message").hide();$("#round-message").show();}else if(document.getElementById("tripMenuID").selectedIndex===2){generateOneWay();document.getElementById("formSubmit").className="subShow";if(resType=="private"){document.getElementById("tenPercent").className="tshowprivGif";}else{document.getElementById("tenPercent").className="tshow";}$("#round-message").hide();$("#one-message").show();}else if(document.getElementById("tripMenuID").selectedIndex===0){if(document.getElementById("formSubmit").className==="subShow"){document.getElementById("formSubmit").className="";}if(document.getElementById("flightInfo").className==="flightshow"){document.getElementById("flightInfo").className="";}alert("Please choose Round trip or One way trip");document.getElementById("tenPercent").className="tshowpriv";$("#round-message").hide();$("#one-message").hide();}else{alert("error on genLastSection");}}}function genLastSectionTempCopy(){if(document.getElementById("flightInfo").className==="flightshow"){removeAllChildren("flightInfo");if(document.getElementById("tripMenuID").selectedIndex===1){generateRound();document.getElementById("formSubmit").className="subShow";}else if(document.getElementById("tripMenuID").selectedIndex===2){generateOneWay();document.getElementById("formSubmit").className="subShow";}else if(document.getElementById("tripMenuID").selectedIndex===0){if(document.getElementById("formSubmit").className==="subShow"){document.getElementById("formSubmit").className="";}if(document.getElementById("flightInfo").className==="flightshow"){document.getElementById("flightInfo").className="";}document.getElementById("tripTypeValidation").className="show";}else{alert("error on genLastSection");}}else{document.getElementById("flightInfo").className="flightshow";if(document.getElementById("tripMenuID").selectedIndex===1){generateRound();document.getElementById("formSubmit").className="subShow";}else if(document.getElementById("tripMenuID").selectedIndex===2){generateOneWay();document.getElementById("formSubmit").className="subShow";}else if(document.getElementById("tripMenuID").selectedIndex===0){if(document.getElementById("formSubmit").className==="subShow"){document.getElementById("formSubmit").className="";}if(document.getElementById("flightInfo").className==="flightshow"){document.getElementById("flightInfo").className="";}alert("Please choose Round trip or One way trip");}else{alert("error on genLastSection");}}}function generateOneWay(){document.getElementById("carType").className="show";if(document.getElementById("tripTypeValidation").className==="show"){document.getElementById("tripTypeValidation").className="";}var firstHeader="You are making a "+resType+" one way reservation";if($("#otherHotel").css("display")!=="block"){if(document.getElementById("destinoInfo")){document.getElementById("destinoInfo").value=destino;}else{genHiddenField("destinoDiv",destino,"destinoInfo");}}addH3("flightInfo",firstHeader,"resTypeHeader");generateDiv("flightInfo","infoName");genLabel("infoName","Your Name: ");genInputTextField("infoName","text","product[]","customerName","");generateDiv("flightInfo","nameWarning");generateDiv("flightInfo","infoTransfer");genLabel("infoTransfer","Type of Transfer: ");var transfer_type=document.createElement("select");transfer_type.name="product[]";transfer_type.id="transferType";createOption(transfer_type,"Please Select One");createOption(transfer_type,"Arrival");createOption(transfer_type,"Departure");document.getElementById("infoTransfer").appendChild(transfer_type);document.getElementById("transferType").onchange=departureCheck;generateDiv("flightInfo","infoTransferWarning");generateDiv("flightInfo","infoDate");genFlightDateField("infoDate","one_way");$("#one_way").datepicker({beforeShowDay:$.datepicker.restrictDays,minDate:'0d'});generateDiv("flightInfo","infoFlight");genFlightNumField("infoFlight","oneFlightInfo");generateDiv("flightInfo","infoTime");genFlightTimeField("infoTime","oneWayTime");generateDiv("flightInfo","flightWarningMsg");}function generateRound(){document.getElementById("carType").className="show";if(document.getElementById("tripTypeValidation").className==="show"){document.getElementById("tripTypeValidation").className="";}var firstHeader="You are making a "+resType+" round trip reservation";if($("#otherHotel").css("display")!=="block"){if(document.getElementById("destinoInfo")){document.getElementById("destinoInfo").value=destino;}else{genHiddenField("destinoDiv",destino,"destinoInfo");}}addH3("flightInfo",firstHeader,"resTypeHeader");generateDiv("flightInfo","infoName");genLabel("infoName","Your Name: ");genInputTextField("infoName","text","product[]","customerName","");generateDiv("flightInfo","nameWarning");genHiddenField("flightInfo","Arriving","arrivingNote");generateDiv("flightInfo","infoArrivalLabel");genLabel("infoArrivalLabel","ARRIVAL INFORMATION");generateDiv("flightInfo","infoADate");genFlightDateField("infoADate","aDate");generateDiv("flightInfo","infoAFlight");genFlightNumField("infoAFlight","arrivalFlightInfo");generateDiv("flightInfo","infoATime");genFlightTimeField("infoATime","arrivalTime");generateDiv("flightInfo","ArrivalWarningMsg");genHiddenField("flightInfo","Departing","departingNote");generateDiv("flightInfo","infoDepartureLabel");genLabel("infoDepartureLabel","DEPARTURE INFORMATION");generateDiv("flightInfo","infoDDate");genFlightDateField("infoDDate","dDate");generateDiv("flightInfo","infoDFlight");genFlightNumField("infoDFlight","departureFlightInfo");generateDiv("flightInfo","infoDTime");genFlightTimeField("infoDTime","departureTime");var departureMsg=document.createElement("p");departureMsg.innerHTML="  *The time your flight leaves from Cancun.";document.getElementById("infoDTime").appendChild(departureMsg);generateDiv("flightInfo","DepartureWarningMsg");$("#aDate").datepicker({beforeShowDay:$.datepicker.restrictDays,minDate:'0d'});$("#dDate").datepicker({beforeShowDay:$.datepicker.restrictDays,minDate:'0d'});}function addH3(divToAdd,Msg,itemId){var header=document.createElement("h3");header.innerHTML=Msg;header.id=itemId;document.getElementById(divToAdd).appendChild(header);}function genFlightDateField(divToAdd,CalID){genLabel(divToAdd,"Date");var calField=document.createElement("input");calField.name="product[]";calField.id=CalID;calField.size="16";document.getElementById(divToAdd).appendChild(calField);}function genFlightNumField(divToAdd,flightId){genLabel(divToAdd,"Airline & Flight#");var fInfo=document.createElement("input");fInfo.name="product[]";fInfo.type="text";fInfo.id=flightId;fInfo.size="12";document.getElementById(divToAdd).appendChild(fInfo);}function genFlightTimeField(divToAdd,timeId){genLabel(divToAdd,"Time");var tInfo=document.createElement("select");tInfo.name="product[]";tInfo.id=timeId+"Hour";createOption(tInfo,"--");createOption(tInfo,"1");createOption(tInfo,"2");createOption(tInfo,"3");createOption(tInfo,"4");createOption(tInfo,"5");createOption(tInfo,"6");createOption(tInfo,"7");createOption(tInfo,"8");createOption(tInfo,"9");createOption(tInfo,"10");createOption(tInfo,"11");createOption(tInfo,"12");document.getElementById(divToAdd).appendChild(tInfo);var mInfo=document.createElement("select");mInfo.name="product[]";mInfo.id=timeId+"Minutes";createOption(mInfo,"--");createOption(mInfo,"00");createOption(mInfo,"05");createOption(mInfo,"10");createOption(mInfo,"15");createOption(mInfo,"20");createOption(mInfo,"25");createOption(mInfo,"30");createOption(mInfo,"35");createOption(mInfo,"40");createOption(mInfo,"45");createOption(mInfo,"50");createOption(mInfo,"55");document.getElementById(divToAdd).appendChild(mInfo);var tInfoAmPm=document.createElement("select");tInfoAmPm.name="product[]";tInfoAmPm.id=timeId+"Ampm";createOption(tInfoAmPm,"--");createOption(tInfoAmPm,"A.M.");createOption(tInfoAmPm,"P.M.");document.getElementById(divToAdd).appendChild(tInfoAmPm);}function generateDiv(divToAdd,divId){var newdiv=document.createElement("div");newdiv.id=divId;document.getElementById(divToAdd).appendChild(newdiv);}function genInputTextField(divToAdd,fieldType,fieldName,fieldId,fieldClass){var newElm=document.createElement("input");newElm.name=fieldName;newElm.type=fieldType;newElm.id=fieldId;newElm.className=fieldClass;document.getElementById(divToAdd).appendChild(newElm);}function departureCheck(){if(document.getElementById("transferType").selectedIndex===0){if(document.getElementById("departureMsg")){deleteElementByID("departureMsg");}}else if(document.getElementById("transferType").selectedIndex===1){if(document.getElementById("departureMsg")){deleteElementByID("departureMsg");}}else if(document.getElementById("transferType").selectedIndex===2){var depMsg=document.createElement("p");depMsg.innerHTML="*The time your flight leaves from Cancun.";depMsg.id="departureMsg";document.getElementById("infoTime").appendChild(depMsg);}}function removeAllChildren(elementID){var cell=document.getElementById(elementID);if(cell.hasChildNodes()){while(cell.childNodes.length>=1){cell.removeChild(cell.firstChild);}}}function validate(dynform){var name=dynform.customerName.value;if(dynform.one_way){var oneWayDate=dynform.one_way.value;}if(dynform.aDate){var arrivalDate=dynform.aDate.value;}if(dynform.dDate){var departureDate=dynform.dDate.value;}if(dynform.transferType){var tType=dynform.transferType;}if(dynform.oneFlightInfo){var oneFInfo=dynform.oneFlightInfo.value;}if(dynform.arrivalFlightInfo){var arrivalInfo=dynform.arrivalFlightInfo.value;}if(dynform.departureFlightInfo){var departureInfo=dynform.departureFlightInfo.value;}if(dynform.oneWayTime){var oneTime=dynform.oneWayTime.value;}if(dynform.arrivalTime){var aTime=dynform.arrivalTime.value;}if(dynform.departureTime){var dTime=dynform.departureTime.value;}if(dynform.oneWayTimeHour){var oneTimeHour=dynform.oneWayTimeHour.value;}if(dynform.oneWayTimeMinutes){var oneTimeMinutes=dynform.oneWayTimeMinutes.value;}if(dynform.oneWayTimeAmpm){var oneTimeAmpm=dynform.oneWayTimeAmpm.value;}if(dynform.arrivalTimeHour){var aTimeHour=dynform.arrivalTimeHour.value;}if(dynform.arrivalTimeMinutes){var aTimeMinutes=dynform.arrivalTimeMinutes.value;}if(dynform.arrivalTimeAmpm){var aTimeAmpm=dynform.arrivalTimeAmpm.value;}if(dynform.departureTimeHour){var dTimeHour=dynform.departureTimeHour.value;}if(dynform.departureTimeMinutes){var dTimeMinutes=dynform.departureTimeMinutes.value;}if(dynform.departureTimeAmpm){var dTimeAmpm=dynform.departureTimeAmpm.value;}var nameRegex=/^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*$/;var emailRegex=/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;var messageRegex=new RegExp(/<\/?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)\/?>/gim);if(document.getElementById("tripMenuID").selectedIndex==1){if(name===""){eraseRoundWarnings();document.getElementById("nameWarning").innerHTML="Please enter your name";dynform.customerName.focus();return false;}if(!name.match(nameRegex)){eraseRoundWarnings();document.getElementById("nameWarning").innerHTML="You have entered an invalid name";dynform.customerName.focus();return false;}if(arrivalDate===""){eraseRoundWarnings();document.getElementById("ArrivalWarningMsg").innerHTML="Please enter the date of your arrival";document.getElementById("ArrivalWarningMsg").className="showLeft";dynform.aDate.focus();return false;}if((arrivalDate==="December 24, 2008")||(arrivalDate==="December 25, 2008")||(arrivalDate==="December 31, 2008")||(arrivalDate==="January 1, 2009")){eraseRoundWarnings();document.getElementById("ArrivalWarningMsg").innerHTML="Unfortunately, December 24th, 25th, 31st and January 1st are sold out. Please choose a different date from the calendar";document.getElementById("ArrivalWarningMsg").className="showBlue";return false;}if(arrivalInfo===""){eraseRoundWarnings();document.getElementById("ArrivalWarningMsg").innerHTML="Enter Airline Name and Flight Number";document.getElementById("ArrivalWarningMsg").className="show";dynform.arrivalFlightInfo.focus();return false;}if(aTimeHour==="--"){eraseRoundWarnings();document.getElementById("ArrivalWarningMsg").innerHTML="Enter the hour of your flight";document.getElementById("ArrivalWarningMsg").className="showRight";dynform.arrivalTimeHour.focus();return false;}if(aTimeMinutes==="--"){eraseRoundWarnings();document.getElementById("ArrivalWarningMsg").innerHTML="Please Enter the minutes";document.getElementById("ArrivalWarningMsg").className="showRight";dynform.arrivalTimeMinutes.focus();return false;}if(aTimeAmpm==="--"){eraseRoundWarnings();document.getElementById("ArrivalWarningMsg").innerHTML="Please enter AM or PM";document.getElementById("ArrivalWarningMsg").className="showRight";dynform.arrivalTimeAmpm.focus();return false;}if(departureDate===""){eraseRoundWarnings();document.getElementById("DepartureWarningMsg").innerHTML="Enter the date of your departure";document.getElementById("DepartureWarningMsg").className="showLeft";dynform.dDate.focus();return false;}if((departureDate==="December 24, 2008")||(departureDate==="December 25, 2008")||(departureDate==="December 31, 2008")||(departureDate==="January 1, 2009")){eraseRoundWarnings();document.getElementById("DepartureWarningMsg").innerHTML="Unfortunately, December 24th, 25th, 31st and January 1st are sold out. Please choose a different date from the calendar";document.getElementById("DepartureWarningMsg").className="showBlue";return false;}if(departureInfo===""){eraseRoundWarnings();document.getElementById("DepartureWarningMsg").innerHTML="Enter Airline Name and Flight Number";document.getElementById("DepartureWarningMsg").className="show";dynform.departureFlightInfo.focus();return false;}if(dTimeHour==="--"){eraseRoundWarnings();document.getElementById("DepartureWarningMsg").innerHTML="Enter the hour of your flight";document.getElementById("DepartureWarningMsg").className="showRight";dynform.departureTimeHour.focus();return false;}if(dTimeMinutes==="--"){eraseRoundWarnings();document.getElementById("DepartureWarningMsg").innerHTML="Please Enter the minutes";document.getElementById("DepartureWarningMsg").className="showRight";dynform.departureTimeMinutes.focus();return false;}if(dTimeAmpm==="--"){eraseRoundWarnings();document.getElementById("DepartureWarningMsg").innerHTML="Please enter AM or PM";document.getElementById("DepartureWarningMsg").className="showRight";dynform.departureTimeAmpm.focus();return false;}}else if(document.getElementById("tripMenuID").selectedIndex==2){if(name===""){eraseOneWayWarnings();document.getElementById("nameWarning").innerHTML="Please enter your name";dynform.customerName.focus();return false;}if(!name.match(nameRegex)){eraseOneWayWarnings();document.getElementById("nameWarning").innerHTML="You have entered an invalid name";dynform.customerName.focus();return false;}if(tType){if(tType.selectedIndex===0){eraseOneWayWarnings();document.getElementById("infoTransferWarning").innerHTML="Please choose the type of transfer you need";dynform.transferType.focus();return false;}}if(oneWayDate===""){eraseOneWayWarnings();document.getElementById("flightWarningMsg").innerHTML="Please enter the date of your flight";document.getElementById("flightWarningMsg").className="showLeft";dynform.one_way.focus();return false;}if((oneWayDate==="December 24, 2008")||(oneWayDate==="December 25, 2008")||(oneWayDate==="December 31, 2008")||(oneWayDate==="January 1, 2009")){eraseOneWayWarnings();document.getElementById("flightWarningMsg").innerHTML="Unfortunately, December 24th, 25th, 31st and January 1st are sold out. Please choose a different date from the calendar";document.getElementById("flightWarningMsg").className="showBlue";return false;}if(oneFInfo===""){eraseOneWayWarnings();document.getElementById("flightWarningMsg").innerHTML="Enter Airline Name and Flight Number";document.getElementById("flightWarningMsg").className="show";dynform.oneFlightInfo.focus();return false;}if((oneTimeHour==="--")){eraseOneWayWarnings();document.getElementById("flightWarningMsg").innerHTML="Enter the hour of your flight";document.getElementById("flightWarningMsg").className="showRight";dynform.oneWayTimeHour.focus();return false;}if((oneTimeMinutes==="--")){eraseOneWayWarnings();document.getElementById("flightWarningMsg").innerHTML="Please Enter the minutes";document.getElementById("flightWarningMsg").className="showRight";dynform.oneWayTimeMinutes.focus();return false;}if((oneTimeAmpm==="--")){eraseOneWayWarnings();document.getElementById("flightWarningMsg").innerHTML="Please enter AM or PM";document.getElementById("flightWarningMsg").className="showRight";dynform.oneWayTimeAmpm.focus();return false;}}return true;}function eraseOneWayWarnings(){document.getElementById("nameWarning").innerHTML="";document.getElementById("infoTransferWarning").innerHTML="";document.getElementById("flightWarningMsg").innerHTML="";document.getElementById("flightWarningMsg").className="";}function eraseRoundWarnings(){document.getElementById("nameWarning").innerHTML="";document.getElementById("ArrivalWarningMsg").innerHTML="";document.getElementById("DepartureWarningMsg").innerHTML="";document.getElementById("ArrivalWarningMsg").className="";document.getElementById("DepartureWarningMsg").className="";}function cleanBelowFlightInfo(){if($("#tripType").css("display")==="block"){$("#tripType").css({display:"none"});removeAllChildren("tripType");$("#tenPercent").css({display:"none"});}if($("#flightInfo").css("display")==="block"){$("#flightInfo").css({display:"none"});document.getElementById("carType").className="";document.getElementById("formSubmit").className="";removeAllChildren("flightInfo");}}function getValue(hname){if(xhr.readyState===4){if(xhr.status===200){if(xhr.responseXML){var allHotelsVar2=xhr.responseXML.getElementsByTagName("item");for(var i=0;i<allHotelsVar2.length;i++){if(allHotelsVar2[i].getElementsByTagName("label")[0].firstChild.nodeValue==hname){return allHotelsVar2[i].getElementsByTagName("value")[0].firstChild.nodeValue;}}return"error, there was no such hotel in the list";}}else{alert("There was a problem with the request "+xhr.status);}}}function processPaxNum(paxnum){paxnum=processString(paxnum);paxNumber=paxnum;if(paxnum<3){if(document.getElementById("CarInfoId")){deleteElementByID("CarInfoId");genHiddenField("carInfo","Car 1-2 Pax","CarInfoId");}else{genHiddenField("carInfo","Car 1-2 Pax","CarInfoId");}return"1-2 Pax";}else if(paxnum<8){if(document.getElementById("CarInfoId")){deleteElementByID("CarInfoId");genHiddenField("carInfo","Van 3-7 Pax","CarInfoId");}else{genHiddenField("carInfo","Van 3-7 Pax","CarInfoId");}return"3-7 Pax";}else{if(document.getElementById("CarInfoId")){deleteElementByID("CarInfoId");genHiddenField("carInfo","Van 8-10 Pax","CarInfoId");}else{genHiddenField("carInfo","Van 8-10 Pax","CarInfoId");}return"8-10 Pax";}alert("error in processPaxNum");}function populateDestinationMenu(){var destinationMenu=document.createElement("select");destinationMenu.name="product[]";destinationMenu.id="destMenu";var optionToAdd=document.createElement("option");optionToAdd.selected="selected";optionToAdd.innerHTML="Please Select Your Destination";destinationMenu.appendChild(optionToAdd);createOption(destinationMenu,"akumal");createOption(destinationMenu,"boca paila");createOption(destinationMenu,"calica");createOption(destinationMenu,"cancun");createOption(destinationMenu,"chetumal");createOption(destinationMenu,"chichen itza");createOption(destinationMenu,"chiquila");createOption(destinationMenu,"cozumel");createOption(destinationMenu,"holbox");createOption(destinationMenu,"isla mujeres");createOption(destinationMenu,"maroma beach");createOption(destinationMenu,"merida");createOption(destinationMenu,"paamul");createOption(destinationMenu,"paraiso beach");createOption(destinationMenu,"playa del carmen");createOption(destinationMenu,"playa mujeres");createOption(destinationMenu,"playacar");createOption(destinationMenu,"puerto aventuras");createOption(destinationMenu,"puerto juarez");createOption(destinationMenu,"puerto morelos");createOption(destinationMenu,"tankah");createOption(destinationMenu,"tulum");createOption(destinationMenu,"tulum hotel zone");createOption(destinationMenu,"valladolid");createOption(destinationMenu,"xcaret");createOption(destinationMenu,"xpu ha");return destinationMenu;}function createOption(Menu,opt){var optionToAdd=document.createElement("option");optionToAdd.value=opt;optionToAdd.innerHTML=opt;Menu.appendChild(optionToAdd);}function processString(str){if(str.charAt(0)===" "){return str.charAt(0);}else return str.substr(0,2);}function deleteElementByID(elementID){var elementToDelete=document.getElementById(elementID);var parentNode=elementToDelete.parentNode;var nodeVar=parentNode.firstChild;var j=1;if(nodeVar.id===elementID){parentNode.removeChild(parentNode.childNodes[0]);}else{var nodeBro=nodeVar.nextSibling;while(nodeBro.id!=elementID){nodeBro=nodeBro.nextSibling;j++;}parentNode.removeChild(parentNode.childNodes[j]);}}function genHiddenField(divToAdd,infoToSend,fieldId){var info=document.createElement("input");info.name="product[]";info.type="hidden";info.value=infoToSend;info.id=fieldId;document.getElementById(divToAdd).appendChild(info);}function genLabel(divToAdd,labelText){var transTypeLabel=document.createElement("label");transTypeLabel.innerHTML=labelText;document.getElementById(divToAdd).appendChild(transTypeLabel);}function genBreakLine(divToAdd){var bLine=document.createElement("br");document.getElementById(divToAdd).appendChild(bLine);}function attachOffer(pxnum){var offer=pxnum*10;if(offer>50){offer=50;}offerMsg=" ";}function findDiscount(paxnum){if(paxnum<3){sharedCoupon=30;privateCoupon=30;}else if(paxnum<8){sharedCoupon=60;privateCoupon=60;}else{sharedCoupon=60;privateCoupon=90;}}function displayDiscount(num){if(num<=0){return"Free";}else{return"$"+num.toFixed(2);}}function checkExceptions(){var i;for(i=0;i<exception.length;i+=1){if(ChosenHotel===exception[i])return false;}return true;}