var offsetxpoint=-10;var offsetypoint=20;var ie=document.all;var ns6=document.getElementById&&!document.all;var enabletip=false;var tipobj=null;function dhtmlEffectOnLoad(){tipobj=document.createElement("DIV");tipobj.id="dhtmltooltip";document.body.appendChild(tipobj)}function ietruebody(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}function ddrivetip(thetext,thecolor,thewidth){if(tipobj==null){tipobj=document.createElement("DIV");tipobj.id="dhtmltooltip";document.body.appendChild(tipobj)}if(ns6||ie){if(typeof thewidth!="undefined"){tipobj.style.width=thewidth+"px"}if(typeof thecolor!="undefined"&&thecolor!=""){tipobj.style.backgroundColor=thecolor}tipobj.innerHTML=thetext;enabletip=true;return false}}function positiontip(e){if(enabletip){var curX=(ns6)?e.pageX:event.clientX+ietruebody().scrollLeft;var curY=(ns6)?e.pageY:event.clientY+ietruebody().scrollTop;var rightedge=ie&&!window.opera?ietruebody().clientWidth-event.clientX-offsetxpoint:window.innerWidth-e.clientX-offsetxpoint-20;var bottomedge=ie&&!window.opera?ietruebody().clientHeight-event.clientY-offsetypoint:window.innerHeight-e.clientY-offsetypoint-20;var leftedge=(offsetxpoint<0)?offsetxpoint*(-1):-1000;if(rightedge<tipobj.offsetWidth){tipobj.style.left=ie?ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px":window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"}else{if(curX<leftedge){tipobj.style.left="5px"}else{tipobj.style.left=curX+offsetxpoint+"px"}}if(bottomedge<tipobj.offsetHeight){tipobj.style.top=ie?ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px":window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"}else{tipobj.style.top=curY+offsetypoint+"px"}tipobj.style.visibility="visible"}}function hideddrivetip(){if(ns6||ie){enabletip=false;tipobj.style.visibility="hidden";tipobj.style.left="-1000px";tipobj.style.backgroundColor="";tipobj.style.width=""}}document.onmousemove=positiontip;function getposOffset(overlay,offsettype){var totaloffset=(offsettype=="left")?overlay.offsetLeft:overlay.offsetTop;var parentEl=overlay.offsetParent;var browser=navigator.appName;while(parentEl!=null){if(browser==="Microsoft Internet Explorer"&&parentEl.getAttribute("id")==="nycPopupDiv"){totaloffset=(offsettype=="left")?totaloffset+parentEl.offsetLeft:totaloffset+$("#nycPopupDiv").offset().top}else{totaloffset=(offsettype=="left")?totaloffset+parentEl.offsetLeft:totaloffset+parentEl.offsetTop}parentEl=parentEl.offsetParent}return totaloffset}function overlay(curobj,subobjstr,opt_position){if(document.getElementById){var subobj=document.getElementById(subobjstr);subobj.style.display=(subobj.style.display!="block")?"block":"none";var xpos=getposOffset(curobj,"left")+((typeof opt_position!="undefined"&&opt_position.indexOf("right")!=-1)?-(subobj.offsetWidth-curobj.offsetWidth):0);var ypos=getposOffset(curobj,"top")+((typeof opt_position!="undefined"&&opt_position.indexOf("bottom")!=-1)?curobj.offsetHeight:0);subobj.style.left=xpos+"px";subobj.style.top=ypos+"px";return false}else{return true}}function overlayclose(subobj){document.getElementById(subobj).style.display="none"};var __monthslong=["January","February","March","April","May","June","July","August","September","October","November","December"];var __monthsshort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var __calImgPath="/image/calendar/";var __calendars=new Array();var __calDivId="nycCal";function Calendar(arrayID,uniqueName,dateFrom,dateTo){this.currDate=new Date();this.uniqueName=uniqueName;this.arrayID=arrayID;this.products=new Array();this.selectedDays=new Array();this.prodDesc="";this.dateFrom=dateFrom;this.dateTo=dateTo;this.startTally=new Array();this.maxDays=1;this.bottomMsg="Select a date from the calendar above";this.posDateColor="#808080"}Calendar.prototype.drawCal=function(nudgeMonth,alreadyLoaded){this.currDate.setMonth((this.currDate.getMonth()+nudgeMonth));var tmpNextMo=new Date(this.currDate.getFullYear(),(this.currDate.getMonth()+1),1);var calStr='<table cellpadding="0" cellspacing="0" border="0"><tr><td style="background:url('+__calImgPath+'ul.gif) no-repeat; height:6px;"></td><td style="background:url('+__calImgPath+'ur.gif) right top no-repeat; height:6px; width:6px;"></td></tr><tr><td style="background:url('+__calImgPath+'ml.gif) left top repeat-y; text-align:center; font-family:Tahoma; font-size:9pt; color:#808080; overflow:auto; padding-left:6px;" id="__calMessage"><table cellpadding="0" cellspacing="0" border="0"><tr><td width="100%" colspan="2" align="middle" style="padding-bottom:5px;"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td align="left" style="font-size:9pt; color:#000000; text-align:left; cursor:pointer;" onClick="__calendars['+this.arrayID+'].drawCal((-1), true);"><img border=0 src="'+__calImgPath+'_left.gif"></td><td width="50%" align="left" style="padding:0px 16px 0px 0px; font-size:9pt; color:#000000; text-align:center; cursor:default;"><b><nobr>'+__monthslong[this.currDate.getMonth()]+" "+this.currDate.getFullYear()+'</nobr></b></td><td width="50%" align="right" style="padding:0px 0px 0px 16px; font-size:9pt; color:#000000; text-align:center; cursor:default;"><b><nobr>'+__monthslong[tmpNextMo.getMonth()]+" "+tmpNextMo.getFullYear()+'</nobr></b></td><td align="right" style="font-size:9pt; color:#000000; text-align:right; cursor:pointer;" onClick="__calendars['+this.arrayID+'].drawCal(1, true);"><img border=0 src="'+__calImgPath+'_right.gif"></td></tr></table></td></tr><tr><td valign="top"><table cellpadding="0" cellspacing="0" border="0"><tr><td align="middle" style="background:#EEEEEE url('+__calImgPath+'lightgray-gradient-ee.gif) bottom repeat-x; padding:1px; font-family:Tahoma; font-size:8pt; color:#000000; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; border-top:1px solid #EEEEEE; text-align:center; cursor:default;">S</td><td align="middle" style="background:#EEEEEE url('+__calImgPath+'lightgray-gradient-ee.gif) bottom repeat-x; padding:1px; font-family:Tahoma; font-size:8pt; color:#000000; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; border-top:1px solid #EEEEEE; text-align:center; cursor:default;">M</td><td align="middle" style="background:#EEEEEE url('+__calImgPath+'lightgray-gradient-ee.gif) bottom repeat-x; padding:1px; font-family:Tahoma; font-size:8pt; color:#000000; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; border-top:1px solid #EEEEEE; text-align:center; cursor:default;">T</td><td align="middle" style="background:#EEEEEE url('+__calImgPath+'lightgray-gradient-ee.gif) bottom repeat-x; padding:1px; font-family:Tahoma; font-size:8pt; color:#000000; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; border-top:1px solid #EEEEEE; text-align:center; cursor:default;">W</td><td align="middle" style="background:#EEEEEE url('+__calImgPath+'lightgray-gradient-ee.gif) bottom repeat-x; padding:1px; font-family:Tahoma; font-size:8pt; color:#000000; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; border-top:1px solid #EEEEEE; text-align:center; cursor:default;">T</td><td align="middle" style="background:#EEEEEE url('+__calImgPath+'lightgray-gradient-ee.gif) bottom repeat-x; padding:1px; font-family:Tahoma; font-size:8pt; color:#000000; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; border-top:1px solid #EEEEEE; text-align:center; cursor:default;">F</td><td align="middle" style="background:#EEEEEE url('+__calImgPath+'lightgray-gradient-ee.gif) bottom repeat-x; padding:1px; font-family:Tahoma; font-size:8pt; color:#000000; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; border-top:1px solid #EEEEEE; text-align:center; cursor:default;">S</td></tr><tr>';this.currDate.setDate(1);var pMonth=new Date();pMonth.setFullYear(this.currDate.getFullYear(),this.currDate.getMonth(),(this.currDate.getDate()-1));var dCount=new Date();dCount.setFullYear(this.currDate.getFullYear(),(this.currDate.getMonth()+1),(this.currDate.getDate()-1));var dayCounter=0;for(var pMo=1;pMo<=this.currDate.getDay();pMo++){calStr+='<td align="middle" style="padding:2px; font-family:Tahoma; font-size:9pt; color:#AAAAAA; border-bottom:1px solid #CCCCCC; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; text-align:center; cursor:default;">&nbsp;</td>';dayCounter++}for(var cMD=0;cMD<dCount.getDate();cMD++){var validFrom=true;if(typeof(this.dateFrom)!="undefined"){if(this.dateFrom.getTime()>(new Date((this.currDate.getMonth()+1)+"/"+(this.currDate.getDate()+cMD)+"/"+this.currDate.getFullYear())).getTime()){validFrom=false}}var validTo=true;if(typeof(this.dateTo)!="undefined"){if(this.dateTo.getTime()<(new Date((this.currDate.getMonth()+1)+"/"+(this.currDate.getDate()+cMD)+"/"+this.currDate.getFullYear())).getTime()){validTo=false}}var dayInList=false;for(var dInd=0;dInd<this.selectedDays.length;dInd++){if(this.selectedDays[dInd][0]==this.currDate.getFullYear()&&this.selectedDays[dInd][1]==this.currDate.getMonth()&&this.selectedDays[dInd][2]==(this.currDate.getDate()+cMD)){dayInList=true}}if(validFrom==false||validTo==false){calStr+='<td align="middle" style="padding:2px; font-family:Tahoma; background:#EFEFEF; font-size:9pt; color:#808080; border-bottom:1px solid #CCCCCC; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; text-align:center; cursor:default;'}else{calStr+='<td id="__cal'+this.arrayID+"__"+this.currDate.getFullYear()+"-"+this.currDate.getMonth()+"-"+(this.currDate.getDate()+cMD)+'" align="middle" style="padding:2px; font-family:Tahoma; font-size:9pt; border-bottom:1px solid #CCCCCC; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; text-align:center; cursor:pointer;';if(dayInList){calStr+=" background:#006699; color:#FFFFFF;"}else{calStr+=" background:#FFFFFF; color:"+this.posDateColor+";"}}if(validFrom==false||validTo==false){calStr+=" text-decoration:line-through;"}if(validFrom==true&&validTo==true){calStr+='" onMouseOver="__calendars['+this.arrayID+"].toggleDayHilight(["+this.currDate.getFullYear()+","+this.currDate.getMonth()+","+(this.currDate.getDate()+cMD)+'], this, true);" '}if(validFrom==true&&validTo==true){calStr+='" onMouseOut="__calendars['+this.arrayID+"].toggleDayHilight(["+this.currDate.getFullYear()+","+this.currDate.getMonth()+","+(this.currDate.getDate()+cMD)+'], this, false);" onMouseDown="__calendars['+this.arrayID+"].toggleDay(["+this.currDate.getFullYear()+","+this.currDate.getMonth()+","+(this.currDate.getDate()+cMD)+"], this, 'down');\" onMouseUp=\"__calendars["+this.arrayID+"].toggleDay(["+this.currDate.getFullYear()+","+this.currDate.getMonth()+","+(this.currDate.getDate()+cMD)+"], this, 'up');\">"+(this.currDate.getDate()+cMD)+"</td>"}else{calStr+='">'+(this.currDate.getDate()+cMD)+"</td>"}dayCounter++;if((dayCounter%7)==0){calStr+="</tr>";if(cMD!=dCount.getDate()){"<tr>"}}}for(var eMo=1;eMo<=(6-dCount.getDay());eMo++){calStr+='<td align="middle" style="padding:2px; font-family:Tahoma; font-size:9pt; color:#AAAAAA; border-bottom:1px solid #CCCCCC; border-right:1px solid #CCCCCC; border-left:1px solid #FFFFFF; text-align:center; cursor:default;">&nbsp;</td>';dayCounter++}calStr+='</table></td><td valign="top" style="padding-left:5px;"><table cellpadding=0 cellspacing=0 border=0><tr><td align="middle" style="background:#EEEEEE url('+__calImgPath+'lightgray-gradient-ee.gif) bottom repeat-x; padding:1px; font-family:Tahoma; font-size:8pt; color:#000000; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; border-top:1px solid #EEEEEE; text-align:center; cursor:default;">S</td><td align="middle" style="background:#EEEEEE url('+__calImgPath+'lightgray-gradient-ee.gif) bottom repeat-x; padding:1px; font-family:Tahoma; font-size:8pt; color:#000000; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; border-top:1px solid #EEEEEE; text-align:center; cursor:default;">M</td><td align="middle" style="background:#EEEEEE url('+__calImgPath+'lightgray-gradient-ee.gif) bottom repeat-x; padding:1px; font-family:Tahoma; font-size:8pt; color:#000000; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; border-top:1px solid #EEEEEE; text-align:center; cursor:default;">T</td><td align="middle" style="background:#EEEEEE url('+__calImgPath+'lightgray-gradient-ee.gif) bottom repeat-x; padding:1px; font-family:Tahoma; font-size:8pt; color:#000000; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; border-top:1px solid #EEEEEE; text-align:center; cursor:default;">W</td><td align="middle" style="background:#EEEEEE url('+__calImgPath+'lightgray-gradient-ee.gif) bottom repeat-x; padding:1px; font-family:Tahoma; font-size:8pt; color:#000000; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; border-top:1px solid #EEEEEE; text-align:center; cursor:default;">T</td><td align="middle" style="background:#EEEEEE url('+__calImgPath+'lightgray-gradient-ee.gif) bottom repeat-x; padding:1px; font-family:Tahoma; font-size:8pt; color:#000000; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; border-top:1px solid #EEEEEE; text-align:center; cursor:default;">F</td><td align="middle" style="background:#EEEEEE url('+__calImgPath+'lightgray-gradient-ee.gif) bottom repeat-x; padding:1px; font-family:Tahoma; font-size:8pt; color:#000000; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; border-top:1px solid #EEEEEE; text-align:center; cursor:default;">S</td></tr><tr>';this.currDate.setMonth((this.currDate.getMonth()+1),1);var pMonth=new Date();pMonth.setFullYear(this.currDate.getFullYear(),this.currDate.getMonth(),(this.currDate.getDate()-1));var dCount=new Date();dCount.setFullYear(this.currDate.getFullYear(),(this.currDate.getMonth()+1),(this.currDate.getDate()-1));var dayCounter=0;for(var pMo=1;pMo<=this.currDate.getDay();pMo++){calStr+='<td align="middle" style="padding:2px; font-family:Tahoma; font-size:9pt; color:#AAAAAA; border-bottom:1px solid #CCCCCC; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; text-align:center; cursor:default;">&nbsp;</td>';dayCounter++}for(var cMD=0;cMD<dCount.getDate();cMD++){var validFrom=true;if(typeof(this.dateFrom)!="undefined"){if(this.dateFrom.getTime()>(new Date((this.currDate.getMonth()+1)+"/"+(this.currDate.getDate()+cMD)+"/"+this.currDate.getFullYear())).getTime()){validFrom=false}}var validTo=true;if(typeof(this.dateTo)!="undefined"){if(this.dateTo.getTime()<(new Date((this.currDate.getMonth()+1)+"/"+(this.currDate.getDate()+cMD)+"/"+this.currDate.getFullYear())).getTime()){validTo=false}}var dayInList=false;for(var dInd=0;dInd<this.selectedDays.length;dInd++){if(this.selectedDays[dInd][0]==this.currDate.getFullYear()&&this.selectedDays[dInd][1]==this.currDate.getMonth()&&this.selectedDays[dInd][2]==(this.currDate.getDate()+cMD)){dayInList=true}}if(validFrom==false||validTo==false){calStr+='<td align="middle" style="padding:2px; font-family:Tahoma; background:#EFEFEF; font-size:9pt; color:#808080; border-bottom:1px solid #CCCCCC; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; text-align:center; cursor:default;'}else{calStr+='<td id="__cal'+this.arrayID+"__"+this.currDate.getFullYear()+"-"+this.currDate.getMonth()+"-"+(this.currDate.getDate()+cMD)+'" align="middle" style="padding:2px; font-family:Tahoma; font-size:9pt; border-bottom:1px solid #CCCCCC; border-right:1px solid #CCCCCC; border-left:1px solid #EEEEEE; text-align:center; cursor:pointer;';if(dayInList){calStr+=" background:#006699; color:#FFFFFF;"}else{calStr+=" background:#FFFFFF; color:"+this.posDateColor+";"}}if(validFrom==false||validTo==false){calStr+=" text-decoration:line-through;"}if(validFrom==true&&validTo==true){calStr+='" onMouseOver="__calendars['+this.arrayID+"].toggleDayHilight(["+this.currDate.getFullYear()+","+this.currDate.getMonth()+","+(this.currDate.getDate()+cMD)+'], this, true);" '}if(validFrom==true&&validTo==true){calStr+='" onMouseOut="__calendars['+this.arrayID+"].toggleDayHilight(["+this.currDate.getFullYear()+","+this.currDate.getMonth()+","+(this.currDate.getDate()+cMD)+'], this, false);" onMouseDown="__calendars['+this.arrayID+"].toggleDay(["+this.currDate.getFullYear()+","+this.currDate.getMonth()+","+(this.currDate.getDate()+cMD)+"], this, 'down');\" onMouseUp=\"__calendars["+this.arrayID+"].toggleDay(["+this.currDate.getFullYear()+","+this.currDate.getMonth()+","+(this.currDate.getDate()+cMD)+"], this, 'up');\">"+(this.currDate.getDate()+cMD)+"</td>"}else{calStr+='">'+(this.currDate.getDate()+cMD)+"</td>"}dayCounter++;if((dayCounter%7)==0){calStr+="</tr>";if(cMD!=dCount.getDate()){"<tr>"}}}for(var eMo=1;eMo<=(6-dCount.getDay());eMo++){calStr+='<td align="middle" style="padding:2px; font-family:Tahoma; font-size:9pt; color:#AAAAAA; border-bottom:1px solid #CCCCCC; border-right:1px solid #CCCCCC; border-left:1px solid #FFFFFF; text-align:center; cursor:default;">&nbsp;</td>';dayCounter++}calStr+='</table></td></tr><tr><td colspan=2 id="__cal'+this.arrayID+'__message" align="left" style="font-family:Tahoma; color:#000000; font-size:9pt; padding:2px;">'+this.bottomMsg+'</td></tr></table></td><td style="background:url('+__calImgPath+'mr.gif) right top repeat-y; height:6px;"><img width="1" height="6" border=0 src="_blank.gif"></td></tr><tr><td style="background:url('+__calImgPath+'bl.gif) no-repeat; height:6px;"><img width="1" height="6" border=0 src="_blank.gif"></td><td style="background:url('+__calImgPath+'br.gif) right top no-repeat; height:6px; width:6px;"><img width="6" height="6" border=0 src="_blank.gif"></td></tr></table>';this.currDate.setMonth((this.currDate.getMonth()-1));if(typeof(alreadyLoaded)!="undefined"&&alreadyLoaded==true){document.getElementById(this.uniqueName).innerHTML=calStr}else{return'<div id="'+this.uniqueName+'">'+calStr+"</div>"}};Calendar.prototype.toggleDay=function(day,divBlock,buttonEvent){var dayInList=(-1);for(var dInd=0;dInd<this.selectedDays.length;dInd++){if(this.selectedDays[dInd][0]==day[0]&&this.selectedDays[dInd][1]==day[1]&&this.selectedDays[dInd][2]==day[2]){dayInList=dInd}}if(dayInList==(-1)&&this.startTally.length==0&&buttonEvent=="down"){if(this.selectedDays.length>=1){var oldDivBlock=document.getElementById("__cal"+this.arrayID+"__"+this.selectedDays[0][0]+"-"+this.selectedDays[0][1]+"-"+this.selectedDays[0][2]);if(oldDivBlock!=null){oldDivBlock.style.background="#FFFFFF";oldDivBlock.style.color=this.posDateColor}this.selectedDays=new Array();this.startTally=new Array()}divBlock.style.background="#006699";divBlock.style.color="#FFFFFF";this.selectedDays.push(day);this.startTally=day;this.toggleDayHilight(day,divBlock,true);this.selectedDays.sort(function(a,b){return(new Date(a[0],a[1],a[2])).getTime()-(new Date(b[0],b[1],b[2])).getTime()})}else{if(this.startTally.length>0&&buttonEvent=="up"){var countDays=1;var tallyDest=new Date(day[0],(parseInt(day[1])+0),day[2]);var tallyNew=new Date(this.startTally[0],(parseInt(this.startTally[1])+0),this.startTally[2]);var tallyPivot=new Date(this.startTally[0],(parseInt(this.startTally[1])+0),this.startTally[2]);while(tallyNew.getFullYear()!=tallyDest.getFullYear()||tallyNew.getMonth()!=tallyDest.getMonth()||tallyNew.getDate()!=tallyDest.getDate()){countDays++;if(tallyNew.getTime()<tallyDest.getTime()){tallyNew.setDate(tallyNew.getDate()+1)}else{tallyNew.setDate(tallyNew.getDate()-1)}var newDayInList=false;for(var dInd=0;dInd<this.selectedDays.length;dInd++){if(this.selectedDays[dInd][0]==tallyNew.getFullYear()&&this.selectedDays[dInd][1]==tallyNew.getMonth()&&this.selectedDays[dInd][2]==tallyNew.getDate()){newDayInList=true}}var newDivBlock=document.getElementById("__cal"+this.arrayID+"__"+tallyNew.getFullYear()+"-"+tallyNew.getMonth()+"-"+tallyNew.getDate());if(!newDayInList&&countDays<=this.maxDays&&newDivBlock){this.selectedDays.push([tallyNew.getFullYear(),tallyNew.getMonth(),tallyNew.getDate()]);this.selectedDays.sort(function(a,b){return(new Date(a[0],a[1],a[2])).getTime()-(new Date(b[0],b[1],b[2])).getTime()});newDivBlock.style.background="#006699";newDivBlock.style.color="#FFFFFF"}else{if(!newDayInList&&newDivBlock){newDivBlock.style.background="#FFFFFF";newDivBlock.style.color=this.posDateColor}}}this.startTally=new Array()}else{if(buttonEvent=="up"){var tallyNew=new Date(day[0],(parseInt(day[1])+0),day[2]);var tallyPrev=new Date(day[0],(parseInt(day[1])+0),day[2]);tallyPrev.setDate(tallyPrev.getDate()-1);var prevDayInList=false;var remDayInList=true;var remDayInListInd=(-1);for(var dInd=0;dInd<this.selectedDays.length;dInd++){if(this.selectedDays[dInd][0]==tallyPrev.getFullYear()&&this.selectedDays[dInd][1]==tallyPrev.getMonth()&&this.selectedDays[dInd][2]==tallyPrev.getDate()){prevDayInList=true}}if(!prevDayInList){while(remDayInList){tallyNew.setDate(tallyNew.getDate()+1);var newDivBlock=document.getElementById("__cal"+this.arrayID+"__"+tallyNew.getFullYear()+"-"+tallyNew.getMonth()+"-"+tallyNew.getDate());remDayInList=false;for(var rdInd=0;rdInd<this.selectedDays.length;rdInd++){if(this.selectedDays[rdInd][0]==tallyNew.getFullYear()&&this.selectedDays[rdInd][1]==tallyNew.getMonth()&&this.selectedDays[rdInd][2]==tallyNew.getDate()){remDayInListInd=rdInd;remDayInList=true}}if(remDayInList){this.selectedDays.splice(remDayInListInd,1);this.selectedDays.sort(function(a,b){return(new Date(a[0],a[1],a[2])).getTime()-(new Date(b[0],b[1],b[2])).getTime()});this.toggleDayHilight([tallyNew.getFullYear(),tallyNew.getMonth(),tallyNew.getDate()],newDivBlock,false)}}}if(dayInList!=(-1)){this.selectedDays.splice(dayInList,1);this.selectedDays.sort(function(a,b){return(new Date(a[0],a[1],a[2])).getTime()-(new Date(b[0],b[1],b[2])).getTime()});this.toggleDayHilight(day,divBlock,false)}this.startTally=new Array()}}}window.setTimeout("document.getElementById(__calDivId).style.display = 'none'",500)};Calendar.prototype.toggleDayHilight=function(day,divBlock,toggle){var dayInList=false;for(var dInd=0;dInd<this.selectedDays.length;dInd++){if(this.selectedDays[dInd][0]==day[0]&&this.selectedDays[dInd][1]==day[1]&&this.selectedDays[dInd][2]==day[2]){dayInList=true}}if(toggle){divBlock.style.background="#008FD6";divBlock.style.color="#FFFFFF"}else{if(dayInList){divBlock.style.background="#006699";divBlock.style.color="#FFFFFF"}else{divBlock.style.background="#FFFFFF";divBlock.style.color=this.posDateColor}}};var HotelCalendar={div:null,isInit:false,dateFrom:(parseInt((new Date()).getMonth())+1)+"/"+(new Date()).getDate()+"/"+(new Date()).getFullYear(),dateTo:(parseInt((new Date()).getMonth())+1)+"/"+(new Date()).getDate()+"/"+((new Date()).getFullYear()+1),curCalIdx:0,curInput:null,hideCalTO:null,init:function(){var me=this;this.div=document.getElementById(__calDivId);if(this.div==null){this.div=document.createElement("div");this.div.id=__calDivId;this.div.style.position="absolute";this.div.style.padding="8px";this.div.style.display="none";this.div.style.width="auto";this.div.style.height="auto";document.body.appendChild(this.div)}var isHotel=false;if($("input[name=checkin]").length>0){var newDateTo=new Date();var one_day=1000*60*60*24;newDateTo.setTime(newDateTo.getTime()+(one_day*330));this.dateTo=newDateTo.format("MM/dd/yyyy");isHotel=true}__calendars.push(new Calendar(0,"_checkinCal",new Date(this.dateFrom),new Date(this.dateTo)));__calendars.push(new Calendar(1,"_checkoutCal",new Date(this.dateFrom),new Date(this.dateTo)));if(isHotel){__calendars[0].bottomMsg="Select your Check-In Date Above";__calendars[1].bottomMsg="Select your Check-Out Date Above"}__calendars[0].posDateColor="#003366";__calendars[1].posDateColor="#003366";this.div.onmouseup=function(){if(__calendars[me.curCalIdx].selectedDays!=null&&__calendars[me.curCalIdx].selectedDays.length>0){var date=(parseInt(__calendars[me.curCalIdx].selectedDays[0][1])+1)+"/"+__calendars[me.curCalIdx].selectedDays[0][2]+"/"+__calendars[me.curCalIdx].selectedDays[0][0];if(me.curInput!=null){me.curInput.value=date;if(me.curInput.onchange){me.curInput.onchange()}}}};this.div.onmouseout=function(){eval("HotelCalendar.closeOnTimeout()")};this.div.onmouseover=function(){eval("HotelCalendar.clearTimeout()")};this.isInit=true},showCal:function(input,calIdx){if(!this.isInit){this.init()}var inputDate=new Date(input.value);if(inputDate.toString()=="Invalid Date"||inputDate.toString()=="NaN"){inputDate=new Date()}if(__calendars[calIdx].selectedDays==null||__calendars[calIdx].selectedDays.length==0){__calendars[calIdx].selectedDays[0]=new Array()}this.curCalIdx=calIdx;this.curInput=input;__calendars[calIdx].currDate=inputDate;__calendars[calIdx].selectedDays[0][0]=inputDate.getFullYear();__calendars[calIdx].selectedDays[0][1]=inputDate.getMonth();__calendars[calIdx].selectedDays[0][2]=inputDate.getDate();if(this.div.style.display!="none"){overlayclose(__calDivId)}if(this.div.style.display=="none"){overlay(input,__calDivId,"bottom");if(calIdx==1&&__calendars[0].selectedDays[0]!=null){__calendars[calIdx].dateFrom=new Date((parseInt(__calendars[0].selectedDays[0][1])+1)+"/"+__calendars[0].selectedDays[0][2]+"/"+__calendars[0].selectedDays[0][0])}this.div.innerHTML=__calendars[calIdx].drawCal(0)}this.div.innerHTML+="<!--[if lte IE 6.5]><iframe src='/secure/ok.aspx' class='cal-select-free'></iframe><![endif]-->";this.clearTimeout();this.hideCalTO=null},closeOnTimeout:function(){this.hideCalTO=window.setTimeout("HotelCalendar.closeCal()",1000)},clearTimeout:function(){if(this.hideCalTO!=null){window.clearTimeout(this.hideCalTO)}this.hideCalTO=null},closeCal:function(){if(document.getElementById(__calDivId)!=null){overlayclose(__calDivId)}}};