context: 		dropDragableNodesCopy:function()		{			var parent;			if(JSTreeObj.dragDropTimer<10){								JSTreeObj.dragDropTimer = -1;				return;			}			if(JSTreeObj.firstTopPage == true){				var rootUl = document.getElementById('rootUl');				if(JSTreeObj.floatingContainer.getElementsByTagName('LI')[0]){					rootUl.appendChild(document.getElementById(JSTreeObj.floatingContainer.getElementsByTagName('LI')[0].id));						var temporaryTable = document.getElementById('templateTable');					rootUl.removeChild(temporaryTable);					JSTreeObj.saveRoot(JSTreeObj.dragNode_source.id, JSTreeObj.dragNode_source.getAttribute('pagetype'), JSTreeObj.dragNode_source.getAttribute('templatefile'), 								(JSTreeObj.dragNode_source.getElementsByTagName('A')[0]).innerHTML);				}								return;			}			if(JSTreeObj.deleteNodes == true){								deletePage(JSTreeObj.dragNode_source.id);				if(JSTreeObj.floatingContainer.getElementsByTagName('LI')[0]){					if (document.getElementById(JSTreeObj.floatingContainer.getElementsByTagName('LI')[0].id)){						JSTreeObj.floatingContainer.removeChild(document.getElementById(JSTreeObj.floatingContainer.getElementsByTagName('LI')[0].id));					}				}				var tmpObj = JSTreeObj.dragNode_parent;				var lis = tmpObj.getElementsByTagName('LI');				if(lis.length==0){					var tmpSpan = tmpObj.parentNode;					var img = tmpSpan.parentNode.getElementsByTagName('IMG')[0];					img.style.visibility='hidden';	// Hide [+],[-] icon					tmpObj.parentNode.removeChild(tmpObj);															}																JSTreeObj.dropTargetIndicator.style.display='none';								JSTreeObj.dragDropTimer = -1;				return;			}															var showMessage = false;			if(JSTreeObj.dragNode_destination){	// Check depth				var countUp = JSTreeObj.dragDropCountLevels(JSTreeObj.dragNode_destination,'up');				var countDown = JSTreeObj.dragDropCountLevels(JSTreeObj.dragNode_source,'down');				var countLevels = countUp/1 + countDown/1 + (JSTreeObj.insertAsSub?1:0);										if(countLevels>JSTreeObj.maximumDepth){					JSTreeObj.dragNode_destination = false;					showMessage = true; 	// Used later down in this function				}			}			if(JSTreeObj.dragNode_destination){				if(JSTreeObj.insertAsSub){					var uls = JSTreeObj.dragNode_destination.getElementsByTagName('UL');					if(uls.length>0){						ul = uls[0];						ul.style.display='block';						var lis = ul.getElementsByTagName('LI');																		var li = JSTreeObj.dragNode_source.getElementsByTagName('LI')[0];												if(lis.length>0){	// Sub elements exists - drop dragable node before the first one							ul.insertBefore(document.getElementById(JSTreeObj.floatingContainer.getElementsByTagName('LI')[0].id),lis[0]);							}else {	// No sub exists - use the appendChild method - This line should not be executed unless there's something wrong in the HTML, i.e empty <ul>							ul.appendChild(document.getElementById(JSTreeObj.floatingContainer.getElementsByTagName('LI')[0].id));							}													}else{						var ul = document.createElement('UL');						ul.style.display='block';						JSTreeObj.dragNode_destination.appendChild(ul);						var childElement = document.getElementById(JSTreeObj.floatingContainer.getElementsByTagName('LI')[0].id);						ul.appendChild(childElement);											//						ul.appendChild(document.getElementById(JSTreeObj.floatingContainer.getElementsByTagName('LI')[0].id));																}					var img = JSTreeObj.dragNode_destination.getElementsByTagName('IMG')[0];						img.style.visibility='visible';					img.src = img.src.replace(JSTreeObj.plusImage,JSTreeObj.minusImage);														}else{						if(JSTreeObj.dragNode_destination.nextSibling){						var remId;						if(JSTreeObj.floatingContainer.getElementsByTagName('LI')[0]){							remId = JSTreeObj.floatingContainer.getElementsByTagName('LI')[0].id;						}						if (document.getElementById(remId)){							var el = document.getElementById(remId);						}												var nextSib = JSTreeObj.dragNode_destination.nextSibling;						nextSib.parentNode.insertBefore(el,nextSib);											}else{						var remId;						if(JSTreeObj.floatingContainer.getElementsByTagName('LI')[0]){							remId = JSTreeObj.floatingContainer.getElementsByTagName('LI')[0].id;						}						if (document.getElementById(remId)){							var el = document.getElementById(remId);						}							JSTreeObj.dragNode_destination.parentNode.appendChild(el);					}				}					/* Clear parent object */								var tmpObj = JSTreeObj.dragNode_parent;				var lis = tmpObj.getElementsByTagName('LI');//console.log('JSTreeObj.dragNode_destination = '+ JSTreeObj.dragNode_destination);						if(lis.length==0){					var tmpSpan = tmpObj.parentNode;					var img = tmpSpan.parentNode.getElementsByTagName('IMG')[0];					img.style.visibility='hidden';	// Hide [+],[-] icon					tmpObj.parentNode.removeChild(tmpObj);															}				//				JSTreeObj.getNewNodeId(JSTreeObj.dragNode_source.id);				//				JSTreeObj.initNode(getElementsByTagName('li').getElementById()//				JSTreeObj.dragNode_source.id);							}else{				// Putting the item back to it's original location					if(JSTreeObj.floatingContainer.getElementsByTagName('LI')[0]){						if (document.getElementById(JSTreeObj.floatingContainer.getElementsByTagName('LI')[0].id)){//							var el = document.getElementById('floatingContainer'+JSTreeObj.floatingContainer.getElementsByTagName('LI')[0].id);							JSTreeObj.floatingContainer.removeChild(document.getElementById(JSTreeObj.floatingContainer.getElementsByTagName('LI')[0].id));						}					}					return;/*								if(JSTreeObj.dragNode_sourceNextSib){					JSTreeObj.dragNode_parent.insertBefore(JSTreeObj.dragNode_source,JSTreeObj.dragNode_sourceNextSib);					var remId;					if(JSTreeObj.floatingContainer.getElementsByTagName('LI')[0]){						remId = JSTreeObj.floatingContainer.getElementsByTagName('LI')[0].id;					}					if (document.getElementById(remId)){						var el = document.getElementById(remId);						JSTreeObj.floatingContainer.removeChild(el);					}				}				return;						*/ 			}			JSTreeObj.dropTargetIndicator.style.display='none';					JSTreeObj.dragDropTimer = -1;				if(showMessage && JSTreeObj.messageMaximumDepthReached)alert(JSTreeObj.messageMaximumDepthReached);//			JSTreeObj.getNewParent(null,null,JSTreeObj.dragNode_source.id,null);						//			saveMyTree(JSTreeObj.getNewParent(null,null,JSTreeObj.dragNode_source.id), JSTreeObj.dragNode_source.id);		//			saveMyTree(JSTreeObj.getNewParent(null,null,JSTreeObj.dragNode_source.id, null), JSTreeObj.dragNode_source.id);								//			JSTreeObj.initTree();						var parentDiv = JSTreeObj.dragNode_destination;//			while(true){				if (parentDiv.getElementsByTagName('DIV')){					if (parentDiv.getElementsByTagName('DIV')[0]){						if(globalDivId == parentDiv.getElementsByTagName('DIV')[0].id){							//console.log('moving node node ID = '+JSTreeObj.dragNode_source.id+" newParent = "+treeObj.getNewParent(null,null,JSTreeObj.dragNode_source.id, null));							saveMyTree(treeObj.getNewParent(null,null,JSTreeObj.dragNode_source.id, null), JSTreeObj.dragNode_source.id);									ThemesEngine.changePageUri(JSTreeObj.dragNode_source.id, (JSTreeObj.dragNode_source.getElementsByTagName('A')[0]).innerHTML, false, changePageTitleCallback);						}						else{							/*console.log('creating node newParent = '+treeObj.getNewParent(null,null,JSTreeObj.dragNode_source.id, null)+ 							' pagetype = '+JSTreeObj.dragNode_source.getAttribute('pagetype') + ' templatefile = '+JSTreeObj.dragNode_source.getAttribute('templatefile'));*///							saveNewPage(treeObj.getNewParent(null,null,JSTreeObj.dragNode_source.id, null), JSTreeObj.dragNode_source.getAttribute('pagetype'), JSTreeObj.dragNode_source.getAttribute('templatefile'), 'newPage');							var newParentId = treeObj.getNewParent(null,null,JSTreeObj.dragNode_source.id, null);							if(!newParentId) {								//console.log('newParentId = null');								JSTreeObj.saveRoot(JSTreeObj.dragNode_source.id, JSTreeObj.dragNode_source.getAttribute('pagetype'), JSTreeObj.dragNode_source.getAttribute('templatefile'), 								(JSTreeObj.dragNode_source.getElementsByTagName('A')[0]).innerHTML);							}							else								JSTreeObj.saveNewPage(newParentId, JSTreeObj.dragNode_source.getAttribute('pagetype'), JSTreeObj.dragNode_source.getAttribute('templatefile'), 								(JSTreeObj.dragNode_source.getElementsByTagName('A')[0]).innerHTML);						}							//need name													break;																}					parentDiv = parentDiv.parentNode;				}			}			//		}
meta: 7498	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/7498/546a09eea9456b9aa55cd83860b43366b8e5f326/drag-drop-folder-tree.js/buggy/resources/javascript/drag-drop-folder-tree.js