var FShowInfo=true;var FInAppointment=false;var FWindowsObjGUID;var ActivityHeight;var ActivityDiv=null;var ActivityType="appointment";var ActivityType2="task";var lastposy=0;var lastposx=0;var newposy=0;var newposx=0;var zIndexTop=10;var heightDiv;var heightTable;var leftDiv;var topDiv;var scrollIE;var scrollCalendar;var scrollDocument;var scrollNS; function showFurtherImageUp(){ var scroll=false; var lScrollPos=parseInt(GetObjDiv("CalendarTable"+MyTagId).scrollTop,10); if(lScrollPos<PosFurtherUp){ scroll=true;} if(GetObjDiv("CalendarFurtherUp")!=null){ if(scroll){ GetObjDiv("CalendarFurtherUp").style.display="none";} else{ GetObjDiv("CalendarFurtherUp").style.display="block"; if(isIE){ GetObjDiv("CalendarFurtherUp").style.top=lScrollPos-4;} else{ GetObjDiv("CalendarFurtherUp").style.top=lScrollPos;}}}} function showFurtherImageDown(){ var scroll=false; var lScrollPos=parseInt(GetObjDiv("CalendarTable"+MyTagId).scrollTop,10); var lHeight=parseInt(GetObjDiv("CalendarTable"+MyTagId).style.height,10); var lNewPos=lScrollPos+lHeight; if(lNewPos>PosFurtherDown){ scroll=true;} if(GetObjDiv("CalendarFurtherDown")!=null){ if(scroll){ GetObjDiv("CalendarFurtherDown").style.display="none";} else{ GetObjDiv("CalendarFurtherDown").style.display="block"; if(isIE){ GetObjDiv("CalendarFurtherDown").style.top=lNewPos-12;} else{ GetObjDiv("CalendarFurtherDown").style.top=lNewPos-8;}}}} function setScrollPosUp(){ GetObjDiv("CalendarTable"+MyTagId).scrollTop=0;} function setScrollPosDown(){ GetObjDiv("CalendarTable"+MyTagId).scrollTop=PixelHeight;} function showiframe(aApplicationURL,aguid,atablename,oqs){ if(!FHide){ GetObjDiv("AppInfoDiv").style.top=CurrentMousePosY; GetObjDiv("AppInfoDiv").style.left=CurrentMousePosX; GetObjDiv("AppInfoDiv").style.display="block"; self.AppInfoFrame.location.replace(aApplicationURL+"internal/calendar.appointmentinfo?guid="+aguid+"&tablename="+atablename+"&oqs="+oqs); setTimeout("showHeight()",50);}} function showAppointmentInfo(URL,lGUID,lIDStr,lHideUsers){ if((FInAppointment)&&(FShowInfo)){ FShowInfo=false; FInAppointment=false; lActivityItem=lIDStr.substring(lIDStr.search(/\,/)+1,lIDStr.length); if((navigator.appVersion).toUpperCase().indexOf("MAC")==-1){ GetObjDiv("AppInfoDiv").style.left=CurrentMousePosX; GetObjDiv("AppInfoDiv").style.top=CurrentMousePosY; GetObjDiv("AppInfoDiv").style.display=""; self.AppInfoFrame.location.replace(URL+"&guid="+lGUID+"&tablename="+lActivityItem+"&hideusers="+lHideUsers); showHeight();} else{ GetObjDiv("AppInfoDiv").style.left=CurrentMousePosX-160; GetObjDiv("AppInfoDiv").style.top=CurrentMousePosY-180;}}} function hideAppointmentInfo(URL){ if(GetObjDiv("AppInfoDiv")!=null){ GetObjDiv("AppInfoDiv").style.display="none"; if((!FShowInfo)&&(URL!="")){ self.AppInfoFrame.location.replace(URL); FShowInfo=true;}}} function showHeight(){ if(AppInfoFrame.document.getElementById("AppInfoTable")!=null){ var lAppTableHeight=AppInfoFrame.document.getElementById("AppInfoTable").offsetHeight; var lAppTableWidth=AppInfoFrame.document.getElementById("AppInfoTable").offsetWidth; var lCorrection=2; if(isOpera){ lCorrection=12;} GetObjDiv("AppInfoDiv").style.height=lAppTableHeight+lCorrection; GetObjDiv("AppInfoFrame").style.height=lAppTableHeight+lCorrection; GetObjDiv("AppInfoDiv").style.width=lAppTableWidth+lCorrection; GetObjDiv("AppInfoFrame").style.width=lAppTableWidth+lCorrection;} else{ setTimeout("showHeight()",50);}} function setActivityInfoArray(ApplicationUrl,PrivateText,TeamFilter){ if(aActivityInfoArr.length==0){ aActivityInfoArr[0]=ApplicationUrl; aActivityInfoArr[1]=PrivateText; aActivityInfoArr[2]=TeamFilter;}} function RoundToDecimalPlaces(aValue,aNumber){ addstr=Math.pow(10,aNumber).toString().substring(1); aValue=Math.round(aValue*Math.pow(10,aNumber))/Math.pow(10,aNumber); if(aValue.toString().indexOf(".")==-1){ aValue=aValue+"."+addstr;} else{ if(aValue.toString().substring(aValue.toString().indexOf(".")+1).length<addstr.length){ aValue=aValue.toString()+addstr.substr(0,(addstr.length-aValue.toString().substring(aValue.toString().indexOf(".")+1).length));}} return aValue;} function clickOnDiv(e){ if(isIE){ if(event.button!=2){ var WindowsObject=window.event.srcElement; if((WindowsObject.parentElement.className.toLowerCase()==ActivityType.toLowerCase())||(WindowsObject.parentElement.className.toLowerCase()==ActivityType2.toLowerCase())){ WindowsObject=WindowsObject.parentElement;} if((WindowsObject.className.toLowerCase()==ActivityType.toLowerCase())||(WindowsObject.className.toLowerCase()==ActivityType2.toLowerCase())){ ActivityDiv=WindowsObject; var lActivityIndex=GetActivityDivIndex(ActivityDiv.id); if(!FActivityArray[lActivityIndex]["DenyAccess"]){ lID=(ActivityDiv.id).substring((ActivityDiv.id).search(/\_/)+1,(ActivityDiv.id).length).toString(); weekdaysHeight=GetObjDiv("WeekDays"+lID).offsetHeight; calendarHeader=GetObjDiv("CalendarHeader"+lID).offsetHeight; leftDiv=parseInt(GetObjDiv("CalendarDiv"+lID).offsetLeft,10); topDiv=parseInt((GetObjDiv("CalendarDiv"+lID).offsetTop+weekdaysHeight+calendarHeader),10); scrollIE=parseInt((GetObjDiv("CalendarTable"+lID).scrollTop+document.body.scrollTop),10); scrollCalendar=parseInt((GetObjDiv("CalendarTable"+lID).scrollTop),10); scrollDocument=parseInt(document.body.scrollTop,10); ActivityHeight=parseInt(ActivityDiv.style.height,10); lastposy=ActivityDiv.style.pixelTop; lastposx=ActivityDiv.style.pixelLeft; newposy=lastposy; newposx=lastposx; zIndexTop++; ActivityDiv.style.zIndex=zIndexTop; activeCalendar=lID; document.onmousemove=dragDiv; document.onmouseup=onMouseUpDiv; return false;}} return false;}}} function dragDiv(e){ lID=activeCalendar; GetObjDiv("WeekTable"+lID).style.cursor="move"; eval("var YPos = getYPosArray"+lID+"();"); eval("var XPos = getXPosArray"+lID+"();"); lCalendarWidth=GetObjDiv("CalendarTable"+lID).offsetWidth; lCalendarHeight=GetObjDiv("CalendarTable"+lID).style.height; if(ActivityDiv!=null){ newposy=event.clientY-topDiv+scrollIE; for(var i=0;i<=YPos.length;i++){ if(YPos[i]>newposy){ newposy=YPos[i-1]; break;}} if((event.clientY-topDiv+scrollIE)<(scrollCalendar+4)){ newposy=-1;} if(newposy>=scrollCalendar+parseInt(lCalendarHeight,10)){ newposy=-1;} if(isNaN(newposy)==true){ newposy=-1;} if((YPos[YPos.length-1])<newposy){ newposy=-1;} newposx=event.clientX-leftDiv; for(var i=0;i<=XPos.length-1;i++){ if(XPos.length=="2"){ newposx=lastposx; break;} else if(XPos[i]>newposx){ newposx=XPos[i-1]; break;} else if(newposx<XPos[1]){ newposx=-1; break;} else if(newposx>((XPos[XPos.length-1])-16)){ if(newposx>(XPos[XPos.length-1])-16){ newposx=-1; break;} else{ newposx=XPos[XPos.length-1]; break;}}} if(isNaN(newposx)==true){ newposx=-1;} return false;}} function onMouseUpDiv(e){ if((newposy!=-1)&&(newposx!=-1)){ if((newposy!=lastposy)||(newposx!=lastposx)){ newPosition();}} GetObjDiv("WeekTable"+activeCalendar).style.cursor="auto"; document.onmousemove=checkActivity; return false;} function getDateFormat(OriginalDate){ lDate=(OriginalDate).substring(0,(OriginalDate).search(/\,/)).toString(); lDateArray=lDate.split("-"); lTime=(OriginalDate).substring(OriginalDate.search(/\,/)+1,OriginalDate.length).toString(); lTimeArray=lTime.split(":"); lAppDate=new Date(lDateArray[0],(lDateArray[1]-1),lDateArray[2],lTimeArray[0],lTimeArray[1]); return lAppDate.getTime();} function showAppointmentInfoNS(aApplicationURL,aguid,atablename,oqs){ lApplicationURL=aApplicationURL; lguid=aguid; ltablename=atablename; loqs=oqs; if(FShowInfo){ FShowInfo=false; setTimeout("showiframe(lApplicationURL, lguid, ltablename, loqs)",1000);}} function showiframe(aApplicationURL,aguid,atablename,oqs){ if(!FShowInfo){ GetObjDiv("AppInfoDiv").style.top=CurrentMousePosY; GetObjDiv("AppInfoDiv").style.left=CurrentMousePosX; GetObjDiv("AppInfoDiv").style.display="block"; self.AppInfoFrame.location.replace(aApplicationURL+"internal/calendar.appointmentinfo?guid="+aguid+"&tablename="+atablename+"&oqs="+oqs); setTimeout("showHeight()",100);}} function hideAppointmentInfoNS(URL){ GetObjDiv("AppInfoDiv").style.height=0; GetObjDiv("AppInfoFrame").style.height=0; GetObjDiv("AppInfoDiv").style.width=0; GetObjDiv("AppInfoFrame").style.width=0; FShowInfo=true; self.AppInfoFrame.location.replace(URL);}
