rem: function(element) { element.onclick = function() { changeModeToWorkweek(); } } 
add: function(element){ element.onclick = function(){ var d = new Date(); var beginOfFunction = d.getTime();  if(resizedElements){ for(var index=0; index<resizedElements.length; index++) { resizedElements[index].removeClass(classNamesForExpanding[index]); if(index < 5){  resizedElements[index].addClass('collapsed'); } else{ resizedElements[index].addClass('collapsed'); } } } var dd = new Date(); var after = dd.getTime(); resizedElements = new Array(); classNamesForExpanding = new Array(); var trElement = element.parentNode; var tableElement = trElement.parentNode; var tdDay = tableElement.parentNode;  var trParent = tdDay.parentNode; var tbody = trParent.parentNode; var isSunday = false;  if (trParent.getChildren().length == 1) isSunday = true; for(var i=0; i<tbody.getChildren().length; i++) { trParent = tbody.getChildren()[i]; if(isSunday){ if(i % 2 != 0){ trParent.getChildren()[0].removeClass('notSelectedDay'); trParent.getChildren()[0].addClass('selectedDay'); } else{ for(var index=0; index<trParent.getChildren().length; index++) { trParent.getChildren()[index].removeClass('selectedDay'); trParent.getChildren()[index].addClass('notSelectedDay'); } } } else{ if(i % 2 == 0){ for(var index=0; index<trParent.getChildren().length; index++) { if(trParent.getChildren()[index] != tdDay){ trParent.getChildren()[index].removeClass('selectedDay'); trParent.getChildren()[index].addClass('notSelectedDay'); } else{ trParent.getChildren()[index].removeClass('notSelectedDay'); trParent.getChildren()[index].addClass('selectedDay'); } } } else{ trParent.getChildren()[0].removeClass('selectedDay'); trParent.getChildren()[0].addClass('notSelectedDay'); } } } /* var widthTime = new Date(); var afterExpandingWidth = widthTime.getTime(); */ trParent = tdDay.parentNode;  if (tdDay.getAttribute('class').match('workday')){ resizedElements.push(trParent); classNamesForExpanding.push('expandedWorkday'); trParent.removeClass('collapsed'); trParent.addClass('expandedWorkday'); trParent = trParent.getNext(); trParent.removeClass('collapsed'); trParent.addClass('expandedWorkday'); resizedElements.push(trParent); classNamesForExpanding.push('expandedWorkday');  /* resizedElements.push(element); classNamesForExpanding.push('workdayExpanded'); element.removeClass('workdayCollapsed'); element.addClass('workdayExpanded'); var tdElements = trParent.getElementsByTagName('td'); var dayNumber = 0; for(var index=0; index<tdElements.length; index++) { var currentTdElement = tdElements[index]; if(currentTdElement.getAttribute('class')){ if(currentTdElement.getAttribute('class').toString().match('content')){  dayNumber++; if(dayNumber != 6){ if(element != tdElements[index]){ resizedElements.push(tdElements[index]); classNamesForExpanding.push('workdayExpanded'); tdElements[index].removeClass('workdayCollapsed'); tdElements[index].addClass('workdayExpanded'); } } else{ resizedElements.push(tdElements[index]); classNamesForExpanding.push('weekendOnExpandedWorkday'); tdElements[index].removeClass('weekendCollapsed'); tdElements[index].addClass('weekendOnExpandedWorkday'); } } } } trParent = trParent.getNext(); tdElements = trParent.getElementsByTagName('td'); for(var index=0; index<tdElements.length; index++) { var currentTdElement = tdElements[index]; if(currentTdElement.getAttribute('class')){   if(currentTdElement.getAttribute('class').toString().match('content')){ resizedElements.push(tdElements[index]); classNamesForExpanding.push('weekendOnExpandedWorkday'); tdElements[index].removeClass('weekendCollapsed'); tdElements[index].addClass('weekendOnExpandedWorkday'); } } } */ } else{ if (trParent.getChildren().length == 1){ trParent = trParent.getPrevious();  trParent.removeClass('collapsed'); trParent.addClass('expandedSunday'); resizedElements.push(trParent); classNamesForExpanding.push('expandedSunday'); trParent = trParent.getNext(); trParent.removeClass('collapsed'); trParent.addClass('expandedSunday'); resizedElements.push(trParent); classNamesForExpanding.push('expandedSunday');  var tdElements = trParent.getElementsByTagName('td'); var dayNumber = 0; /* for(var index=0; index<tdElements.length; index++) { var currentTdElement = tdElements[index]; if(currentTdElement.getAttribute('class')){ if((currentTdElement.getAttribute('class').toString() == 'content')){ dayNumber++; if(dayNumber != 6){ resizedElements.push(tdElements[index]); classNamesForExpanding.push('workdayOnExpandedWeekend'); tdElements[index].removeClass('workdayCollapsed'); tdElements[index].addClass('workdayOnExpandedWeekend'); } } } } */ /* resizedElements.push(element); classNamesForExpanding.push('weekendExpanded'); element.removeClass('weekendCollapsed'); element.addClass('weekendExpanded'); */ } else{  trParent.removeClass('collapsed'); trParent.addClass('expandedSaturday'); resizedElements.push(trParent); classNamesForExpanding.push('expandedSaturday'); trParent = trParent.getNext(); trParent.removeClass('collapsed'); trParent.addClass('expandedSaturday'); resizedElements.push(trParent); classNamesForExpanding.push('expandedSaturday');    /* for(var index=0; index<tdElements.length; index++) { var currentTdElement = tdElements[index]; if(currentTdElement.getAttribute('class')){ if((currentTdElement.getAttribute('class').toString() == 'content')|| (currentTdElement.getAttribute('class').toString() == 'content weekendCollapsed')|| (currentTdElement.getAttribute('class').toString() == 'content workdayCollapsed')){ dayNumber++; if(dayNumber != 6){ resizedElements.push(tdElements[index]); classNamesForExpanding.push('workdayOnExpandedWeekend'); currentTdElement.removeClass('workdayCollapsed'); currentTdElement.addClass('workdayOnExpandedWeekend'); } else{ resizedElements.push(currentTdElement); classNamesForExpanding.push('weekendExpanded'); currentTdElement.removeClass('weekendCollapsed'); currentTdElement.addClass('weekendExpanded');   } } } } */   /* for(var index=0; index<tdElements.length; index++) { var currentTdElement = tdElements[index]; if(currentTdElement.getAttribute('class')){ if(currentTdElement.getAttribute('class').toString() == 'content'){   } } } */ /* resizedElements.push(element); classNamesForExpanding.push('weekendExpanded'); element.removeClass('weekendCollapsed'); element.addClass('weekendExpanded'); */ }  } var d2 = new Date(); var endOfFunction = d2.getTime(); }   } 
context: 			function(element) {				element.onclick = function() {					changeModeToWorkweek();					}	    	}
meta: 8390	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/8390/b0239ca13bf899f606c2000f0e252a59db748455/CalendarList.js/clean/resources/javascript/CalendarList.js