IE=false,AOL=false,SF=false,MZ=false;if(navigator.appName=="Microsoft Internet Explorer"){IE=true;if(navigator.userAgent.indexOf("AOL")>=0)AOL=true;}
else if(navigator.userAgent.indexOf("Safari")>=0)SF=true;else if(navigator.appName=="Netscape")MZ=true;winOS=(navigator.platform.substring(0,3)=="Win");winIE=(winOS&&IE);macOS=(navigator.platform.substring(0,3)=="Mac");macIE=(macOS&&IE);theHost=document.location.hostname;theHostLC=theHost.toLowerCase();local=(theHostLC.length==0||theHostLC=="127.0.0.1"||theHostLC=="localhost"),live=!local;qStr=unescape(document.location.search).substring(1);var NowG=new Date();var TodayG=new Date(NowG.getFullYear(),NowG.getMonth(),NowG.getDate());var todayG=TodayG.getTime();function getEmailLink(recipient,subject,message){return "";}
function getVal(key){var value=null;var strToSearch=this.toString();var KeyVals=strToSearch.split("&");for(member in KeyVals){var ThisPair=KeyVals[member].split("=");if(key==ThisPair[0]){value=ThisPair[1];break;}}
if(typeof value=="undefined")value="";return value;}
String.prototype.getVal=getVal;function getFinancialFormat(moneyIn,showZeroCents,noDollarSign){var moneyOut="";moneyIn=moneyIn.toFixed(2);var moneyInStr=moneyIn.toString();var Money=moneyInStr.split(".");var dollars=Money[0],cents=Money[1];var Dollars=new Array();var counter=0;for(var i=dollars.length-1;i>=0;i--){counter++;Dollars.push(dollars.charAt(i));if(counter%3==0&&i)Dollars.push(",");}
if(!noDollarSign)Dollars.push("$");Dollars.reverse();if(showZeroCents)cents="."+cents;else cents=(cents=="00")?"":"."+cents;moneyOut=Dollars.join("")+cents;return moneyOut;}
function cleanIt(){var out=this.toString();out=out.replace(/<span>.*?<\/span>/gi, "" );
out=out.replace(/\^/g, "\"" ).replace(/^\s+$/g, "" );
return out;}
String.prototype.cleanIt=cleanIt;function writeFactSheetDataFile(){dataFile=(qStr&&qStr.getVal("db"))?qStr.getVal("db"):"";if(dataFile){var server=(live)?"http://www.luxuryvacationestates.com/":"../";document.write("<scr"+"ipt language='javascript1.2' src='"+server+"calendar/rThPo3eWx.js'><\/scr"+"ipt>");document.write("<scr"+"ipt language='javascript1.2' src='"+server+"data/"+dataFile+"'><\/scr"+"ipt>");var villaID=dataFile.replace(/^fs-.+-/, "" );
document.write("\n<scr"+"ipt language='javascript1.2' src='"+server+"db/"+villaID+"'><\/scr"+"ipt>");document.write("\n<scr"+"ipt language='javascript1.2' src='"+server+"db/global_data.js'><\/scr"+"ipt>");}}
VillasHT=new Array();villaID="";setting="";function initializeData(){if(!window.CALENDAR_RECORDS){var server=(live)?"http://www.luxuryvacationestates.com/":"../";document.write("<scr"+"ipt language='javascript1.2' src='"+server+"calendar/rThPo3eWx.js'><\/scr"+"ipt>");}
if(window.Villa){villaID=Villa["ID"];Villas.length=Villas.length-1;for(var i=0;i<Villas.length;i++){if(Villas[i][0]==villaID){Villas[i][1]=Villas[i][1].cleanIt();Villas[i][2]=Villas[i][2].cleanIt();setting=Villas[i][11];var id=Villas[i][0];VillasHT[id]=Villas[i];break;}}}
else
alert("ERROR: Unable to locate data file. Please make sure that the villa specific data file (fs-*.js) you are referencing in the query string portion of the URL ("+document.location.href+") is referencing a valid data file on our server at http://www.luxuryvacationestates.com/data/");}
function writeListings(agentName,fsFileName,tableAlignment){try{var output="<tr><td colspan='9'></td><td class='HeaderCellRow1TVV'>Rate/Nt</td><td class='HeaderCellRow1TVV'>Max</td></tr><tr><td class='HeaderCellRow2TVV'>Property Name</td><td class='HeaderCellRow2TVV'>Location</td><td class='HeaderCellRow2TVV'>Island</td><td class='HeaderCellRow2TVV'>Setting</td><td class='HeaderCellRow2TVV'>Bdrm</td><td class='HeaderCellRow2TVV'>Bath</td><td class='HeaderCellRow2TVV'>Pool</td><td class='HeaderCellRow2TVV'>Spa</td><td class='HeaderCellRow2TVV'>A/C</td><td class='HeaderCellRow2TVV'>From</td><td class='HeaderCellRow2TVV'>Occ</td></tr>";var ThisAgent=Agent[agentName];if(ThisAgent){Villas.length=Villas.length-1;for(var i=0;i<Villas.length;i++){Villas[i][1]=Villas[i][1].cleanIt();Villas[i][2]=Villas[i][2].cleanIt();var id=Villas[i][0];VillasHT[id]=Villas[i];}
var FactSheets=ThisAgent[2];for(var i=0;i<FactSheets.length-1;i++){var factSheet=FactSheets[i][0];var villaID=factSheet.replace(/^fs-.+-/, "" ).replace(/\.js$/, "" );
output+="<tr "+((i%2)?"class='AlternatingRow'":"")+"><td class='DataCellTVV'><a href='"+fsFileName+"?db="+factSheet+"' class='LinkTVV'>"+VillasHT[villaID][1]+"</a></td><td class='DataCellTVV'>"+VillasHT[villaID][2]+"</td><td class='DataCellTVV'>"+eval("window.Island."+VillasHT[villaID][3])+"</td><td class='DataCellTVV'>"+eval("window.Setting."+VillasHT[villaID][11])+"</td><td class='DataCellTVV'>"+((VillasHT[villaID][4][0]==VillasHT[villaID][4][1])?VillasHT[villaID][4][0]:VillasHT[villaID][4][0]+"-"+VillasHT[villaID][4][1])+"</td><td class='DataCellTVV'>"+((VillasHT[villaID][5][0]==VillasHT[villaID][5][1])?VillasHT[villaID][5][0]:VillasHT[villaID][5][0]+"-"+VillasHT[villaID][5][1])+"</td><td class='DataCellTVV'>"+((VillasHT[villaID][6])?"Yes":"No")+"</td><td class='DataCellTVV'>"+((VillasHT[villaID][7])?"Yes":"No")+"</td><td class='DataCellTVV'>"+((VillasHT[villaID][8])?"Yes":"No")+"</td><td class='DataCellTVV'>"+((VillasHT[villaID][9][0]==VillasHT[villaID][9][1])?"$"+VillasHT[villaID][9][0]:"$"+VillasHT[villaID][9][0]+"-"+VillasHT[villaID][9][1])+"</td><td class='DataCellTVV'>"+((VillasHT[villaID][10][0]==VillasHT[villaID][10][1])?VillasHT[villaID][10][0]:VillasHT[villaID][10][0]+"-"+VillasHT[villaID][10][1])+"</td></tr><tr><td colspan='11' style='line-height:3px;'> &nbsp;<br></td></tr>";}
document.write("<table align='"+tableAlignment+"' border='0' cellspacing='0' cellpadding='0'>"+output+"</table>");}
else
document.write("<div style='color:red;'>Error at writeListings function. 1st argument, your company name, \""+agentName+"\" cannot be found in the data-base at Tropical Villa Vacations. Please make sure you set the 1st argument to your exact company name on file at Tropical Villa Vacations. To get your company name, log-in to your <a href='http://www.hawaiitropicalvillavacations.com/'>agent homepage</a> and note the company name that we greet you by! If you are unable to resolve this problem, contact Tropical Villa Vacations for assistance.</div>");}
catch(Err){output="<b style='color:red;'>Exception Caught in writeListings( agentName, fsFileName, tableAlignment ) function</b>:<br><br>";for(var i in Err)output+=i+": "+Err[i]+"<br>";document.write(output);}}
function getData(fieldName){var output="";var noErr=true;var index=-1;if(fieldName=="Setting"||fieldName=="Name"||fieldName=="Loc"||fieldName=="Island"||fieldName=="Bdrm"||fieldName=="Bath"||fieldName=="MaxOcc"||fieldName=="Pool"){var inheritanceKey=Villa[fieldName][0];switch(fieldName){case "Name":index=1;if(inheritanceKey==0)output=Villa[fieldName][1];else if(inheritanceKey==1)output=VillasHT[villaID][index];else output=VillasHT[villaID][index]+" "+Villa[fieldName][1];break;case "Loc":index=2;if(inheritanceKey==0)output=Villa[fieldName][1];else if(inheritanceKey==1)output=VillasHT[villaID][index];else output=VillasHT[villaID][index]+" "+Villa[fieldName][1];break;case "Island":index=3;VillasHT[villaID][3]=Island[VillasHT[villaID][3]];if(inheritanceKey==0)output=Villa[fieldName][1];else if(inheritanceKey==1)output=VillasHT[villaID][index];else output=VillasHT[villaID][index]+" "+Villa[fieldName][1];break;case "Setting":index=11;VillasHT[villaID][11]=Setting[VillasHT[villaID][11]];if(inheritanceKey==0)output=Villa[fieldName][1];else if(inheritanceKey==1)output=VillasHT[villaID][index];else output=VillasHT[villaID][index]+" "+Villa[fieldName][1];break;case "Bdrm":index=4;if(inheritanceKey==0)output=Villa[fieldName][1];else{if(VillasHT[villaID][index][0]==VillasHT[villaID][index][1])output=VillasHT[villaID][index][0]+" Bedrooms";else
output=VillasHT[villaID][index][0]+" - "+VillasHT[villaID][index][1]+" Bedrooms";if(inheritanceKey==2)output=output+" "+Villa[fieldName][1];}
break;case "Bath":index=5;if(inheritanceKey==0)output=Villa[fieldName][1];else{if(VillasHT[villaID][index][0]==VillasHT[villaID][index][1])output=VillasHT[villaID][index][0]+" Bathrooms";else
output=VillasHT[villaID][index][0]+" - "+VillasHT[villaID][index][1]+" Bathrooms";if(inheritanceKey==2)output=output+" "+Villa[fieldName][1];}
break;case "MaxOcc":index=10;if(inheritanceKey==0)output=Villa[fieldName][1];else{if(VillasHT[villaID][index][0]==VillasHT[villaID][index][1])output=VillasHT[villaID][index][0]+" Guests";else
output=VillasHT[villaID][index][0]+" - "+VillasHT[villaID][index][1]+" Guests";if(inheritanceKey==2)output=output+" "+Villa[fieldName][1];}
break;case "Pool":index=6;if(inheritanceKey==0)output=Villa[fieldName][1];else{output=(VillasHT[villaID][index])?"Yes":"No";if(inheritanceKey==2)output=output+" "+Villa[fieldName][1];}
break;default:output="<div style='color:red;'>Switch/Case Error at writeData function while processing index. A matching case for fieldName \""+fieldName+"\" not found.</div>";noErr=false;}}
else{try{switch(fieldName){case "Deposit":output=getFinancialFormat(OtherFees_TVV.SecDep);break;case "OutClean":var cleanOut="";if(OtherFees_TVV.Cleaning.Included){if(OtherFees_TVV.Cleaning.Max)cleanOut="Included up to "+getFinancialFormat(OtherFees_TVV.Cleaning.Max);else
cleanOut="Included";}
else{cleanOut=getFinancialFormat(OtherFees_TVV.Cleaning.Fee);cleanOut+=" + GET Tax";}
output=cleanOut;break;case "Rate":var GetOut=new Array();var TatOut=new Array();for(var i=0;i<GET_TVV.length-1;i++)GetOut.push([GET_TVV[i][0],GET_TVV[i][1][0]+"/"+GET_TVV[i][1][1]+"/"+GET_TVV[i][1][2]]);for(var i=0;i<TAT_TVV.length-1;i++)TatOut.push([TAT_TVV[i][0],TAT_TVV[i][1][0]+"/"+TAT_TVV[i][1][1]+"/"+TAT_TVV[i][1][2]]);var Htm=new Array();var perWkCol=false,perMoCol=false,notesCol=false;var counter=0;for(var i=0;i<Rates_TVV.length-1;i++){var Rate=Rates_TVV[i];var EndDate=new Date(Rate[2][5]+2000,Rate[2][3]-1,Rate[2][4]);var endDate=EndDate.getTime();if(endDate>=todayG){counter++;var rowCls=(counter%2)?" class='AlternatingRow'":"";Htm.push("<tr");Htm.push(rowCls);Htm.push(" style='vertical-align:top;'>");var tit=Rate[0];Htm.push("<td class='' style='text-align:right; padding:2px 10px 2px 10px;'>");Htm.push((tit)?tit:"&#151;");Htm.push("</td>");var beg=Rate[2][0]+"/"+Rate[2][1]+"/"+Rate[2][2];Htm.push("<td class='' style='text-align:right; padding:2px 10px 2px 10px;'>");Htm.push(beg);Htm.push("</td>");Htm.push("<td class='' style='padding:2px 0px 2px 0px;'>");Htm.push("-");Htm.push("</td>");var end=Rate[2][3]+"/"+Rate[2][4]+"/"+Rate[2][5];Htm.push("<td class='' style='text-align:left; padding:2px 10px 2px 10px;'>");Htm.push(end);Htm.push("</td>");var per_Nt=Rate[3][0];Htm.push("<td class='' style='text-align:right; padding:2px 10px 2px 10px;'>");Htm.push((per_Nt)?getFinancialFormat(parseFloat(per_Nt)):"&#151;");Htm.push("</td>");var per_Wk=Rate[3][1];if(per_Wk){Htm.push("<td class='' style='text-align:right; padding:2px 10px 2px 10px;'>");Htm.push(getFinancialFormat(parseFloat(per_Wk)));Htm.push("</td>");perWkCol=true;}
else
Htm.push("<td class=''></td>");var per_Mo=Rate[3][2];if(per_Mo){Htm.push("<td class='' style='text-align:right; padding:2px 10px 2px 10px;'>");Htm.push(getFinancialFormat(parseFloat(per_Mo)));Htm.push("</td>");perMoCol=true;}
else
Htm.push("<td class=''></td>");var min_Stay=Rate[4];Htm.push("<td class='' style='text-align:right; padding:2px 10px 2px 10px;'>");Htm.push(min_Stay);Htm.push("</td>");var notes=Rate[5];if(notes){Htm.push("<td class='' style='text-align:left; padding:2px 10px 2px 10px;'>");Htm.push(notes);Htm.push("</td>");notesCol=true;}
else
Htm.push("<td class=''></td>");Htm.push("</tr>");}}
if(counter==0){Htm.push("<tr class='AlternatingRow' style='vertical-align:top;'>");Htm.push("<td class='' align='center' colspan='9'>Please inquire for rates</td>");Htm.push("</tr>");}
var Head=new Array();Htm.push("<table border='0' cellpadding='0' cellspacing='0' style='margin-top:10px;'>");Htm.push("<tbody>");Head.push("<tr>");Head.push("<td class='' style='text-align:right; padding:0px 10px 8px 10px; vertical-align:bottom; font-variant:small-caps; text-decoration:underline;'>Period</td>");Head.push("<td class='' style='text-align:right; padding:0px 10px 8px 10px; vertical-align:bottom; font-variant:small-caps; text-decoration:underline;'>From</td>");Head.push("<td class=''></td>");Head.push("<td class='' style='text-align:left; padding:0px 10px 8px 10px; vertical-align:bottom; font-variant:small-caps; text-decoration:underline;'>To</td>");Head.push("<td class='' style='text-align:right; padding:0px 10px 8px 10px; vertical-align:bottom; font-variant:small-caps; text-decoration:underline;'>Per Nt</td>");if(perWkCol)Head.push("<td class='' style='text-align:right; padding:0px 10px 8px 10px; vertical-align:bottom; font-variant:small-caps; text-decoration:underline;'>Per Wk</td>");else
Head.push("<td class=''></td>");if(perMoCol)Head.push("<td class='' style='text-align:right; padding:0px 10px 8px 10px; vertical-align:bottom; font-variant:small-caps; text-decoration:underline;'>Per Mo</td>");else
Head.push("<td class=''></td>");Head.push("<td class='' style='text-align:right; padding:0px 10px 8px 10px; vertical-align:bottom; font-variant:small-caps;'>Min<div style='text-decoration:underline;'>Stay</div></td>");if(notesCol)Head.push("<td class='' style='text-align:left; padding:0px 10px 8px 10px; vertical-align:bottom; font-variant:small-caps; text-decoration:underline;'>Notes</td>");else
Head.push("<td class=''></td>");Head.push("</tr>");var head=Head.join("");Htm.unshift(head);Htm.unshift("<table border='0' cellpadding='0' cellspacing='0' style='margin-top:10px;'><tbody>");Htm.push("</tbody></table>");Htm.push("<div style='margin:20px 0px 20px 0px;'>");Htm.push("Rates are plus General Excise Taxes (GET) & Transient Accommodations Taxes (TAT):");Htm.push("<div style='margin:2px 0px 20px 15px;'>");Htm.push("GET is ");for(var k=0;k<GetOut.length;k++){Htm.push(GetOut[k][0]);Htm.push("%");if(GetOut.length>1){if(k>0){Htm.push(" on ");Htm.push(GetOut[k][1]);}
Htm.push(", ");}}
Htm[Htm.length-1]=Htm[Htm.length-1].replace(/, /, "" );
Htm.push(" and TAT is ");for(var k=0;k<TatOut.length;k++){Htm.push(TatOut[k][0]);Htm.push("%");if(TatOut.length>1){if(k>0){Htm.push(" on ");Htm.push(TatOut[k][1]);}
Htm.push(", ");}}
Htm[Htm.length-1]=Htm[Htm.length-1].replace(/, /, "" );
Htm.push("</div>");if(OtherFees_TVV.ResortFee){Htm.push("Resort Fee:");Htm.push("<div style='margin:2px 0px 20px 15px;'>");if(isNaN(OtherFees_TVV.ResortFee))Htm.push(OtherFees_TVV.ResortFee);else
Htm.push(getFinancialFormat(OtherFees_TVV.ResortFee));Htm.push(" + GE Tax");Htm.push("</div>");}
Htm.push("</div>");var rate_Notes_Additional=Property_TVV.Rate_Notes_Additional;rate_Notes_Additional=rate_Notes_Additional.replace(/(<span>).*?(<\/span>)/gi, "" );
rate_Notes_Additional=rate_Notes_Additional.replace(/(<br\/*>){3,}/gi, "<br/><br/>" ); //*/
Htm.push(rate_Notes_Additional);output=Htm.join("");break;case "RateOtherVar":var Htm=new Array();var RSFOut=new Array();for(var i=0;i<RSF_TVV.length-1;i++)RSFOut.push([RSF_TVV[i][0],RSF_TVV[i][1][0]+"/"+RSF_TVV[i][1][1]+"/"+RSF_TVV[i][1][2]]);Htm.push("<span>A ");for(var k=0;k<RSFOut.length;k++){Htm.push(getFinancialFormat(RSFOut[k][0]));if(RSFOut.length>1){if(k>0){Htm.push(" on ");Htm.push(RSFOut[k][1]);}
Htm.push(", ");}}
Htm[Htm.length-1]=Htm[Htm.length-1].replace(/, /, "" );
Htm.push(" Reservation Service Fee will be collected with the initial payment.</span>");output=Htm.join("");break;case "MinStay":output="";break;default:output=Villa[fieldName];}
if(typeof output!="string")output="<div style='color:red;'>Error processing data for field-name \""+fieldName+"\". This Villa does not have a field by this name. Please see our <a href='http://www.luxuryvacationestates.com/instructions/live-data-feed.html' style='text-decoration:underline;'>live-feed instructions</a> page for a complete list of available field names.</div>";}
catch(Err){output="<b style='color:red;'>Exception Caught in getData function</b>:<br><br>";for(var i in Err)output+=i+": "+Err[i]+"<br>";output+="<br>Please make sure that the data file you are referencing in the query string portion of the URL ("+document.location.href+") is referencing a valid data file on our server at <nobr>http://www.luxuryvacationestates.com/data/</nobr>";}}
output=output.toString();output=output.cleanIt();return output;}
function writeImages(resize,showPhotoCredit){if(resize&&!isNaN(resize))resize=resize/100;if(window.Images){var imgFolder="http://www.luxuryvacationestates.com/images/"+setting+"-"+Villa["ID"]+"/";var localMsg="";if(local&&Images.length>3){localMsg="<div><b>Note</b>: To speed up load time, only 2 images display when running locally...</div>";Images=Images.slice(0,3);}
var Htm=new Array(Images.length);for(var i=0;i<Images.length-1;i++){if(!Images[i][4]){var wid=(resize)?parseInt(Images[i][1]*resize):Images[i][1];var hgt=(resize)?parseInt(Images[i][2]*resize):Images[i][2];var visibleImageHgt=(showPhotoCredit)?hgt:parseInt(hgt*.92);Htm.push("<div style='width:100%; height:"+visibleImageHgt+"px; overflow:hidden; margin:30px 0px 2px 0px;'><img src='"+imgFolder+Images[i][0]+"' style='width:"+wid+"px; height:"+hgt+"px; margin:0px 0px 0px 0px;'></div><div style='width:"+wid+"px;'>"+Images[i][3].cleanIt()+"</div>");}}
document.write(localMsg+Htm.join(""));}}
function getImageArray(){alert("Sorry, the getImageArray function is not ready for prime time - please contact us and we will set it up for you!");}
var gToday=new Date();var gThisYear=gToday.getFullYear();var gThisMonth=gToday.getMonth()+1;var gThisDay=gToday.getDate();tip=new Array();tip["confirmed"]="Reservation is confirmed";tip["pending"]="Reservation is pending";tip["flexible"]="Reserved with flexible dates";tip["available"]="Date is available for check-in";tip["err"]="ERROR: The Calendar Is Unable To Display Because A Data Error Has Been Detected";tip["init"]="Initializing Data-Base Engine...";function writeCalendar(otherCSS){var css="<style>.calBookedTVV { color:rgb( 102,102,102 ); text-decoration: line-through; }.calDates { cursor:default; }.calKeyBg{ background-color:rgb( 230,230,230 ); }.calFlexible{ color:rgb( 51,51,255 ); text-decoration: line-through; }.calPending{ color:rgb( 255,102,0 ); text-decoration: line-through; }.calPinLine { border:1px solid rgb( 51,51,51 ); }.calRow{ color:rgb( 0,0,0 ); font-family:Arial, Helvetica; background-color:rgb( 230,230,230 ); padding:1px 6px 1px 6px; }.fSize12{ font-size:12pt; }.fSize11{ font-size:11pt; }</style>";otherCSS=(otherCSS)?"<style>"+otherCSS+"</style>":"";document.write(css+otherCSS);writeCalKeys();document.write(getSinglePropCal());}
function getMonthName(index,fullName){index=parseInt(index);var arrMonth=new Array("January","February","March","April","May","June","July","August","September","October","November","December");var monName=arrMonth[index-1];if(fullName)return arrMonth[index-1];else return arrMonth[index-1].substring(0,3);}
function isLeapYear(theYear){var leapYear=false;if(theYear%4!=0)leapYear=false;else if(theYear%400==0)leapYear=true;else if(theYear%100==0)leapYear=false;else leapYear=true;return leapYear;}
function getNumDaysInMonth(month,year){var nDays=31;if(month==4||month==6||month==9||month==11)nDays=30;else if(month==2)nDays=(isLeapYear(year))?29:28;return nDays;}
function getDayOfWeek(index,abbrev){var arrWeekDay=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var theDay=(abbrev)?arrWeekDay[index].substring(0,3):arrWeekDay[index];return theDay;}
function writeCalKeys(){var pName=VillasHT[villaID][1].cleanIt();var html="";html+="<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><FIELDSET CLASS='pinLine'><LEGEND ALIGN='center'><SPAN style='font-size:12pt;'>&nbsp;"+pName+" Calendar&nbsp;</SPAN></LEGEND>";html+="<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=550><TR><TD ALIGN=left style='font-size:10pt;'><UL><LI STYLE='margin:0px 0px 4px 0px;'>Reserved reservation dates are designated: <NOBR><SPAN CLASS='calDates calBookedTVV calKeyBg' TITLE='"+tip.confirmed+"'>1 2 3 4 5 6 7</SPAN></NOBR><LI STYLE='margin:0px 0px 4px 0px;'>Pending reservation dates are designated: <NOBR><SPAN CLASS='calDates calPending calKeyBg' TITLE='"+tip.pending+"'>1 2 3 4 5 6 7</SPAN></NOBR><LI STYLE='margin:0px 0px 4px 0px;'>Reserved reservation with flexible dates which may be re-assigned are designated: <NOBR><SPAN CLASS='calDates calFlexible calKeyBg' TITLE='"+tip.flexible+"'>1 2 3 4 5 6 7</SPAN>,</NOBR> please inquire if interested<LI>All other dates are available for check-in & designated: <NOBR><SPAN CLASS='calDates' style='font-size:10pt;' TITLE='"+tip.available+"'>1 2 3 4 5 6 7</SPAN></NOBR></UL></TD></TR></TABLE>";html+="</FIELDSET></TD></TR></TABLE><BR>";if(!IE)html+="<BR>";document.write(html);}
function showTip(index,theSpan,event){if(typeof index=="number"){switch(index){case 0:index="confirmed";break;case 1:index="pending";break;case 2:index="flexible";break;case 3:index="available";break;}}
var msg=tip[index];self.status=msg;theSpan.title=msg;event.cancelBubble=true;return true;}
function getWinWid(){return winWid=(document.body.clientWidth)?document.body.clientWidth:window.innerWidth;}
function getSinglePropCal(){if(!window.CALENDAR_RECORDS)alert("Calendar data is nonexistent or corrupted and cannot be read by the data-base engine.");self.status=tip["init"];var fontSizeClass=(getWinWid()>830)?"fSize12":"fSize11";var nPropsTotal=CALENDAR_RECORDS.length-1;var id=villaID;var html="";var hSpacer="<TR><TD COLSPAN='2' HEIGHT='2'><!-- PLACE HOLDER --></TD></TR>";var recordFound=false;var lastUpdated="";for(var recordNum=0;recordNum<nPropsTotal;recordNum++){var ThisRecord=CALENDAR_RECORDS[recordNum];if(ThisRecord[7])lastUpdated="<div style='font-size:9pt;'>This Calendar Last Updated on "+new Date(ThisRecord[7][1]).toLocaleString()+"</div>";self.status="Please wait: Scanning record: "+(recordNum+1)+" of "+nPropsTotal;var propID=ThisRecord[2];if(id==propID){recordFound=true;var propType=ThisRecord[1];var nDaysOutAutoBook=ThisRecord[6];var DateArr=null;var errMsg="";if(nDaysOutAutoBook){var todayMS=gToday.getTime();var nDaysOutAutoBookMS=24*60*60*nDaysOutAutoBook*1000;var AutoBookStartDate=new Date(todayMS+nDaysOutAutoBookMS);var twoYearsOut=todayMS+nDaysOutAutoBookMS+(24*60*60*365*2*1000);var AutoBookEndDate=new Date(twoYearsOut);var VirtualBooking=[[AutoBookStartDate.getMonth()+1,AutoBookStartDate.getDate(),AutoBookStartDate.getFullYear()-2000,AutoBookEndDate.getMonth()+1,AutoBookEndDate.getDate(),AutoBookEndDate.getFullYear()-2000],[AutoBookStartDate.getMonth()+1,AutoBookStartDate.getDate(),AutoBookStartDate.getFullYear()-2000,AutoBookEndDate.getMonth()+1,AutoBookEndDate.getDate(),AutoBookEndDate.getFullYear()-2000],1,0,"Nobody","This is an auto-generated reservation which was created because this property is for sale. It begins "+nDaysOutAutoBook+" days out from today.",[0,0,0]];if(typeof ThisRecord[9]=="object"){DateArr=ThisRecord.slice(9);var LastBooking=DateArr[DateArr.length-1];var ckOutLastBookingMS=new Date(LastBooking[0][5]+2000,LastBooking[0][3]-1,LastBooking[0][4]).getTime();var autoBookStartDateMS=AutoBookStartDate.getTime();if(ckOutLastBookingMS<=autoBookStartDateMS)DateArr[DateArr.length]=VirtualBooking;else{errMsg="ERROR: An existing booking ending on "+LastBooking[0][3]+"/"+LastBooking[0][4]+"/"+LastBooking[0][5]+" conflicts with the virtual for-sale booking starting on "+VirtualBooking[0][0]+"/"+VirtualBooking[0][1]+"/"+VirtualBooking[0][2];}}
else
ThisRecord[9]=VirtualBooking;}
if(!DateArr)DateArr=ThisRecord.slice(9);var nDates=DateArr.length;var noBookings=(nDates==0);var BookType=new Array(nDates);var BegBookMon=new Array(nDates);var BegBookDate=new Array(nDates);var BegBookYr=new Array(nDates);var BegDate=new Array(nDates);var EndBookMon=new Array(nDates);var EndBookDate=new Array(nDates);var EndBookYr=new Array(nDates);var EndDate=new Array(nDates);var carryForwardPriorMon=false;for(var dateRecCounter=0;dateRecCounter<nDates;dateRecCounter++){var Booking=DateArr[dateRecCounter];if(Booking!=0){BookType[dateRecCounter]=Booking[2];BegBookMon[dateRecCounter]=Booking[0][0];BegBookDate[dateRecCounter]=Booking[0][1];BegBookYr[dateRecCounter]=Booking[0][2]+2000;BegDate[dateRecCounter]=new Date(BegBookYr[dateRecCounter],BegBookMon[dateRecCounter]-1,BegBookDate[dateRecCounter]);EndBookMon[dateRecCounter]=Booking[0][3];EndBookDate[dateRecCounter]=Booking[0][4];EndBookYr[dateRecCounter]=Booking[0][5]+2000;EndDate[dateRecCounter]=new Date(EndBookYr[dateRecCounter],EndBookMon[dateRecCounter]-1,EndBookDate[dateRecCounter]);var FirstDayThisMonth=new Date(gThisYear,gThisMonth-1,1);if(!carryForwardPriorMon){carryForwardPriorMon=(BegDate[dateRecCounter].getTime()<FirstDayThisMonth.getTime()&&EndDate[dateRecCounter].getTime()>FirstDayThisMonth.getTime());if(carryForwardPriorMon){BegBookDate[dateRecCounter]=1;BegBookMon[dateRecCounter]=gThisMonth;BegBookYr[dateRecCounter]=gThisYear;}}}}
var thisMonth=gThisMonth;var thisYear=gThisYear;var carryBookingForward=false;var spanTag="";var newYear=true;var endYearHtml="</TABLE><BR><BR>";for(var monCounter=1;monCounter<=24;monCounter++){if(newYear)html+="<DIV style='font-size:12pt;'><SPAN>&nbsp;"+thisYear+"&nbsp;</SPAN></DIV><TABLE BORDER='0' CELLSPACING='4'>";var calRowClass="calRow";html+="<TR><TD ALIGN='right' NOWRAP CLASS='"+calRowClass+"'><DIV CLASS='"+fontSizeClass+" fColorGray51'>";html+=getMonthName(thisMonth,true);html+="</DIV></TD><TD NOWRAP CLASS='"+calRowClass+"'><DIV CLASS='"+fontSizeClass+"'>&nbsp;";html+="<SPAN CLASS='calDates' onMouseover='return eval( \"showTip( 3, this, event )\" );' onMouseout='self.status=\"\"; return true;'>";var lastHTML="";var nDaysThisMonth=getNumDaysInMonth(thisMonth,thisYear);var bookingEndsFirstDayNextMon=false;for(var dayOfMon=1;dayOfMon<=nDaysThisMonth;dayOfMon++){bookingEndsFirstDayNextMon=false;writeOpenSpan:for(member in DateArr){var bookType=BookType[member];var begBookMon=BegBookMon[member];var begBookDay=BegBookDate[member];var begBookYr=BegBookYr[member];var begBooking=(carryBookingForward||dayOfMon==begBookDay&&begBookMon==thisMonth&&begBookYr==thisYear);if(begBooking){lastHTML="beg";if(carryBookingForward){carryBookingForward=false;html+=spanTag;break writeOpenSpan;}
else{switch(bookType){case 1:spanTag="<SPAN CLASS='calBookedTVV' onMouseover='return eval( \"showTip( 0, this, event )\" );' onMouseout='self.status=\"\"; return true;'>";html+=spanTag;break writeOpenSpan;case 2:spanTag="<SPAN CLASS='calPending' onMouseover='return eval( \"showTip( 1, this, event )\" );' onMouseout='self.status=\"\"; return true;'>";html+=spanTag;break writeOpenSpan;case 3:spanTag="<SPAN CLASS='calFlexible' onMouseover='return eval( \"showTip( 2, this, event )\" );' onMouseout='self.status=\"\"; return true;'>";html+=spanTag;break writeOpenSpan;}}}}
html+=dayOfMon;for(member in DateArr){var endBookMon=EndBookMon[member];var endBookDay=EndBookDate[member];var endBookYr=EndBookYr[member];if(!bookingEndsFirstDayNextMon){var nextMon=thisMonth+1;var nextYear=thisYear;if(nextMon==13){nextMon=1;nextYear=thisYear+1;}
bookingEndsFirstDayNextMon=(nextMon==endBookMon&&endBookDay==1&&endBookYr==nextYear);}
var endBooking=(dayOfMon==endBookDay-1&&endBookMon==thisMonth&&endBookYr==thisYear);if(endBooking){lastHTML="end";html+="</SPAN>";break;}}
html+=" ";}
html=html.substring(0,html.length-1);if(lastHTML=="beg"){html+="</SPAN>";carryBookingForward=true;}
else carryBookingForward=false;if(bookingEndsFirstDayNextMon)carryBookingForward=false;html+="</SPAN>&nbsp;</DIV></TD></TR>";thisMonth++;if(thisMonth==13){thisMonth=1;thisYear++;newYear=true;html+=endYearHtml;}
else newYear=false;}
break;}}
if(!recordFound)alert("A record having the ID \""+id+"\" was not found in the calendar data file");if(recordFound&&!newYear)html+=endYearHtml.replace(/<br>$/i, "" );
html="<table border='0' cellspacing='0' cellpadding='0'><tr><td align='center'>"+html+lastUpdated+"</td></tr></table>";self.status="";return html;}
function writeCalendarVersion2(tableAlignment){if(window.CALENDAR_RECORDS){if(!tableAlignment)tableAlignment="center";else if(tableAlignment!="left"&&tableAlignment!="center"&&tableAlignment!="right"){alert("Unrecognized table alignment value of \""+tableAlignment+"\" passed to function writeCalendarVersion2.\n\nThis single string parameter must be \"left\", \"center\" or \"right\" (no exceptions).");tableAlignment="center";}
var pName=VillasHT[villaID][1].cleanIt();var htmKey="";htmKey+="<TR><TD colspan=2 style='padding-bottom:30px;'><table align='center' border='0' cellspacing='0' cellpadding='0'><tr><td><FIELDSET CLASS='calKeyPinLineTVV'><LEGEND ALIGN='center' class='calKeyTitleTVV'>&nbsp;"+pName+" Calendar&nbsp;</LEGEND>";htmKey+="<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=600><TR><TD ALIGN=left style='padding:6px 0px 6px 0px;'><UL class='calKeyInstructionsTVV' style='margin-top:0px; margin-bottom:0px;'><LI STYLE='margin:0px 0px 4px 0px;'>Reserved reservation dates are designated: <NOBR><SPAN CLASS='calRowTVV calDatesTVV calBookedTVV' TITLE='"+tip.confirmed+"' style='cursor:default;'>1 2 3 4 5 6 7</SPAN></NOBR><LI STYLE='margin:0px 0px 4px 0px;'>Pending reservation dates are designated: <NOBR><SPAN CLASS='calRowTVV calDatesTVV calPendingTVV' TITLE='"+tip.pending+"' style='cursor:default;'>1 2 3 4 5 6 7</SPAN></NOBR><LI STYLE='margin:0px 0px 4px 0px;'>Reserved reservation with flexible dates which may be re-assigned are designated: <NOBR><SPAN CLASS='calRowTVV calDatesTVV calFlexibleTVV' TITLE='"+tip.flexible+"' style='cursor:default;'>1 2 3 4 5 6 7</SPAN>,</NOBR> please inquire if interested<LI>All other dates are available for check-in & designated: <NOBR><SPAN CLASS='calRowTVV calDatesTVV' TITLE='"+tip.available+"' style='cursor:default;'>1 2 3 4 5 6 7</SPAN></NOBR></UL></TD></TR></TABLE>";htmKey+="</FIELDSET></td></tr></table></TD></TR>";self.status=tip["init"];var nPropsTotal=CALENDAR_RECORDS.length-1;var id=villaID;var htm="";var hSpacer="<TR><TD COLSPAN='2' HEIGHT='2'><!-- PLACE HOLDER --></TD></TR>";var recordFound=false;var lastUpdated="";for(var recordNum=0;recordNum<nPropsTotal;recordNum++){var ThisRecord=CALENDAR_RECORDS[recordNum];if(ThisRecord[7])lastUpdated="<div class='calLastUpdatedTVV'>This Calendar Last Updated on "+new Date(ThisRecord[7][1]).toLocaleString()+"</div>";self.status="Please wait: Scanning record: "+(recordNum+1)+" of "+nPropsTotal;var propID=ThisRecord[2];if(id==propID){recordFound=true;var propType=ThisRecord[1];var nDaysOutAutoBook=ThisRecord[6];var DateArr=null;var errMsg="";if(nDaysOutAutoBook){var todayMS=gToday.getTime();var nDaysOutAutoBookMS=24*60*60*nDaysOutAutoBook*1000;var AutoBookStartDate=new Date(todayMS+nDaysOutAutoBookMS);var twoYearsOut=todayMS+nDaysOutAutoBookMS+(24*60*60*365*2*1000);var AutoBookEndDate=new Date(twoYearsOut);var VirtualBooking=[[AutoBookStartDate.getMonth()+1,AutoBookStartDate.getDate(),AutoBookStartDate.getFullYear()-2000,AutoBookEndDate.getMonth()+1,AutoBookEndDate.getDate(),AutoBookEndDate.getFullYear()-2000],[AutoBookStartDate.getMonth()+1,AutoBookStartDate.getDate(),AutoBookStartDate.getFullYear()-2000,AutoBookEndDate.getMonth()+1,AutoBookEndDate.getDate(),AutoBookEndDate.getFullYear()-2000],1,0,"Nobody","This is an auto-generated reservation which was created because this property is for sale. It begins "+nDaysOutAutoBook+" days out from today.",[0,0,0]];if(typeof ThisRecord[9]=="object"){DateArr=ThisRecord.slice(9);var LastBooking=DateArr[DateArr.length-1];var ckOutLastBookingMS=new Date(LastBooking[0][5]+2000,LastBooking[0][3]-1,LastBooking[0][4]).getTime();var autoBookStartDateMS=AutoBookStartDate.getTime();if(ckOutLastBookingMS<=autoBookStartDateMS)DateArr[DateArr.length]=VirtualBooking;else{errMsg="ERROR: An existing booking ending on "+LastBooking[0][3]+"/"+LastBooking[0][4]+"/"+LastBooking[0][5]+" conflicts with the virtual for-sale booking starting on "+VirtualBooking[0][0]+"/"+VirtualBooking[0][1]+"/"+VirtualBooking[0][2];}}
else
ThisRecord[9]=VirtualBooking;}
if(!DateArr)DateArr=ThisRecord.slice(9);var nDates=DateArr.length;var noBookings=(nDates==0);var BookType=new Array(nDates);var BegBookMon=new Array(nDates);var BegBookDate=new Array(nDates);var BegBookYr=new Array(nDates);var BegDate=new Array(nDates);var EndBookMon=new Array(nDates);var EndBookDate=new Array(nDates);var EndBookYr=new Array(nDates);var EndDate=new Array(nDates);var carryForwardPriorMon=false;for(var dateRecCounter=0;dateRecCounter<nDates;dateRecCounter++){var Booking=DateArr[dateRecCounter];if(Booking!=0){BookType[dateRecCounter]=Booking[2];BegBookMon[dateRecCounter]=Booking[0][0];BegBookDate[dateRecCounter]=Booking[0][1];BegBookYr[dateRecCounter]=Booking[0][2]+2000;BegDate[dateRecCounter]=new Date(BegBookYr[dateRecCounter],BegBookMon[dateRecCounter]-1,BegBookDate[dateRecCounter]);EndBookMon[dateRecCounter]=Booking[0][3];EndBookDate[dateRecCounter]=Booking[0][4];EndBookYr[dateRecCounter]=Booking[0][5]+2000;EndDate[dateRecCounter]=new Date(EndBookYr[dateRecCounter],EndBookMon[dateRecCounter]-1,EndBookDate[dateRecCounter]);var FirstDayThisMonth=new Date(gThisYear,gThisMonth-1,1);if(!carryForwardPriorMon){carryForwardPriorMon=(BegDate[dateRecCounter].getTime()<FirstDayThisMonth.getTime()&&EndDate[dateRecCounter].getTime()>FirstDayThisMonth.getTime());if(carryForwardPriorMon){BegBookDate[dateRecCounter]=1;BegBookMon[dateRecCounter]=gThisMonth;BegBookYr[dateRecCounter]=gThisYear;}}}}
var thisMonth=gThisMonth;var thisYear=gThisYear;var carryBookingForward=false;var spanTag="";var newYear=true;var endYearHtml="</TABLE><BR><BR>";var Row=new Array();for(var monCounter=1;monCounter<=24;monCounter++){if(newYear)Row.push("<DIV class='calYearTVV'>&nbsp;"+thisYear+"&nbsp;</DIV><TABLE BORDER='0' CELLSPACING='4'>");var calRowClass="calRowTVV";Row.push("<TR><TD ALIGN='right' NOWRAP CLASS='"+calRowClass+"'><DIV>");Row.push(getMonthName(thisMonth,true));Row.push("</DIV></TD><TD NOWRAP CLASS='"+calRowClass+"'><DIV>&nbsp;");Row.push("<SPAN onMouseover='return eval( \"showTip( 3, this, event )\" );' onMouseout='self.status=\"\"; return true;' style='cursor:default;'>");var lastHTML="";var nDaysThisMonth=getNumDaysInMonth(thisMonth,thisYear);var bookingEndsFirstDayNextMon=false;for(var dayOfMon=1;dayOfMon<=nDaysThisMonth;dayOfMon++){bookingEndsFirstDayNextMon=false;writeOpenSpan:for(member in DateArr){var bookType=BookType[member];var begBookMon=BegBookMon[member];var begBookDay=BegBookDate[member];var begBookYr=BegBookYr[member];var begBooking=(carryBookingForward||dayOfMon==begBookDay&&begBookMon==thisMonth&&begBookYr==thisYear);if(begBooking){lastHTML="beg";if(carryBookingForward){carryBookingForward=false;Row.push(spanTag);break writeOpenSpan;}
else{switch(bookType){case 1:spanTag="<SPAN CLASS='calBookedTVV' onMouseover='return eval( \"showTip( 0, this, event )\" );' onMouseout='self.status=\"\"; return true;'>";Row.push(spanTag);break writeOpenSpan;case 2:spanTag="<SPAN CLASS='calPendingTVV' onMouseover='return eval( \"showTip( 1, this, event )\" );' onMouseout='self.status=\"\"; return true;'>";Row.push(spanTag);break writeOpenSpan;case 3:spanTag="<SPAN CLASS='calFlexibleTVV' onMouseover='return eval( \"showTip( 2, this, event )\" );' onMouseout='self.status=\"\"; return true;'>";Row.push(spanTag);break writeOpenSpan;}}}}
Row.push(dayOfMon);for(member in DateArr){var endBookMon=EndBookMon[member];var endBookDay=EndBookDate[member];var endBookYr=EndBookYr[member];if(!bookingEndsFirstDayNextMon){var nextMon=thisMonth+1;var nextYear=thisYear;if(nextMon==13){nextMon=1;nextYear=thisYear+1;}
bookingEndsFirstDayNextMon=(nextMon==endBookMon&&endBookDay==1&&endBookYr==nextYear);}
var endBooking=(dayOfMon==endBookDay-1&&endBookMon==thisMonth&&endBookYr==thisYear);if(endBooking){lastHTML="end";Row.push("</SPAN>");break;}}
Row.push(" ");}
Row[Row.length-1]=Row[Row.length-1].replace(/ +$/, "" );
if(lastHTML=="beg"){carryBookingForward=true;Row.push("</SPAN>");}
else carryBookingForward=false;if(bookingEndsFirstDayNextMon)carryBookingForward=false;Row.push("</SPAN>&nbsp;</DIV></TD></TR>");thisMonth++;if(thisMonth==13){thisMonth=1;thisYear++;newYear=true;Row.push(endYearHtml);}
else newYear=false;}
break;}}
if(!recordFound)alert("A record having the ID \""+id+"\" was not found in the calendar data file");if(recordFound&&!newYear)Row.push(endYearHtml.replace(/<br>$/i, "" ) );
htm="<table align='"+tableAlignment+"' border='0' cellspacing='0' cellpadding='0'>"+htmKey+"<tr><td align='center'>"+Row.join("")+lastUpdated+"</td></tr></table>";self.status="";document.write("<table width='100%;' align='center' border='0' cellspacing='0' cellpadding='0'><tr><td>"+htm+"</td></tr></table>");}
else{var eMsg="Calendar data is nonexistent or corrupted and cannot be read by the data-base engine.";document.write("<b style='color:red;'>"+eMsg+"</b>");alert(eMsg);}}
