var styleTargetObject = null; var styleDivShim = getStyleObject('DivShim'); var PeriodStart = "09-02-2018"; var PeriodEnd = "05-01-2013"; var LastStartDate=TB_startdate.value,IsIE=false,aMatches=window.navigator.userAgent.match(/MSIE ([\d]+\.[\d]+)/);if(aMatches!=null)if(parseFloat(aMatches[1])>=5)IsIE=true;function addLoadEvent(a){var b=window.onload;window.onload=typeof window.onload!="function"?a:function(){b&&b();a()}}function addUnLoadEvent(a){var b=window.onunload;window.onunload=typeof window.onunload!="function"?a:function(){b&&b();a()}}addLoadEvent(initializeHacks);addUnLoadEvent(initializeHacks);document.onclick=hidePopup; function findPosX(a){var b=0;if(a.offsetParent)for(;a.offsetParent;){b+=a.offsetLeft;a=a.offsetParent}else if(a.x)b+=a.x;return b}function findPosY(a){var b=0;if(a.offsetParent)for(;a.offsetParent;){b+=a.offsetTop;a=a.offsetParent}else if(a.y)b+=a.y;return b}function getStyleObject(a){return document.getElementById&&document.getElementById(a)?document.getElementById(a).style:document.all&&document.all(a)?document.all(a).style:document.layers&&document.layers[a]?document.layers[a]:false} function showPopup(a,b){styleTargetObject||(styleTargetObject=getStyleObject(a));if(b&&styleTargetObject&&styleDivShim){doCal("show");b.cancelBubble=true;var c=findPosX(document.getElementById("Image_startdate")),d=findPosY(document.getElementById("Image_startdate"));styleTargetObject.left=c+"px";styleTargetObject.top=d+"px";styleTargetObject.position="absolute";if(IsIE){styleTargetObject.width=200;styleDivShim.position=styleTargetObject.position;styleDivShim.width=styleTargetObject.width; styleDivShim.left=c+"px";styleDivShim.top=d+"px";styleDivShim.zIndex=styleTargetObject.zIndex-1;styleDivShim.display=styleTargetObject.display}}else return false}function hidePopup(){if(styleTargetObject){styleTargetObject.display="none";if(IsIE)styleDivShim.display=styleTargetObject.display}} function initializeHacks(){if(navigator.appVersion.indexOf("MSIE 5")!=-1&&navigator.platform.indexOf("Mac")!=-1&&getStyleObject("blankDiv"))window.onresize=explorerMacResizeFix;resizeBlankDiv();if(!window.event)window.event=false}function resizeBlankDiv(){if(navigator.appVersion.indexOf("MSIE 5")!=-1&&navigator.platform.indexOf("Mac")!=-1&&getStyleObject("blankDiv")){getStyleObject("blankDiv").width=document.body.clientWidth-20;getStyleObject("blankDiv").height=document.body.clientHeight-20}} function explorerMacResizeFix(){location.reload(false)}function writeit(a,b){var c=null;if(document.getElementById){if(c=document.getElementById(b))c.innerHTML=a}else if(document.all)if(c=document.all[b])c.innerHTML=a} function doCal(a,b){var c;if(window.XMLHttpRequest)c=new XMLHttpRequest;else if(window.ActiveXObject)try{c=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){try{c=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}if(!c)return false;c.onreadystatechange=function(){responseCal(a,c)};c.open("GET","/common/Calendar.aspx?f="+a+"&p="+LastStartDate+":"+b+"&sd="+TB_startdate.value+"&ps="+PeriodStart+"&pe="+PeriodEnd,true);c.send(null)} function responseCal(a,b){if(b.readyState==4)if(b.status==200){var c=eval("("+b.responseText+")");LastStartDate=c.calendar[0].startdate;writeit(c.calendar[0].html,"docCal");styleTargetObject.display="block";if(IsIE)styleDivShim.display=styleTargetObject.display;if(a=="day"){TB_startdate.value=c.calendar[0].startdate;TB_startdate.onchange&&TB_startdate.onchange();hidePopup()}}};