-
Notifications
You must be signed in to change notification settings - Fork 0
/
DatePicker.js Infopath
34 lines (26 loc) · 27.2 KB
/
DatePicker.js Infopath
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
en infopath con Chrome tenemos el problema de que al pinchar en el datepicker el focus se va a arriba de la página,
es un problema con el datepicker.js que está en
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\LAYOUTS
en este github he subido los archivos necesarios datepicker.js y datepicker.debug.js por si vuelve a pasar
porque si hacemos un update de CU o similar habrá que volver a ponerlos...
una posible solución en
http://sharepoint.stackexchange.com/questions/116399/sharepoint-datepicker-jumps-to-top-in-chrome
este es el que utilizaba Encamina
function $_global_datepicker(){UTF8_1ST_OF_2=192;UTF8_1ST_OF_3=224;UTF8_1ST_OF_4=240;UTF8_TRAIL=128;HIGH_SURROGATE_BITS=55296;LOW_SURROGATE_BITS=56320;SURROGATE_6_BIT=64512;SURROGATE_ID_BITS=63488;SURROGATE_OFFSET=65536;if(typeof String.prototype.endsWith=="undefined")String.prototype.endsWith=function(a){return this.substr(this.length-a.length)===a};if(typeof String.prototype.startsWith=="undefined")String.prototype.startsWith=function(a){return this.substr(0,a.length)===a};XUIHtml={};XUIHtml.SetOpacity=function(a,b){if(typeof a.style=="undefined")return;if(document.body.style.opacity!=null)if(b==1)XUIHtml.RemoveCSSProperty(a,"opacity");else a.style.opacity=b;else if(b==1)XUIHtml.RemoveCSSProperty(a,"filter");else a.style.filter="alpha(opacity="+String(b*100)+")"};XUIHtml.RemoveCSSProperty=function(a,b){if(typeof a.style.removeProperty!="undefined")a.style.removeProperty(b);else a.style.removeAttribute(b)};XUIHtml.GetOpacity=function(a){if(typeof a.style=="undefined")return-1;if(document.body.style.opacity!=null){var c=a.style.opacity;return c!=null&&c!=""?parseFloat(c):1}else{var b=a.style.filter;return b!=null&&b!=""?parseInt(b.replace("alpha(opacity=","").replace(")",""))/100:1}};Browseris.prototype={firefox:undefined,firefox36up:undefined,firefox3up:undefined,firefox4up:undefined,ie:undefined,ie55up:undefined,ie5up:undefined,ie7down:undefined,ie8down:undefined,ie8standard:undefined,ie8standardUp:undefined,ie9standardUp:undefined,ipad:undefined,windowsphone7:undefined,chrome:undefined,chrome7up:undefined,chrome8up:undefined,chrome9up:undefined,iever:undefined,mac:undefined,major:undefined,msTouch:undefined,isTouch:undefined,nav:undefined,nav6:undefined,nav6up:undefined,nav7up:undefined,osver:undefined,safari:undefined,safari125up:undefined,safari3up:undefined,safariMobile:undefined,verIEFull:undefined,w3c:undefined,webKit:undefined,win:undefined,win8AppHost:undefined,win32:undefined,win64bit:undefined,winnt:undefined,armProcessor:undefined};browseris=new Browseris;bis=browseris;typeof Sys!="undefined"&&Boolean(Sys)&&typeof Sys.Application!="undefined"&&Boolean(Sys.Application)&&typeof Sys.Application.notifyScriptLoaded=="function"&&Sys.Application.notifyScriptLoaded();typeof NotifyScriptLoadedAndExecuteWaitingJobs=="function"&&NotifyScriptLoadedAndExecuteWaitingJobs("owsbrows.js");g_insideCurrentMonth=false;g_focusOnFirstDayCurrentMonth=false;g_focusOnLastDayCurrentMonth=false;g_strDatePickerFrameID="DatePickerFrame";g_strDatePickerImageID="DatePickerImage";g_strDatePickerRangeValidatorID="DatePickerRangeValidator";g_warnonce=1;typeof Sys!="undefined"&&Sys!=null&&Sys.Application!=null&&Sys.Application.notifyScriptLoaded();typeof NotifyScriptLoadedAndExecuteWaitingJobs=="function"&&NotifyScriptLoadedAndExecuteWaitingJobs("datepicker.js")}function ULSvmd(){var a={};a.ULSTeamName="Microsoft SharePoint Foundation";a.ULSFileName="datepicker.commentedjs";return a}function $dg(a){a:;if(!(a in window))window[a]=undefined}var UTF8_1ST_OF_2,UTF8_1ST_OF_3,UTF8_1ST_OF_4,UTF8_TRAIL,HIGH_SURROGATE_BITS,LOW_SURROGATE_BITS,SURROGATE_6_BIT,SURROGATE_ID_BITS,SURROGATE_OFFSET;function escapeProperlyCoreCore(f,g,h,i){var c="",b,d=0,k=" \"%<>'&";if(typeof f=="undefined")return"";for(d=0;d<f.length;d++){var a=f.charCodeAt(d),e=f.charAt(d);if(g&&(e=="#"||e=="?")){c+=f.substr(d);break}if(h&&e=="&"){c+=e;continue}if(a<=127){if(i)c+=e;else if(a>=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57||g&&a>=32&&a<=95&&k.indexOf(e)<0)c+=e;else if(a<=15)c+="%0"+a.toString(16).toUpperCase();else if(a<=127)c+="%"+a.toString(16).toUpperCase()}else if(a<=2047){b=UTF8_1ST_OF_2|a>>6;c+="%"+b.toString(16).toUpperCase();b=UTF8_TRAIL|a&63;c+="%"+b.toString(16).toUpperCase()}else if((a&SURROGATE_6_BIT)!=HIGH_SURROGATE_BITS){b=UTF8_1ST_OF_3|a>>12;c+="%"+b.toString(16).toUpperCase();b=UTF8_TRAIL|(a&4032)>>6;c+="%"+b.toString(16).toUpperCase();b=UTF8_TRAIL|a&63;c+="%"+b.toString(16).toUpperCase()}else if(d<f.length-1){a=(a&1023)<<10;d++;var j=f.charCodeAt(d);a|=j&1023;a+=SURROGATE_OFFSET;b=UTF8_1ST_OF_4|a>>18;c+="%"+b.toString(16).toUpperCase();b=UTF8_TRAIL|(a&258048)>>12;c+="%"+b.toString(16).toUpperCase();b=UTF8_TRAIL|(a&4032)>>6;c+="%"+b.toString(16).toUpperCase();b=UTF8_TRAIL|a&63;c+="%"+b.toString(16).toUpperCase()}}return c}function escapeProperly(a){a:;return escapeProperlyCoreCore(a,false,false,false)}function escapeProperlyCore(b,a){a:;return escapeProperlyCoreCore(b,a,false,false)}function escapeUrlForCallback(a){var c=a.indexOf("#"),b=a.indexOf("?");if(c>0&&(b==-1||c<b)){var d=a.substr(0,c);if(b>0)d+=a.substr(b);a=d}return escapeProperlyCoreCore(a,true,false,true)}function IsSTSPageUrlValid(a){return a.substr(0,4)=="http"||a.substr(0,1)=="/"||a.indexOf(":")==-1}function PageUrlValidation(a){if(IsSTSPageUrlValid(a))return a;else{alert(Strings.STS.L_InvalidPageUrl_Text);return""}}function SelectRibbonTab(b,c){a:;var a;try{a=SP.Ribbon.PageManager.get_instance().get_ribbon()}catch(d){}if(!Boolean(a))typeof _ribbonStartInit!="undefined"&&_ribbonStartInit(b,false,null);else(c||a.get_selectedTabId()=="Ribbon.Read")&&a.selectTabById(b)}function FV4UI(){a:;return typeof _fV4UI!="undefined"&&_fV4UI}function GoToHistoryLink(c,d){if(c.href==null)return;var b=c.href,f=c.href.indexOf("?")>=0?"&":"?",e=f+"VersionNo="+d,a=GetSource();if(a!=null&&a!="")a="&Source="+a;b=c.href+e+a;if(isPortalTemplatePage(b))window.top.location.href=STSPageUrlValidation(b);else window.location.href=STSPageUrlValidation(b)}function GetGotoLinkUrl(b){if(b.href==null)return null;var d=b.href.indexOf("?")>=0?"&":"?",a=GetSource();if(a!=null&&a!="")a=d+"Source="+a;var c=b.href+a;return c}function GoToLink(c){a:;var a=GetGotoLinkUrl(c);if(a==null)return;var b=true;if(typeof window.top.SPUpdatePage!=="undefined")b=window.top.SPUpdatePage(a);if(b)if(c.target==="_blank")window.open(a,"_blank");else if(isPortalTemplatePage(a))window.top.location.href=STSPageUrlValidation(a);else window.location.href=STSPageUrlValidation(a)}function GoToLinkOrDialogNewWindow(a){if(a.href==null)return;if(Boolean(ajaxNavigate.get_search().match(RegExp("[?&]IsDlg=1"))))window.open(a.href);else GoToLink(a)}function GoToDiscussion(b){var c=b.indexOf("?")>=0?"&":"?",a=GetSource();if(a!=null&&a!="")b+=c+"TopicsView="+a;STSNavigate(b)}function GetCurrentEltStyle(b,c){if(Boolean(b.currentStyle))return b.currentStyle[c];else if(Boolean(window)&&Boolean(window.getComputedStyle)){var a=window.getComputedStyle(b,null);if(Boolean(a)&&Boolean(a.getPropertyValue))return a.getPropertyValue(c)}return null}function InsertNodeAfter(a,b){if(a==null||a.parentNode==null||b==null)return;var d=a.parentNode,c=a.nextSibling;if(c==null)d.appendChild(b);else d.insertBefore(b,c)}function EEDecodeSpecialChars(b){var a=b.replace(/"/g,'"');a=a.replace(/>/g,">");a=a.replace(/</g,"<");a=a.replace(/'/g,"'");a=a.replace(/&/g,"&");return a}function ShowAttachmentRows(){a:;var b=document.getElementById("idAttachmentsTable"),a=document.getElementById("idAttachmentsRow");if(a!=null)if(b==null||b.rows.length==0)a.style.display="none";else a.style.display="table-row"}function PreventDefaultNavigation(){a:;var a=window.event;if(a!=null)if(a.preventDefault==null)a.returnValue=false;else a.preventDefault()}function cancelDefault(a){if(typeof a=="undefined"||a==null)a=window.event;if(!(typeof a=="undefined"||a==null)){if(typeof a.stopPropagation=="function")a.stopPropagation();else a.cancelBubble=true;if(typeof a.preventDefault=="function")a.preventDefault();else a.returnValue=false}return false}function IsArray(a){return typeof a=="object"&&a instanceof Array}function IsNullOrUndefined(a){return a==null||a==undefined}function SetOpacity(a,b){XUIHtml.SetOpacity(a,b)}function GetOpacity(a){return XUIHtml.GetOpacity(a)}var XUIHtml;function Browseris(){a:;var a=navigator.userAgent.toLowerCase(),b;this.osver=1;if(Boolean(a)){var j=a.substring(a.indexOf("windows ")+11);this.osver=parseFloat(j)}this.major=parseInt(navigator.appVersion);this.nav=a.indexOf("mozilla")!=-1&&a.indexOf("spoofer")==-1&&a.indexOf("compatible")==-1;this.nav6=this.nav&&this.major==5;this.nav6up=this.nav&&this.major>=5;this.nav7up=false;if(this.nav6up){b=a.indexOf("netscape/");if(b>=0)this.nav7up=parseInt(a.substring(b+9))>=7}this.ie=a.indexOf("msie")!=-1;this.ipad=a.indexOf("ipad")!=-1;this.windowsphone7=a.indexOf("windows phone os 7.5")!=-1;this.aol=this.ie&&a.indexOf(" aol ")!=-1;if(this.ie){var g=a.substring(a.indexOf("msie ")+5);this.iever=parseInt(g);this.verIEFull=parseFloat(g)}else this.iever=0;this.ie4up=this.ie&&this.major>=4;this.ie5up=this.ie&&this.iever>=5;this.ie55up=this.ie&&this.verIEFull>=5.5;this.ie6up=this.ie&&this.iever>=6;this.ie7down=this.ie&&this.iever<=7;this.ie8down=this.ie&&this.iever<=8;this.ie7up=this.ie&&this.iever>=7;this.ie8standard=this.ie&&Boolean(document.documentMode)&&document.documentMode==8;this.ie8standardUp=this.ie&&Boolean(document.documentMode)&&document.documentMode>=8;this.ie9standardUp=this.ie&&Boolean(document.documentMode)&&document.documentMode>=9;this.ie10standardUp=this.ie&&Boolean(document.documentMode)&&document.documentMode>=10;this.winnt=a.indexOf("winnt")!=-1||a.indexOf("windows nt")!=-1;this.win32=this.major>=4&&navigator.platform=="Win32"||a.indexOf("win32")!=-1||a.indexOf("32bit")!=-1;this.win64bit=a.indexOf("win64")!=-1;this.win=this.winnt||this.win32||this.win64bit;this.mac=a.indexOf("mac")!=-1;this.w3c=this.nav6up;this.webKit=a.indexOf("webkit")!=-1;this.safari=a.indexOf("webkit")!=-1;this.safari125up=false;this.safari3up=false;this.safariMobile=false;if(this.safari&&this.major>=5){b=a.indexOf("webkit/");if(b>=0)this.safari125up=parseInt(a.substring(b+7))>=125;var h=a.indexOf("version/");if(h>=0)this.safari3up=parseInt(a.substring(h+8))>=3;this.safariMobile=a.indexOf("mobile")>b&&(this.ipad||a.indexOf("iphone")!=-1||a.indexOf("ipod")!=-1)}this.firefox=this.nav&&a.indexOf("firefox")!=-1;this.firefox3up=false;this.firefox36up=false;this.firefox4up=false;if(this.firefox&&this.major>=5){var f=a.indexOf("firefox/");if(f>=0){var c=a.substring(f+8);this.firefox3up=parseInt(c)>=3;this.firefox36up=parseFloat(c)>=3.6;this.firefox4up=parseInt(c)>=4}}this.win8AppHost=a.indexOf("msapphost")!=-1;this.chrome=this.nav&&a.indexOf("chrome")!=-1;this.chrome7up=false;this.chrome8up=false;this.chrome9up=false;if(this.chrome&&this.major>=5){var e=a.indexOf("chrome/");if(e>=0){var i=a.substring(e+7),d=parseInt(i);this.chrome7up=d>=7;this.chrome8up=d>=8;this.chrome9up=d>=9}}this.msTouch=typeof navigator.msMaxTouchPoints!="undefined"&&navigator.msMaxTouchPoints>0;this.isTouch=this.msTouch||"ontouchstart"in document.documentElement;this.armProcessor=a.indexOf("arm")!=-1}var browseris,bis;function byid(a){a:;return document.getElementById(a)}function newE(a){a:;return document.createElement(a)}function wpf(){a:;return typeof window.MSOWebPartPageFormName!="undefined"?document.forms[window.MSOWebPartPageFormName]:null}function startReplacement(){}function SetEvent(c,a,b){if(!b)b=window;if(typeof a=="string")a=new Function(a);b["on"+c]=a}function AttachEvent(a,c,b){if(!b)b=window;if(a=="domLoad")a=typeof b.addEventListener!="undefined"&&b.addEventListener&&browseris.nav?"DOMContentLoaded":"load";else if(a!="undefined"&&a!=null&&a.indexOf("touch")==0&&bis.msTouch)switch(a){case"touchstart":a="MSPointerDown";break;case"touchmove":a="MSPointerMove";break;case"touchend":a="MSPointerUp"}if(typeof c=="string")c=new Function(c);if(typeof b.addEventListener!="undefined"&&b.addEventListener)b.addEventListener(a,c,false);else typeof b.attachEvent!="undefined"&&b.attachEvent("on"+a,c)}function DetachEvent(c,b,a){if(!a)a=window;if(c=="domLoad")c=typeof a.removeEventListener!="undefined"&&a.removeEventListener&&browseris.nav?"DOMContentLoaded":"load";if(typeof b=="string")b=new Function(b);if(typeof a.removeEventListener!="undefined"&&a.removeEventListener)a.removeEventListener(c,b,false);else typeof a.detachEvent!="undefined"&&a.detachEvent("on"+c,b)}function CancelEvent(a){a.cancelBubble=true;Boolean(a.preventDefault)&&a.preventDefault();a.returnValue=false;return false}function GetEventSrcElement(a){return a.target!=null?a.target:a.srcElement}function GetEventKeyCode(a){return browseris.nav?a.which:a.keyCode}function GetInnerText(a){return browseris.safari&&browseris.major<5?a.innerHTML:browseris.nav||browseris.safari?a.textContent:a.innerText}function St2Digits(b){a:;var a="";if(b<0)return a;if(b<10)a+="0";a+=String(b);return a}var g_currentID,g_insideCurrentMonth,g_focusOnFirstDayCurrentMonth,g_focusOnLastDayCurrentMonth,g_firstDayID,g_lastDayID,g_strDatePickerFrameID,g_strDatePickerImageID,g_strDatePickerRangeValidatorID,g_warnonce,g_scrollLeft,g_scrollTop,g_selectedDate;function WindowPosition(a){var b=new Position;b.x=0;b.y=0;while(a.offsetParent!=null&&!(a.tagName=="DIV"&&(a.style.overflow=="auto"||a.style.overflowX=="auto"||a.style.overflowY=="auto"))){b.x+=a.offsetLeft-a.scrollLeft;b.y+=a.offsetTop-a.scrollTop;a=a.offsetParent}return b}function getOffsetTop(a,b){if(a==null)return b;if(a.tagName.toUpperCase()=="TD"&&a.style.borderTopStyle!="none"){var c=parseInt(a.style.borderTopWidth);if(!isNaN(c))b+=c}return getOffsetTop(a.tagName.toUpperCase()=="BODY"?a.parentNode:a.offsetParent,a.offsetTop-a.scrollTop+b)}function getOffsetLeft(a,b){if(a==null)return b;if(a.tagName.toUpperCase()=="TD"&&a.style.borderLeftStyle!="none"){var c=parseInt(a.style.borderLeftWidth);if(!isNaN(c))b+=c}return getOffsetLeft(a.tagName.toUpperCase()=="BODY"?a.parentNode:a.offsetParent,a.offsetLeft-a.scrollLeft+b)}function getDate(a,d,b){if(b!=null){var c=a[b];return c!=null?c:""}else return a.value!=null?a.value:d}function HLD(a){a:;HL(a,"ms-dphighlightedday")}function HLM(a){a:;HL(a,"ms-dphighlightedmonth")}function HL(a,b){if(typeof a.classSave!="undefined"&&a.classSave!=null){a.className=a.classSave;a.classSave=null}else{a.classSave=a.className;a.className=b}}function GetIframe(){a:;if(typeof GetParentWindow=="function"&&Boolean(GetParentWindow())){var a=GetParentWindow();return a.frameElement}return null}function GetParentWindow(a){if(a==null)a=document;return typeof a.parentWindow!="undefined"&&a.parentWindow!=null?a.parentWindow:typeof a.defaultView!="undefined"&&a.defaultView!=null?a.defaultView:null}function GetCurrentStyleDatepicker(c){var a=c;if(a.currentStyle!=null)return a.currentStyle;var d=Boolean(a.ownerDocument)?a.ownerDocument:c,b=d.defaultView;return b!=null&&c!==b&&b.getComputedStyle!=null?b.getComputedStyle(a,null):a.style}function PositionFrame(o){a:;var c=document.getElementById(o),a=GetIframe();if(a==null||c==null)return;if(a.style.display=="none")a.style.display="block";if(typeof window.bDidAlign=="undefined"||!window.bDidAlign)window.bDidAlign=true;a.style.width=String(c.offsetWidth)+"px";a.style.height=String(c.offsetHeight+1)+"px";if(GetCurrentStyleDatepicker(a).direction!="rtl"&&typeof a.leftBeforeFlip!="undefined")a.style.left=String(parseInt(a.leftBeforeFlip,10)-parseInt(a.style.width,10))+"px";if(parseInt(a.style.left,10)<0)a.style.left="1px";var k=GetParentWindow().parent.document,i=k.body,d=i.scrollWidth;if(typeof a.v4WorkSpaceDivScrollWidth!="undefined")var e=a.v4WorkSpaceDivScrollWidth;var j=k.getElementById("s4-workspace"),f=Boolean(j)?j.offsetWidth-j.clientWidth:i.offsetWidth-i.clientWidth;if(f!=0){d-=f;e-=f}var l=d>e?d:e;if(parseInt(a.style.left,10)+parseInt(a.style.width,10)>l)a.style.left=String(l-parseInt(a.style.width,10)-1)+"px";var n=document.getElementById(g_currentID);if(n==null)return;g_firstDayID=g_currentID.substr(0,6)+"01";var g=document.getElementById(g_firstDayID);if(g!=null){g.onfocus=function(){a:;FocusOnFirstDay(true,g_firstDayID);return false};g.onblur=function(){a:;FocusOnFirstDay(false,g_firstDayID);return false}}var b=Number(g_currentID.substr(6,2)),m=g_currentID.substr(0,6)+St2Digits(b+1);while(document.getElementById(m)!=null){b+=1;m=g_currentID.substr(0,6)+St2Digits(b+1)}g_lastDayID=g_currentID.substr(0,6)+St2Digits(b);var h=document.getElementById(g_lastDayID);if(h!=null){h.onfocus=function(){a:;FocusOnLastDay(true,g_lastDayID);return false};h.onblur=function(){a:;FocusOnLastDay(false,g_lastDayID);return false}}if(typeof a.firstUp!="undefined"&&a.firstUp==true){window.setTimeout(function(){a:;setFocusDatepicker(n)},0);a.firstUp=false;g_insideCurrentMonth=true}else{window.setTimeout(function(){a:;setFirstFocus(c)},0);g_insideCurrentMonth=false}return}function setFirstFocus(b){var a=b.getElementsByTagName("A")[0];if(a!=null)try{a.focus()}catch(c){}}function FocusOnFirstDay(a,b){a:;g_focusOnFirstDayCurrentMonth=a;if(a==true)g_currentID=b;var c=document.getElementById(b);c!=null&&DateStyle(a,c)}function FocusOnLastDay(a,b){a:;g_focusOnLastDayCurrentMonth=a;if(a==true)g_currentID=b;var c=document.getElementById(b);c!=null&&DateStyle(a,c)}function FocusOnDay(c,a){a:;var b=null;if(a!=null)if(a.target!=null)b=a.target;else if(a.srcElement!=null)b=a.srcElement;b!=null&&DateStyle(c,b)}function DateStyle(b,a){a:;if(a!=null&&a.parentNode!=null)if(b==true)a.parentNode.className="ms-picker-dayselected";else a.parentNode.className="ms-picker-daycenter"}function setFocusDatepicker(a){if(a.onfocus==null)if(browseris.ie)a.onfocus=function(){a:;FocusOnDay(true,event);return false};else a.onfocus=function(a){a:;FocusOnDay(true,a);return false};if(a.onblur==null)if(browseris.ie)a.onblur=function(){a:;FocusOnDay(false,event);return false};else a.onblur=function(a){a:;FocusOnDay(false,a);return false};
try{
if(browseris.chrome) {
FocusOnDay(true, { target: a });
} else {
a.focus()
}
}catch(b){}}function HideUnhide(d,c,e){a:;var b=document.getElementById(d);if(b!=null)b.style.display="none";var a=document.getElementById(c);if(a!=null)a.style.display="block";g_currentID=e;PositionFrame(c);return}function datereplace(g,f,d){var a=String(g),c=a.indexOf(f);if(c!=-1){var b=a.substring(0,c);b+=d;var e=a.indexOf("&",c);if(e!=-1)b+=a.substr(e+1);return b}else{var h=a.indexOf("?");if(h==-1)a+="?";if(a.charAt(a.length-1)!="&")a+="&";a+=d;return a}}function DP_MoveToDate(c){var a=document.location.href,b="date=";a=datereplace(a,b,"date="+escapeProperly(c)+"&");document.location.href=a;return!browseris.firefox36up?true:false}function OnKeyDown(a){if(a.target!=null&&(a.target.id=="DateMinutes0"||a.target.id=="DateHours0"))return;var b;if(Boolean(a.keyCode))b=a.keyCode;else if(Boolean(a.which))b=a.which;if(b==Sys.UI.Key.enter&&a.target!=null){var d=document.getElementById("DateHours0");if(d!=null)if(typeof a.target.onblur=="function"){try{d.focus()}catch(e){}return}}if(b==27){if(Boolean(a.preventDefault))a.preventDefault();else a.returnValue=false;ClosePicker();return}var c=a.shiftKey;if(g_focusOnFirstDayCurrentMonth==true&&(b==39||b==40||b==9&&!c))g_insideCurrentMonth=true;if(g_focusOnFirstDayCurrentMonth==true&&b==9&&c)g_insideCurrentMonth=false;if(g_focusOnLastDayCurrentMonth==true&&b==9&&!c)g_insideCurrentMonth=false;if(g_focusOnLastDayCurrentMonth==true&&(b==37||b==38||b==9&&c))g_insideCurrentMonth=true;if(b==9&&g_insideCurrentMonth==true)b=!c?39:37;if(g_insideCurrentMonth==true)switch(b){case 38:if(Boolean(a.preventDefault))a.preventDefault();else a.returnValue=false;MoveDays(-7);break;case 40:if(Boolean(a.preventDefault))a.preventDefault();else a.returnValue=false;MoveDays(7);break;case 37:if(Boolean(a.preventDefault))a.preventDefault();else a.returnValue=false;MoveDays(-1);break;case 39:if(Boolean(a.preventDefault))a.preventDefault();else a.returnValue=false;MoveDays(1)}}function ClosePicker(){a:;var a=GetIframe();if(a==null)return;typeof a.resultfunc=="function"&&a.resultfunc(a.resultfield);a.style.display="none";a=null}function MoveDays(d){a:;var b;if(g_currentID==null||g_currentID.length<6)return;var g=Number(g_currentID.substr(0,4)),f=Number(g_currentID.substr(4,2)),e=Number(g_currentID.substr(6,2));if(e+d<1)return;else{b=g_currentID.substr(0,6)+St2Digits(e+d);var c=document.getElementById(b);if(c==null)return;var a=c.parentNode;if(a!=null&&a.onmousedown!=null)a.onmousedown();else{g_currentID=b;setFocusDatepicker(c)}}}function clickDatePicker(b,d,a,c){a:;clickDatePickerWorker(b,d,a,c,null,null,null)}function clickDatePickerExtended(e,g,d,f,c,b,a){a:;clickDatePickerWorker(e,g,d,f,c,b,a)}function clickDatePickerWorker(f,n,m,d,g,k,j){a:;var h,e=document.getElementById(f),b;if(d==null)d=window.event;if(d!=null)d.cancelBubble=true;if(f==null&&typeof this.Picker!="undefined"&&this.Picker!=null){var c=this.Picker;if(typeof c.resultfield!="undefined"&&c.resultfield!=null)try{var l=c.resultfield;l.focus()}catch(o){}c.style.display="none";this.Picker=null;document.body.onclick=null}else if(e!=null){var a=document.getElementById(f);if(a!=null&&typeof a.isDisabled!="undefined"&&a.isDisabled)return;h=getDate(e,m,g);b=e.id;var i=document.getElementById(b+g_strDatePickerImageID);clickDatePickerHelper(b,b+g_strDatePickerFrameID,i,h,n,OnSelectDate,OnPickerFinish,g,k,j);document.body.onclick=function(){a:;OnPickerFinish(a)}}}function clickDatePickerHelper(d,u,b,v,s,o,n,i,h,g){a:;var e="";if(typeof this.Picker!="undefined"&&this.Picker!=null){var a=this.Picker;a.style.display="none";if(typeof a.resultfield!="undefined"){var r=a.resultfield;e=r.id}typeof a.resultfunc!="undefined"&&a.resultfunc!=null&&a.resultfunc();this.Picker=null}if(e==d)return;if(d!=null){this.Picker=document.getElementById(u);if(this.Picker==null)return;g_scrollLeft=document.body.scrollLeft;g_scrollTop=document.body.scrollTop;var m=document.getElementById("s4-workspace");this.Picker.v4WorkSpaceDivScrollWidth=Boolean(m)?m.scrollWidth:0;if(Boolean(this.Picker.attachEvent))this.Picker.attachEvent("onreadystatechange",OnIframeLoadFinish);else if(Boolean(this.Picker.addEventListener)){this.Picker.Picker=this.Picker;this.Picker.readyState="complete";this.Picker.addEventListener("load",OnIframeLoadFinish,false)}this.Picker.resultfield=document.getElementById(d);this.Picker.OnSelectDateCallback=o;this.Picker.resultfunc=n;this.Picker.firstUp=true;var p=PageUrlValidation(s)+escapeProperly(v);this.Picker.src=p;this.Picker.style.display="block";var k=this.Picker.offsetParent;this.Picker.style.display="none";var t=getOffsetTop(b,1),l=getOffsetLeft(b,1),q=getOffsetTop(k,1),j=getOffsetLeft(k,1),f=0,c=0;if(i!=null){this.Picker.targetAttribute=i;if(!isNaN(h))f=Number(h);if(!isNaN(g))c=Number(g)}this.Picker.style.top=String(t-q+b.offsetHeight+f+1)+"px";if(GetCurrentStyleDatepicker(this.Picker).direction=="rtl")this.Picker.style.left=String(l-j-c+1)+"px";else this.Picker.leftBeforeFlip=String(l-j+b.offsetWidth+c+1)+"px"}}function ClickDay(c){a:;var a=GetIframe();if(a==null)DP_MoveToDate(c);else{var e=a.resultfield,b=GetParentWindow().parent.document.getElementById(e.id+g_strDatePickerRangeValidatorID);if(b!=null)b.style.display="none";var d=a.OnSelectDateCallback;d(a.resultfield,c,a.targetAttribute);var f=a.resultfunc;f(a.resultfield);if(window.event!=null)window.event.returnValue=false}}function SetSelectedDate(b,a){g_selectedDate=b;g_currentID=a.firstChild.id;a.className="ms-picker-dayselected";setTimeout(function(){a:;setFocusDatepicker(a.firstChild)},0)}function DatePickerMouse(a,b){if(a.firstChild.id!=g_currentID)a.className=b}function ClickDayTime(c,d){a:;if(c==null&&g_selectedDate==null)alert(Strings.STS.L_DatePickerDateTimePleaseSelect);else if(g_selectedDate==null)g_selectedDate=c;var g=document.getElementById("DateHours"+d),f=document.getElementById("DateMinutes"+d),b=String(g.selectedIndex),a=String(f.selectedIndex*5);if(b.length==1)b="0"+b;if(a.length==1)a="0"+a;var e=g_selectedDate+" "+b+":"+a;ClickDay(e.toString())}function OnPickerFinish(resultfield){a:;if(resultfield!=null)if(typeof resultfield.ondatepickerclose!="undefined"&&Boolean(resultfield.ondatepickerclose))if(typeof resultfield.ondatepickerclose=="function")resultfield.ondatepickerclose();else eval(resultfield.ondatepickerclose);clickDatePicker(null,"","",null)}function OnSelectDate(resultfield,date,targetAttribute){if(targetAttribute==null){var autoPostBack=resultfield.attributes.AutoPostBack,shouldPostBack=autoPostBack!=null&&typeof autoPostBack.value!="undefined"&&autoPostBack.value=="1"&&resultfield.value!=date,shouldNotifyChange=resultfield.value!=date;resultfield.value=date;shouldNotifyChange&&typeof resultfield.clientcontrolonvaluesetfrompicker=="function"&&resultfield.clientcontrolonvaluesetfrompicker();if(shouldNotifyChange&&typeof resultfield.onvaluesetfrompicker!="undefined"&&Boolean(resultfield.onvaluesetfrompicker)&&!shouldPostBack)if(typeof resultfield.onvaluesetfrompicker=="function")resultfield.onvaluesetfrompicker();else eval(resultfield.onvaluesetfrompicker);shouldPostBack&&window.setTimeout(new Function("__doPostBack('"+resultfield.id+"','')"),0)}else{resultfield[targetAttribute]=date;try{resultfield.fireEvent("onchange")}catch(exception){}}}function ChangeDateTimeControlState(b,a){a:;if(typeof g_strDateTimeControlIDs!="undefined"){var f=document.getElementById(g_strDateTimeControlIDs[b]);if(f!=null)f.disabled=a;var e=document.getElementById(g_strDateTimeControlIDs[b]+"Hours");if(e!=null)e.disabled=a;var d=document.getElementById(g_strDateTimeControlIDs[b]+"Minutes");if(d!=null)d.disabled=a;var c=document.getElementById(g_strDateTimeControlIDs[b]+"DatePickerImage");if(c!=null)if(a)c.src="/_layouts/15/images/calendar_grey.gif?rev=23";else c.src="/_layouts/15/images/calendar.gif?rev=23"}}function EnableDateTimeControl(a){a:;ChangeDateTimeControlState(a,false)}function DisableDateTimeControl(a){a:;ChangeDateTimeControlState(a,true)}function OnIframeLoadFinish(){a:;var a;if(typeof this.Picker!="undefined")a=this.Picker;if(a!=null&&typeof a.readyState!="undefined"&&a.readyState!=null&&a.readyState=="complete"){document.body.scrollLeft=g_scrollLeft;document.body.scrollTop=g_scrollTop;a.style.display="block";if(typeof document.frames!="undefined"&&Boolean(document.frames)){var b=document.frames[a.id];b!=null&&typeof b.focus=="function"&&b.focus()}else a.focus()}}function RecurPatternType_ShowDiv(b){a:;var a=document.getElementById("recurCustomDiv");if(a!=null)a.style.display=b?"block":"none"}function RecurPatternType_ShowRecurType(e){a:;var d,a,c=["recurDailyDiv","recurWeeklyDiv","recurMonthlyDiv","recurYearlyDiv"];for(d in c){a=document.getElementById(c[d]);if(a!=null)a.style.display="none"}var b=document.getElementById(e);a=document.getElementById(c[Number(b.value)-2]);if(a!=null)a.style.display="block";RecurPatternType_ShowDiv(Number(b.value)==6?false:true);if(Number(b.value)!=6&&g_warnonce==0){alert(Strings.STS.L_WarnkOnce_text);g_warnonce++}}function RecurType_SetRadioButton1(b){a:;var a=document.getElementById(b);if(a!=null)a.checked=true}function RecurType_SetRadioButton(f,h){if(f==null)return;for(var c=f.childNodes,g=c.length,b=0;b<g;b++){var d=c[b];if(d.nodeType==1){var a=d.innerHTML;a=a.substr(a.indexOf("id=")+3);a=a.substr(0,a.indexOf(" "));if(a.indexOf(h)>0){if(a.length>2&&a.charAt(0)=='"'){a=a.substr(1);a=a.substr(0,a.length-1)}var e=document.getElementById(a);if(e!=null)e.checked=true}return}}}$_global_datepicker();
var css = 'textarea { white-space: pre-line !important; }',
head = document.head || document.getElementsByTagName('head')[0],
style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet){
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
head.appendChild(style);