window.onload=initAll;window.onunload=function(){};var xhr=false;var sharedServer="http://ww11.aitsafe.com/cf/add.cfm";var sharedId="D229456";var privateServer="http://ww4.aitsafe.com/cf/add.cfm";var privateId="62182686";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 8:00a.m. to 9:00 p.m. ONLY</li><li>Share vehicle with up to 10 passengers</li><li>Shuttles depart every 20 minutes</li><li>Multiple stops – 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 CShuttlePList={"cancun":{"round":{"1-2 Pax":65,"3-7 Pax":75,"8-10 Pax":95},"oneway":{"1-2 Pax":45,"3-7 Pax":50,"8-10 Pax":55},"airportRound":{"1-2 Pax":115,"3-7 Pax":125,"8-10 Pax":145},"airportOneWay":{"1-2 Pax":70,"3-7 Pax":75,"8-10 Pax":80},"shared":{"oneway":14,"round":23},headerMsg:"<p>Your destination is beautiful Cancun.</p>"},"isla mujeres":{"round":{"1-2 Pax":70,"3-7 Pax":75,"8-10 Pax":95},"oneway":{"1-2 Pax":45,"3-7 Pax":50,"8-10 Pax":55},"airportRound":{"1-2 Pax":120,"3-7 Pax":125,"8-10 Pax":145},"airportOneWay":{"1-2 Pax":70,"3-7 Pax":75,"8-10 Pax":80},"shared":{"oneway":18,"round":30},headerMsg:"<p>You are going to Isla Mujeres. We will transfer you to the ferry dock in Puerto Juarez</p>"},"puerto juarez":{"round":{"1-2 Pax":70,"3-7 Pax":75,"8-10 Pax":95},"oneway":{"1-2 Pax":45,"3-7 Pax":50,"8-10 Pax":55},"airportRound":{"1-2 Pax":120,"3-7 Pax":125,"8-10 Pax":145},"airportOneWay":{"1-2 Pax":70,"3-7 Pax":75,"8-10 Pax":80},"shared":{"oneway":18,"round":30},headerMsg:"<p>Your destination is beautiful Puerto Juarez</p>"},"playa mujeres":{"round":{"1-2 Pax":90,"3-7 Pax":100,"8-10 Pax":110},"oneway":{"1-2 Pax":60,"3-7 Pax":65,"8-10 Pax":70},"airportRound":{"1-2 Pax":140,"3-7 Pax":150,"8-10 Pax":160},"airportOneWay":{"1-2 Pax":85,"3-7 Pax":90,"8-10 Pax":95},"shared":{"oneway":0,"round":0},headerMsg:"<p>Your destination is beautiful Playa Mujeres.</p>"},"puerto morelos":{"round":{"1-2 Pax":90,"3-7 Pax":100,"8-10 Pax":110},"oneway":{"1-2 Pax":60,"3-7 Pax":65,"8-10 Pax":70},"airportRound":{"1-2 Pax":140,"3-7 Pax":150,"8-10 Pax":160},"airportOneWay":{"1-2 Pax":85,"3-7 Pax":90,"8-10 Pax":95},"shared":{"oneway":23,"round":45},headerMsg:"<p>Your destination is beautiful Puerto Morelos.</p>"},"paraiso beach":{"round":{"1-2 Pax":95,"3-7 Pax":105,"8-10 Pax":115},"oneway":{"1-2 Pax":65,"3-7 Pax":70,"8-10 Pax":75},"airportRound":{"1-2 Pax":145,"3-7 Pax":155,"8-10 Pax":165},"airportOneWay":{"1-2 Pax":90,"3-7 Pax":95,"8-10 Pax":100},"shared":{"oneway":23,"round":45},headerMsg:"<p>Your destination is beautiful Paraiso Beach.</p>"},"playa del carmen":{"round":{"1-2 Pax":125,"3-7 Pax":135,"8-10 Pax":145},"oneway":{"1-2 Pax":80,"3-7 Pax":85,"8-10 Pax":90},"airportRound":{"1-2 Pax":175,"3-7 Pax":185,"8-10 Pax":195},"airportOneWay":{"1-2 Pax":105,"3-7 Pax":110,"8-10 Pax":115},"shared":{"oneway":23,"round":45},headerMsg:"<p>Your destination is beautiful Playa del Carmen.</p>"},"maroma beach":{"round":{"1-2 Pax":95,"3-7 Pax":105,"8-10 Pax":115},"oneway":{"1-2 Pax":65,"3-7 Pax":70,"8-10 Pax":75},"airportRound":{"1-2 Pax":145,"3-7 Pax":155,"8-10 Pax":165},"airportOneWay":{"1-2 Pax":90,"3-7 Pax":95,"8-10 Pax":100},"shared":{"oneway":23,"round":45},headerMsg:"<p>Your destination is beautiful Maroma Beach.</p>"},"playacar":{"round":{"1-2 Pax":125,"3-7 Pax":135,"8-10 Pax":145},"oneway":{"1-2 Pax":80,"3-7 Pax":85,"8-10 Pax":90},"airportRound":{"1-2 Pax":175,"3-7 Pax":185,"8-10 Pax":195},"airportOneWay":{"1-2 Pax":105,"3-7 Pax":110,"8-10 Pax":115},"shared":{"oneway":23,"round":45},headerMsg:"<p>Your destination is beautiful Playacar.</p>"},"cozumel":{"round":{"1-2 Pax":125,"3-7 Pax":135,"8-10 Pax":145},"oneway":{"1-2 Pax":80,"3-7 Pax":85,"8-10 Pax":90},"airportRound":{"1-2 Pax":175,"3-7 Pax":185,"8-10 Pax":195},"airportOneWay":{"1-2 Pax":105,"3-7 Pax":110,"8-10 Pax":115},"shared":{"oneway":23,"round":45},headerMsg:"<p>You are going to Cozumel. We will transfer you to the ferry dock in Playa del Carmen</p>"},"xcaret":{"round":{"1-2 Pax":135,"3-7 Pax":145,"8-10 Pax":165},"oneway":{"1-2 Pax":90,"3-7 Pax":95,"8-10 Pax":105},"airportRound":{"1-2 Pax":185,"3-7 Pax":195,"8-10 Pax":215},"airportOneWay":{"1-2 Pax":115,"3-7 Pax":120,"8-10 Pax":130},"shared":{"oneway":23,"round":45},headerMsg:"<p>Your destination is beautiful Xcaret.</p>"},"puerto aventuras":{"round":{"1-2 Pax":150,"3-7 Pax":155,"8-10 Pax":165},"oneway":{"1-2 Pax":95,"3-7 Pax":100,"8-10 Pax":105},"airportRound":{"1-2 Pax":200,"3-7 Pax":205,"8-10 Pax":215},"airportOneWay":{"1-2 Pax":120,"3-7 Pax":125,"8-10 Pax":130},"shared":{"oneway":28,"round":55},headerMsg:"<p>Your destination is beautiful Puerto Aventuras.</p>"},"calica":{"round":{"1-2 Pax":135,"3-7 Pax":145,"8-10 Pax":165},"oneway":{"1-2 Pax":90,"3-7 Pax":95,"8-10 Pax":105},"airportRound":{"1-2 Pax":185,"3-7 Pax":195,"8-10 Pax":215},"airportOneWay":{"1-2 Pax":115,"3-7 Pax":120,"8-10 Pax":130},"shared":{"oneway":0,"round":0},headerMsg:"<p>Your destination is the beautiful Port of Calica.</p>"},"paamul":{"round":{"1-2 Pax":150,"3-7 Pax":155,"8-10 Pax":165},"oneway":{"1-2 Pax":95,"3-7 Pax":100,"8-10 Pax":105},"airportRound":{"1-2 Pax":200,"3-7 Pax":205,"8-10 Pax":215},"airportOneWay":{"1-2 Pax":120,"3-7 Pax":125,"8-10 Pax":130},"shared":{"oneway":0,"round":0},headerMsg:"<p>Your destination is beautiful Paamul.</p>"},"xpu ha":{"round":{"1-2 Pax":150,"3-7 Pax":155,"8-10 Pax":165},"oneway":{"1-2 Pax":95,"3-7 Pax":100,"8-10 Pax":105},"airportRound":{"1-2 Pax":200,"3-7 Pax":205,"8-10 Pax":215},"airportOneWay":{"1-2 Pax":120,"3-7 Pax":125,"8-10 Pax":130},"shared":{"oneway":35,"round":70},headerMsg:"<p>Your destination is beautiful Xpu Ha.</p>"},"akumal":{"round":{"1-2 Pax":170,"3-7 Pax":180,"8-10 Pax":195},"oneway":{"1-2 Pax":105,"3-7 Pax":110,"8-10 Pax":115},"airportRound":{"1-2 Pax":220,"3-7 Pax":230,"8-10 Pax":245},"airportOneWay":{"1-2 Pax":130,"3-7 Pax":135,"8-10 Pax":140},"shared":{"oneway":35,"round":70},headerMsg:"<p>Your destination is beautiful Akumal.</p>"},"tankah":{"round":{"1-2 Pax":190,"3-7 Pax":195,"8-10 Pax":215},"oneway":{"1-2 Pax":110,"3-7 Pax":115,"8-10 Pax":125},"airportRound":{"1-2 Pax":240,"3-7 Pax":245,"8-10 Pax":265},"airportOneWay":{"1-2 Pax":135,"3-7 Pax":140,"8-10 Pax":150},"shared":{"oneway":0,"round":0},headerMsg:"<p>Your destination is beautiful Tankah.</p>"},"tulum":{"round":{"1-2 Pax":190,"3-7 Pax":195,"8-10 Pax":215},"oneway":{"1-2 Pax":110,"3-7 Pax":115,"8-10 Pax":125},"airportRound":{"1-2 Pax":240,"3-7 Pax":245,"8-10 Pax":265},"airportOneWay":{"1-2 Pax":135,"3-7 Pax":140,"8-10 Pax":150},"shared":{"oneway":35,"round":70},headerMsg:"<p>Your destination is beautiful Tulum.</p>"},"tulum hotel zone":{"round":{"1-2 Pax":195,"3-7 Pax":200,"8-10 Pax":220},"oneway":{"1-2 Pax":115,"3-7 Pax":120,"8-10 Pax":130},"airportRound":{"1-2 Pax":245,"3-7 Pax":250,"8-10 Pax":270},"airportOneWay":{"1-2 Pax":140,"3-7 Pax":145,"8-10 Pax":155},"shared":{"oneway":35,"round":70},headerMsg:"<p>Your destination is the beautiful Tulum Hotel Zone.</p>"},"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":638,"3-7 Pax":772,"8-10 Pax":772},"airportOneWay":{"1-2 Pax":319,"3-7 Pax":386,"8-10 Pax":386},"shared":{"oneway":0,"round":0},headerMsg:"<p>Your destination is beautiful Holbox.</p>"},"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":638,"3-7 Pax":772,"8-10 Pax":772},"airportOneWay":{"1-2 Pax":319,"3-7 Pax":386,"8-10 Pax":386},"shared":{"oneway":0,"round":0},headerMsg:"<p>Your destination is beautiful Chiquila.</p>"},"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":650,"3-7 Pax":772,"8-10 Pax":772},"airportOneWay":{"1-2 Pax":325,"3-7 Pax":386,"8-10 Pax":386},"shared":{"oneway":0,"round":0},headerMsg:"<p>Your destination is beautiful Valladolid.</p>"},"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":878,"3-7 Pax":878,"8-10 Pax":1000},"airportOneWay":{"1-2 Pax":439,"3-7 Pax":439,"8-10 Pax":500},"shared":{"oneway":0,"round":0},headerMsg:"<p>Your destination is beautiful Boca Paila.</p>"},"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":700,"3-7 Pax":700,"8-10 Pax":900},"airportOneWay":{"1-2 Pax":400,"3-7 Pax":400,"8-10 Pax":500},"shared":{"oneway":0,"round":0},headerMsg:"<p>Your destination is beautiful Chichen Itza.</p>"},"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":824,"3-7 Pax":1038,"8-10 Pax":1038},"airportOneWay":{"1-2 Pax":412,"3-7 Pax":519,"8-10 Pax":519},"shared":{"oneway":0,"round":0},headerMsg:"<p>Your destination is beautiful Merida.</p>"},"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":878,"3-7 Pax":1170,"8-10 Pax":1170},"airportOneWay":{"1-2 Pax":439,"3-7 Pax":585,"8-10 Pax":585},"shared":{"oneway":0,"round":0},headerMsg:"<p>Your destination is beautiful Chetumal.</p>"},"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":1100,"3-7 Pax":1100,"8-10 Pax":1200},"airportOneWay":{"1-2 Pax":600,"3-7 Pax":600,"8-10 Pax":700},"shared":{"oneway":0,"round":0},headerMsg:"<p>Your destination is beautiful Costa Maya.</p>"}};function initAll(){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");}$("#reserve-shared").bind("click",function(e){$('html, body').animate({scrollTop:200},'slow');if($("#tripType").css("display")=="block"){resType="shared shuttle";var tripTypeIndex=document.getElementById("tripMenuID").selectedIndex;removeAllChildren("tripType");if(document.getElementById("CarInfoId")){deleteElementByID("CarInfoId");}if(offerMsg!==" "){document.getElementById("tenPercent").innerHTML=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";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){$('html, body').animate({scrollTop:200},'slow');if($("#tripType").css("display")==="block"){resType="private";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";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);}}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 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");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];var roundAirPrice=CShuttlePList[destino].airportRound[vehicleType];var oneSave=oneAirPrice-onePrice;var roundSave=roundAirPrice-roundPrice;var beSafeOne=0;var beSafeRound=0;finalOne=onePrice;finalRound=roundPrice;var priceContent="<h3>Private Transportation<br/>(Price Per Vehicle in US Dollars)</h3><table width='100%'border='0'><tr><td width='30%'></td><th width='15%'>One Way</th><th width='15%'>Round Trip</th><td width='40%'></td></tr><tr><td class='tText'><span class='pricePer'>Price at the airport:</span></td><td class='demPrice'>"+"$"+oneAirPrice.toFixed(2)+"</td><td class='demPrice'>"+"$"+roundAirPrice.toFixed(2)+"</td><td></td></tr><tr><td class='tText'>Online Discount:</td><td>"+"-$"+oneSave.toFixed(2)+"</td><td>"+"-$"+roundSave.toFixed(2)+"</td><td></td></tr></tr><tr><td class='tText rPrice'>Total Online Price:</td><td class='rPrice emPrice'>"+"$"+finalOne.toFixed(2)+"</td><td class='rPrice emPrice'>"+"$"+finalRound.toFixed(2)+"</td><td class='promo-msg'>(Your Best Option)</td></tr></table>";document.getElementById("privatePrices").innerHTML=priceContent;if(oneWayTotal>onePrice){document.getElementById("priv-recommend").className="show";$("td.promo-msg").css("display","block");}else{document.getElementById("priv-recommend").className="";}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);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);if(oneWayTotal>onePrice){$("#see-priv").css("display","block");}else{$("#see-priv").css("display","none");}var priceContent="<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";}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(($("#flightInfo").css("display:block"))){}addH3("flightInfo","You need to choose a round trip or one way to continue","warningMsg");$("#carType").removeClass("show");}else{alert("error on genLastSection");}}else{$("#flightInfo").fadeIn("slow");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 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","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");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 customerName=dynform.cname.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(customerName===""){eraseRoundWarnings();$("#cnameWarning").show();$('html, body').animate({scrollTop:0},'slow');dynform.cname.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(customerName===""){eraseOneWayWarnings();$("#cnameWarning").show();$('html, body').animate({scrollTop:0},'slow');dynform.cname.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(){$("#cnameWarning").hide();document.getElementById("infoTransferWarning").innerHTML="";document.getElementById("flightWarningMsg").innerHTML="";document.getElementById("flightWarningMsg").className="";}function eraseRoundWarnings(){$("#cnameWarning").hide();if(document.getElementById("ArrivalWarningMsg"))document.getElementById("ArrivalWarningMsg").innerHTML="";if(document.getElementById("DepartureWarningMsg"))document.getElementById("DepartureWarningMsg").innerHTML="";if(document.getElementById("ArrivalWarningMsg"))document.getElementById("ArrivalWarningMsg").className="";if(document.getElementById("DepartureWarningMsg"))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=" ";document.getElementById("tenPercent").innerHTML=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;}