Dea.Lookups={};var eventTypeTipShowing=false;function showFindEventTypes(){if(!eventTypeTipShowing){hideLocationFilters();hideSubLocationFilters();hideCalendarFilters();Dea.Lookups.hideDepartmentFilters();var a=Dea.Get(eventTypesDiv);SetCurrentPos(eventTypesDiv);a.style.visibility="visible";eventTypeTipShowing=true;jQuery("#"+eventTypesDiv).draggable({cancel:"#EventTypeScroll"})}return false}function showAddEventType(){var a=Dea.Get(eventTypeDiv);SetCurrentPos(eventTypeDiv);a.style.visibility="visible";return false}function hideAddEventType(){var a=Dea.Get(eventTypeDiv);a.style.visibility="hidden";return false}var locationTipShowing=false;function showFindLocation(){if(!locationTipShowing){hideEventTypeFilters();hideCalendarFilters();hideSubLocationFilters();Dea.Lookups.hideDepartmentFilters();var a=Dea.Get(locationsDiv);SetCurrentPos(locationsDiv);a.style.visibility="visible";locationTipShowing=true;jQuery("#"+locationsDiv).draggable({cancel:"#LocationScroll"})}return false}var subLocationTipShowing=false;function showFindSubLocation(){if(!subLocationTipShowing){hideLocationFilters();hideEventTypeFilters();hideCalendarFilters();Dea.Lookups.hideDepartmentFilters();var a=Dea.Get(subLocationsDiv);SetCurrentPos(subLocationsDiv);a.style.visibility="visible";subLocationTipShowing=true;jQuery("#"+subLocationsDiv).draggable({cancel:"#SubLocationScroll"})}return false}function showAddLocation(){var a=Dea.Get(showlocationDiv);SetCurrentPos(showlocationDiv);a.style.visibility="visible";return false}function showAddDepartment(){var a=Dea.Get(showDepartmentDiv);SetCurrentPos(showDepartmentDiv);a.style.visibility="visible";return false}function hideAddLocation(){var a=Dea.Get(showlocationDiv);a.style.visibility="hidden";return false}function showAddToCalOptions(){var a=Dea.Get(showAddToCalOptionsDiv);SetCurrentPos(showAddToCalOptionsDiv);a.style.visibility="visible";return false}function hideAddToCalOptions(){var a=Dea.Get(showAddToCalOptionsDiv);a.style.visibility="hidden";return false}function showAddCustomHint(){var a=Dea.Get(showCusotmFieldDiv);SetCurrentPos(showCusotmFieldDiv);a.style.visibility="visible";return false}function hideAddCustomHint(){var a=Dea.Get(showCusotmFieldDiv);a.style.visibility="hidden";return false}function hideDepartment(){var a=Dea.Get(showDepartmentDiv);a.style.visibility="hidden";return false}var calTipShowing=false;function showFindCalendars(){if(!calTipShowing){hideEventTypeFilters();hideLocationFilters();hideLocationLookupFilters();hideCustomFieldLookupFilters();hideDepartmentLookupFilters();Dea.Lookups.hideDepartmentFilters();hideSubLocationFilters();var a=Dea.Get(calendarsDiv);SetCurrentPos(calendarsDiv);a.style.visibility="visible";calTipShowing=true;jQuery("#"+calendarsDiv).draggable({cancel:"#CalendarScroll"})}return false}var locationLookupTipShowing=false;function showFindLocationLookup(){if(!locationLookupTipShowing){hideCalendarFilters();hideCustomFieldLookupFilters();hideDepartmentLookupFilters();Dea.Lookups.hideDepartmentFilters();var a=Dea.Get(locationLookupDiv);SetCurrentPos(locationLookupDiv);a.style.visibility="visible";Dea.setDisplay(locationLookupId,"");locationLookupTipShowing=true;jQuery("#"+locationLookupDiv).draggable({cancel:"#LocationHolder"})}return false}var customFieldTipShowing=false;function showFindCustomFieldsLookup(a){if(!customFieldTipShowing){hideLocationLookupFilters();hideCalendarFilters();hideDepartmentLookupFilters();Dea.Lookups.hideDepartmentFilters();customFieldNum=a;var b=Dea.Get(customFieldLookupDiv);SetCurrentPos(customFieldLookupDiv);b.style.visibility="visible";Dea.setDisplay(customFieldLookupId,"");customFieldTipShowing=true;jQuery("#"+customFieldLookupDiv).draggable({cancel:"#CustomFieldHolder",cursor:"crosshair"})}return false}var departmentLookupTipShowing=false;function showFindDepartmentLookup(){if(!departmentLookupTipShowing){hideCalendarFilters();hideCustomFieldLookupFilters();hideLocationLookupFilters();hideSubLocationFilters();var a=Dea.Get(departmentLookupDiv);SetCurrentPos(departmentLookupDiv);a.style.visibility="visible";Dea.setDisplay(departmentLookupId,"");departmentLookupTipShowing=true;jQuery("#"+departmentLookupDiv).draggable({cancel:"#DepartmentHolder",cursor:"crosshair"})}return false}var locationLookupDiv="";function hideLocationLookupFilters(){if(locationLookupDiv!==""&&Dea.Get(locationLookupDiv)){var a=Dea.Get(locationLookupDiv);a.style.visibility="hidden";Dea.setDisplay(locationLookupId,"none");locationLookupTipShowing=false}return false}var customFieldLookupDiv="";function hideCustomFieldLookupFilters(){if(customFieldLookupDiv!==""&&Dea.Get(customFieldLookupDiv)){var a=Dea.Get(customFieldLookupDiv);a.style.visibility="hidden";Dea.setDisplay(customFieldLookupId,"none");customFieldTipShowing=false}return false}var departmentLookupDiv="";function hideDepartmentLookupFilters(){if(departmentLookupDiv!==""&&Dea.Get(departmentLookupDiv)){var a=Dea.Get(departmentLookupDiv);a.style.visibility="hidden";Dea.setDisplay(departmentLookupId,"none");departmentLookupTipShowing=false}return false}var mcEventTypeIds="",eventTypesDiv="";function hideEventTypeFilters(){if(eventTypesDiv!==""&&Dea.Get(eventTypesDiv)){var a=Dea.Get(eventTypesDiv);a.style.visibility="hidden";eventTypeTipShowing=false}return false}var mcDepartmentIds="",departmentsDiv="";Dea.Lookups.hideDepartmentFilters=function(){if(departmentsDiv!==""&&Dea.Get(departmentsDiv)){var a=Dea.Get(departmentsDiv);a.style.visibility="hidden";departmentTipShowing=false}return false};Dea.Lookups.addDepartmentId=function(a){if(mcDepartments.length==0)mcDepartments=a;else{for(var d=mcDepartments.split(","),c=false,b=0;b<d.length;b++)if(d[b]==a)c=true;if(!c)mcDepartments+=","+a}Dea.Get(sDepartmentIds).value=mcDepartments};var mcDepartments="";Dea.Lookups.checkDepartments=function(d,c){if(Dea.Get(d.id).checked)Dea.Lookups.addDepartmentId(c);else{var b=mcDepartments.split(",");mcDepartments="";for(var a=0;a<b.length;a++)b[a]!==c&&Dea.Lookups.addDepartmentId(b[a])}return false};var departmentTipShowing=false;Dea.Lookups.showFindDepartment=function(){if(!departmentTipShowing){hideCalendarFilters();hideEventTypeFilters();hideLocationFilters();hideSubLocationFilters();var a=Dea.Get(departmentsDiv);SetCurrentPos(departmentsDiv);a.style.visibility="visible";departmentTipShowing=true;jQuery("#"+departmentsDiv).draggable({cancel:"#DepartmentScroll",cursor:"crosshair"})}return false};function checkEventType(d,c){if(Dea.Get(d.id).checked)addEventTypeId(c);else{var b=mcEventTypeIds.split(",");mcEventTypeIds="";for(var a=0;a<b.length;a++)b[a]!==c&&addEventTypeId(b[a])}return false}function addEventTypeId(a){if(mcEventTypeIds.length==0)mcEventTypeIds=a;else{for(var d=mcEventTypeIds.split(","),c=false,b=0;b<d.length;b++)if(d[b]==a)c=true;if(!c)mcEventTypeIds+=","+a}Dea.Get(sEventTypeIds).value=mcEventTypeIds}var mcLocations="";function checkLocations(d,c){if(Dea.Get(d.id).checked)addLocationId(c);else{var b=mcLocations.split(",");mcLocations="";for(var a=0;a<b.length;a++)b[a]!==c&&addLocationId(b[a])}return false}function addLocationId(a){if(mcLocations.length==0)mcLocations=a;else{for(var d=mcLocations.split(","),c=false,b=0;b<d.length;b++)if(d[b]==a)c=true;if(!c)mcLocations+=","+a}Dea.Get(sLocationIds).value=mcLocations}var locationsDiv="";function hideLocationFilters(){if(locationsDiv!==""&&Dea.Get(locationsDiv)){var a=Dea.Get(locationsDiv);a.style.visibility="hidden";locationTipShowing=false}return false}var mcSubLocations="";function checkSubLocations(d,c){if(Dea.Get(d.id).checked)addSubLocationId(c);else{var b=mcSubLocations.split(",");mcSubLocations="";for(var a=0;a<b.length;a++)b[a]!==c&&addSubLocationId(b[a])}return false}function addSubLocationId(a){if(mcSubLocations.length==0)mcSubLocations=a;else{for(var d=mcSubLocations.split(","),c=false,b=0;b<d.length;b++)if(d[b]==a)c=true;if(!c)mcSubLocations+=","+a}Dea.Get(sSubLocationIds).value=mcSubLocations}var sublocationsDiv="";function hideSubLocationFilters(){try{if(subLocationsDiv!==""&&Dea.Get(subLocationsDiv)){var a=Dea.Get(subLocationsDiv);a.style.visibility="hidden";subLocationTipShowing=false}}catch(b){}return false}var mcCalendars="",mcCalendarNames="";function checkCalendars(d,c){if(Dea.Get(d.id).checked)addCalPopId(c);else{var b=mcCalendars.split(",");mcCalendars="";for(var a=0;a<b.length;a++)b[a]!==c&&addCalPopId(b[a])}return false}function checkCalendars(){mcCalendars="";var a=jQuery("#"+calendarsTipId).find("td");a.each(function(){var a=jQuery(this).find("input[type ^= checkbox]");if(a.is(":checked"))mcCalendars+=a.val()+","});if(mcCalendars!="")mcCalendars=mcCalendars.substring(0,mcCalendars.length-1);mcCalendarNames="";var a=jQuery("#"+calendarsTipId).find("td");a.each(function(){var a=jQuery(this).find("input[type ^= checkbox]");if(a.is(":checked")){var b=jQuery(this).find("span");mcCalendarNames+=b.html()+","}});if(mcCalendarNames!="")mcCalendarNames=mcCalendarNames.substring(0,mcCalendarNames.length-1);return false}function addCalendarNames(){mcCalendarNames="";var a=jQuery("#"+calendarsTipId).find("span"),c=a.length,b=1;a.each(function(){mcCalendarNames=mcCalendarNames+jQuery(this).html()+(b>=c?"":",");b++})}function addCalPopId(a){if(mcCalendars.length==0)mcCalendars=a;else{for(var d=mcCalendars.split(","),c=false,b=0;b<d.length;b++)if(d[b]==a)c=true;if(!c)mcCalendars+=","+a}try{Dea.Get(scalendarIds).value=mcCalendars}catch(e){}}function addCalName(a){if(mcCalendarNames.length==0)mcCalendarNames=a;else{for(var d=mcCalendarNames.split(","),c=false,b=0;b<d.length;b++)if(d[b]!=a)c=true;if(!c)mcCalendarNames+=","+a}}var calendarsDiv="";function hideCalendarFilters(){if(calendarsDiv!==""&&Dea.Get(calendarsDiv)){var a=Dea.Get(calendarsDiv);a.style.visibility="hidden";calTipShowing=false}return false}function selectValueSet(b,c){var a=Dea.Get(b);if(a!==null)for(index=0;index<a.length;index++)if(a[index].value==c)a.selectedIndex=index}function addMultipleSelected(b,c){var a=Dea.Get(b);for(i=0;i<a.length;i++)if(a[i].value==-2)return;a.options[a.options.length]=new Option(c,-2,false,false);for(index=0;index<a.length;index++)if(a[index].value==-2)a.selectedIndex=index}function removeSelectValue(b,c){var a=Dea.Get(b);for(index=0;index<a.length;index++)if(a[index].value==c)a.options[index]=null}function showRemindersLookup(){var a=Dea.Get(eventReminderDiv);SetCurrentPos(eventReminderDiv);a.style.visibility="visible";return false}function hideReminderLookup(){var a=Dea.Get(eventReminderDiv);a.style.visibility="hidden";return false}function setDepartmentLookupValue(a){departmentId=a.options[a.selectedIndex].value;departmentName=a.options[a.selectedIndex].text;return}function applyDepartmentLookup(){hideDepartmentLookupFilters();departmentName!=undefined&&Dea.setValue("Department",departmentName);Dea.emsData.departmentId=departmentId;return false}
