Reconline
function BusyBox(id, varName, imageCount, imageNamePrefix, imageNameSuffix, imageDelay, width, height, url) {
this.id = id; this.ImageCount = imageCount; this.CurrentImageIndex = 0; this.ImageWidth = 0; this.ImageHeight = 0; this.ImageNamePrefix = imageNamePrefix; this.ImageNameSuffix = imageNameSuffix; this.ImageDelay = imageDelay; this.DivID = "BusyBoxDiv"; this.ImgID = "BusyBoxImg"; this.Enabled = true; this.Width = width; this.Height = height;
this.VarName = varName;
this.timeout_id = null;
this.CacheImages();
this.BusyBoxUrl = url;
this.IFrame = document.getElementById(this.id);
this.Hide();
if( this.BusyBoxUrl )
this.LoadUrl(this.BusyBoxUrl); else
this.RenderContent();
if( !frames[this.id] ) this.Enabled = false; }
BusyBox.prototype.GetIFrameDocument = function() { var doc;
if( this.IFrame.contentDocument )
doc = this.IFrame.contentDocument; else if( this.IFrame.contentWindow )
doc = this.IFrame.contentWindow.document; else if( this.IFrame.document )
doc = this.IFrame.document; else
doc = this.IFrame.document;
return doc; }
BusyBox.prototype.LoadUrl = function(url) {
var IFrameDoc = this.GetIFrameDocument();
IFrameDoc.location.replace(url); }
BusyBox.prototype.RenderContent = function() {
var doc = this.GetIFrameDocument();
var style = "BORDER: #A6A6A6 2px solid; WIDTH: 304px; POSITION: absolute; HEIGHT: 168px; BACKGROUND-COLOR: white";
doc.open(); doc.writeln("
"); doc.writeln("
"); doc.writeln(""); doc.close(); }
BusyBox.prototype.Resize = function() {
if( BusyBox.IsBrowserIE() ) {
var div = frames[this.id].document.getElementById(this.DivID); this.IFrame.style.width = div.offsetWidth; this.IFrame.style.height = div.offsetHeight; } else {
this.IFrame.style.width = this.Width; this.IFrame.style.height = this.Height; } }
BusyBox.prototype.Center = function() { if( !this.IFrame ) return;
var objLeft = (document.body.clientWidth - this.IFrame.offsetWidth) / 2; var objTop = (document.body.clientHeight - this.IFrame.offsetHeight) / 2; objLeft = objLeft + document.body.scrollLeft; objTop = objTop + document.body.scrollTop;
this.IFrame.style.position = "absolute"; this.IFrame.style.top = objTop; this.IFrame.style.left = objLeft; }
BusyBox.prototype.CacheImages = function() {
this.Images = new Array(this.ImageCount);
for(var i = 0; i < this.ImageCount; i++) { this.Images[i] = new Image(); this.Images[i].src = this.ImageNamePrefix + i + this.ImageNameSuffix; } } BusyBox.prototype.IsAnimating = function() { if( this.timeout_id == null) return false; else return true; } BusyBox.prototype.IsVisible = function() { var ifrm = document.getElementById(this.id); if( ifrm.style.visibility == "visible" && ifrm.style.width > 0 ) return true; else return false; }
BusyBox.prototype.Animate = function() {
if( frames[this.id] )
frames[this.id].document.getElementById(this.ImgID).src = this.Images[this.CurrentImageIndex].src; else
document.getElementById(this.ImgID).src = this.Images[this.CurrentImageIndex].src;
this.Resize(); this.Center();
this.CurrentImageIndex = (this.CurrentImageIndex + 1)%this.ImageCount;
this.timeout_id = setTimeout(this.VarName + ".Animate();", this.ImageDelay); }
BusyBox.prototype.StartAnimate = function() { if( this.IsAnimating() ) return;
this.Animate(); }
BusyBox.prototype.StopAnimate = function() { clearTimeout(this.timeout_id); this.timeout_id = null; }
BusyBox.prototype.Hide = function() { this.StopAnimate();
this.IFrame.style.visibility = "hidden"; this.IFrame.style.width = 0; this.IFrame.style.height = 0; }
BusyBox.prototype.Show = function() { if( !this.Enabled ) return;
if( this.IsAnimating() || this.IsVisible() ) return;
this.IFrame.style.visibility = "visible"; this.IFrame.style.zIndex = "999999";
this.StartAnimate(); }
BusyBox.IsBrowserIE = function() { try { return (window.navigator.userAgent.indexOf("MSIE ") > 0); } catch(x) { return false; } }
BusyBox.IsBrowserNS = function() { try { return (window.navigator.userAgent.indexOf("Netscape") > 0); } catch(x) { return false; } }
BusyBox.IsBrowserFirefox = function() { try { return (window.navigator.userAgent.indexOf("Firefox") > 0); } catch(x) { return false; } }
var today=new Date(); var todate=today.getDate(); var tomonth=today.getMonth(); var toyear=today.getFullYear(); var checkOK = "0123456789";
var tomorrow=new Date(); var totomorrowdate=today.getDate()+1; var totomorrowmonth=today.getMonth(); var totomorrowyear=today.getFullYear();
function leapYearCheck(y) { if ( ( (y%4==0)&&(y%100 != 0) ) || (y%400==0) ) { return true; } else { return false; } }
function addDays(datefield, num) { var numDays=Number(monthDays[num]); if(leapYearCheck(toyear) && (num==1)) { numDays=29; } datefield.options.length=0; for(i=1; i<=numDays; i++) { datefield.options[datefield.options.length]=new Option(i, i); } if(datefield.options[0].value=="") datefield.remove(0); } monthDays=new Array("31", "28", "31", "30", "31", "30", "31", "31", "30", "31", "30", "31"); function isDate1(dt) { var dtCh= "/"; var daysInMonth = DaysArray(12) var pos1=dt.indexOf(dtCh) var pos2=dt.indexOf(dtCh,pos1+1) var strMonth=dt.substring(0,pos1) var strDay=dt.substring(pos1+1,pos2) var strYear=dt.substring(pos2+1) var strYr=strYear if (strDay.charAt(0)=="0" && strDay.length>1) var strDay=strDay.substring(1) if (strMonth.charAt(0)=="0" && strMonth.length>1) var strMonth=strMonth.substring(1) for (var i = 1; i <= 3; i++) { if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1) } month=parseInt(strMonth) day=parseInt(strDay) year=parseInt(strYr) if (strMonth.length<1 || month<1 || month>12){ alert("Please enter a valid month") return false } if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){ alert("Please enter a valid day") return false } return true } function stripCharsInBag(s, bag) { var i; var returnString = "";
for (i = 0; i < s.length; i++) { var c = s.charAt(i); if (bag.indexOf(c) == -1) returnString += c; } return returnString; } function daysInFebruary (year) { return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 ); } function DaysArray(n) { for (var i = 1; i <= n; i++) { this[i] = 31 if (i==4 || i==6 || i==9 || i==11) {this[i] = 30} if (i==2) {this[i] = 29} } return this } function myfunction() { document.searchform.submit(); } function CityCheck(indicator) { var iscity=false; var city=document.searchform.strCity for(i=0;i30) { alert("Sorry You Cannot Do Booking For More Than 30 Days"); return false; }
else { return true; } }
function setCheckOutDateNew(formname,checkindateField,checkinmonthField,checkinyearField,checkoutdateField,checkoutmonthField,checkoutyearField) { if(isNaN(formname)==false){ formname=document.forms[formname]; }else if(formname.indexOf('@')!=-1){ formname=document.forms[0]; }else{ formname=document.forms[formname]; } var d=Number(formname[checkindateField].value); var m=Number(formname[checkinmonthField].value); if(formname[checkinyearField]){ var y=Number(formname[checkinyearField].value); } var checkoutDay=d+1; var nextMonth=m; var checkoutYear=y; if(leapYearCheck(y)){monthDays[1]="29";}else{monthDays[1]="28";} if(leapYearCheck(y)&&m==2){ addDays(formname[checkindateField],m-1); addDays(formname[checkoutdateField],m-1); } if(formname[checkinmonthField].options.length!=monthDays[m-1]){ addDays(formname[checkindateField],m-1); addDays(formname[checkoutdateField],m-1); } if(checkoutDay>monthDays[m-1]){ nextMonth=m+1; if(nextMonth>12){ nextMonth=1; checkoutYear+=1; } addDays(formname[checkoutdateField],nextMonth-1); checkoutDay=checkoutDay-monthDays[m-1]; } if(d>monthDays[m-1]){ d=monthDays[m-1]; checkoutDay=1; } if(formname[checkinyearField]){ formname[checkinyearField].value=y; } formname[checkinmonthField].value=m; formname[checkindateField].value=d; if(formname[checkoutyearField]){ if(formname[checkinmonthField].value==12) { if(formname[checkindateField].value==31) { if(formname[checkinyearField].selectedIndex==1) { alert("Sorry you can't check in on this date"); return true; } else { formname[checkoutyearField].value=checkoutYear; } } else { formname[checkoutyearField].value=checkoutYear; } } else { formname[checkoutyearField].value=checkoutYear; } } formname[checkoutmonthField].value=nextMonth; formname[checkoutdateField].value=checkoutDay; }