';
ni.appendChild(newdiv);
}
function vbSetRoomsAdults(totrooms) {
var actrooms = parseInt(document.getElementById('vbroomhelper').value);
var torooms = parseInt(totrooms);
var difrooms;
if (torooms > actrooms) {
difrooms = torooms - actrooms;
for(var ir=1; ir<=difrooms; ir++) {
vbAddElement();
}
}
if (torooms < actrooms) {
for(var ir=actrooms; ir>torooms; ir--) {
if (ir > 1) {
var rmra = document.getElementById('vb' + ir + 'racont');
rmra.parentNode.removeChild(rmra);
}
}
document.getElementById('vbroomhelper').value = torooms;
}
}
function vbCalcNights() {
var vbcheckin = document.getElementById('checkindate').value;
var vbcheckout = document.getElementById('checkoutdate').value;
if (vbcheckin.length > 0 && vbcheckout.length > 0) {
var vbcheckinp = vbcheckin.split("/");
var vbcheckoutp = vbcheckout.split("/");
var vbinmonth = parseInt(vbcheckinp[1]);
vbinmonth = vbinmonth - 1;
var vbinday = parseInt(vbcheckinp[0], 10);
var vbcheckind = new Date(vbcheckinp[2], vbinmonth, vbinday);
var vboutmonth = parseInt(vbcheckoutp[1]);
vboutmonth = vboutmonth - 1;
var vboutday = parseInt(vbcheckoutp[0], 10);
var vbcheckoutd = new Date(vbcheckoutp[2], vboutmonth, vboutday);
var vbdivider = 1000 * 60 * 60 * 24;
var vbints = vbcheckind.getTime();
var vboutts = vbcheckoutd.getTime();
if (vboutts > vbints) {
//var vbnights = Math.ceil((vboutts - vbints) / (vbdivider));
var utc1 = Date.UTC(vbcheckind.getFullYear(), vbcheckind.getMonth(), vbcheckind.getDate());
var utc2 = Date.UTC(vbcheckoutd.getFullYear(), vbcheckoutd.getMonth(), vbcheckoutd.getDate());
var vbnights = Math.ceil((utc2 - utc1) / vbdivider);
if (vbnights > 0) {
document.getElementById('vbjstotnights').innerHTML = 'Nights: '+vbnights;
} else {
document.getElementById('vbjstotnights').innerHTML = '';
}
} else {
document.getElementById('vbjstotnights').innerHTML = '';
}
} else {
document.getElementById('vbjstotnights').innerHTML = '';
}
}
Error, Insufficient Data Received.