if (window.roValidate == undefined) {
window.roOnLoad = window.onload;
window.roValList = Array();
window.roValIndex = 0;
window.roValidate = function () {
if (window.roOnLoad != null) {
try {
window.roOnLoad();
} catch (err) { }
}
for (ii = 0; ii < window.roValIndex; ii=ii+1) {
fname = window.roValList[ii]
fname();
}
}
window.roAddValidator = function (fname) {
window.roValList[window.roValIndex] = fname;
window.roValIndex = window.roValIndex + 1;
}
window.onload = window.roValidate
}
var _Title = _rod["setTitle"];
var _Button = _rod["setButton"];
var _Account = _rod["setAccount"];
var _Unit = _rod["setUnit"];
var _Adults = _rod["setAdults"];
var _Children = _rod["setChildren"];
var _Pets = _rod["setPets"];
var _Size = _rod["setSize"];
var _Rows = _rod["setRows"];
var _Engine = _rod["setEngine"];
var _Rates = _rod["setRates"];
_Engine = "";
var onbuttonclick = "";
var resdataA = [];
var idA = [];
var moyrA = [];
if ( _Title == undefined) { _Title="Book Now";}
if ( _Button == undefined) { _Button="continue";}
if ( _Adults == undefined) { _Adults="Guests";}
if ( _Children == undefined) { _Children="";}
if ( _Pets == undefined) { _Pets="";}
if ( _Size == undefined) { _Size = "medium";}
if ( _Size != "tiny" && _Size != "small" && _Size != "medium" && _Size != "large" ) { _Size = "medium";}
if ( _Rows == undefined) { _Rows = "oneRow";}
if ( _Rows != "oneRow" && _Rows != "twoRows" && _Rows != "threeRows" ) { _Rows = "oneRow";}
if ( _Engine == undefined) { _Engine="";}
if ( _Engine == "overlay" ) { onbuttonclick = " onclick=\"ROBook('"+_Account+"','"+_Account+"','',''); return false;\"";}
if ( _Rates == undefined) { _Rates="";}
if(document.createStyleSheet) {
document.createStyleSheet("https://www2.reservationsonline.com/addons/style.css");
} else {
var stylesImport = "@import url('https://www2.reservationsonline.com/addons/style.css');";
var newSS=document.createElement('link');
newSS.rel='stylesheet';
newSS.href='data:text/css,'+escape(stylesImport);
if (document.getElementsByTagName("head")[0]) {
s = document.getElementsByTagName("style")[0];
if (s) {
s.parentNode.insertBefore(newSS, s);
} else {
document.getElementsByTagName("head")[0].appendChild(newSS);
}
// document.getElementsByTagName("head")[0].appendChild(newSS);
} else { document.write('');
}
}
var calJs = document.createElement('script');
calJs.setAttribute('type', 'text/javascript');
calJs.setAttribute('src', 'https://www2.reservationsonline.com/addons/singleCalendar_073124.js');
document.getElementsByTagName("head")[0].appendChild(calJs);
if ( _Engine != "overlay2" ) {
//just do it
var newJs = document.createElement('script');
newJs.setAttribute('type', 'text/javascript');
newJs.setAttribute('src', 'https://www2.reservationsonline.com/addons/hs-full.packed.js');
document.getElementsByTagName("head")[0].appendChild(newJs);
var newJs = document.createElement('script');
newJs.setAttribute('type', 'text/javascript');
newJs.setAttribute('src', 'https://www2.reservationsonline.com/addons/ro_hs.js');
document.getElementsByTagName("head")[0].appendChild(newJs);
}
window.roAddValidator (injectpicker)
function loadReviews(uid) {
//alert("loadReviews");
var xhttp = new XMLHttpRequest();
var zdata = 'roid='+_Account+'&roroomid='+uid;
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var zResponse = this.responseText;
//alert(zResponse);
var reviews = document.getElementsByClassName('ROReviews');
if (reviews != null) {
var reviewsT = "no fake reviews....";
for (i = 0; i < reviews.length; i++) {
reviewsT = zResponse;
reviews[i].innerHTML = reviewsT;
reviews[i].style.display = "block";
reviews[i].style.visibility = "visible";
}
}
}
};
xhttp.open("POST", "https://www2.reservationsonline.com/addons/reviewdata.asp", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send(zdata);
}
function loadLMS(i) {
//alert("loadSnip");
var xhttp = new XMLHttpRequest();
var zdata = 'roid='+_Account;
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var zResponse = this.responseText;
//alert(zResponse);
var lms = document.getElementsByClassName('ROlms');
if (lms != null) {
var lmsT = "last minute special....";
for (i = 0; i < lms.length; i++) {
lmsT = buildLMS(zResponse);
lms[i].innerHTML = lmsT;
lms[i].style.display = "block";
lms[i].style.visibility = "visible";
}
}
}
};
xhttp.open("POST", "https://www2.reservationsonline.com/addons/lmsdata.asp", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send(zdata);
}
function loadUCals(i) {
//alert("loadUCals");
var unitcals = document.getElementsByClassName('ROAllUnitsCalendar');
if (unitcals != null) {
var unitcalT = "Multipe Unit Calendars...";
var uids = "999";
for (i = 0; i < unitcals.length; i++) {
unitcalT = buildUnitCalendars(uids);
unitcals[i].innerHTML = unitcalT;
unitcals[i].style.display = "block";
unitcals[i].style.visibility = "visible";
}
}
}
function loadSnip(i) {
//alert("loadSnip");
var xhttp = new XMLHttpRequest();
var zdata = 'roid='+_Account+'&rid='+_Unit;
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var zResponse = this.responseText;
//alert(zResponse);
var snipdataA = zResponse.split("||");
var str = snipdataA[0];
snipidA = str.split(",");
str = snipdataA[1];
sniptextA = str.split("ZZ");
var snips = document.getElementsByClassName('ROSnippet');
if (snips != null) {
for (i = 0; i < snips.length; i++) {
var y = snips[i].hasAttribute("reference");
if (y) {
var yT = snips[i].getAttribute("reference");
snipRow = snipidA.indexOf(yT);
if (snipRow != -1) {
str = sniptextA[snipRow];
snips[i].innerHTML = str;
snips[i].style.display = "block";
snips[i].style.visibility = "visible";
snips[i].style.marginTop = "8px";
snips[i].style.marginBottom = "16px";
}
}
}
}
}
};
xhttp.open("POST", "https://www2.reservationsonline.com/addons/snipdata.asp", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send(zdata);
}
function loadDoc(i) {
//alert("loadDoc");
var xhttp = new XMLHttpRequest();
var zdata = 'roid='+_Account+'&rid='+_Unit;
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var mocontainer = document.getElementById('ReservationsOnline_Calendar');
//alert(this.responseText + '\n\n');
var sResponse = this.responseText;
var res = sResponse.split("||");
resdataA = sResponse.split("||");
var str = res[0];
//alert(str);
moyrA = str.split(",");
str = res[1];
moA = str.split(",");
str = res[2];
nameA = str.split(",");
str = res[3];
idA = str.split(",");
for (i = 4; i < res.length; i++) {
str = res[i];
//alert(str);
tempA = str.split(",");
if (tempA[0] == _Unit) {
tempA.shift();
pavailA = tempA;
//alert(pavailA);
break;
}
}
var unitcals = document.getElementsByClassName('ROAllUnitsCalendar');
if (unitcals != null) {
var unitcalT = "Multipe Unit Calendars...";
var uids = "999";
var ucsize = "";
var sizeT = "";
for (i = 0; i < unitcals.length; i++) {
ucsize = unitcals[i].hasAttribute("size");
sizeT = "";
if (ucsize) {var sizeT = unitcals[i].getAttribute("size"); } else {sizeT = "medium";}
unitcalT = buildUnitCalendars(uids,sizeT);
unitcals[i].innerHTML = unitcalT;
unitcals[i].style.display = "block";
unitcals[i].style.visibility = "visible";
}
}
var mocals = document.getElementsByClassName('ROCalendar');
if (mocals != null) {
var possibleMonthsA = ["1,1", "1,2", "1,3", "1,4", "2,1", "2,2", "2,3", "3,1", "3,2", "4,1"];
var addrowA = ["rows1","rows1","rows1","rows1","rows2","rows2","rows2","rows3","rows3","rows4"];
var addcolA = ["cols1","cols2","cols3","cols4","cols1","cols2","cols3","cols1","cols2","cols1"];
var possibleSizesA = ["tiny","small","medium"];
for (i = 0; i < mocals.length; i++) {
var y = mocals[i].hasAttribute("months");
var z = mocals[i].hasAttribute("unitID");
var zz = mocals[i].hasAttribute("size");
var calText = "";
var passed = true;
if (y && z && zz) {
var yT = mocals[i].getAttribute("months");
var zT = mocals[i].getAttribute("unitID");
var theSize = mocals[i].getAttribute("size");
var aok = possibleSizesA.indexOf(theSize);
if (aok == -1) {passed = false;}
var aok2 = possibleMonthsA.indexOf(yT);
if (aok2 == -1) {passed = false;}
if (passed) {
var newrowc = addrowA[aok2];
var newcolc = addcolA[aok2];
mocals[i].classList.add(newrowc);
mocals[i].classList.add(newcolc);
mocals[i].classList.add(theSize);
unitRow = idA.indexOf(zT);
//alert(zT + ',' + unitRow);
if (unitRow > -1) {
availRow = unitRow + 3
str = res[availRow];
// alert(str);
tempA = str.split(",");
pavailA = tempA;
rateRow = 3 + idA.length + unitRow
str = res[rateRow];
// alert(rateRow + ' ' + str);
tempB = str.split(",");
prateA = tempB;
//build the calendar.......
calText = buildcals(zT,yT,theSize,pavailA,prateA);
} else { alert("missing unit " & zT); }
} } } }
}
};
xhttp.open("POST", "https://www2.reservationsonline.com/addons/justnow_073124.asp", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send(zdata);
}
function injectpicker() {
var dpickers = document.getElementsByClassName('RODatePicker');
var mocals = document.getElementsByClassName('ROCalendar');
var bookitlinks = document.getElementsByClassName('ROLink');
var snippets = document.getElementsByClassName('ROSnippet');
var lms = document.getElementsByClassName('ROlms');
var reviews = document.getElementsByClassName('ROReviews');
var unitcals = document.getElementsByClassName('ROAllUnitsCalendar');
if (dpickers.length == 0 && mocals.length == 0 && bookitlinks.length == 0 && snippets.length == 0 && lms.length == 0 && reviews.length == 0 && unitcals.length == 0) {
//do some feedback if setup incorrect.....
var scriptTags = document.getElementsByTagName("script");
for (var i=0; i= 0) {
var msgElem = document.createElement('div');
msgElem.style.margin='8px';
msgElem.style.color='red';
msgElem.innerHTML="Please check the ReservationsOnline code and install again.";
parentElem.appendChild(msgElem);
break;
}
}
return;
}
var valid = true;
if (valid) {
var _DUnit = _Unit;
if ( _Unit == 999) {
_DUnit = "";
}
var UniqueID = 0;
var dpickers = document.getElementsByClassName('RODatePicker');
for (i = 0; i < dpickers.length; i++) {
var z = dpickers[i].hasAttribute("unitID");
var passed = true;
if (z) {
var zT = dpickers[i].getAttribute("unitID");
if (zT == "") {zT = "999";}
var zlock = dpickers[i].hasAttribute("unitLOCK");
if (zlock) {var lockT = dpickers[i].getAttribute("unitLOCK");} else {var lockT = "";}
var roomID = zT;
UniqueID = UniqueID + 1;
zT = UniqueID;
//alert("dpickers:" + UniqueID);
var occ = dpickers[i].hasAttribute("occupants");
var occVals = false;
if (occ) {var occT = dpickers[i].getAttribute("occupants"); var occA = occT.split(",");
if (occA.length == 3) {occVals = true;}
}
dpickers[i].style.visibility='visible';
if ( _Engine == "overlay" ) { onbuttonclick = " onclick=\"ROBook('"+zT+"','"+_Account+"','',''); return false;\"";}
dpickersT = '';
dpickersT += '
';
dpickersT += '
X
';
dpickersT += '
';
dpickers[i].innerHTML = dpickersT;
}
}
var mocals = document.getElementsByClassName('ROCalendar');
if (mocals != null) {
var possibleMonthsA = ["1,1", "1,2", "1,3", "1,4", "2,1", "2,2", "2,3", "3,1", "3,2", "4,1"];
var possibleSizesA = ["tiny","small","medium"];
for (i = 0; i < mocals.length; i++) {
var y = mocals[i].hasAttribute("months");
var z = mocals[i].hasAttribute("unitID");
var zz = mocals[i].hasAttribute("size");
var calText = "";
var passed = true;
if (y && z && zz) {
var yT = mocals[i].getAttribute("months");
var zT = mocals[i].getAttribute("unitID");
if (zT == "") {zT = "999";}
var theSize = mocals[i].getAttribute("size");
var aok = possibleMonthsA.indexOf(yT);
if (aok == -1) {passed = false;}
var aok = possibleSizesA.indexOf(theSize);
if (aok == -1) {passed = false;}
if (passed) {
var gridA = yT.split(",");
var gridSize = gridA[0]*gridA[1];
var holdText = "";
var loopcnt = 0;
for (c = 0; c < gridSize; c++) {
holdText += '
'+zT+'
';
}
mocals[i].innerHTML = '
'+holdText+'
';
}
} } }
var bookitlinks = document.getElementsByClassName('ROLink');
for (i = 0; i < bookitlinks.length; i++) {
var z = bookitlinks[i].hasAttribute("unitID");
var passed = true;
if (z) {
var zT = bookitlinks[i].getAttribute("unitID");
if (zT == "") {zT = "999";}
var roomID = zT;
UniqueID = UniqueID + 1;
zT = "u"+UniqueID;
//alert("bookitlinks:" + UniqueID);
//var zT = 'z'+bookitlinks[i].getAttribute("unitID")+'pu';
var zTc = 'z'+bookitlinks[i].getAttribute("unitID")+'puC';
var linkT = 'show'+bookitlinks[i].getAttribute("unitID");
var zlock = bookitlinks[i].hasAttribute("unitLOCK");
if (zlock) {var lockT = bookitlinks[i].getAttribute("unitLOCK");} else {var lockT = "";}
var occ = bookitlinks[i].hasAttribute("occupants");
var occVals = false;
if (occ) {var occT = bookitlinks[i].getAttribute("occupants"); var occA = occT.split(",");
if (occA.length == 3) {occVals = true;}
} var zTcE = bookitlinks[i];
zTcE.addEventListener('click',showPU,true);
zTcE.myParam = zTc;
if (bookitlinks[i].style.position == "") {
bookitlinks[i].style.position="relative";}
if ( _Engine == "overlay" ) { onbuttonclick = " onclick=\"ROBook('"+zT+"','"+_Account+"','',''); return false;\"";} else { onbuttonclick = " onclick=\"this.form.submit(); return false;\"";}
dpickersT = '';
dpickersT += '
';
dpickersT += '
X
';
dpickersT += '
';
dpickersT += '
' + _Title + '
';
dpickersT += '
Arrival Date ';
dpickersT += '';
dpickersT += '
Number of Nights
';
if (!occVals) {
var displayT = "";
if ( _Adults == "") { displayT = "display:none;"; }
dpickersT += '
'+_Adults+'
';
var displayT = "";
if ( _Children == "") { displayT = "display:none;"; }
dpickersT += '
'+_Children+'
';
var displayT = "";
if ( _Pets == "") { displayT = "display:none;"; }
dpickersT += '
'+_Pets+'
';
} else {
var displayT = "";
if (occA[0] < 1) { displayT = "display:none;"; }
dpickersT += '
'+_Adults+'
';
var displayT = "";
if (occA[1] < 1) { displayT = "display:none;"; }
dpickersT += '
'+_Children+'
';
var displayT = "";
if (occA[2] < 1) { displayT = "display:none;"; }
dpickersT += '