var DaybooxPopup_CurrentOverlay;var DaybooxPopup_onClientAfterShow;var step=0.05;function DaybooxPopup_StepShowing(popUpId,opacity,autoHideInterval){var popUp=document.getElementById(popUpId);if(popUp!=null){if(typeof opacity=="undefined"){opacity=0}popUp.style.opacity=opacity;popUp.style.filter="alpha(opacity="+opacity*100+")";opacity+=step;if(opacity<=1+step){setTimeout("DaybooxPopup_StepShowing('"+popUpId+"', "+opacity+", "+autoHideInterval+")",10)}else{if(autoHideInterval){setTimeout("DaybooxPopUp_HidePopUp('"+popUpId+"')",autoHideInterval*1000)}popUp.style.opacity="";if(typeof document.body.style.maxHeight=="undefined"){popUp.style.filter=""}if(typeof DaybooxPopup_onClientAfterShow!="undefined"){eval(DaybooxPopup_onClientAfterShow)}}}}function DaybooxPopup_ShowPopupForControl(snapControl,popUpId,popUpContainerId,popUpOverlayId,scrollableControlId,isModal,leftOffset,topOffset,autoHideInterval,arrow,arrowLeft,arrowTop,onClientBeforeShow,positionCenter,notUseFadeIn,onClientAfterShow){if(notUseFadeIn){step=1}var popUp=document.getElementById(popUpId);var popUpContainer=document.getElementById(popUpContainerId);var popUpOverlay=document.getElementById(popUpOverlayId);if(popUp&&popUpContainer){if(isModal&&popUpOverlay){popUpOverlay.style.display="block";popUpOverlay.style.opacity=0.1;popUpOverlay.style.filter="alpha(opacity=10)";DaybooxPopup_CurrentOverlay=popUpOverlayId;DaybooxPopup_AlignOverlay();if(window.attachEvent){window.attachEvent("onresize",DaybooxPopup_AlignOverlay);window.attachEvent("onscroll",DaybooxPopup_AlignOverlay)}else{window.addEventListener("resize",DaybooxPopup_AlignOverlay,false);window.addEventListener("scroll",DaybooxPopup_AlignOverlay,false)}}var containerPosition=DaybooxPopup_GetElementPosition(popUpContainer);if(typeof onClientBeforeShow!="undefined"){eval(onClientBeforeShow)}if(typeof onClientAfterShow!="undefined"){DaybooxPopup_onClientAfterShow=onClientAfterShow}var scrollCorrX=0;var scrollCorrY=0;var scrollableControl=document.getElementById(scrollableControlId);if(scrollableControl){scrollCorrX=scrollableControl.scrollLeft;scrollCorrY=scrollableControl.scrollTop}popUp.style.opacity=0;popUp.style.filter="alpha(opacity=0)";popUp.style.display="block";if(!positionCenter){var senderPosition=DaybooxPopup_GetElementPosition(snapControl);popUp.style.left=senderPosition[0]-containerPosition[0]+scrollCorrX+leftOffset+"px";popUp.style.top=senderPosition[1]-containerPosition[1]-scrollCorrY+topOffset+"px"}else{popUpContainer.style.position="absolute";var windowWidth,windowHeight;if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight}else{if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight}}}var leftPos=(windowWidth-popUp.offsetWidth)/2;var topPos=(windowHeight-popUp.offsetHeight-15)/2;if(leftPos<0){leftPos=0}if(topPos<0){topPos=0}popUpContainer.style.left=leftPos+"px";popUpContainer.style.top=topPos+"px"}DaybooxPopUp_ShowArrows(popUpId,arrow,arrowLeft,arrowTop);DaybooxPopup_StepShowing(popUpId,0,autoHideInterval)}}function DaybooxPopup_ShowPopup(M,G,K,H,C,O,A,I,B,P,N,J,Q,D,L,E){if(M!=null){var F=(M.srcElement)?M.srcElement:M.target;DaybooxPopup_ShowPopupForControl(F,G,K,H,C,O,A,I,B,P,N,J,Q,D,L,E)}}function DaybooxPopUp_ShowArrows(B,D,F,E){var A=B+"_arrow_";document.getElementById(A+"left").style.display="none";document.getElementById(A+"top").style.display="none";document.getElementById(A+"right").style.display="none";document.getElementById(A+"bottom").style.display="none";if(typeof D!="undefined"){var A=B+"_arrow_";switch(D.toLowerCase()){case"top":case"left":case"bottom":case"right":var C=document.getElementById(A+D.toLowerCase());if(C!=null){C.style.left=((typeof F!="undefined")?F:0)+"px";C.style.top=((typeof E!="undefined")?E:0)+"px";C.style.display="block"}break}}}function DaybooxPopUp_HidePopUp(A,C){var B=document.getElementById(A);var D=document.getElementById(C);if(B){B.style.display="none"}if(D){if(window.detachEvent){window.detachEvent("onresize",DaybooxPopup_AlignOverlay)}else{window.removeEventListener("resize",DaybooxPopup_AlignOverlay,false)}D.style.display="none";DaybooxPopup_CurrentOverlay=null}}function DaybooxPopup_AlignOverlay(){if(DaybooxPopup_CurrentOverlay){var C=document.getElementById(DaybooxPopup_CurrentOverlay);if(C){var B=document.body.offsetWidth;var A=document.body.offsetHeight;if(typeof document.body.style.maxHeight=="undefined"){B=document.documentElement.clientWidth;A=document.documentElement.clientHeight;C.style.position="absolute"}B=Math.max(B,document.body.scrollWidth);A=Math.max(A,document.body.scrollHeight);C.style.left="0px";C.style.top="0px";C.style.width="100%";C.style.height="100%";if(A>C.offsetHeight){C.style.height=A+"px"}if(B>C.offsetWidth){C.style.width=B+"px"}}}}function DaybooxPopup_GetElementPosition(C){var A=0;var B=0;if(C!=null){var D=C.offsetParent;B=C.offsetLeft;A=C.offsetTop;while(D){B+=D.offsetLeft;A+=D.offsetTop;D=D.offsetParent}}return new Array(B,A)};
