rem: function toggleMaximize(button, id, action, oldWidth, oldHeight) { var element = document.getElementById(id); if(action == 'maximize') { var oldWidth = element.offsetWidth; var oldHeight = element.offsetHeight; var parent = element.parentNode; var left = parent.offsetLeft; var top = parent.offsetTop; while((parent = parent.parentNode) != document) { left += parent.offsetLeft; top += parent.offsetTop; } var newWidth = getViewportWidth() - left; var newHeight = getViewportHeight() - top; element.style.width = newWidth + 'px'; element.style.height = newHeight + 'px'; button.setAttribute('onclick', 'toggleMaximize(this, "' + id + '", "restore", "' + oldWidth + 'px", "' + oldHeight + 'px");'); } else { element.style.width = oldWidth; element.style.height = oldHeight; button.setAttribute('onclick', 'toggleMaximize(this, "' + id + '", "maximize", "", "");'); 
add: function toggleMaximize(button, id) { var obj = getAppletObject(id); if(obj) { var elm = obj.div.parentNode; var globalWrapper = document.getElementById('globalWrapper'); if(obj.clone) {  document.body.removeChild(obj.clone); obj.clone = false;   globalWrapper.style.display = "";   elm.style.position = "relative"; elm.style.offsetLeft = obj.oldpos[0]; elm.style.offsetTop = obj.oldpos[1]; elm.style.width = obj.oldsize[0]; elm.style.height = obj.oldsize[1]; } else {  var clone = elm.cloneNode(true); obj.clone = clone;  obj.oldParent = elm.parentNode; document.body.appendChild(clone);  globalWrapper.style.display = "none";   obj.oldsize = Array(elm.style.width, elm.style.height); obj.oldpos = Array(elm.style.offsetLeft, elm.style.offsetTop); clone.style.position = "absolute"; clone.style.width = "99%"; clone.style.height = "99%"; } 
context: function toggleMaximize(button, id, action, oldWidth, oldHeight) {	var element = document.getElementById(id);	if(action == 'maximize') {		var oldWidth = element.offsetWidth;		var oldHeight = element.offsetHeight;		var parent = element.parentNode;		var left = parent.offsetLeft;		var top = parent.offsetTop;		while((parent = parent.parentNode) != document) { left += parent.offsetLeft; top += parent.offsetTop; }		var newWidth = getViewportWidth() - left;		var newHeight = getViewportHeight() - top;		element.style.width = newWidth + 'px';		element.style.height = newHeight + 'px';		button.setAttribute('onclick', 'toggleMaximize(this, "' + id + '", "restore", "' + oldWidth + 'px", "' + oldHeight + 'px");');	} else {		element.style.width = oldWidth;		element.style.height = oldHeight;		button.setAttribute('onclick', 'toggleMaximize(this, "' + id + '", "maximize", "", "");');	}}
meta: 7966	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/7966/835b03a8d722cc33eed076a92ed7ae0760d6012a/editapplet.js/buggy/wpi/js/editapplet.js