var _tmp_date_update_time_div=null;
var _tmp_date_update_time_add_days=null;
function getAnchorPosition(b){var e=false;
var k=new Object();
var j=0,g=0;
var d=false,f=false,h=false;
if(document.getElementById){d=true
}else{if(document.all){f=true
}else{if(document.layers){h=true
}}}if(d&&document.all){j=AnchorPosition_getPageOffsetLeft(document.all[b]);
g=AnchorPosition_getPageOffsetTop(document.all[b])
}else{if(d){var a=document.getElementById(b);
j=AnchorPosition_getPageOffsetLeft(a);
g=AnchorPosition_getPageOffsetTop(a)
}else{if(f){j=AnchorPosition_getPageOffsetLeft(document.all[b]);
g=AnchorPosition_getPageOffsetTop(document.all[b])
}else{if(h){var l=0;
for(var c=0;
c<document.anchors.length;
c++){if(document.anchors[c].name==b){l=1;
break
}}if(l==0){k.x=0;
k.y=0;
return k
}j=document.anchors[c].x;
g=document.anchors[c].y
}else{k.x=0;
k.y=0;
return k
}}}}k.x=j;
k.y=g;
return k
}function getAnchorWindowPosition(b){var c=getAnchorPosition(b);
var a=0;
var d=0;
if(document.getElementById){if(isNaN(window.screenX)){a=c.x-document.body.scrollLeft+window.screenLeft;
d=c.y-document.body.scrollTop+window.screenTop
}else{a=c.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
d=c.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset
}}else{if(document.all){a=c.x-document.body.scrollLeft+window.screenLeft;
d=c.y-document.body.scrollTop+window.screenTop
}else{if(document.layers){a=c.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
d=c.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset
}}}c.x=a;
c.y=d;
return c
}function AnchorPosition_getPageOffsetLeft(b){var a=b.offsetLeft;
while((b=b.offsetParent)!=null){a+=b.offsetLeft
}return a
}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
}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(e,f,c,d){var b=getDateFromFormat(e,f);
var a=getDateFromFormat(c,d);
if(b==0||a==0){return -1
}else{if(b>a){return 1
}}return 0
}function formatDate(I,D){D=D+"";
var l="";
var v=0;
var G="";
var f="";
var j=I.getYear()+"";
var g=I.getMonth()+1;
var F=I.getDate();
var o=I.getDay();
var n=I.getHours();
var x=I.getMinutes();
var q=I.getSeconds();
var t,u,b,r,J,e,C,B,z,p,N,n,L,i,a,A;
var w=new Object();
if(j.length<4){j=""+(j-0+1900)
}w.y=""+j;
w.yyyy=j;
w.yy=j.substring(2,4);
w.M=g;
w.MM=LZ(g);
w.MMM=MONTH_NAMES[g-1];
w.NNN=MONTH_NAMES[g+11];
w.d=F;
w.dd=LZ(F);
w.E=DAY_NAMES[o+7];
w.EE=DAY_NAMES[o];
w.H=n;
w.HH=LZ(n);
if(n==0){w.h=12
}else{if(n>12){w.h=n-12
}else{w.h=n
}}w.hh=LZ(w.h);
if(n>11){w.K=n-12
}else{w.K=n
}w.k=n+1;
w.KK=LZ(w.K);
w.kk=LZ(w.k);
if(n>11){w.a="PM"
}else{w.a="AM"
}w.m=x;
w.mm=LZ(x);
w.s=q;
w.ss=LZ(q);
while(v<D.length){G=D.charAt(v);
f="";
while((D.charAt(v)==G)&&(v<D.length)){f+=D.charAt(v++)
}if(w[f]!=null){l=l+w[f]
}else{l=l+f
}}return l
}function _isInteger(c){var b="1234567890";
for(var a=0;
a<c.length;
a++){if(b.indexOf(c.charAt(a))==-1){return false
}}return true
}function _getInt(f,d,e,c){for(var a=c;
a>=e;
a--){var b=f.substring(d,d+a);
if(b.length<e){return null
}if(_isInteger(b)){return b
}}return null
}function getDateFromFormat(w,p){w=w+"";
p=p+"";
var v=0;
var l=0;
var r="";
var f="";
var u="";
var h,g;
var b=new Date();
var j=b.getYear();
var t=b.getMonth()+1;
var s=1;
var d=b.getHours();
var q=b.getMinutes();
var n=b.getSeconds();
var k="";
while(l<p.length){r=p.charAt(l);
f="";
while((p.charAt(l)==r)&&(l<p.length)){f+=p.charAt(l++)
}if(f=="yyyy"||f=="yy"||f=="y"){if(f=="yyyy"){h=4;
g=4
}if(f=="yy"){h=2;
g=2
}if(f=="y"){h=2;
g=4
}j=_getInt(w,v,h,g);
if(j==null){return 0
}v+=j.length;
if(j.length==2){if(j>70){j=1900+(j-0)
}else{j=2000+(j-0)
}}}else{if(f=="MMM"||f=="NNN"){t=0;
for(var o=0;
o<MONTH_NAMES.length;
o++){var e=MONTH_NAMES[o];
if(w.substring(v,v+e.length).toLowerCase()==e.toLowerCase()){if(f=="MMM"||(f=="NNN"&&o>11)){t=o+1;
if(t>12){t-=12
}v+=e.length;
break
}}}if((t<1)||(t>12)){return 0
}}else{if(f=="EE"||f=="E"){for(var o=0;
o<DAY_NAMES.length;
o++){var m=DAY_NAMES[o];
if(w.substring(v,v+m.length).toLowerCase()==m.toLowerCase()){v+=m.length;
break
}}}else{if(f=="MM"||f=="M"){t=_getInt(w,v,f.length,2);
if(t==null||(t<1)||(t>12)){return 0
}v+=t.length
}else{if(f=="dd"||f=="d"){s=_getInt(w,v,f.length,2);
if(s==null||(s<1)||(s>31)){return 0
}v+=s.length
}else{if(f=="hh"||f=="h"){d=_getInt(w,v,f.length,2);
if(d==null||(d<1)||(d>12)){return 0
}v+=d.length
}else{if(f=="HH"||f=="H"){d=_getInt(w,v,f.length,2);
if(d==null||(d<0)||(d>23)){return 0
}v+=d.length
}else{if(f=="KK"||f=="K"){d=_getInt(w,v,f.length,2);
if(d==null||(d<0)||(d>11)){return 0
}v+=d.length
}else{if(f=="kk"||f=="k"){d=_getInt(w,v,f.length,2);
if(d==null||(d<1)||(d>24)){return 0
}v+=d.length;
d--
}else{if(f=="mm"||f=="m"){q=_getInt(w,v,f.length,2);
if(q==null||(q<0)||(q>59)){return 0
}v+=q.length
}else{if(f=="ss"||f=="s"){n=_getInt(w,v,f.length,2);
if(n==null||(n<0)||(n>59)){return 0
}v+=n.length
}else{if(f=="a"){if(w.substring(v,v+2).toLowerCase()=="am"){k="AM"
}else{if(w.substring(v,v+2).toLowerCase()=="pm"){k="PM"
}else{return 0
}}v+=2
}else{if(w.substring(v,v+f.length)!=f){return 0
}else{v+=f.length
}}}}}}}}}}}}}}if(v!=w.length){return 0
}if(t==2){if(((j%4==0)&&(j%100!=0))||(j%400==0)){if(s>29){return 0
}}else{if(s>28){return 0
}}}if((t==4)||(t==6)||(t==9)||(t==11)){if(s>30){return 0
}}if(d<12&&k=="PM"){d=d-0+12
}else{if(d>11&&k=="AM"){d-=12
}}var a=new Date(j,t-1,s,d,q,n);
return a.getTime()
}function parseDate(h){var f=(arguments.length==2)?arguments[1]:false;
generalFormats=new Array("yyyy/MM/dd","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 b=new Array("generalFormats",f?"dateFirst":"monthFirst",f?"monthFirst":"dateFirst");
var g=null;
for(var e=0;
e<b.length;
e++){var a=window[b[e]];
for(var c=0;
c<a.length;
c++){g=getDateFromFormat(h,a[c]);
if(g!=0){return new Date(g)
}}}return null
}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+"px";
document.getElementById(this.divName).style.top=this.y+"px";
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
}}var b=window.opera||(document.layers&&!navigator.mimeTypes["*"])||navigator.vendor=="KDE"||(document.childNodes&&!document.all&&!navigator.taintEnabled);
this.popupWindow=window.open(b?"":"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 d=c.pageX;
var b=c.pageY;
var a=document.layers[this.divName];
if((d>a.left)&&(d<a.left+a.clip.width)&&(b>a.top)&&(b<a.top+a.clip.height)){return true
}else{return false
}}else{if(document.all){var a=window.event.srcElement;
while(a.parentElement!=null){if(a.id==this.divName){return true
}a=a.parentElement
}return false
}else{if(this.use_gebi&&c){var a=c.originalTarget;
while(a.parentNode!=null){if(a.id==this.divName){return true
}a=a.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(c){for(var a=0;
a<popupWindowObjects.length;
a++){if(popupWindowObjects[a]!=null){var b=popupWindowObjects[a];
b.hideIfNotClicked(c)
}}}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="CP_tmpReturnFunction";
a.returnMonthFunction="CP_tmpReturnMonthFunction";
a.returnQuarterFunction="CP_tmpReturnQuarterFunction";
a.returnYearFunction="CP_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";
a.cssPrefix="";
a.isShowNavigationDropdowns=false;
a.isShowYearNavigationInput=false;
window.CP_calendarObject=null;
window.CP_targetInput=null;
window.CP_dateFormat="MM/dd/yyyy";
a.copyMonthNamesToWindow=CP_copyMonthNamesToWindow;
a.setReturnFunction=CP_setReturnFunction;
a.setReturnMonthFunction=CP_setReturnMonthFunction;
a.setReturnQuarterFunction=CP_setReturnQuarterFunction;
a.setReturnYearFunction=CP_setReturnYearFunction;
a.setMonthNames=CP_setMonthNames;
a.setMonthAbbreviations=CP_setMonthAbbreviations;
a.setDayHeaders=CP_setDayHeaders;
a.setWeekStartDay=CP_setWeekStartDay;
a.setDisplayType=CP_setDisplayType;
a.setDisabledWeekDays=CP_setDisabledWeekDays;
a.addDisabledDates=CP_addDisabledDates;
a.setYearSelectStartOffset=CP_setYearSelectStartOffset;
a.setTodayText=CP_setTodayText;
a.showYearNavigation=CP_showYearNavigation;
a.showCalendar=CP_showCalendar;
a.hideCalendar=CP_hideCalendar;
a.getStyles=getCalendarStyles;
a.refreshCalendar=CP_refreshCalendar;
a.getCalendar=CP_getCalendar;
a.select=CP_select;
a.select_update=CP_select_update;
a.setCssPrefix=CP_setCssPrefix;
a.showNavigationDropdowns=CP_showNavigationDropdowns;
a.showYearNavigationInput=CP_showYearNavigationInput;
a.copyMonthNamesToWindow();
return a
}function CP_copyMonthNamesToWindow(){if(typeof(window.MONTH_NAMES)!="undefined"&&window.MONTH_NAMES!=null){window.MONTH_NAMES=new Array();
for(var a=0;
a<this.monthNames.length;
a++){window.MONTH_NAMES[window.MONTH_NAMES.length]=this.monthNames[a]
}for(var a=0;
a<this.monthAbbreviations.length;
a++){window.MONTH_NAMES[window.MONTH_NAMES.length]=this.monthAbbreviations[a]
}}}function CP_tmpReturnFunction(e,a,c){if(window.CP_targetInput!=null){var b=new Date(e,a-1,c,0,0,0);
if(window.CP_calendarObject!=null){window.CP_calendarObject.copyMonthNamesToWindow()
}window.CP_targetInput.value=formatDate(b,window.CP_dateFormat);
if(_tmp_date_update_time_div!=null&&_tmp_date_update_time_add_days!=null){b.setDate(b.getDate()+_tmp_date_update_time_add_days);
document.getElementById(_tmp_date_update_time_div).value=formatDate(b,"dd-MM-yyyy");
_tmp_date_update_time_div=null;
_tmp_date_update_time_add_days=null
}}else{alert("Use setReturnFunction() to define which function will get the clicked results!")
}}function CP_tmpReturnMonthFunction(b,a){alert("Use setReturnMonthFunction() to define which function will get the clicked results!\nYou clicked: year="+b+" , month="+a)
}function CP_tmpReturnQuarterFunction(b,a){alert("Use setReturnQuarterFunction() to define which function will get the clicked results!\nYou clicked: year="+b+" , quarter="+a)
}function CP_tmpReturnYearFunction(a){alert("Use setReturnYearFunction() to define which function will get the clicked results!\nYou clicked: year="+a)
}function CP_setReturnFunction(a){this.returnFunction=a
}function CP_setReturnMonthFunction(a){this.returnMonthFunction=a
}function CP_setReturnQuarterFunction(a){this.returnQuarterFunction=a
}function CP_setReturnYearFunction(a){this.returnYearFunction=a
}function CP_setMonthNames(){for(var a=0;
a<arguments.length;
a++){this.monthNames[a]=arguments[a]
}this.copyMonthNamesToWindow()
}function CP_setMonthAbbreviations(){for(var a=0;
a<arguments.length;
a++){this.monthAbbreviations[a]=arguments[a]
}this.copyMonthNamesToWindow()
}function CP_setDayHeaders(){for(var a=0;
a<arguments.length;
a++){this.dayHeaders[a]=arguments[a]
}}function CP_setWeekStartDay(a){this.weekStartDay=a
}function CP_showYearNavigation(){this.isShowYearNavigation=(arguments.length>0)?arguments[0]:true
}function CP_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 CP_setYearSelectStartOffset(a){this.yearSelectStartOffset=a
}function CP_setDisabledWeekDays(){this.disabledWeekDays=new Object();
for(var a=0;
a<arguments.length;
a++){this.disabledWeekDays[arguments[a]]=true
}}function CP_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 CP_setTodayText(a){this.todayText=a
}function CP_setCssPrefix(a){this.cssPrefix=a
}function CP_showNavigationDropdowns(){this.isShowNavigationDropdowns=(arguments.length>0)?arguments[0]:true
}function CP_showYearNavigationInput(){this.isShowYearNavigationInput=(arguments.length>0)?arguments[0]:true
}function CP_hideCalendar(){if(arguments.length>0){window.popupWindowObjects[arguments[0]].hidePopup()
}else{this.hidePopup()
}}function CP_refreshCalendar(a){var b=window.popupWindowObjects[a];
if(arguments.length>1){b.populate(b.getCalendar(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]))
}else{b.populate(b.getCalendar())
}b.refresh()
}function CP_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 CP_select(e,b,g,d,c){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(e.type!="text"&&e.type!="hidden"&&e.type!="textarea"){alert("calendar.select: Input object passed is not a valid form input object");
window.CP_targetInput=null;
return
}if(e.disabled){return
}window.CP_targetInput=e;
window.CP_calendarObject=this;
this.currentDate=null;
var f=0;
if(d!=null){f=getDateFromFormat(d,g)
}else{if(e.value!=""){f=getDateFromFormat(e.value,g)
}}if(c!=null&&f!=0){var a=new Date(f);
a.setDate(a.getDate()+c);
f=a.getTime()
}if(d!=null||e.value!=""){if(f==0){this.currentDate=null
}else{this.currentDate=new Date(f)
}}window.CP_dateFormat=g;
this.showCalendar(b)
}function CP_select_update(d,a,f,c,b){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(d.type!="text"&&d.type!="hidden"&&d.type!="textarea"){alert("calendar.select: Input object passed is not a valid form input object");
window.CP_targetInput=null;
return
}if(d.disabled){return
}window.CP_targetInput=d;
window.CP_calendarObject=this;
this.currentDate=null;
var e=0;
if(d.value!=""){e=getDateFromFormat(d.value,f)
}if(d.value!=""){if(e==0){this.currentDate=null
}else{this.currentDate=new Date(e)
}}window.CP_dateFormat=f;
this.showCalendar(a);
if(b!=null&&c!=null){_tmp_date_update_time_div=c;
_tmp_date_update_time_add_days=b
}}function getCalendarStyles(){var a="";
var b="";
if(this!=null&&typeof(this.cssPrefix)!="undefined"&&this.cssPrefix!=null&&this.cssPrefix!=""){b=this.cssPrefix
}a+="<STYLE>\n";
a+="."+b+"cpYearNavigation,."+b+"cpMonthNavigation { background-color:#C0C0C0; text-align:center; vertical-align:center; text-decoration:none; color:#000000; font-weight:bold; }\n";
a+="."+b+"cpDayColumnHeader, ."+b+"cpYearNavigation,."+b+"cpMonthNavigation,."+b+"cpCurrentMonthDate,."+b+"cpCurrentMonthDateDisabled,."+b+"cpOtherMonthDate,."+b+"cpOtherMonthDateDisabled,."+b+"cpCurrentDate,."+b+"cpCurrentDateDisabled,."+b+"cpTodayText,."+b+"cpTodayTextDisabled,."+b+"cpText { font-family:arial; font-size:8pt; }\n";
a+="TD."+b+"cpDayColumnHeader { text-align:right; border:solid thin #C0C0C0;border-width:0px 0px 1px 0px; }\n";
a+="."+b+"cpCurrentMonthDate, ."+b+"cpOtherMonthDate, ."+b+"cpCurrentDate  { text-align:right; text-decoration:none; }\n";
a+="."+b+"cpCurrentMonthDateDisabled, ."+b+"cpOtherMonthDateDisabled, ."+b+"cpCurrentDateDisabled { color:#D0D0D0; text-align:right; text-decoration:line-through; }\n";
a+="."+b+"cpCurrentMonthDate, .cpCurrentDate { color:#000000; }\n";
a+="."+b+"cpOtherMonthDate { color:#808080; }\n";
a+="TD."+b+"cpCurrentDate { color:white; background-color: #C0C0C0; border-width:1px; border:solid thin #800000; }\n";
a+="TD."+b+"cpCurrentDateDisabled { border-width:1px; border:solid thin #FFAAAA; }\n";
a+="TD."+b+"cpTodayText, TD."+b+"cpTodayTextDisabled { border:solid thin #C0C0C0; border-width:1px 0px 0px 0px;}\n";
a+="A."+b+"cpTodayText, SPAN."+b+"cpTodayTextDisabled { height:20px; }\n";
a+="A."+b+"cpTodayText { color:black; }\n";
a+="."+b+"cpTodayTextDisabled { color:#D0D0D0; }\n";
a+="."+b+"cpBorder { border:solid thin #808080; }\n";
a+="</STYLE>\n";
return a
}function CP_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 CLASS="'+this.cssPrefix+'cpBorder" WIDTH=144 BORDER=1 BORDERWIDTH=1 CELLSPACING=0 CELLPADDING=1>\n';
result+="<TR><TD ALIGN=CENTER>\n";
result+="<CENTER>\n"
}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&&arguments[1]>0&&arguments[1]-0==arguments[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;
offset=(weekday>=this.weekStartDay)?weekday-this.weekStartDay: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+="<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>"
}result+="<TR>\n";
var refresh=windowref+"CP_refreshCalendar";
var refreshLink="javascript:"+refresh;
if(this.isShowNavigationDropdowns){result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="78" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpMonthNavigation" name="cpMonth" onChange="'+refresh+"("+this.index+",this.options[this.selectedIndex].value-0,"+(year-0)+');">';
for(var monthCounter=1;
monthCounter<=12;
monthCounter++){var selected=(monthCounter==month)?"SELECTED":"";
result+='<option value="'+monthCounter+'" '+selected+">"+this.monthNames[monthCounter-1]+"</option>"
}result+="</select></TD>";
result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';
result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="56" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpYearNavigation" name="cpYear" onChange="'+refresh+"("+this.index+","+month+',this.options[this.selectedIndex].value-0);">';
for(var yearCounter=year-this.yearSelectStartOffset;
yearCounter<=year+this.yearSelectStartOffset;
yearCounter++){var selected=(yearCounter==year)?"SELECTED":"";
result+='<option value="'+yearCounter+'" '+selected+">"+yearCounter+"</option>"
}result+="</select></TD>"
}else{if(this.isShowYearNavigation){result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+"("+this.index+","+last_month+","+last_month_year+');">&lt;</A></TD>';
result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="58"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+"</SPAN></TD>";
result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+"("+this.index+","+next_month+","+next_month_year+');">&gt;</A></TD>';
result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';
result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+"("+this.index+","+month+","+(year-1)+');">&lt;</A></TD>';
if(this.isShowYearNavigationInput){result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><INPUT NAME="cpYear" CLASS="'+this.cssPrefix+'cpYearNavigation" SIZE="4" MAXLENGTH="4" VALUE="'+year+'" onBlur="'+refresh+"("+this.index+","+month+',this.value-0);"></TD>'
}else{result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><SPAN CLASS="'+this.cssPrefix+'cpYearNavigation">'+year+"</SPAN></TD>"
}result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+"("+this.index+","+month+","+(year+1)+');">&gt;</A></TD>'
}else{result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+"("+this.index+","+last_month+","+last_month_year+');">&lt;&lt;</A></TD>\n';
result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="100"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+" "+year+"</SPAN></TD>\n";
result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+"("+this.index+","+next_month+","+next_month_year+');">&gt;&gt;</A></TD>\n'
}}result+="</TR></TABLE>\n";
result+="<TABLE WIDTH=120 BORDER=0 CELLSPACING=0 CELLPADDING=1 ALIGN=CENTER>\n";
result+="<TR>\n";
for(var j=0;
j<7;
j++){result+='<TD CLASS="'+this.cssPrefix+'cpDayColumnHeader" WIDTH="14%"><SPAN CLASS="'+this.cssPrefix+'cpDayColumnHeader">'+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++){var disabled=false;
if(this.disabledDatesExpression!=""){var ds=""+display_year+LZ(display_month)+LZ(display_date);
eval("disabled=("+this.disabledDatesExpression+")")
}var dateClass="";
if((display_month==this.currentDate.getMonth()+1)&&(display_date==this.currentDate.getDate())&&(display_year==this.currentDate.getFullYear())){dateClass="cpCurrentDate"
}else{if(display_month==month){dateClass="cpCurrentMonthDate"
}else{dateClass="cpOtherMonthDate"
}}if(disabled||this.disabledWeekDays[col-1]){result+='	<TD CLASS="'+this.cssPrefix+dateClass+'"><SPAN CLASS="'+this.cssPrefix+dateClass+'Disabled">'+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="'+this.cssPrefix+dateClass+'"><A HREF="javascript:'+windowref+this.returnFunction+"("+selected_year+","+selected_month+","+selected_date+");"+windowref+"CP_hideCalendar('"+this.index+'\');" CLASS="'+this.cssPrefix+dateClass+'">'+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="'+this.cssPrefix+'cpTodayText">\n';
if(this.disabledDatesExpression!=""){var ds=""+now.getFullYear()+LZ(now.getMonth()+1)+LZ(now.getDate());
eval("disabled=("+this.disabledDatesExpression+")")
}if(disabled||this.disabledWeekDays[current_weekday+1]){result+='		<SPAN CLASS="'+this.cssPrefix+'cpTodayTextDisabled">'+this.todayText+"</SPAN>\n"
}else{result+='		<A CLASS="'+this.cssPrefix+'cpTodayText" HREF="javascript:'+windowref+this.returnFunction+"('"+now.getFullYear()+"','"+(now.getMonth()+1)+"','"+now.getDate()+"');"+windowref+"CP_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+="<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";
result+="<TR>\n";
result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+"CP_refreshCalendar("+this.index+","+(year-1)+');">&lt;&lt;</A></TD>\n';
result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="100">'+year+"</TD>\n";
result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+"CP_refreshCalendar("+this.index+","+(year+1)+');">&gt;&gt;</A></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="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnMonthFunction+"("+year+","+(monthindex+1)+");"+windowref+"CP_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="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnQuarterFunction+"("+year+","+quarter+");"+windowref+"CP_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+="<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";
result+="<TR>\n";
result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+"CP_refreshCalendar("+this.index+","+(year-(yearColumnSize*2))+');">&lt;&lt;</A></TD>\n';
result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+"CP_refreshCalendar("+this.index+","+(year+(yearColumnSize*2))+');">&gt;&gt;</A></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="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnYearFunction+"("+currentyear+");"+windowref+"CP_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
};