﻿$(document).ready(function(){var f=$("ul#mainNavLinks").width();var b=$("ul#mainNavLinks > li");var e=0;$("ul#mainNavLinks > li > a").each(function(){var h=$(this);e+=h.width()});var d=(f-e);var c=(d/(2*(b.length)));var c=Math.floor(c*100)/100;var g=(c);g=Math.floor(g);$("ul#mainNavLinks > li > a").css({"padding-right":g});$("ul#mainNavLinks > li > a").css({"padding-left":g});$("ul#mainNavLinks > li > a").each(function(){var h=Math.floor($(this).width());$(this).css("width",h)});var a=$("#subNav ul  > li ");if(a.length<1){$("#subNav").css({display:"none"})}});function removeFocusOnAllLinks(){for(var a=0;a<document.links.length;a++){document.links.onmouseup=blurLink}}function blurLink(){if(this.blur){this.blur()}}window.onload=removeFocusOnAllLinks;var MONTH_NAMES=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var DAY_NAMES=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat");function LZ(a){return(a<0||a>9?"":"0")+a}function isDate(c,b){var a=getDateFromFormat(c,b);if(a==0){return false}return true}function compareDates(c,e,d,f){var a=getDateFromFormat(c,e);var b=getDateFromFormat(d,f);if(a==0||b==0){return -1}else{if(a>b){return 1}}return 0}function formatDate(f,j){j=j+"";var C="";var q=0;var b="";var G="";var J=f.getYear()+"";var x=f.getMonth()+1;var e=f.getDate();var i=f.getDay();var n=f.getHours();var w=f.getMinutes();var D=f.getSeconds();var N,L,B,A,g,o,l,z,F,a,p,n,v,t,u,r;var I=new Object();if(J.length<4){J=""+(J-0+1900)}I.y=""+J;I.yyyy=J;I.yy=J.substring(2,4);I.M=x;I.MM=LZ(x);I.MMM=MONTH_NAMES[x-1];I.NNN=MONTH_NAMES[x+11];I.d=e;I.dd=LZ(e);I.E=DAY_NAMES[i+7];I.EE=DAY_NAMES[i];I.H=n;I.HH=LZ(n);if(n==0){I.h=12}else{if(n>12){I.h=n-12}else{I.h=n}}I.hh=LZ(I.h);if(n>11){I.K=n-12}else{I.K=n}I.k=n+1;I.KK=LZ(I.K);I.kk=LZ(I.k);if(n>11){I.a="PM"}else{I.a="AM"}I.m=w;I.mm=LZ(w);I.s=D;I.ss=LZ(D);while(q<j.length){b=j.charAt(q);G="";while((j.charAt(q)==b)&&(q<j.length)){G+=j.charAt(q++)}if(I[G]!=null){C=C+I[G]}else{C=C+G}}return C}function _isInteger(c){var a="1234567890";for(var b=0;b<c.length;b++){if(a.indexOf(c.charAt(b))==-1){return false}}return true}function _getInt(d,a,c,b){for(var f=b;f>=c;f--){var e=d.substring(a,a+f);if(e.length<c){return null}if(_isInteger(e)){return e}}return null}function getDateFromFormat(t,f){t=t+"";f=f+"";var k=0;var j=0;var b="";var r="";var s="";var u,v;var p=new Date();var w=p.getYear();var m=p.getMonth()+1;var d=1;var g=p.getHours();var l=p.getMinutes();var q=p.getSeconds();var a="";while(j<f.length){b=f.charAt(j);r="";while((f.charAt(j)==b)&&(j<f.length)){r+=f.charAt(j++)}if(r=="yyyy"||r=="yy"||r=="y"){if(r=="yyyy"){u=4;v=4}if(r=="yy"){u=2;v=2}if(r=="y"){u=2;v=4}w=_getInt(t,k,u,v);if(w==null){return 0}k+=w.length;if(w.length==2){if(w>70){w=1900+(w-0)}else{w=2000+(w-0)}}}else{if(r=="MMM"||r=="NNN"){m=0;for(var h=0;h<MONTH_NAMES.length;h++){var n=MONTH_NAMES[h];if(t.substring(k,k+n.length).toLowerCase()==n.toLowerCase()){if(r=="MMM"||(r=="NNN"&&h>11)){m=h+1;if(m>12){m-=12}k+=n.length;break}}}if((m<1)||(m>12)){return 0}}else{if(r=="EE"||r=="E"){for(var h=0;h<DAY_NAMES.length;h++){var e=DAY_NAMES[h];if(t.substring(k,k+e.length).toLowerCase()==e.toLowerCase()){k+=e.length;break}}}else{if(r=="MM"||r=="M"){m=_getInt(t,k,r.length,2);if(m==null||(m<1)||(m>12)){return 0}k+=m.length}else{if(r=="dd"||r=="d"){d=_getInt(t,k,r.length,2);if(d==null||(d<1)||(d>31)){return 0}k+=d.length}else{if(r=="hh"||r=="h"){g=_getInt(t,k,r.length,2);if(g==null||(g<1)||(g>12)){return 0}k+=g.length}else{if(r=="HH"||r=="H"){g=_getInt(t,k,r.length,2);if(g==null||(g<0)||(g>23)){return 0}k+=g.length}else{if(r=="KK"||r=="K"){g=_getInt(t,k,r.length,2);if(g==null||(g<0)||(g>11)){return 0}k+=g.length}else{if(r=="kk"||r=="k"){g=_getInt(t,k,r.length,2);if(g==null||(g<1)||(g>24)){return 0}k+=g.length;g--}else{if(r=="mm"||r=="m"){l=_getInt(t,k,r.length,2);if(l==null||(l<0)||(l>59)){return 0}k+=l.length}else{if(r=="ss"||r=="s"){q=_getInt(t,k,r.length,2);if(q==null||(q<0)||(q>59)){return 0}k+=q.length}else{if(r=="a"){if(t.substring(k,k+2).toLowerCase()=="am"){a="AM"}else{if(t.substring(k,k+2).toLowerCase()=="pm"){a="PM"}else{return 0}}k+=2}else{if(t.substring(k,k+r.length)!=r){return 0}else{k+=r.length}}}}}}}}}}}}}}if(k!=t.length){return 0}if(m==2){if(((w%4==0)&&(w%100!=0))||(w%400==0)){if(d>29){return 0}}else{if(d>28){return 0}}}if((m==4)||(m==6)||(m==9)||(m==11)){if(d>30){return 0}}if(g<12&&a=="PM"){g=g-0+12}else{if(g>11&&a=="AM"){g-=12}}var o=new Date(w,m-1,d,g,l,q);return o.getTime()}function parseDate(h){var g=(arguments.length==2)?arguments[1]:false;generalFormats=new Array("y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d");monthFirst=new Array("M/d/y","M-d-y","M.d.y","MMM-d","M/d","M-d");dateFirst=new Array("d/M/y","d-M-y","d.M.y","d-MMM","d/M","d-M");var a=new Array("generalFormats",g?"dateFirst":"monthFirst",g?"monthFirst":"dateFirst");var b=null;for(var c=0;c<a.length;c++){var f=window[a[c]];for(var e=0;e<f.length;e++){b=getDateFromFormat(h,f[e]);if(b!=0){return new Date(b)}}}return null}function getAnchorPosition(a){var j=false;var b=new Object();var k=0,l=0;var g=false,f=false,h=false;if(document.getElementById){g=true}else{if(document.all){f=true}else{if(document.layers){h=true}}}if(g&&document.all){k=AnchorPosition_getPageOffsetLeft(document.all[a]);l=AnchorPosition_getPageOffsetTop(document.all[a])}else{if(g){var e=document.getElementById(a);k=AnchorPosition_getPageOffsetLeft(e);l=AnchorPosition_getPageOffsetTop(e)}else{if(f){k=AnchorPosition_getPageOffsetLeft(document.all[a]);l=AnchorPosition_getPageOffsetTop(document.all[a])}else{if(h){var c=0;for(var d=0;d<document.anchors.length;d++){if(document.anchors[d].name==a){c=1;break}}if(c==0){b.x=0;b.y=0;return b}k=document.anchors[d].x;l=document.anchors[d].y}else{b.x=0;b.y=0;return b}}}}b.x=k;b.y=l;return b}function getAnchorWindowPosition(a){var b=getAnchorPosition(a);var c=0;var d=0;if(document.getElementById){if(isNaN(window.screenX)){c=b.x-document.body.scrollLeft+window.screenLeft;d=b.y-document.body.scrollTop+window.screenTop}else{c=b.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;d=b.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset}}else{if(document.all){c=b.x-document.body.scrollLeft+window.screenLeft;d=b.y-document.body.scrollTop+window.screenTop}else{if(document.layers){c=b.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;d=b.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset}}}b.x=c;b.y=d;return b}function AnchorPosition_getPageOffsetLeft(a){var b=a.offsetLeft;while((a=a.offsetParent)!=null){b+=a.offsetLeft}return b}function AnchorPosition_getWindowOffsetLeft(a){return AnchorPosition_getPageOffsetLeft(a)-document.body.scrollLeft}function AnchorPosition_getPageOffsetTop(a){var b=a.offsetTop;while((a=a.offsetParent)!=null){b+=a.offsetTop}return b}function AnchorPosition_getWindowOffsetTop(a){return AnchorPosition_getPageOffsetTop(a)-document.body.scrollTop}function PopupWindow_getXYPosition(a){var b;if(this.type=="WINDOW"){b=getAnchorWindowPosition(a)}else{b=getAnchorPosition(a)}this.x=b.x;this.y=b.y}function PopupWindow_setSize(b,a){this.width=b;this.height=a}function PopupWindow_populate(a){this.contents=a;this.populated=false}function PopupWindow_setUrl(a){this.url=a}function PopupWindow_setWindowProperties(a){this.windowProperties=a}function PopupWindow_refresh(){if(this.divName!=null){if(this.use_gebi){document.getElementById(this.divName).innerHTML=this.contents}else{if(this.use_css){document.all[this.divName].innerHTML=this.contents}else{if(this.use_layers){var a=document.layers[this.divName];a.document.open();a.document.writeln(this.contents);a.document.close()}}}}else{if(this.popupWindow!=null&&!this.popupWindow.closed){if(this.url!=""){this.popupWindow.location.href=this.url}else{this.popupWindow.document.open();this.popupWindow.document.writeln(this.contents);this.popupWindow.document.close()}this.popupWindow.focus()}}}function PopupWindow_showPopup(a){this.getXYPosition(a);this.x+=this.offsetX;this.y+=this.offsetY;if(!this.populated&&(this.contents!="")){this.populated=true;this.refresh()}if(this.divName!=null){if(this.use_gebi){document.getElementById(this.divName).style.left=this.x;document.getElementById(this.divName).style.top=this.y;document.getElementById(this.divName).style.visibility="visible"}else{if(this.use_css){document.all[this.divName].style.left=this.x;document.all[this.divName].style.top=this.y;document.all[this.divName].style.visibility="visible"}else{if(this.use_layers){document.layers[this.divName].left=this.x;document.layers[this.divName].top=this.y;document.layers[this.divName].visibility="visible"}}}}else{if(this.popupWindow==null||this.popupWindow.closed){if(this.x<0){this.x=0}if(this.y<0){this.y=0}if(screen&&screen.availHeight){if((this.y+this.height)>screen.availHeight){this.y=screen.availHeight-this.height}}if(screen&&screen.availWidth){if((this.x+this.width)>screen.availWidth){this.x=screen.availWidth-this.width}}this.popupWindow=window.open("about:blank","window_"+a,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"")}this.refresh()}}function PopupWindow_hidePopup(){if(this.divName!=null){if(this.use_gebi){document.getElementById(this.divName).style.visibility="hidden"}else{if(this.use_css){document.all[this.divName].style.visibility="hidden"}else{if(this.use_layers){document.layers[this.divName].visibility="hidden"}}}}else{if(this.popupWindow&&!this.popupWindow.closed){this.popupWindow.close();this.popupWindow=null}}}function PopupWindow_isClicked(c){if(this.divName!=null){if(this.use_layers){var a=c.pageX;var b=c.pageY;var d=document.layers[this.divName];if((a>d.left)&&(a<d.left+d.clip.width)&&(b>d.top)&&(b<d.top+d.clip.height)){return true}else{return false}}else{if(document.all){var d=window.event.srcElement;while(d.parentElement!=null){if(d.id==this.divName){return true}d=d.parentElement}return false}else{if(this.use_gebi){var d=c.originalTarget;while(d.parentNode!=null){if(d.id==this.divName){return true}d=d.parentNode}return false}}}return false}return false}function PopupWindow_hideIfNotClicked(a){if(this.autoHideEnabled&&!this.isClicked(a)){this.hidePopup()}}function PopupWindow_autoHide(){this.autoHideEnabled=true}function PopupWindow_hidePopupWindows(a){for(var b=0;b<popupWindowObjects.length;b++){if(popupWindowObjects[b]!=null){var c=popupWindowObjects[b];c.hideIfNotClicked(a)}}}function PopupWindow_attachListener(){if(document.layers){document.captureEvents(Event.MOUSEUP)}window.popupWindowOldEventListener=document.onmouseup;if(window.popupWindowOldEventListener!=null){document.onmouseup=new Function("window.popupWindowOldEventListener();PopupWindow_hidePopupWindows();")}else{document.onmouseup=PopupWindow_hidePopupWindows}}function PopupWindow(){if(!window.popupWindowIndex){window.popupWindowIndex=0}if(!window.popupWindowObjects){window.popupWindowObjects=new Array()}if(!window.listenerAttached){window.listenerAttached=true;PopupWindow_attachListener()}this.index=popupWindowIndex++;popupWindowObjects[this.index]=this;this.divName=null;this.popupWindow=null;this.width=0;this.height=0;this.populated=false;this.visible=false;this.autoHideEnabled=false;this.contents="";this.url="";this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";if(arguments.length>0){this.type="DIV";this.divName=arguments[0]}else{this.type="WINDOW"}this.use_gebi=false;this.use_css=false;this.use_layers=false;if(document.getElementById){this.use_gebi=true}else{if(document.all){this.use_css=true}else{if(document.layers){this.use_layers=true}else{this.type="WINDOW"}}}this.offsetX=0;this.offsetY=0;this.getXYPosition=PopupWindow_getXYPosition;this.populate=PopupWindow_populate;this.setUrl=PopupWindow_setUrl;this.setWindowProperties=PopupWindow_setWindowProperties;this.refresh=PopupWindow_refresh;this.showPopup=PopupWindow_showPopup;this.hidePopup=PopupWindow_hidePopup;this.setSize=PopupWindow_setSize;this.isClicked=PopupWindow_isClicked;this.autoHide=PopupWindow_autoHide;this.hideIfNotClicked=PopupWindow_hideIfNotClicked}function CalendarPopup(){var a;if(arguments.length>0){a=new PopupWindow(arguments[0])}else{a=new PopupWindow();a.setSize(150,175)}a.offsetX=-152;a.offsetY=25;a.autoHide();a.monthNames=new Array("January","February","March","April","May","June","July","August","September","October","November","December");a.monthAbbreviations=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");a.dayHeaders=new Array("S","M","T","W","T","F","S");a.returnFunction="CalendarPopup_tmpReturnFunction";a.returnMonthFunction="CalendarPopup_tmpReturnMonthFunction";a.returnQuarterFunction="CalendarPopup_tmpReturnQuarterFunction";a.returnYearFunction="CalendarPopup_tmpReturnYearFunction";a.weekStartDay=0;a.isShowYearNavigation=false;a.displayType="date";a.disabledWeekDays=new Object();a.disabledDatesExpression="";a.yearSelectStartOffset=2;a.currentDate=null;a.todayText="Today";window.CalendarPopup_targetInput=null;window.CalendarPopup_dateFormat="mm/dd/yyyy";a.setReturnFunction=CalendarPopup_setReturnFunction;a.setReturnMonthFunction=CalendarPopup_setReturnMonthFunction;a.setReturnQuarterFunction=CalendarPopup_setReturnQuarterFunction;a.setReturnYearFunction=CalendarPopup_setReturnYearFunction;a.setMonthNames=CalendarPopup_setMonthNames;a.setMonthAbbreviations=CalendarPopup_setMonthAbbreviations;a.setDayHeaders=CalendarPopup_setDayHeaders;a.setWeekStartDay=CalendarPopup_setWeekStartDay;a.setDisplayType=CalendarPopup_setDisplayType;a.setDisabledWeekDays=CalendarPopup_setDisabledWeekDays;a.addDisabledDates=CalendarPopup_addDisabledDates;a.setYearSelectStartOffset=CalendarPopup_setYearSelectStartOffset;a.setTodayText=CalendarPopup_setTodayText;a.showYearNavigation=CalendarPopup_showYearNavigation;a.showCalendar=CalendarPopup_showCalendar;a.hideCalendar=CalendarPopup_hideCalendar;a.getStyles=CalendarPopup_getStyles;a.refreshCalendar=CalendarPopup_refreshCalendar;a.getCalendar=CalendarPopup_getCalendar;a.select=CalendarPopup_select;return a}function CalendarPopup_tmpReturnFunction(e,c,a){if(window.CalendarPopup_targetInput!=null){var b=new Date(e,c-1,a,0,0,0);window.CalendarPopup_targetInput.value=formatDate(b,window.CalendarPopup_dateFormat)}else{alert("Use setReturnFunction() to define which function will get the clicked results!")}}function CalendarPopup_tmpReturnMonthFunction(b,a){alert("Use setReturnMonthFunction() to define which function will get the clicked results!\nYou clicked: year="+b+" , month="+a)}function CalendarPopup_tmpReturnQuarterFunction(b,a){alert("Use setReturnQuarterFunction() to define which function will get the clicked results!\nYou clicked: year="+b+" , quarter="+a)}function CalendarPopup_tmpReturnYearFunction(a){alert("Use setReturnYearFunction() to define which function will get the clicked results!\nYou clicked: year="+a)}function CalendarPopup_setReturnFunction(a){this.returnFunction=a}function CalendarPopup_setReturnMonthFunction(a){this.returnMonthFunction=a}function CalendarPopup_setReturnQuarterFunction(a){this.returnQuarterFunction=a}function CalendarPopup_setReturnYearFunction(a){this.returnYearFunction=a}function CalendarPopup_setMonthNames(){for(var a=0;a<arguments.length;a++){this.monthNames[a]=arguments[a]}}function CalendarPopup_setMonthAbbreviations(){for(var a=0;a<arguments.length;a++){this.monthAbbreviations[a]=arguments[a]}}function CalendarPopup_setDayHeaders(){for(var a=0;a<arguments.length;a++){this.dayHeaders[a]=arguments[a]}}function CalendarPopup_setWeekStartDay(a){this.weekStartDay=a}function CalendarPopup_showYearNavigation(){this.isShowYearNavigation=true}function CalendarPopup_setDisplayType(a){if(a!="date"&&a!="week-end"&&a!="month"&&a!="quarter"&&a!="year"){alert("Invalid display type! Must be one of: date,week-end,month,quarter,year");return false}this.displayType=a}function CalendarPopup_setYearSelectStartOffset(a){this.yearSelectStartOffset=a}function CalendarPopup_setDisabledWeekDays(){this.disabledWeekDays=new Object();for(var a=0;a<arguments.length;a++){this.disabledWeekDays[arguments[a]]=true}}function CalendarPopup_addDisabledDates(b,a){if(arguments.length==1){a=b}if(b==null&&a==null){return}if(this.disabledDatesExpression!=""){this.disabledDatesExpression+="||"}if(b!=null){b=parseDate(b);b=""+b.getFullYear()+LZ(b.getMonth()+1)+LZ(b.getDate())}if(a!=null){a=parseDate(a);a=""+a.getFullYear()+LZ(a.getMonth()+1)+LZ(a.getDate())}if(b==null){this.disabledDatesExpression+="(ds<="+a+")"}else{if(a==null){this.disabledDatesExpression+="(ds>="+b+")"}else{this.disabledDatesExpression+="(ds>="+b+"&&ds<="+a+")"}}}function CalendarPopup_setTodayText(a){this.todayText=a}function CalendarPopup_hideCalendar(){if(arguments.length>0){window.popupWindowObjects[arguments[0]].hidePopup()}else{this.hidePopup()}}function CalendarPopup_refreshCalendar(b){var a=window.popupWindowObjects[b];if(arguments.length>1){a.populate(a.getCalendar(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]))}else{a.populate(a.getCalendar())}a.refresh()}function CalendarPopup_showCalendar(a){if(arguments.length>1){if(arguments[1]==null||arguments[1]==""){this.currentDate=new Date()}else{this.currentDate=new Date(parseDate(arguments[1]))}}this.populate(this.getCalendar());this.showPopup(a)}function CalendarPopup_select(b,c,a){var d=(arguments.length>3)?arguments[3]:null;if(!window.getDateFromFormat){alert("calendar.select: To use this method you must also include 'date.js' for date formatting");return}if(this.displayType!="date"&&this.displayType!="week-end"){alert("calendar.select: This function can only be used with displayType 'date' or 'week-end'");return}if(b.type!="text"&&b.type!="hidden"&&b.type!="textarea"){alert("calendar.select: Input object passed is not a valid form input object");window.CalendarPopup_targetInput=null;return}window.CalendarPopup_targetInput=b;this.currentDate=null;var e=0;if(d!=null){e=getDateFromFormat(d,a)}else{if(b.value!=""){e=getDateFromFormat(b.value,a)}}if(d!=null||b.value!=""){if(e==0){this.currentDate=null}else{this.currentDate=new Date(e)}}window.CalendarPopup_dateFormat=a;this.showCalendar(c)}function CalendarPopup_getStyles(){var a="";a+="<STYLE>\n";a+="TD.cal,TD.calday,TD.calmonth,TD.caltoday,A.textlink,.disabledtextlink{font-family:arial;font-size: 8pt;}\n";a+="TD.calday{border:solid thin #C0C0C0;border-width:0 0 1 0;}\n";a+="TD.calmonth{text-align:right;}\n";a+="TD.caltoday{text-align:right;color:white;background-color:#C0C0C0;border-width:1;border:solid thing #800000;}\n";a+="TD.textlink{border:solid thin #C0C0C0;border-width:1 0 0 0;}\n";a+="A.textlink{height:20px;color:black;}\n";a+=".disabledtextlink{height:20px;color:#808080;}\n";a+="A.cal{text-decoration:none;color:#000000;}\n";a+="A.calthismonth{text-decoration:none;color:#000000;}\n";a+="A.calothermonth{text-decoration:none;color:#808080;}\n";a+=".calnotclickable{color:#808080;}\n";a+=".disabled{color:#D0D0D0;text-decoration:line-through;}\n";a+="</STYLE>\n";return a}function CalendarPopup_getCalendar(){var now=new Date();if(this.type=="WINDOW"){var windowref="window.opener."}else{var windowref=""}var result="";if(this.type=="WINDOW"){result+="<HTML><HEAD><TITLE>Calendar</TITLE>"+this.getStyles()+"</HEAD><BODY MARGINWIDTH=0 MARGINHEIGHT=0 TOPMARGIN=0 RIGHTMARGIN=0 LEFTMARGIN=0>\n";result+="<CENTER><TABLE WIDTH=100% BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>\n"}else{result+='<TABLE WIDTH=144 BORDER=1 BORDERWIDTH=1 BORDERCOLOR="#808080" CELLSPACING=0 CELLPADDING=1>\n';result+="<TR><TD ALIGN=CENTER>\n";result+="<CENTER>\n"}var t144="<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";if(this.displayType=="date"||this.displayType=="week-end"){if(this.currentDate==null){this.currentDate=now}if(arguments.length>0){var month=arguments[0]}else{var month=this.currentDate.getMonth()+1}if(arguments.length>1){var year=arguments[1]}else{var year=this.currentDate.getFullYear()}var daysinmonth=new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);if(((year%4==0)&&(year%100!=0))||(year%400==0)){daysinmonth[2]=29}var current_month=new Date(year,month-1,1);var display_year=year;var display_month=month;var display_date=1;var weekday=current_month.getDay();var offset=0;if(weekday>=this.weekStartDay){offset=weekday-this.weekStartDay}else{offset=7-this.weekStartDay+weekday}if(offset>0){display_month--;if(display_month<1){display_month=12;display_year--}display_date=daysinmonth[display_month]-offset+1}var next_month=month+1;var next_month_year=year;if(next_month>12){next_month=1;next_month_year++}var last_month=month-1;var last_month_year=year;if(last_month<1){last_month=12;last_month_year--}var date_class;if(this.type!="WINDOW"){result+=t144}result+='<TR BGCOLOR="#C0C0C0">\n';var refresh="javascript:"+windowref+"CalendarPopup_refreshCalendar";var td='<TD BGCOLOR="#C0C0C0" CLASS="cal" ALIGN=CENTER VALIGN=MIDDLE WIDTH=';if(this.isShowYearNavigation){result+=td+'10><B><A CLASS="cal" HREF="'+refresh+"("+this.index+","+last_month+","+last_month_year+');">&lt;</A></B></TD>';result+=td+"58>"+this.monthNames[month-1]+"</TD>";result+=td+'10><B><A CLASS="cal" HREF="'+refresh+"("+this.index+","+next_month+","+next_month_year+');">&gt;</A></B></TD>';result+=td+"10>&nbsp;</TD>";result+=td+'10><B><A CLASS="cal" HREF="'+refresh+"("+this.index+","+month+","+(year-1)+');">&lt;</A></B></TD>';result+=td+"36>"+year+"</TD>";result+=td+'10><B><A CLASS="cal" HREF="'+refresh+"("+this.index+","+month+","+(year+1)+');">&gt;</A></B></TD>'}else{result+=td+'22><B><A CLASS="cal" HREF="'+refresh+"("+this.index+","+last_month+","+last_month_year+');">&lt;&lt;</A></B></TD>\n';result+=td+"100>"+this.monthNames[month-1]+" "+year+"</TD>\n";result+=td+'22><B><A CLASS="cal" HREF="'+refresh+"("+this.index+","+next_month+","+next_month_year+');">&gt;&gt;</A></B></TD>\n'}result+="</TR></TABLE>\n";result+="<TABLE WIDTH=120 BORDER=0 CELLSPACING=0 CELLPADDING=1 ALIGN=CENTER>\n";result+="<TR>\n";var td='     <TD CLASS="calday" ALIGN=RIGHT WIDTH=14%>';for(var j=0;j<7;j++){result+=td+this.dayHeaders[(this.weekStartDay+j)%7]+"</TD>\n"}result+="</TR>\n";for(var row=1;row<=6;row++){result+="<TR>\n";for(var col=1;col<=7;col++){if(display_month==month){date_class="calthismonth"}else{date_class="calothermonth"}if((display_month==this.currentDate.getMonth()+1)&&(display_date==this.currentDate.getDate())&&(display_year==this.currentDate.getFullYear())){td_class="caltoday"}else{td_class="calmonth"}var disabled=false;if(this.disabledDatesExpression!=""){var ds=""+display_year+LZ(display_month)+LZ(display_date);eval("disabled=("+this.disabledDatesExpression+")")}if(disabled||this.disabledWeekDays[col-1]){date_class=(disabled)?"disabled":"calnotclickable";result+='  <TD CLASS="'+td_class+'"><SPAN CLASS="'+date_class+'">'+display_date+"</SPAN></TD>\n"}else{var selected_date=display_date;var selected_month=display_month;var selected_year=display_year;if(this.displayType=="week-end"){var d=new Date(selected_year,selected_month-1,selected_date,0,0,0,0);d.setDate(d.getDate()+(7-col));selected_year=d.getYear();if(selected_year<1000){selected_year+=1900}selected_month=d.getMonth()+1;selected_date=d.getDate()}result+='   <TD CLASS="'+td_class+'"><A HREF="javascript:'+windowref+this.returnFunction+"("+selected_year+","+selected_month+","+selected_date+");"+windowref+"CalendarPopup_hideCalendar('"+this.index+'\');" CLASS="'+date_class+'">'+display_date+"</A></TD>\n"}display_date++;if(display_date>daysinmonth[display_month]){display_date=1;display_month++}if(display_month>12){display_month=1;display_year++}}result+="</TR>"}var current_weekday=now.getDay()-this.weekStartDay;if(current_weekday<0){current_weekday+=7}result+="<TR>\n";result+=' <TD COLSPAN=7 ALIGN=CENTER CLASS="textlink">\n';if(this.disabledWeekDays[current_weekday+1]){result+='      <SPAN CLASS="disabledtextlink">'+this.todayText+"</SPAN>\n"}else{result+='        <A CLASS="textlink" HREF="javascript:'+windowref+this.returnFunction+"('"+now.getFullYear()+"','"+(now.getMonth()+1)+"','"+now.getDate()+"');"+windowref+"CalendarPopup_hideCalendar('"+this.index+"');\">"+this.todayText+"</A>\n"}result+="        <BR>\n";result+=" </TD></TR></TABLE></CENTER></TD></TR></TABLE>\n"}if(this.displayType=="month"||this.displayType=="quarter"||this.displayType=="year"){if(arguments.length>0){var year=arguments[0]}else{if(this.displayType=="year"){var year=now.getFullYear()-this.yearSelectStartOffset}else{var year=now.getFullYear()}}if(this.displayType!="year"&&this.isShowYearNavigation){result+=t144;result+='<TR BGCOLOR="#C0C0C0">\n';result+='   <TD BGCOLOR="#C0C0C0" CLASS="cal" WIDTH=22 ALIGN=CENTER VALIGN=MIDDLE><B><A CLASS="cal" HREF="javascript:'+windowref+"CalendarPopup_refreshCalendar("+this.index+","+(year-1)+');">&lt;&lt;</A></B></TD>\n';result+='     <TD BGCOLOR="#C0C0C0" CLASS="cal" WIDTH=100 ALIGN=CENTER>'+year+"</TD>\n";result+='     <TD BGCOLOR="#C0C0C0" CLASS="cal" WIDTH=22 ALIGN=CENTER VALIGN=MIDDLE><B><A CLASS="cal" HREF="javascript:'+windowref+"CalendarPopup_refreshCalendar("+this.index+","+(year+1)+');">&gt;&gt;</A></B></TD>\n';result+="</TR></TABLE>\n"}}if(this.displayType=="month"){result+="<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n";for(var i=0;i<4;i++){result+="<TR>";for(var j=0;j<3;j++){var monthindex=((i*3)+j);result+='<TD WIDTH=33% ALIGN=CENTER><A CLASS="textlink" HREF="javascript:'+windowref+this.returnMonthFunction+"("+year+","+(monthindex+1)+");"+windowref+"CalendarPopup_hideCalendar('"+this.index+'\');" CLASS="'+date_class+'">'+this.monthAbbreviations[monthindex]+"</A></TD>"}result+="</TR>"}result+="</TABLE></CENTER></TD></TR></TABLE>\n"}if(this.displayType=="quarter"){result+="<BR><TABLE WIDTH=120 BORDER=1 CELLSPACING=0 CELLPADDING=0 ALIGN=CENTER>\n";for(var i=0;i<2;i++){result+="<TR>";for(var j=0;j<2;j++){var quarter=((i*2)+j+1);result+='<TD WIDTH=50% ALIGN=CENTER><BR><A CLASS="textlink" HREF="javascript:'+windowref+this.returnQuarterFunction+"("+year+","+quarter+");"+windowref+"CalendarPopup_hideCalendar('"+this.index+'\');" CLASS="'+date_class+'">Q'+quarter+"</A><BR><BR></TD>"}result+="</TR>"}result+="</TABLE></CENTER></TD></TR></TABLE>\n"}if(this.displayType=="year"){var yearColumnSize=4;result+=t144;result+='<TR BGCOLOR="#C0C0C0">\n';result+='    <TD BGCOLOR="#C0C0C0" CLASS="cal" WIDTH=50% ALIGN=CENTER VALIGN=MIDDLE><B><A CLASS="cal" HREF="javascript:'+windowref+"CalendarPopup_refreshCalendar("+this.index+","+(year-(yearColumnSize*2))+');">&lt;&lt;</A></B></TD>\n';result+='  <TD BGCOLOR="#C0C0C0" CLASS="cal" WIDTH=50% ALIGN=CENTER VALIGN=MIDDLE><B><A CLASS="cal" HREF="javascript:'+windowref+"CalendarPopup_refreshCalendar("+this.index+","+(year+(yearColumnSize*2))+');">&gt;&gt;</A></B></TD>\n';result+="</TR></TABLE>\n";result+="<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n";for(var i=0;i<yearColumnSize;i++){for(var j=0;j<2;j++){var currentyear=year+(j*yearColumnSize)+i;result+='<TD WIDTH=50% ALIGN=CENTER><A CLASS="textlink" HREF="javascript:'+windowref+this.returnYearFunction+"("+currentyear+");"+windowref+"CalendarPopup_hideCalendar('"+this.index+'\');" CLASS="'+date_class+'">'+currentyear+"</A></TD>"}result+="</TR>"}result+="</TABLE></CENTER></TD></TR></TABLE>\n"}if(this.type=="WINDOW"){result+="</BODY></HTML>\n"}return result}document.write(CalendarPopup_getStyles());var cal=new CalendarPopup();cal.showYearNavigation();cal.setTodayText("");cal.setReturnFunction("setD");function setD(e,c,a){document.MainPage.lstArrivalYear.value=e;document.MainPage.lstArrivalMonth.selectedIndex=--c;for(var b=0;b<document.MainPage.lstArrivalDay.options.length;b++){if(document.MainPage.lstArrivalDay.options[b].value==a){document.MainPage.lstArrivalDay.selectedIndex=b}}}function getDateString(g,e,b){var f=g.options[g.selectedIndex].value;var c=e.options[e.selectedIndex].value;var a=b.options[b.selectedIndex].value;if(f==""||c==""){return null}if(a==""){a=1}return str=f+"-"+c+"-"+a}var advancedDay=2;function isLeapYear(c){var a=false;var b=parseInt(c,10);if(b%4==0){a=true}return a}function getDaysInMonth(b,c){var a=31;if(b==1){if(isLeapYear(c)){a=29}else{a=28}}if(b==3||b==5||b==8||b==10){a=30}return a}function initEweb(){var d=new Date();var f=d.getFullYear();var a=d.getFullYear();var e=d.getMonth();var b=d.getDate();var c=getDaysInMonth(e,f);if(b+advancedDay>c){b=((b+advancedDay)%c);if(e==11){e=0;f++}else{e++}}else{b=b+advancedDay}b--;f-=a;document.MainPage.lstArrivalMonth.selectedIndex=e;document.MainPage.lstArrivalDay.selectedIndex=b;document.MainPage.lstArrivalYear.selectedIndex=f;return}if(window.taValidate==undefined){window.taOnLoad=window.onload;window.taValList=Array();window.taValIndex=0;window.taValidate=function(){if(window.taOnLoad!=null){try{window.taOnLoad()}catch(a){}}for(ii=0;ii<window.taValIndex;ii=ii+1){fname=window.taValList[ii];fname()}};window.taAddValidator=function(a){window.taValList[window.taValIndex]=a;window.taValIndex=window.taValIndex+1};window.onload=window.taValidate}window.taAddValidator(injectrated1281);if(document.createStyleSheet){document.createStyleSheet("http://c1.tacdn.com/css2/widget/cdswidFRR-v968959094a.css")}else{var stylesImport="@import url(' http://c1.tacdn.com/css2/widget/cdswidFRR-v968959094a.css ');";var newSS=document.createElement("link");newSS.rel="stylesheet";newSS.href="data:text/css,"+escape(stylesImport);if(document.getElementsByTagName("head")[0]){document.getElementsByTagName("head")[0].appendChild(newSS)}else{document.write('<link rel="stylesheet" href="data:text/css,'+escape(stylesImport)+'"/>')}}var newJs=document.createElement("script");newJs.setAttribute("type","text/javascript");newJs.setAttribute("src","http://c1.tacdn.com/js3/src/widget/CdsWidgets-v2592911786a.js");document.getElementsByTagName("head")[0].appendChild(newJs);var validityRegEx=[new RegExp("https?://([^/]+.|)tripadvisor.(com.ar|ca|com|jp|co.uk|de|dk|ie|fr|com.mx|co.id|com.my|it|com.br|com.tr|com.eg|se|in|co.kr|com.gr|com.sg|com.au|ru|es|com.tw|nl)/.*"),new RegExp("https?://([^/]+.|)daodao.(com)/.*")];function injectrated1281(){var a=document.getElementById("TA_rated453");if(a==null){var h=document.getElementsByTagName("script");for(var b=0;b<h.length;b++){if(h[b]!=null&&h[b].src!=null&&h[b].src.indexOf("rated?uniq=453")>=0){var f=document.createElement("div");if(f!=null&&f!="undefined"){f.style.margin="8px";f.style.color="red";f.innerHTML="Please check the TripAdvisor code and install again.";var g=h[b].parentNode;if(g!=null&&g!="undefined"){g.appendChild(f)}break}}}return}var m=true;var d=0;var c=a.getElementsByTagName("a");for(var b=0;b<c.length;b++){var j=c[b];var k=j.href;if(k.search(/(daodao|tripadvisor)/)!=-1){d=d+1;if(typeof(j.rel)!="undefined"&&j.rel=="nofollow"){m=false;continue}var e=false;for(var n=0;n<validityRegEx.length;n++){if(k.match(validityRegEx[n])){e=true;break}}if(!e){continue}}}if(d==0){m=false}if(!m){var l="<dl><dt>Please check the TripAdvisor code and install again.</dt></dl>";a.innerHTML=l}else{a.innerHTML='<div id="CDSWIDFRR" class="widFRR"> <img class="widFRRIMG" id="CDSWIDFRRIMG" src="http://www.tripadvisor.com/img/cdsi/img2/badges/recommended_en-11424-2.gif" alt="Candy Cane Inn, Anaheim"/> <var class="widFRRCopy"><a target="_blank" href="http://www.tripadvisor.com/Hotel_Review-g29092-d218752-Reviews-Candy_Cane_Inn-Anaheim_California.html">Candy Cane Inn</a></var><!--/ cdsRRFCopy--> </div><!--/ cdsFRRBadge--> '}};
