From 8eca6bcbdca668110560148189fd832047a32cda Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Tue, 9 Apr 2013 08:29:41 +0200
Subject: [PATCH] OO-531: finish tree implementation for e-portfolio, fix some
 issues with IE

---
 .../textboxlist/TextBoxListRenderer.java      |  88 -----
 .../_content/translationToolI18nItemEdit.html |   3 -
 .../olat/course/nodes/st/_content/run.html    |   2 +-
 .../instantMessaging/ui/_content/chat.html    |   1 -
 .../portfolio/manager/EPStructureManager.java |   6 +-
 .../ui/structel/edit/EPTOCController.java     | 343 ++++--------------
 .../ui/structel/edit/EPTOCTreeModel.java      | 128 ++-----
 .../olat/search/ui/_content/searchInput.html  |   1 -
 src/main/webapp/static/js/functions.js        |  37 +-
 src/main/webapp/static/js/js.plugins.min.js   |   2 +-
 src/main/webapp/static/movie/player.js        |   2 +-
 11 files changed, 133 insertions(+), 480 deletions(-)

diff --git a/src/main/java/org/olat/core/gui/components/textboxlist/TextBoxListRenderer.java b/src/main/java/org/olat/core/gui/components/textboxlist/TextBoxListRenderer.java
index 634ac77b98e..140787afbd8 100644
--- a/src/main/java/org/olat/core/gui/components/textboxlist/TextBoxListRenderer.java
+++ b/src/main/java/org/olat/core/gui/components/textboxlist/TextBoxListRenderer.java
@@ -172,94 +172,6 @@ public class TextBoxListRenderer implements ComponentRenderer {
 		
 		output.append(FormJSHelper.getJSEnd()).append(lineBreak);
 	}
-	/*
-	private void test(TextBoxListComponent tblComponent, StringOutput output, Translator translator) {
-		
-		// if in debug mode, create more readable javascript code
-		String lineBreak = "";
-		if(logger.isDebug()){
-			lineBreak = Character.toString((char)10);
-			logger.debug("rendering TextBoxListComponent in debug mode, nice JS output.");
-		}
-		
-		TextBoxListElementImpl te = ((TextBoxListElementComponent) tblComponent).getTextElementImpl();
-		Form rootForm = te.getRootForm();
-		Translator fullTrans = Util.createPackageTranslator(TextBoxListRenderer.class, translator.getLocale(), translator);
-		String dispatchId = tblComponent.getFormDispatchId();
-		output.append("tlist = new ProtoMultiSelect('textboxlistinput").append(dispatchId).append("', 'textboxlist-auto").append(dispatchId)
-				.append("',{ newValues: ").append(lineBreak);
-		output.append(Boolean.toString(tblComponent.isAllowNewValues())).append(lineBreak);
-		output.append(", ").append(lineBreak);
-		
-		if (tblComponent.getProvider() != null) {
-			// use autocomplete provider instead of prebuilt-map
-			String mapperUri = tblComponent.getMapperUri();
-			output.append("fetchFile: '").append(mapperUri).append("', ").append(lineBreak);
-		}
-		output.append("jsonInputValue: false,").append(lineBreak);
-		
-		// hint for the input field
-		String setHintKey = tblComponent.getInputHint();
-		String inputHint;
-		if (!StringHelper.containsNonWhitespace(setHintKey))
-			inputHint = fullTrans.translate("default.input.hint");
-		else
-			inputHint = tblComponent.getTranslator().translate(setHintKey);
-		
-		output.append("inputMessage: '").append(inputHint).append("',").append(lineBreak);
-		output.append("sortResults: true, ").append(lineBreak);
-		output.append("autoResize: true, ").append(lineBreak);
-		
-		if (tblComponent.getMaxResults() > 0 ) {
-			output.append("results: ").append(tblComponent.getMaxResults()).append(", ").append(lineBreak);
-			output.append("maxResults: ").append(tblComponent.getMaxResults()).append(", ").append(lineBreak);
-		}
-		output.append("encodeEntities: false, ");
-		output.append("addPrefix: '").append(fullTrans.translate("add.new.element.prefix")).append("', ").append(lineBreak);
-		output.append("searchMessage: '").append(fullTrans.translate("please.wait.searching")).append("', ").append(lineBreak);
-		output.append("moreMessage: '").append(fullTrans.translate("more.results.found.specify.search")).append("', ").append(lineBreak);
-		output.append("allowDuplicates: ").append(Boolean.toString(tblComponent.isAllowDuplicates())).append(", ").append(lineBreak);
-		output.append("loadFromInput: false,").append(lineBreak);
-		output.append("fetchParameters: 'keyword', ").append(lineBreak);
-		
-		// depending on config of the Component, form is submitted on input
-		if (false) {
-			output.append("onEmptyInput: function(input){ ");
-			output.append("document.forms['").append(rootForm.getFormName()).append("'].submit();} , ").append(lineBreak);
-		
-			output.append("onUserAdd: function(input){");
-			output.append("document.forms['").append(rootForm.getFormName()).append("'].submit();} , ").append(lineBreak);
-		
-			output.append("onUserRemove: function(input){");
-			output.append("document.forms['").append(rootForm.getFormName()).append("'].submit();} , ").append(lineBreak);
-		} else {
-			// otherwise, o_ffEvents are fired:
-			// OO-137 ( invoke o_ffEvent on UserAdd or userRemove )
-			// but only in flexiform
-			String o_ffEvent = FormJSHelper.getJSFnCallFor(rootForm, dispatchId, 2);
-			output.append("onEmptyInput: function(input){").append(lineBreak);
-			//output.append("console.log('onEmptyInput');").append(lineBreak);
-			output.append(o_ffEvent).append("; } , ").append(lineBreak);
-			
-			output.append("onUserAdd: function(input){").append(lineBreak);
-			//output.append("console.log('onUserAdd');").append(lineBreak);
-			output.append(o_ffEvent).append("; } , ").append(lineBreak);
-		
-			output.append("onUserRemove: function(input){").append(lineBreak);
-			//output.append("console.log('onUserRemove');").append(lineBreak);
-			output.append(o_ffEvent).append("; } , ").append(lineBreak);
-		}
-		output.append("regexSearch: false });").append(lineBreak);
-		
-		if (tblComponent.getProvider() == null) {
-			// no provider is specified, use a prebuilt-map to look for
-			// autocompletion
-			output.append("var myjson = ");
-			output.append(tblComponent.getAutoCompleteJSON().toString());
-			output.append(";");
-			output.append("myjson.each(function(t){tlist.autoFeed(t)});");
-		}
-	}*/
 
 	/**
 	 * Renders the textBoxListComponent in disabled/read-only mode
diff --git a/src/main/java/org/olat/core/util/i18n/ui/_content/translationToolI18nItemEdit.html b/src/main/java/org/olat/core/util/i18n/ui/_content/translationToolI18nItemEdit.html
index 8815e3d9cda..5e9ed1f67fc 100644
--- a/src/main/java/org/olat/core/util/i18n/ui/_content/translationToolI18nItemEdit.html
+++ b/src/main/java/org/olat/core/util/i18n/ui/_content/translationToolI18nItemEdit.html
@@ -96,8 +96,6 @@ function checkClick(wrapperName, langCode) {
 	while (content.indexOf("$") != -1 && counter < 10) {
 		var startPos = content.search("\\$\\{?([\\w\\.\\-]*):([\\w\\.\\-]*[\\w\\-])\\}?");
 		var endPos = startPos + content.substring(startPos).search("[^\\{\\w\\.\\-:\\}]|$");
-		console.log("cursorPos::" + cursorPos + " startPos::"+ startPos + " endPos::"+ endPos + " KEY::" + content.substring(startPos, endPos));
-
 		if (startPos <= cursorPos && endPos >= cursorPos) {
 			var reference = content.substring(startPos, endPos);
 			## remove {wrapper} brakes
@@ -119,7 +117,6 @@ function checkClick(wrapperName, langCode) {
 			var trans = jQuery(document).ooTranslator().getTranslator(langCode, bundleName);
 			if (trans) {
 				var translated = trans.translate(key);
-				console.log("WORD FOUND::" + reference + " translated as::" + translated);
 				if (translated != reference) {
 					## set new key and value, make element visible
 					jQuery('div.' + wrapperName + ' div.b_translation_refKey code')[0].update(reference);
diff --git a/src/main/java/org/olat/course/nodes/st/_content/run.html b/src/main/java/org/olat/course/nodes/st/_content/run.html
index e274586644f..56e907d55b0 100644
--- a/src/main/java/org/olat/course/nodes/st/_content/run.html
+++ b/src/main/java/org/olat/course/nodes/st/_content/run.html
@@ -96,7 +96,7 @@ jQuery(function() {
 			   		var padding = parseInt(childEl.css('padding-top')) + parseInt(childEl.css('padding-bottom'));
 			  		childEl.height((maxHeight - padding) + 'px');
 			    });
-			} catch (e) { console.log(e) }
+			} catch (e) { if(console) console.log(e) }
 		});
 	#end
 });
diff --git a/src/main/java/org/olat/instantMessaging/ui/_content/chat.html b/src/main/java/org/olat/instantMessaging/ui/_content/chat.html
index f6501eba027..2d5e252d0cc 100644
--- a/src/main/java/org/olat/instantMessaging/ui/_content/chat.html
+++ b/src/main/java/org/olat/instantMessaging/ui/_content/chat.html
@@ -18,7 +18,6 @@ function tweak_${panelName}() {
 		jQuery('.o_instantmessaging_chat_history', win).each(function(index, el){
 			var historyEl = jQuery(el);
 			historyEl.height(win.height() - 150);
-			console.log('History', win.height() - 150);
 			historyEl.scrollTop(el.scrollHeight);
 		});
 	} catch (e) { /**/ }
diff --git a/src/main/java/org/olat/portfolio/manager/EPStructureManager.java b/src/main/java/org/olat/portfolio/manager/EPStructureManager.java
index 9f1f778c9e4..6cc6553014d 100755
--- a/src/main/java/org/olat/portfolio/manager/EPStructureManager.java
+++ b/src/main/java/org/olat/portfolio/manager/EPStructureManager.java
@@ -1147,7 +1147,11 @@ public class EPStructureManager extends BasicManager {
 		int oldPos = indexOf(structureLinks, orderSubject);		
 		if (oldPos != orderDest && oldPos != -1) {
 			EPStructureToStructureLink link = structureLinks.remove(oldPos);
-			while (orderDest > structureLinks.size()) orderDest--; // place at end
+			if(orderDest > structureLinks.size()) {
+				orderDest = structureLinks.size() -1; // place at end
+			} else if(oldPos < orderDest) {
+				orderDest--;
+			}
 			structureLinks.add(orderDest, link);			
 			dbInstance.updateObject(structureEl);
 			return true;
diff --git a/src/main/java/org/olat/portfolio/ui/structel/edit/EPTOCController.java b/src/main/java/org/olat/portfolio/ui/structel/edit/EPTOCController.java
index 4b4a062d805..fad2ac7e5e8 100644
--- a/src/main/java/org/olat/portfolio/ui/structel/edit/EPTOCController.java
+++ b/src/main/java/org/olat/portfolio/ui/structel/edit/EPTOCController.java
@@ -27,6 +27,7 @@ import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.components.Component;
 import org.olat.core.gui.components.link.Link;
 import org.olat.core.gui.components.link.LinkFactory;
+import org.olat.core.gui.components.tree.GenericTreeNode;
 import org.olat.core.gui.components.tree.MenuTree;
 import org.olat.core.gui.components.tree.TreeDropEvent;
 import org.olat.core.gui.components.tree.TreeEvent;
@@ -64,7 +65,6 @@ public class EPTOCController extends BasicController {
 
 	protected static final String ARTEFACT_NODE_CLICKED = "artefactNodeClicked";
 	private static final String DELETE_LINK_CMD = "delete";
-	private static final String ARTEFACT_NODE_IDENTIFIER = "art";
 	private static final String ROOT_NODE_IDENTIFIER = "rootStruct";
 	protected final EPFrontendManager ePFMgr;
 	protected final EPStructureManager eSTMgr;
@@ -118,8 +118,15 @@ public class EPTOCController extends BasicController {
 		putInitialPanel(tocV);
 	}
 	
+	
+	public void update(UserRequest ureq, PortfolioStructure structure) {
+		reloadTreeModel(structure);
+		refreshAddElements(ureq, structure);
+	}
+	
 	protected void refreshTree(PortfolioStructureMap root) {
 		this.rootNode = root;
+		reloadTreeModel(root);
 	}
 	
 	/**
@@ -153,19 +160,33 @@ public class EPTOCController extends BasicController {
 		}		
 	}
 	
-	private TreeModel buildTreeModel() {
-		idToPath.put(rootNode.getKey(), "/" + ROOT_NODE_IDENTIFIER);
-		return new EPTOCTreeModel(rootNode, translate("toc.root"));
-		
+	private void reloadTreeModel(PortfolioStructure oldStruct, PortfolioStructure newStruct) {
+		if(oldStruct != null && newStruct != null && oldStruct.equals(newStruct)) {
+			newStruct = null;//only 1 reload
+		}
+		if(oldStruct != null ) {
+			reloadTreeModel(oldStruct);
+		}
+		if(newStruct != null) {
+			reloadTreeModel(newStruct);
+		}
 	}
 	
-	public void update(UserRequest ureq, PortfolioStructure structure) {
-		String path = idToPath.get(structure.getKey());
-		if(path != null) {
-		//TODO jquery treeCtr.reloadPath(path);
-		//TODO jquery treeCtr.selectPath(path);
+	private void reloadTreeModel(PortfolioStructure struct) {
+		EPTOCTreeModel model = (EPTOCTreeModel)treeCtr.getTreeModel();
+		if(struct != null) {
+			GenericTreeNode node = (GenericTreeNode)TreeHelper.findNodeByUserObject(struct, model.getRootNode());
+			if(node != null) {
+				node.setTitle(struct.getTitle());
+				node.setUserObject(struct);
+				model.loadChildNode(struct, node);
+			}
 		}
-		refreshAddElements(ureq, structure);
+	}
+	
+	private TreeModel buildTreeModel() {
+		idToPath.put(rootNode.getKey(), "/" + ROOT_NODE_IDENTIFIER);
+		return new EPTOCTreeModel(rootNode, translate("toc.root"));
 	}
 
 	/**
@@ -249,28 +270,6 @@ public class EPTOCController extends BasicController {
 		}
 	}
 	
-	private void reloadTreeModel(PortfolioStructure oldStruct, PortfolioStructure newStruct) {
-		if(oldStruct != null && newStruct != null && oldStruct.equals(newStruct)) {
-			newStruct = null;//only 1 reload
-		}
-		if(oldStruct != null ) {
-			reloadTreeModel(oldStruct);
-		}
-		if(newStruct != null) {
-			reloadTreeModel(newStruct);
-		}
-	}
-	
-	private void reloadTreeModel(PortfolioStructure struct) {
-		EPTOCTreeModel model = (EPTOCTreeModel)treeCtr.getTreeModel();
-		if(struct != null) {
-			TreeNode node = TreeHelper.findNodeByUserObject(struct, model.getRootNode());
-			if(node != null) {
-				model.loadChildNode(struct, node);
-			}
-		}
-	}
-	
 	private void doDrop(UserRequest ureq, String droppedNodeId, String targetNodeId, boolean child, boolean atTheEnd) {
 		TreeNode droppedNode = treeCtr.getTreeModel().getNodeById(droppedNodeId);
 		TreeNode targetNode = treeCtr.getTreeModel().getNodeById(targetNodeId);
@@ -289,43 +288,21 @@ public class EPTOCController extends BasicController {
 
 		if (droppedObj instanceof AbstractArtefact) {
 			AbstractArtefact artefact = (AbstractArtefact)droppedObj;
-			if (checkNewArtefactTarget(artefact, targetObj)){
+			if (checkArtefactTarget(artefact, targetObj)){
 				moveArtefactToNewParent(ureq, artefact, droppedParentObj, targetObj);
 			} else if(targetParentObj != null && targetParentObj.equals(droppedParentObj)) {
 				reorder(ureq, artefact, (TreeNode)targetNode.getParent(), targetObj);
 			}
 		} else if (droppedObj instanceof PortfolioStructure) {
 			PortfolioStructure droppedStruct = (PortfolioStructure)droppedObj;
-			if (checkNewStructureTarget(droppedStruct, droppedParentObj, targetNode)) {
-				int newPos = 0;// moveEvent.getPosition();
-				moveStructureToNewParent(ureq, droppedStruct, droppedParentObj, targetObj, newPos);
-			}
-		}
-	}
-	
-	private boolean moveStructureToNewParent(UserRequest ureq, PortfolioStructure structToBeMvd,
-			Object oldParent, Object newParent, int newPos) {
-		
-		if(oldParent instanceof PortfolioStructure && newParent instanceof PortfolioStructure) {
-			PortfolioStructure oldParStruct = (PortfolioStructure)oldParent;
-			PortfolioStructure newParStruct = (PortfolioStructure)newParent;
-			if (oldParStruct.equals(newParStruct)) {
-				// this is only a position move
-				if(ePFMgr.moveStructureToPosition(structToBeMvd, newPos)) {
-					reloadTreeModel(structToBeMvd, null);
-					fireEvent(ureq, new EPMoveEvent());
-					return true;
-				}
-			} else if(ePFMgr.moveStructureToNewParentStructure(structToBeMvd, oldParStruct, newParStruct, newPos)) {
-				reloadTreeModel(oldParStruct, newParStruct);
-				fireEvent(ureq, new EPMoveEvent());
-				return true;
+			if (checkStructureTarget(droppedStruct, droppedParentObj, targetObj, targetParentObj, !child)) {
+				int newPos = TreeHelper.indexOfByUserObject(targetObj, (TreeNode)targetNode.getParent());
+				moveStructureToNewParent(ureq, droppedStruct, droppedParentObj, targetParentObj, newPos);
 			}
 		}
-		return false;
 	}
 	
-	private boolean checkNewArtefactTarget(AbstractArtefact artefact, Object  targetObj){
+	private boolean checkArtefactTarget(AbstractArtefact artefact, Object  targetObj) {
 		PortfolioStructure newParStruct;
 		if (targetObj instanceof EPAbstractMap ) {
 			return false;
@@ -397,11 +374,13 @@ public class EPTOCController extends BasicController {
 		return false;
 	}
 	
-	private boolean checkNewStructureTarget(Object droppedObj, Object droppedParentObj, Object targetObj){
+	private boolean checkStructureTarget(PortfolioStructure droppedObj, Object droppedParentObj,
+			Object targetObj, Object targetParentObj, boolean sibling){
+		
 		if(targetObj == null || droppedParentObj == null) {
 			return false;
 		}
-		if (droppedParentObj.equals(targetObj)) {
+		if (droppedParentObj != null && droppedParentObj.equals(targetParentObj)) {
 			return true; // seems only to be a move in order
 		}
 		if (droppedObj instanceof EPPage && targetObj instanceof EPPage) {
@@ -413,122 +392,39 @@ public class EPTOCController extends BasicController {
 		return true;
 	}
 	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
+	private boolean moveStructureToNewParent(UserRequest ureq, PortfolioStructure structToBeMvd,
+			Object oldParent, Object newParent, int newPos) {
+		
+		if(oldParent instanceof PortfolioStructure && newParent instanceof PortfolioStructure) {
+			PortfolioStructure oldParStruct = (PortfolioStructure)oldParent;
+			PortfolioStructure newParStruct = (PortfolioStructure)newParent;
+			if (oldParStruct.equals(newParStruct)) {
+				// this is only a position move
+				if(ePFMgr.moveStructureToPosition(structToBeMvd, newPos)) {
+					reloadTreeModel(structToBeMvd, null);
+					fireEvent(ureq, new EPMoveEvent());
+					return true;
+				}
+			} else if(ePFMgr.moveStructureToNewParentStructure(structToBeMvd, oldParStruct, newParStruct, newPos)) {
+				reloadTreeModel(oldParStruct, newParStruct);
+				fireEvent(ureq, new EPMoveEvent());
+				return true;
+			}
+		}
+		return false;
+	}
 	
 	/**
 	 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
 	 */
 	@Override
 	protected void event(UserRequest ureq, Controller source, Event event) {
-		//TODO jquery implements drag and drop logic
-		/*
-		if (event instanceof TreeNodeClickedEvent) {
-			resetClickedNodes();
-			TreeNodeClickedEvent treeEv = (TreeNodeClickedEvent) event;
-			String nodeClicked = treeEv.getNodeId();
-			boolean isArtefactNode = nodeClicked.startsWith(ARTEFACT_NODE_IDENTIFIER);
-			if (!nodeClicked.equals(ROOT_NODE_IDENTIFIER) && !isArtefactNode){
-				structureClicked = ePFMgr.loadPortfolioStructureByKey(new Long(nodeClicked));
-				refreshAddElements(ureq, structureClicked);
-				delButton.setVisible(true);
-				//send event to load this page
-				fireEvent(ureq, new EPStructureChangeEvent(EPStructureChangeEvent.SELECTED, structureClicked));
-				// needed because refreshAddElements set flc dirty, therefore selected node gets lost
-				String path = idToPath.get(structureClicked.getKey());
-			//TODO jquery treeCtr.selectPath(path);
-			} else if (isArtefactNode) {
-				artefactNodeClicked = nodeClicked;
-				refreshAddElements(ureq, null);
-				delButton.setVisible(true);
-				String artIdent = getArtefactIdFromNodeId(nodeClicked);
-				String path = idToPath.get(new Long(artIdent));
-				PortfolioStructure structure = pathToStructure.get(path);
-				fireEvent(ureq, new EPArtefactClicked(ARTEFACT_NODE_CLICKED, structure));
-				// needed because refreshAddElements set flc dirty, therefore selected node gets lost
-			//TODO jquery treeCtr.selectPath(path); 
-			} else {
-				// root tree node clicked, no add/delete link
-				delButton.setVisible(false);
-				refreshAddElements(ureq, null);
-				fireEvent(ureq, new Event(ARTEFACT_NODE_CLICKED));
-			}
-		} else if (event instanceof MoveTreeNodeEvent) {
-			resetClickedNodes();
-			MoveTreeNodeEvent moveEvent = (MoveTreeNodeEvent) event;
-			String movedNode = moveEvent.getNodeId();
-			String oldParent = moveEvent.getOldParentNodeId();
-			String newParent = moveEvent.getNewParentNodeId();
-			int newPos = moveEvent.getPosition();
-			boolean isArtefactNode = movedNode.startsWith(ARTEFACT_NODE_IDENTIFIER);
-			if (isArtefactNode) {
-				String nodeId = getArtefactIdFromNodeId(movedNode);
-				if (checkNewArtefactTarget(nodeId, newParent)){
-					if (moveArtefactToNewParent(nodeId, oldParent, newParent)) {
-						if (isLogDebugEnabled()) logInfo("moved artefact " + nodeId + " from structure " + oldParent + " to " + newParent, null);
-						moveEvent.setResult(true, null, null);
-						// refresh the view
-						EPMoveEvent movedEvent = new EPMoveEvent(newParent, nodeId);
-						fireEvent(ureq, movedEvent);						
-					} else {
-						moveEvent.setResult(false, translate("move.error.title"), translate("move.artefact.error.move"));	
-					}						
-				} else if(oldParent.equals(newParent)) {
-					int position = moveEvent.getPosition();
-					reorder(nodeId, newParent, position);
-					moveEvent.setResult(true, null, null);
-					// refresh the view
-					EPMoveEvent movedEvent = new EPMoveEvent(newParent, nodeId);
-					fireEvent(ureq, movedEvent);
-				} else {
-					moveEvent.setResult(false, translate("move.error.title"), translate("move.artefact.error.target"));
-				}
-			} else {
-				if (checkNewStructureTarget(movedNode, oldParent, newParent)){
-					if (moveStructureToNewParent(movedNode, oldParent, newParent, newPos)) {
-						if (isLogDebugEnabled()) logInfo("moved structure " + movedNode + " from structure " + oldParent + " to " + newParent, null);
-						moveEvent.setResult(true, null, null);
-						// refresh the view
-						EPMoveEvent movedEvent = new EPMoveEvent(newParent, movedNode);
-						fireEvent(ureq, movedEvent);
-					} else {
-						moveEvent.setResult(false, translate("move.error.title"), translate("move.struct.error.move"));
-					}
-				} else {					
-					moveEvent.setResult(false, translate("move.error.title"), translate("move.struct.error.target"));
-				}
-			
-			}
-		} else */ if (source == addElCtrl){
+		if (source == addElCtrl){
 			// refresh the view, this is a EPStructureChangeEvent
 			fireEvent(ureq, event);	
 		}
 	}
 	
-	// reset previously choosen nodes. reference were there to be able to delete a node.
-	private void resetClickedNodes(){
-		structureClicked = null;
-		artefactClicked = null;
-	}
-	
-	private String getArtefactIdFromNodeId(String nodeId){
-		String artId = nodeId.substring(ARTEFACT_NODE_IDENTIFIER.length());
-		if (artId.contains("_")){
-			artId = artId.substring(artId.indexOf("_")+1);
-		}
-		return artId;
-	}
-	
 	private PortfolioStructure getArtefactParentStruct(AbstractArtefact artefact) {
 		TreeNode artefactNode = TreeHelper.findNodeByUserObject(artefact, treeCtr.getTreeModel().getRootNode());
 		if(artefactNode != null && artefactNode.getParent() != null) {
@@ -540,120 +436,7 @@ public class EPTOCController extends BasicController {
 
 		return null;
 	}
-	
-	/**
-	 * check if an artefact might be moved to this new parent node
-	 * artefact might be moved to pages or structureElements, but not on maps
-	 * @param artefactId
-	 * @param structureId
-	 * @return
-	 */
-	private boolean checkNewArtefactTarget(String artefactId, String structureId){
-		//artefact cannot be moved directly under root
-		if(ROOT_NODE_IDENTIFIER.equals(structureId)) return false;
-		
-		PortfolioStructure newParStruct;
-		AbstractArtefact artefact;
-		try {
-			artefact = ePFMgr.loadArtefactByKey(new Long(artefactId));
-			newParStruct = ePFMgr.loadPortfolioStructureByKey(new Long(structureId));
-		} catch (Exception e) {
-			logWarn("could not check for valid artefact target", e);
-			return false;
-		}
-		boolean sameTarget = ePFMgr.isArtefactInStructure(artefact, newParStruct);
-		if (sameTarget) return false;
-		if (newParStruct instanceof EPAbstractMap ) return false;
-		return true;
-	}
-	
-	// really do the move!
-	private boolean moveArtefactToNewParent(String artefactId, String oldParentId, String newParentId){
-		PortfolioStructure newParStruct;
-		PortfolioStructure oldParStruct;
-		AbstractArtefact artefact;
-		try {
-			artefact = ePFMgr.loadArtefactByKey(new Long(artefactId));
-			oldParStruct = ePFMgr.loadPortfolioStructureByKey(new Long(oldParentId));
-			newParStruct = ePFMgr.loadPortfolioStructureByKey(new Long(newParentId));
-		} catch (Exception e) {
-			logError("could not load artefact, old and new parent", e);
-			return false;
-		}
-		return ePFMgr.moveArtefactFromStructToStruct(artefact, oldParStruct, newParStruct);
-	}
-	
-	// really do the move!
-	private boolean reorder(String artefactId, String parentId, int position){
-		PortfolioStructure parStruct;
-		AbstractArtefact artefact;
-		try {
-			artefact = ePFMgr.loadArtefactByKey(new Long(artefactId));
-			parStruct = ePFMgr.loadPortfolioStructureByKey(new Long(parentId));
-			
-			//translate in the position in the list of artefacts
-			int numOfChildren = ePFMgr.countStructureChildren(parStruct);
-			position = position - numOfChildren;
-			if(position < 0) {
-				position = 0;
-			}
-		} catch (Exception e) {
-			logError("could not load artefact, old and new parent", e);
-			return false;
-		}
-		return ePFMgr.moveArtefactInStruct(artefact, parStruct, position);
-	}
-	
-	/**
-	 * check if a structure (page/structEl/map may be dropped here!
-	 * its only allowed to move:
-	 * - StructureElement from page -> page
-	 * - change the order of pages
-	 * - change the order of structures 
-	 * @param subjectStructId
-	 * @param oldParStructId
-	 * @param newParStructId
-	 * @return
-	 */	
-	private boolean checkNewStructureTarget(String subjectStructId, String oldParStructId, String newParStructId){
-		PortfolioStructure structToBeMvd;
-		PortfolioStructure newParStruct;
-		if (oldParStructId.equals(newParStructId)) return true; // seems only to be a move in order
-		if (newParStructId.equals(ROOT_NODE_IDENTIFIER)) return false;
-		try {
-			structToBeMvd = ePFMgr.loadPortfolioStructureByKey(new Long(subjectStructId));
-			newParStruct = ePFMgr.loadPortfolioStructureByKey(new Long(newParStructId));
-		} catch (Exception e) {
-			logError("could not check for valid structure target", e);
-			return false;
-		}
-		if (structToBeMvd instanceof EPPage && newParStruct instanceof EPPage) return false;
-		if (structToBeMvd instanceof EPStructureElement && !(newParStruct instanceof EPPage)) return false;
 
-		return true;
-	}
-	
-	// really do the move
-	private boolean moveStructureToNewParent(String subjectStructId, String oldParStructId, String newParStructId, int newPos){
-		PortfolioStructure structToBeMvd;
-		PortfolioStructure oldParStruct;
-		PortfolioStructure newParStruct;
-		try {
-			structToBeMvd = ePFMgr.loadPortfolioStructureByKey(new Long(subjectStructId));
-			oldParStruct = ePFMgr.loadPortfolioStructureByKey(new Long(oldParStructId));
-			newParStruct = ePFMgr.loadPortfolioStructureByKey(new Long(newParStructId));
-		} catch (Exception e) {
-			logError("could not load: structure to be moved, old or new structure while trying to move", e);
-			return false;
-		}
-		
-		if (oldParStructId.equals(newParStructId)) {
-			// this is only a position move
-			return ePFMgr.moveStructureToPosition(structToBeMvd, newPos);
-		}
-		
-		return ePFMgr.moveStructureToNewParentStructure(structToBeMvd, oldParStruct, newParStruct, newPos);		
-	}
 
 	/**
 	 * @see org.olat.core.gui.control.DefaultController#doDispose()
diff --git a/src/main/java/org/olat/portfolio/ui/structel/edit/EPTOCTreeModel.java b/src/main/java/org/olat/portfolio/ui/structel/edit/EPTOCTreeModel.java
index e4a25ef2519..c071988e960 100644
--- a/src/main/java/org/olat/portfolio/ui/structel/edit/EPTOCTreeModel.java
+++ b/src/main/java/org/olat/portfolio/ui/structel/edit/EPTOCTreeModel.java
@@ -102,8 +102,7 @@ public class EPTOCTreeModel extends GenericTreeModel implements DnDTreeModel {
 		}
 
 		Object targetObj = targetNode.getUserObject();
-		boolean isArtefactNode = droppedObj instanceof AbstractArtefact;
-		if (isArtefactNode) {
+		if (droppedObj instanceof AbstractArtefact) {
 			AbstractArtefact droppedArtefact = (AbstractArtefact)droppedObj;
 			if (checkArtefactTarget(droppedParentObj, droppedArtefact, targetObj, targetParentObj, sibling)) {
 				return true;
@@ -112,12 +111,15 @@ public class EPTOCTreeModel extends GenericTreeModel implements DnDTreeModel {
 			} else {	
 				return false;
 			}
-		} else {
-			if (checkNewStructureTarget(droppedObj, droppedParentObj, targetObj, targetParentObj)) {
+		} else if (droppedObj instanceof PortfolioStructure) {
+			PortfolioStructure droppedStructure = (PortfolioStructure)droppedObj;
+			if (checkStructureTarget(droppedParentObj, droppedStructure, targetObj, targetParentObj, sibling)) {
 				return true;
 			} else {				
 				return false;
 			}
+		} else {
+			return false;
 		}
 	}
 	
@@ -149,110 +151,32 @@ public class EPTOCTreeModel extends GenericTreeModel implements DnDTreeModel {
 		return true;
 	}
 	
-	private boolean checkNewStructureTarget(Object droppedObj, Object droppedParentObj, Object targetObj, Object targetParentObj){
+	private boolean checkStructureTarget(Object droppedParentObj, PortfolioStructure droppedStructure,
+			Object targetObj, Object targetParentObj, boolean sibling){
+	
 		if(targetObj == null || droppedParentObj == null) {
 			return false;
 		}
-		if (droppedParentObj.equals(targetObj)) {
-			return true; // seems only to be a move in order
-		}
-		if (droppedObj instanceof EPPage && targetObj instanceof EPPage) {
-			return false;
-		}
-		if (droppedObj instanceof EPStructureElement && !(targetObj instanceof EPPage)) {
-			return false;
-		}
-		return true;
-	}
-
-	/*
-	TreeModel model = new GenericTreeModel(ROOT_NODE_IDENTIFIER) {
 
-		@Override
-		public List<AjaxTreeNode> getChildrenFor(String nodeId) {
-			List<AjaxTreeNode> children = new ArrayList<AjaxTreeNode>();
-			AjaxTreeNode child;
-			boolean isRoot = false;
-			PortfolioStructure selStruct = null;
-			try {
-				List<PortfolioStructure> structs = new ArrayList<PortfolioStructure>();
-				if (nodeId.equals(ROOT_NODE_IDENTIFIER)) {
-					structs.add(rootNode);
-					isRoot = true;
-				} else if (!nodeId.startsWith(ARTEFACT_NODE_IDENTIFIER)){
-					selStruct = ePFMgr.loadPortfolioStructureByKey(new Long(nodeId));
-					structs = ePFMgr.loadStructureChildren(selStruct);
+		if(sibling) {
+			if(targetParentObj instanceof PortfolioStructure) {
+				if(droppedParentObj != null && targetParentObj != null && droppedParentObj.equals(targetParentObj)) {
+					return true; //reorder
 				} else {
-					// its an artefact -> no childs anymore
-					return null;
+					return false;
 				}
-				if (structs != null && structs.size() != 0) { 
-					for (PortfolioStructure portfolioStructure : structs) {
-						String childNodeId = String.valueOf(portfolioStructure.getKey());
-						boolean hasStructureChild = eSTMgr.countStructureChildren(portfolioStructure) > 0;
-						boolean hasArtefacts = eSTMgr.countArtefacts(portfolioStructure) > 0;
-						boolean hasChilds = hasStructureChild || hasArtefacts;
-						child = new AjaxTreeNode(childNodeId, portfolioStructure.getTitle());
-						if (isLogDebugEnabled()){
-							child = new AjaxTreeNode(childNodeId, portfolioStructure.getTitle() + "drop:" + !isRoot + "drag:" + !isRoot + "leaf:"+!hasChilds);
-						}
-						// seems to be a bug, nothing can be dropped on a leaf, therefore we need to tweak with expanded/expandable ourself!
-//						child.put(AjaxTreeNode.CONF_LEAF, !hasChilds);
-						child.put(AjaxTreeNode.CONF_IS_TYPE_LEAF, !hasChilds);
-						child.put(AjaxTreeNode.CONF_ALLOWDRAG, !isRoot);
-			
-						child.put(AjaxTreeNode.CONF_EXPANDED, hasStructureChild);
-						child.put(AjaxTreeNode.CONF_EXPANDABLE, hasChilds);
-						child.put(AjaxTreeNode.CONF_ALLOWDROP, true);
-						child.put(AjaxTreeNode.CONF_ISTARGET, !isRoot); 
-						
-						child.put(AjaxTreeNode.CONF_ICON_CSS_CLASS, portfolioStructure.getIcon());
-						String description = FilterFactory.getHtmlTagAndDescapingFilter().filter(portfolioStructure.getDescription());
-						child.put(AjaxTreeNode.CONF_QTIP, description);
-						children.add(child);
-						
-						String path;
-						if(isRoot) {
-							path = "/" + ROOT_NODE_IDENTIFIER;
-						} else {
-							path = idToPath.get(selStruct.getKey()); 
-						}
-
-						idToPath.put(portfolioStructure.getKey(), path + "/" + childNodeId);
-					}
-				} 
-				if (selStruct != null && ePFMgr.countArtefactsRecursively(selStruct) != 0){
-					List<AbstractArtefact> artList = ePFMgr.getArtefacts(selStruct);
-					for (AbstractArtefact abstractArtefact : artList) {
-						//include struct also, to still be unique if an artefact is linked multiple times
-						String childNodeId = ARTEFACT_NODE_IDENTIFIER + String.valueOf(selStruct.getKey()) + "_" + String.valueOf(abstractArtefact.getKey());
-						child = new AjaxTreeNode(childNodeId, abstractArtefact.getTitle());
-						child.put(AjaxTreeNode.CONF_LEAF, true);
-						child.put(AjaxTreeNode.CONF_IS_TYPE_LEAF, true);
-						child.put(AjaxTreeNode.CONF_ALLOWDRAG, true);
-						child.put(AjaxTreeNode.CONF_EXPANDED, false);
-						child.put(AjaxTreeNode.CONF_ALLOWDROP, false);
-						child.put(AjaxTreeNode.CONF_ICON_CSS_CLASS, abstractArtefact.getIcon());
-						String description = FilterFactory.getHtmlTagAndDescapingFilter().filter(abstractArtefact.getDescription());
-						child.put(AjaxTreeNode.CONF_QTIP, description);
-						children.add(child);
-						
-						String path = idToPath.get(selStruct.getKey());
-						
-						String artefactPath = path + "/" + childNodeId;
-						idToPath.put(abstractArtefact.getKey(), artefactPath);
-						pathToStructure.put(artefactPath, selStruct);
-					}						
-				} 
-			} catch (JSONException e) {
-				throw new OLATRuntimeException("Error while creating tree model for map/page/structure selection", e);
 			}
-			return children;
+		} else {
+			if (droppedParentObj.equals(targetObj)) {
+				return true; // seems only to be a move in order
+			}
+			if (droppedStructure instanceof EPPage && targetObj instanceof EPPage) {
+				return false;
+			}
+			if (droppedStructure instanceof EPStructureElement && !(targetObj instanceof EPPage)) {
+				return false;
+			}
 		}
-	};
-	model.setCustomRootIconCssClass("o_st_icon");
-	return model;
-	*/
-
-
+		return true;
+	}
 }
diff --git a/src/main/java/org/olat/search/ui/_content/searchInput.html b/src/main/java/org/olat/search/ui/_content/searchInput.html
index 5a966df3199..44733eb3c64 100644
--- a/src/main/java/org/olat/search/ui/_content/searchInput.html
+++ b/src/main/java/org/olat/search/ui/_content/searchInput.html
@@ -21,7 +21,6 @@
 	/* <![CDATA[ */ 
 		jQuery(function() {
 			jQuery('#o_search_form_toggler').click(function() {
-				console.log('Aoi malena');
 				jQuery('#o_search_form_content').slideToggle(300);
 			});
 		});
diff --git a/src/main/webapp/static/js/functions.js b/src/main/webapp/static/js/functions.js
index bd7c6eed3fc..ee05a475a00 100644
--- a/src/main/webapp/static/js/functions.js
+++ b/src/main/webapp/static/js/functions.js
@@ -30,6 +30,7 @@ var BLoader = {
 	// Internal mehod to check if a JS file has already been loaded on the page
 	_isAlreadyLoadedJS: function(jsURL) {
 		var notLoaded = true;
+		console.log(jsURL);
 		// first check for scrips loaded via HTML head
 		jQuery('head script[src]').each(function(s,t) {
 			if (jQuery(t).attr('src').indexOf(jsURL) != -1) {
@@ -37,7 +38,7 @@ var BLoader = {
 			};
 		});
 		// second check for script loaded via ajax call
-		if (this._ajaxLoadedJS.indexOf(jsURL) != -1) notLoaded = false;
+		if (jQuery.inArray(jsURL, this._ajaxLoadedJS) != -1) notLoaded = false;
 		return !notLoaded;
 	},
 		
@@ -341,6 +342,40 @@ Array.prototype.search = function(s,q){
   return false;
 }
 
+if(!Array.prototype.indexOf) {
+	Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
+		"use strict";
+		if (this == null) {
+			throw new TypeError();
+        }
+        var t = Object(this);
+        var len = t.length >>> 0;
+        if (len === 0) {
+            return -1;
+        }
+        var n = 0;
+        if (arguments.length > 1) {
+            n = Number(arguments[1]);
+            if (n != n) { // shortcut for verifying if it's NaN
+                n = 0;
+            } else if (n != 0 && n != Infinity && n != -Infinity) {
+                n = (n > 0 || -1) * Math.floor(Math.abs(n));
+            }
+        }
+        if (n >= len) {
+            return -1;
+        }
+        var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);
+        for (; k < len; k++) {
+            if (k in t && t[k] === searchElement) {
+                return k;
+            }
+        }
+        return -1;
+	}
+}
+
+
 // b_AddOnDomReplacementFinishedCallback is used to add callback methods that are executed after
 // the DOM replacement has occured. Note that when not in AJAX mode, those methods will not be 
 // executed. Use this callback to execute some JS code to cleanup eventhandlers or alike
diff --git a/src/main/webapp/static/js/js.plugins.min.js b/src/main/webapp/static/js/js.plugins.min.js
index f25bc8e8f89..4ac5db4ad8c 100644
--- a/src/main/webapp/static/js/js.plugins.min.js
+++ b/src/main/webapp/static/js/js.plugins.min.js
@@ -1,4 +1,4 @@
-OPOL={};var o2c=0;var o3c=new Array();o_info.guibusy=false;o_info.linkbusy=false;o_info.debug=true;var BLoader={_ajaxLoadedJS:new Array(),_isAlreadyLoadedJS:function(b){var a=true;jQuery("head script[src]").each(function(d,c){if(jQuery(c).attr("src").indexOf(b)!=-1){a=false}});if(this._ajaxLoadedJS.indexOf(b)!=-1){a=false}return !a},loadJS:function(b,c,a){if(!this._isAlreadyLoadedJS(b)){if(o_info.debug){o_log("BLoader::loadJS: loading ajax::"+a+" url::"+b)}if(a){jQuery.ajax(b,{async:false,dataType:"script",success:function(d,f,e){}});this._ajaxLoadedJS.push(b)}else{jQuery.getScript(b)}if(o_info.debug){o_log("BLoader::loadJS: loading DONE url::"+b)}}else{if(o_info.debug){o_log("BLoader::loadJS: already loaded url::"+b)}}},executeGlobalJS:function(jsString,contextDesc){try{if(window.execScript){window.execScript(jsString)}else{window.eval(jsString)}}catch(e){if(console){console.log(contextDesc,"cannot execute js",jsString)}if(o_info.debug){o_logerr("BLoader::executeGlobalJS: Error when executing JS code in contextDesc::"+contextDesc+' error::"'+showerror(e)+" for: "+escape(jsString))}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::executeGlobalJS: Error when executing JS code in contextDesc::"+contextDesc+' error::"'+showerror(e)+" for: "+escape(jsString),"functions.js::BLoader::executeGlobalJS::"+contextDesc)}if(window.location.href.indexOf("o_winrndo")!=-1){window.location.reload()}else{window.location.href=window.location.href+(window.location.href.indexOf("?")!=-1?"&":"?")+"o_winrndo=1"}}},loadCSS:function(b,o,q){var r=window.document;try{if(r.createStyleSheet){var j=r.styleSheets;var d=0;var p=0;for(i=0;i<j.length;i++){var m=j[i];var g=m.href;if(g==b){d++;if(m.disabled){m.disabled=false;return}else{if(o_info.debug){o_logwarn("BLoader::loadCSS: style: "+b+" already in document and not disabled! (duplicate add)")}return}}if(m.id=="b_theme_css"){p=i}}if(d>1&&o_info.debug){o_logwarn("BLoader::loadCSS: apply styles: num of stylesheets found was not 0 or 1:"+d)}if(q){p=j.length}var f=r.createStyleSheet(b,p)}else{var c=jQuery("#"+o);if(c&&c.size()>0){if(o_info.debug){o_logwarn("BLoader::loadCSS: stylesheet already found in doc when trying to add:"+b+", with id "+o)}return}else{var a=jQuery('<link id="'+o+'" rel="stylesheet" type="text/css" href="'+b+'">');if(q){a.insertBefore(jQuery("#b_fontSize_css"))}else{a.insertBefore(jQuery("#b_theme_css"))}}}}catch(n){if(console){console.log(n)}if(o_info.debug){o_logerr("BLoader::loadCSS: Error when loading CSS from URL::"+b)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::loadCSS: Error when loading CSS from URL::"+b,"functions.js::BLoader::loadCSS")}}},unLoadCSS:function(a,m){var n=window.document;try{if(n.createStyleSheet){var f=n.styleSheets;var d=0;var o=a;var b=window.location.href.substring(0,window.location.href.indexOf("/",8));if(a.indexOf(b)==0){o=a.substring(b.length)}for(i=0;i<f.length;i++){var g=f[i].href;if(g==a||g==o){d++;if(!f[i].disabled){f[i].disabled=true}else{if(o_info.debug){o_logwarn("stylesheet: when removing: matching url, but already disabled! url:"+g)}}}}if(d!=1&&o_info.debug){o_logwarn("stylesheet: when removeing: num of stylesheets found was not 1:"+d)}}else{var c=jQuery("#"+m);if(c){c.href="";c.remove();c=null;return}else{if(o_info.debug){o_logwarn("no link with id found to remove, id:"+m+", url "+a)}}}}catch(j){if(o_info.debug){o_logerr("BLoader::unLoadCSS: Error when unloading CSS from URL::"+a)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::unLoadCSS: Error when unloading CSS from URL::"+a,"functions.js::BLoader::loadCSS")}}}};var BFormatter={formatLatexFormulas:function(b){try{if(jsMath){if(jsMath.loaded){jsMath.ProcessBeforeShowing.curry(b).delay(0.01)}else{jsMath.Autoload.LoadJsMath();BFormatter.formatLatexFormulas.delay(0.1)}}else{if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BFormatter::formatLatexFormulas: can not format latex formulas, jsMath not installed. Check your logfile","functions.js::BFormatter::formatLatexFormulas")}}}catch(a){if(o_info.debug){o_log("error in BFormatter.formatLatexFormulas: "+showerror(a))}}}};function o_init(){try{o_getOpenWin().o_afterserver()}catch(a){if(o_info.debug){o_log("error in o_init: "+showerror(a))}}}function b_initEmPxFactor(){o_info.emPxFactor=jQuery("#b_width_1em").width();if(o_info.emPxFactor==0||o_info.emPxFactor=="undefined"){o_info.emPxFactor=12;if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Could not read with of element b_width_1em, set o_info.emPxFactor to 12","functions.js")}}}function o_getOpenWin(){var a=top;try{if(a.opener&&a.opener.o_info){a=a.opener}}catch(b){}return a}function o_beforeserver(){o_info.linkbusy=true;showAjaxBusy();if(window.suppressOlatOnUnloadOnce){window.suppressOlatOnUnloadOnce=false}else{if(window.olatonunload){olatonunload()}}}function o_afterserver(){o2c=0;o_info.linkbusy=false;removeAjaxBusy()}function o2cl(){if(o_info.linkbusy){return false}else{var a=(o2c==0||confirm(o_info.dirty_form));if(a){o_beforeserver()}return a}}function o3cl(d){if(o_info.linkbusy){return false}else{var b=o3c1.indexOf(d)>-1;var a=(b&&o3c1.length>1)||o3c1.length>0;var c=(!a||confirm(o_info.dirty_form));if(c){o_beforeserver()}return c}}function o_onc(a){var b=a.responseText;BLoader.executeGlobalJS("o_info.last_o_onc="+b+";","o_onc");o_ainvoke(o_info.last_o_onc,false)}function o_allowNextClick(){o_info.linkbusy=false;removeAjaxBusy()}function removeBusyAfterDownload(c,b,a){o2c=0;o_afterserver()}Array.prototype.search=function(c,d){var a=this.length;for(var b=0;b<a;b++){if(this[b].constructor==Array){if(this[b].search(c,d)){return true;break}}else{if(d){if(this[b].indexOf(c)!=-1){return true;break}}else{if(this[b]==c){return true;break}}}}return false};var b_onDomReplacementFinished_callbacks=new Array();function b_AddOnDomReplacementFinishedCallback(a){var b=jQuery(document).ooLog().isDebugEnabled();if(b){jQuery(document).ooLog("debug","callback stack size: "+b_onDomReplacementFinished_callbacks.length,"functions.js ADD")}if(b&&jQuery.browser.mozilla&&!jQuery.browser.webkit){jQuery(document).ooLog("debug","stack content"+b_onDomReplacementFinished_callbacks.toSource(),"functions.js ADD")}b_onDomReplacementFinished_callbacks.push(a);if(b){jQuery(document).ooLog("debug","push to callback stack, func: "+a,"functions.js ADD")}}var b_changedDomEl=new Array();function b_AddOnDomReplacementFinishedUniqueCallback(a){if(a.constructor==Array){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","add: its an ARRAY! ","functions.js ADD")}if(b_onDomReplacementFinished_callbacks.search(a[0])){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","push to callback stack, already there!!: "+a[0],"functions.js ADD")}return}}b_AddOnDomReplacementFinishedCallback(a)}var o_debug_trid=0;function o_ainvoke(H){if(H==undefined){return}o_info.inainvoke=true;var D=H.cmdcnt;if(D>0){b_changedDomEl=new Array();if(o_info.debug){o_debug_trid++}var v=H.cmds;for(var N=0;N<D;N++){var E=v[N];var x=E.cmd;var L=E.cda;var O=E.w;var b=this.window;var F;if(b){switch(x){case 1:var G=L.e;BLoader.executeGlobalJS(G,"o_ainvoker::jsexec");if(o_info.debug){o_log("c1: execute jscode: "+G)}case 2:var s=L.cc;var B=L.cps;for(var K=0;K<s;K++){var h=B[K];var g=h.cid;var J=h.cidvis;var u=h.hfrag;var I=h.jsol;var f=h.hdr;if(o_info.debug){o_log("c2: redraw: "+h.cname+" ("+g+") "+h.hfragsize+" bytes, listener(s): "+h.clisteners)}var Q=f+"\n\n"+u;var z="";var M=false;var y=jQuery("#o_c"+g);if(y==null||(y.length==0)){y=jQuery("#o_fi"+g);M=true}if(y!=null){if(J){y.css("display","")}else{y.css("display","none")}if(M){y.replaceWith(Q)}else{y.empty();try{y.html(Q)}catch(T){if(console){console.log(T)}if(console){console.log("Fragment",Q)}}b_changedDomEl.push("o_c"+g)}y=null;if(z!=""){z.each(function(e){BLoader.executeGlobalJS(e,"o_ainvoker::inscripts")})}if(I!=""){BLoader.executeGlobalJS(I,"o_ainvoker::jsol")}}}break;case 3:b.o2c=0;var R=L.rurl;b.o_afterserver();b.document.location.replace(R);break;case 5:b.o2c=0;var R=L.rurl;b.o_afterserver();b.document.location.replace(R);break;case 6:b.o2c=0;b.o_afterserver();break;case 7:var n=b.document.location;var w=n.protocol+"//"+n.hostname;if(n.port!=""){w+=":"+n.port}var t=L.cssrm;for(K=0;K<t.length;K++){var A=t[K];var C=A.id;var d=w+A.url;BLoader.unLoadCSS(d,C);if(o_info.debug){o_log("c7: rm css: id:"+C+" ,url:'"+d+"'")}}var P=L.cssadd;for(k=0;k<P.length;k++){var A=P[k];var C=A.id;var d=w+A.url;var m=A.pt;BLoader.loadCSS(d,C,m);if(o_info.debug){o_log("c7: add css: id:"+C+" ,url:'"+d+"'")}}var o=L.jsadd;for(l=0;l<o.length;l++){var A=o[l];var S=A.before;if(jQuery.type(S)==="string"){BLoader.executeGlobalJS(S,"o_ainvoker::preJsAdd")}var d=A.url;var p=A.enc;if(jQuery.type(d)==="string"){BLoader.loadJS(d,p,true)}if(o_info.debug){o_log("c7: add js: "+d)}}break;default:if(o_info.debug){o_log("?: unknown command "+x)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in o_ainvoke(), ?: unknown command "+x,"functions.js")}break}}else{if(o_info.debug){o_log("could not find window??")}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in o_ainvoke(), could not find window??","functions.js")}}}var a=b_onDomReplacementFinished_callbacks.length;if(jQuery.browser.mozilla&&!jQuery.browser.webkit){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","stack content"+b_onDomReplacementFinished_callbacks.toSource(),"functions.js")}}for(mycounter=0;a>mycounter;mycounter++){if(mycounter>50){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stopped executing DOM replacement callback functions - to many functions::"+b_onDomReplacementFinished_callbacks.length,"functions.js")}break}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stacksize before shift: "+b_onDomReplacementFinished_callbacks.length,"functions.js")}var q=b_onDomReplacementFinished_callbacks.shift();if(typeof q.length==="number"){if(q[0]=="glosshighlighter"){var c=q[1];if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","arr fct: "+c,"functions.js")}q=c}}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Executing DOM replacement callback function #"+mycounter+" with timeout funct::"+q,"functions.js")}q();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stacksize after timeout: "+b_onDomReplacementFinished_callbacks.length,"functions.js")}}}o_info.inainvoke=false}function clearAfterAjaxIframeCall(){if(o_info.linkbusy){o_afterserver();showMessageBox("info",o_info.i18n_noresponse_title,o_info.i18n_noresponse,undefined)}}function showAjaxBusy(){if(o_info.linkbusy){try{jQuery("#b_ajax_busy").delay(500).queue(function(b){jQuery(this).addClass("b_ajax_busy");jQuery("#b_body").addClass("b_ajax_busy")})}catch(a){}}return}function removeAjaxBusy(){try{jQuery("#b_ajax_busy").delay(500).queue(function(b){jQuery(this).removeClass("b_ajax_busy");jQuery("#b_body").removeClass("b_ajax_busy")})}catch(a){}}var htmlEditorEnabled=(jQuery.browser.msie||jQuery.browser.mozilla);var scormPlayerEnabled=(jQuery.browser.msie||jQuery.browser.mozilla||jQuery.browser.webkit);function setFormDirty(c){o2c=1;var a=document.getElementById(c);if(a!=null){var b=a.olat_fosm_0;if(b==null){b=a.olat_fosm}if(b){b.className="b_button b_button_dirty"}}else{if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in setFormDirty, myForm was null for formId="+c,"functions.js")}}}function contextHelpWindow(a){helpWindow=window.open(a,"HelpWindow","height=760, width=940, left=0, top=0, location=no, menubar=no, resizable=yes, scrollbars=yes, toolbar=no");helpWindow.focus()}function o_openPopUp(b,d,c,a,e){attributes="height="+a+", width="+c+", resizable=yes, scrollbars=yes, left=100, top=100, ";if(e){attributes+="location=yes, menubar=yes, status=yes, toolbar=yes"}else{attributes+="location=no, menubar=no, status=no, toolbar=no"}var f=window.open(b,d,attributes);f.focus()}function b_togglebox(a,b){jQuery("#"+a).slideToggle(400,function(){var c=jQuery(b);c.toggleClass("b_togglebox_closed");c.toggleClass("b_togglebox_opened")})}function b_handleFileUploadFormChange(e,b,d){var f=e.value;slashPos=f.lastIndexOf("/");if(slashPos!=-1){f=f.substring(slashPos+1)}slashPos=f.lastIndexOf("\\");if(slashPos!=-1){f=f.substring(slashPos+1)}b.value=f;if(d){d.className="b_button b_button_dirty"}var c=e.form.elements;for(i=0;i<c.length;i++){var a=c[i];if(a.name==b.name&&i+1<c.length){c[i+1].focus()}}}function gotonode(a){try{if(typeof o_activateCourseNode!="undefined"){o_activateCourseNode(a)}else{if(opener&&typeof opener.o_activateCourseNode!="undefined"){opener.o_activateCourseNode(a)}else{if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in gotonode(), could not find main window","functions.js")}}}}catch(b){alert("Goto node error:"+b);if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in gotonode()::"+b.message,"functions.js")}}}function o_openUriInMainWindow(b){var a=top;try{if(a.opener&&a.opener.o_info){a=a.opener}}catch(c){}a.focus();a.location.replace(b)}function b_viewportHeight(){var a=jQuery(document).height();if(a>0){return a}else{return 600}}OPOL.getMainColumnsMaxHeight=function(){var j=0,f=0,a=0,c=0,h=0,b,g=jQuery("#b_col1_content"),e=jQuery("#b_col2_content"),d=jQuery("#b_col3_content");if(g!="undefined"&&g!=null){j=g.height()}if(e!="undefined"&&e!=null){f=e.height()}if(d!="undefined"&&d!=null){a=d.height()}c=(j>f?j:f);c=(c>a?c:a);if(c>0){return c}b=jQuery("#b_main");if(b!="undefined"&&b!=null){h=b.height()}if(b>0){return b}return b_viewportHeight()};function b_resizeIframeToMainMaxHeight(f){alert("b_resizeIframeToMainMaxHeight");var d=jQuery("#"+f);if(d!="undefined"&&d!=null){var c=OPOL.getMainColumnsMaxHeight();var b=b_viewportHeight()-100;var e=jQuery("#b_header");if(e!="undefined"&&e!=null){b=b-e.getHeight()}e=jQuery("#b_nav");if(e!="undefined"&&e!=null){b=b-e.getHeight()}e=jQuery("#b_footer");if(e!="undefined"&&e!=null){b=b-e.getHeight()}var a=(b>c?b:c)+"px";d.setHeight(a)}}var o_debu_oldcn,o_debu_oldtt;function o_debu_show(b,a){if(o_debu_oldcn){o_debu_hide(o_debu_oldcn,o_debu_oldtt)}jQuery(b).css("border","3px solid #00F").css("margin","0px").css("background-color","#FCFCB8");jQuery(a).show();o_debu_oldtt=a;o_debu_oldcn=b}function o_debu_hide(b,a){jQuery(a).hide();jQuery(b).css("border","1px dotted black").css("margin","2px").css("background-color","")}function o_dbg_mark(a){var b=jQuery("#"+a);if(b){b.css("background-color","#FCFCB8");b.css("border","3px solid #00F")}}function o_dbg_unmark(a){var b=jQuery("#"+a);if(b){b.css("border","");b.css("background-color","")}}function o_clearConsole(){o_log_all="";o_log(null)}var o_log_all="";function o_log(b){if(b){o_log_all="\n"+o_debug_trid+"> "+b+o_log_all;o_log_all=o_log_all.substr(0,4000)}var a=jQuery("#o_debug_cons");if(a){if(o_log_all.length==4000){o_log_all=o_log_all+"\n... (stripped: to long)... "}a.value=o_log_all}if(!jQuery.browser.IE&&!jQuery.type(window.console)==="undefined"){window.console.log(b)}}function o_logerr(a){o_log("ERROR:"+a)}function o_logwarn(a){o_log("WARN:"+a)}function showerror(c){var a="";for(var b in c){a+=b+": "+c[b]+"\n"}return"error detail:\n"+a}function o_ffEvent(e,d,c,h,j){var f,g,b,a;f=document.getElementById(d);g=f.value;f.value=c;b=document.getElementById(h);a=b.value;b.value=j;if(document.forms[e].onsubmit()){document.forms[e].submit()}f.value=g;b.value=a}function o_ffXHREvent(f,e,a,h,j){var c=new Object();c.dispatchuri=a;c.dispatchevent=j;if(arguments.length>5){var g=arguments.length;for(var d=5;d<g;d=d+2){if(g>d+1){c[arguments[d]]=arguments[d+1]}}}var b=jQuery("#"+f).attr("action");jQuery.ajax(b,{type:"GET",data:c,dataType:"json",success:function(n,o,m){o_ainvoke(n)},error:function(m,o,n){if(console){console.log("Error status",o)}}})}function setFlexiFormDirtyByListener(a){setFlexiFormDirty(a.data.formId)}function setFlexiFormDirty(b){var a=o3c.indexOf(b)>-1;if(!a){o3c.push(b)}jQuery("#"+b).each(function(){var c=jQuery(this).data("FlexiSubmit");if(c!=null){jQuery("#"+c).addClass("b_button b_button_dirty");o2c=1}})}function o_ffRegisterSubmit(b,a){jQuery("#"+b).data("FlexiSubmit",a)}function showInfoBox(f,c){var b=Math.floor(Math.random()*65536).toString(16);var e='<div id="'+b+'" class="b_msg-div msg" style="display:none;"><div class="b_msg_info_content b_msg_info_winicon o_sel_info_message"><h3>'+f+"</h3>"+c+"<br/><br/></div></div>";var a=jQuery("#b_page").prepend(e);var d=(c.length>150)?8000:((c.length>70)?6000:4000);jQuery("#"+b).slideDown(300).delay(d).slideUp(300);jQuery("#"+b).click(function(g){jQuery("#"+b).remove()});f=null;c=null;a=null;d=null}function showMessageBox(b,e,c,a){if(b=="info"){showInfoBox(e,c)}else{var d;if("warn"==b){d='<div><div class="b_msg_info_content b_msg_warn_winicon">'}else{if("error"==b){d='<div><div class="b_msg_info_content b_msg_error_winicon">'}else{d="<div><div>"}}jQuery(d+"<p>"+c+"</p></div></div>").dialog({height:170,width:400,modal:true,title:e,resizable:false}).dialog("open")}}function tableFormInjectCommandAndSubmit(a,b,c){document.forms[a].elements.cmd.value=b;document.forms[a].elements.param.value=c;document.forms[a].submit()}function b_table_toggleCheck(d,c){var a=document.forms[d].elements.tb_ms;len=a.length;if(typeof(len)=="undefined"){a.checked=c}else{var b;for(b=0;b<len;b++){a[b].checked=c}}}function b_doPrint(){var d=$$("div.b_iframe_wrapper iframe");if(d.length>0){try{var a=d[0];frames[a.name].focus();frames[a.name].print();return}catch(c){for(i=0;frames.length>i;i++){a=frames[i];if(a.name=="oaa0"){continue}var b=document.getElementsByName(a.name)[0];if(b&&b.getAttribute("class")=="ext-shim"){continue}if(a.name!=""){try{frames[a.name].focus();frames[a.name].print()}catch(c){window.print()}return}}window.print()}}else{window.print()}}function b_attach_i18n_inline_editing(){jQuery("span.b_translation_i18nitem").hover(function(){jQuery(this.firstChild).show();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Entered i18nitem::"+this.firstChild,"functions.js:b_attach_i18n_inline_editing()")}},function(){jQuery("a.b_translation_i18nitem_launcher").hide();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Leaving i18nitem::"+this,"functions.js:b_attach_i18n_inline_editing()")}});jQuery("a.b_translation_i18nitem_launcher").hover(function(){var a=jQuery(this).parent("span.b_translation_i18nitem");a.effect("highlight")});b_AddOnDomReplacementFinishedCallback(b_attach_i18n_inline_editing)}var BDebugger={_lastDOMCount:0,_lastObjCount:0,_knownGlobalOLATObjects:["o_afterserver","o_onc","o_getOpenWin","o_ainvoke","o_info","o_beforeserver","o_ffEvent","o_openPopUp","o_debu_show","o_logwarn","o_dbg_unmark","o_ffRegisterSubmit","o_clearConsole","o_init","o_log","o_allowNextClick","o_dbg_mark","o_debu_hide","o_logerr","o_debu_oldcn","o_debu_oldtt","o_openUriInMainWindow","o_debug_trid","o_log_all"],_countDOMElements:function(){return document.getElementsByTagName("*").length},_countGlobalObjects:function(){var a=0;for(prop in window){a++}return a},logDOMCount:function(){var b=BDebugger;var a=b._countDOMElements();var c=a-b._lastDOMCount;console.log((c>0?"+":"")+c+" \t"+a+" \tDOM element count after DOM replacement");b._lastDOMCount=a;a=null},logGlobalObjCount:function(){var b=BDebugger;var a=b._countGlobalObjects();var c=a-b._lastObjCount;console.log((c>0?"+":"")+c+" \t"+a+" \tGlobal object count after DOM replacement");b._lastObjCount=a;a=null},logGlobalOLATObjects:function(){var b=BDebugger;var a=new Array();for(prop in window){if(prop.indexOf("o_")==0&&b._knownGlobalOLATObjects.indexOf(prop)==-1){a.push(prop)}}if(a.length>0){console.log(a.length+" global OLAT objects found:");a.each(function(c){console.log("\t"+typeof window[c]+" \t"+c)})}},logManagedOLATObjects:function(){var a=BDebugger;if(o_info.objectMap.length>0){console.log(o_info.objectMap.length+" managed OLAT objects found:");o_info.objectMap.eachKey(function(b){var c=o_info.objectMap.get(b);console.log("\t"+typeof c+" \t"+b);return true})}}};var Hashtable=(function(){var p="function";var n=(typeof Array.prototype.splice==p)?function(s,r){s.splice(r,1)}:function(u,t){var s,v,r;if(t===u.length-1){u.length=t}else{s=u.slice(t+1);u.length=t;for(v=0,r=s.length;v<r;++v){u[t+v]=s[v]}}};function a(t){var r;if(typeof t=="string"){return t}else{if(typeof t.hashCode==p){r=t.hashCode();return(typeof r=="string")?r:a(r)}else{if(typeof t.toString==p){return t.toString()}else{try{return String(t)}catch(s){return Object.prototype.toString.call(t)}}}}}function g(r,s){return r.equals(s)}function e(r,s){return(typeof s.equals==p)?s.equals(r):(r===s)}function c(r){return function(s){if(s===null){throw new Error("null is not a valid "+r)}else{if(typeof s=="undefined"){throw new Error(r+" must not be undefined")}}}}var q=c("key"),l=c("value");function d(u,s,t,r){this[0]=u;this.entries=[];this.addEntry(s,t);if(r!==null){this.getEqualityFunction=function(){return r}}}var h=0,j=1,f=2;function o(r){return function(t){var s=this.entries.length,v,u=this.getEqualityFunction(t);while(s--){v=this.entries[s];if(u(t,v[0])){switch(r){case h:return true;case j:return v;case f:return[s,v[1]]}}}return false}}function k(r){return function(u){var v=u.length;for(var t=0,s=this.entries.length;t<s;++t){u[v+t]=this.entries[t][r]}}}d.prototype={getEqualityFunction:function(r){return(typeof r.equals==p)?g:e},getEntryForKey:o(j),getEntryAndIndexForKey:o(f),removeEntryForKey:function(s){var r=this.getEntryAndIndexForKey(s);if(r){n(this.entries,r[0]);return r[1]}return null},addEntry:function(r,s){this.entries[this.entries.length]=[r,s]},keys:k(0),values:k(1),getEntries:function(s){var u=s.length;for(var t=0,r=this.entries.length;t<r;++t){s[u+t]=this.entries[t].slice(0)}},containsKey:o(h),containsValue:function(s){var r=this.entries.length;while(r--){if(s===this.entries[r][1]){return true}}return false}};function m(s,t){var r=s.length,u;while(r--){u=s[r];if(t===u[0]){return r}}return null}function i(r,s){var t=r[s];return(t&&(t instanceof d))?t:null}function b(t,r){var w=this;var v=[];var u={};var x=(typeof t==p)?t:a;var s=(typeof r==p)?r:null;this.put=function(B,C){q(B);l(C);var D=x(B),E,A,z=null;E=i(u,D);if(E){A=E.getEntryForKey(B);if(A){z=A[1];A[1]=C}else{E.addEntry(B,C)}}else{E=new d(D,B,C,s);v[v.length]=E;u[D]=E}return z};this.get=function(A){q(A);var B=x(A);var C=i(u,B);if(C){var z=C.getEntryForKey(A);if(z){return z[1]}}return null};this.containsKey=function(A){q(A);var z=x(A);var B=i(u,z);return B?B.containsKey(A):false};this.containsValue=function(A){l(A);var z=v.length;while(z--){if(v[z].containsValue(A)){return true}}return false};this.clear=function(){v.length=0;u={}};this.isEmpty=function(){return !v.length};var y=function(z){return function(){var A=[],B=v.length;while(B--){v[B][z](A)}return A}};this.keys=y("keys");this.values=y("values");this.entries=y("getEntries");this.remove=function(B){q(B);var C=x(B),z,A=null;var D=i(u,C);if(D){A=D.removeEntryForKey(B);if(A!==null){if(!D.entries.length){z=m(v,C);n(v,z);delete u[C]}}}return A};this.size=function(){var A=0,z=v.length;while(z--){A+=v[z].entries.length}return A};this.each=function(C){var z=w.entries(),A=z.length,B;while(A--){B=z[A];C(B[0],B[1])}};this.putAll=function(H,C){var B=H.entries();var E,F,D,z,A=B.length;var G=(typeof C==p);while(A--){E=B[A];F=E[0];D=E[1];if(G&&(z=w.get(F))){D=C(F,z,D)}w.put(F,D)}};this.clone=function(){var z=new b(t,r);z.putAll(w);return z}}return b})();(function(b){b.fn.ooLog=function(f,d,e){var c=null;b(this).each(function(){c=b(this).data("_ooLog");if(c==undefined){c=new a();b(this).data("_ooLog",c)}});if(f==undefined){return c}else{if(typeof f==="string"){if(c){c.log(f,d,e)}}}};function a(){return this}a.prototype={isDebugEnabled:function(){return o_info.JSTracingLogDebugEnabled},log:function(e,c,d){if(!this.isDebugEnabled()){return}jQuery.post(o_info.JSTracingUri,{level:e,logMsg:c,jsFile:d})}}})(jQuery);(function(b){b.fn.ooTranslator=function(){var d=null;b(document).each(function(){d=b(document).data("_ooTranslator");if(d==undefined){d=new a();b(document).data("_ooTranslator",d)}});return d};function a(){return this}a.prototype={mapperUrl:null,translators:null,initialize:function(d){this.mapperUrl=d;this.translators=new Object()},getTranslator:function(d,f){if(this.translators[d]==null){this.translators[d]=new Object()}if(this.translators[d][f]==null){var e=this.mapperUrl+"/"+d+"/"+f+"/translations.js";jQuery.ajax(e,{async:false,dataType:"json",success:function(g,i,h){jQuery(document).ooTranslator()._createTranslator(g,d,f)}})}return this.translators[d][f]},_createTranslator:function(e,d,f){this.translators[d][f]=new c().initialize(e,d,f)}};function c(){return this}c.prototype={localizationData:null,bundle:null,locale:null,initialize:function(f,d,e){this.bundle=e;this.locale=d;this.localizationData=f;return this},translate:function(d){if(this.localizationData[d]){return this.localizationData[d]}else{return this.bundle+":"+d}}}})(jQuery);/*!
+OPOL={};var o2c=0;var o3c=new Array();o_info.guibusy=false;o_info.linkbusy=false;o_info.debug=true;var BLoader={_ajaxLoadedJS:new Array(),_isAlreadyLoadedJS:function(b){var a=true;console.log(b);jQuery("head script[src]").each(function(d,c){if(jQuery(c).attr("src").indexOf(b)!=-1){a=false}});if(jQuery.inArray(b,this._ajaxLoadedJS)!=-1){a=false}return !a},loadJS:function(b,c,a){if(!this._isAlreadyLoadedJS(b)){if(o_info.debug){o_log("BLoader::loadJS: loading ajax::"+a+" url::"+b)}if(a){jQuery.ajax(b,{async:false,dataType:"script",success:function(d,f,e){}});this._ajaxLoadedJS.push(b)}else{jQuery.getScript(b)}if(o_info.debug){o_log("BLoader::loadJS: loading DONE url::"+b)}}else{if(o_info.debug){o_log("BLoader::loadJS: already loaded url::"+b)}}},executeGlobalJS:function(jsString,contextDesc){try{if(window.execScript){window.execScript(jsString)}else{window.eval(jsString)}}catch(e){if(console){console.log(contextDesc,"cannot execute js",jsString)}if(o_info.debug){o_logerr("BLoader::executeGlobalJS: Error when executing JS code in contextDesc::"+contextDesc+' error::"'+showerror(e)+" for: "+escape(jsString))}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::executeGlobalJS: Error when executing JS code in contextDesc::"+contextDesc+' error::"'+showerror(e)+" for: "+escape(jsString),"functions.js::BLoader::executeGlobalJS::"+contextDesc)}if(window.location.href.indexOf("o_winrndo")!=-1){window.location.reload()}else{window.location.href=window.location.href+(window.location.href.indexOf("?")!=-1?"&":"?")+"o_winrndo=1"}}},loadCSS:function(b,o,q){var r=window.document;try{if(r.createStyleSheet){var j=r.styleSheets;var d=0;var p=0;for(i=0;i<j.length;i++){var m=j[i];var g=m.href;if(g==b){d++;if(m.disabled){m.disabled=false;return}else{if(o_info.debug){o_logwarn("BLoader::loadCSS: style: "+b+" already in document and not disabled! (duplicate add)")}return}}if(m.id=="b_theme_css"){p=i}}if(d>1&&o_info.debug){o_logwarn("BLoader::loadCSS: apply styles: num of stylesheets found was not 0 or 1:"+d)}if(q){p=j.length}var f=r.createStyleSheet(b,p)}else{var c=jQuery("#"+o);if(c&&c.size()>0){if(o_info.debug){o_logwarn("BLoader::loadCSS: stylesheet already found in doc when trying to add:"+b+", with id "+o)}return}else{var a=jQuery('<link id="'+o+'" rel="stylesheet" type="text/css" href="'+b+'">');if(q){a.insertBefore(jQuery("#b_fontSize_css"))}else{a.insertBefore(jQuery("#b_theme_css"))}}}}catch(n){if(console){console.log(n)}if(o_info.debug){o_logerr("BLoader::loadCSS: Error when loading CSS from URL::"+b)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::loadCSS: Error when loading CSS from URL::"+b,"functions.js::BLoader::loadCSS")}}},unLoadCSS:function(a,m){var n=window.document;try{if(n.createStyleSheet){var f=n.styleSheets;var d=0;var o=a;var b=window.location.href.substring(0,window.location.href.indexOf("/",8));if(a.indexOf(b)==0){o=a.substring(b.length)}for(i=0;i<f.length;i++){var g=f[i].href;if(g==a||g==o){d++;if(!f[i].disabled){f[i].disabled=true}else{if(o_info.debug){o_logwarn("stylesheet: when removing: matching url, but already disabled! url:"+g)}}}}if(d!=1&&o_info.debug){o_logwarn("stylesheet: when removeing: num of stylesheets found was not 1:"+d)}}else{var c=jQuery("#"+m);if(c){c.href="";c.remove();c=null;return}else{if(o_info.debug){o_logwarn("no link with id found to remove, id:"+m+", url "+a)}}}}catch(j){if(o_info.debug){o_logerr("BLoader::unLoadCSS: Error when unloading CSS from URL::"+a)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::unLoadCSS: Error when unloading CSS from URL::"+a,"functions.js::BLoader::loadCSS")}}}};var BFormatter={formatLatexFormulas:function(b){try{if(jsMath){if(jsMath.loaded){jsMath.ProcessBeforeShowing.curry(b).delay(0.01)}else{jsMath.Autoload.LoadJsMath();BFormatter.formatLatexFormulas.delay(0.1)}}else{if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BFormatter::formatLatexFormulas: can not format latex formulas, jsMath not installed. Check your logfile","functions.js::BFormatter::formatLatexFormulas")}}}catch(a){if(o_info.debug){o_log("error in BFormatter.formatLatexFormulas: "+showerror(a))}}}};function o_init(){try{o_getOpenWin().o_afterserver()}catch(a){if(o_info.debug){o_log("error in o_init: "+showerror(a))}}}function b_initEmPxFactor(){o_info.emPxFactor=jQuery("#b_width_1em").width();if(o_info.emPxFactor==0||o_info.emPxFactor=="undefined"){o_info.emPxFactor=12;if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Could not read with of element b_width_1em, set o_info.emPxFactor to 12","functions.js")}}}function o_getOpenWin(){var a=top;try{if(a.opener&&a.opener.o_info){a=a.opener}}catch(b){}return a}function o_beforeserver(){o_info.linkbusy=true;showAjaxBusy();if(window.suppressOlatOnUnloadOnce){window.suppressOlatOnUnloadOnce=false}else{if(window.olatonunload){olatonunload()}}}function o_afterserver(){o2c=0;o_info.linkbusy=false;removeAjaxBusy()}function o2cl(){if(o_info.linkbusy){return false}else{var a=(o2c==0||confirm(o_info.dirty_form));if(a){o_beforeserver()}return a}}function o3cl(d){if(o_info.linkbusy){return false}else{var b=o3c1.indexOf(d)>-1;var a=(b&&o3c1.length>1)||o3c1.length>0;var c=(!a||confirm(o_info.dirty_form));if(c){o_beforeserver()}return c}}function o_onc(a){var b=a.responseText;BLoader.executeGlobalJS("o_info.last_o_onc="+b+";","o_onc");o_ainvoke(o_info.last_o_onc,false)}function o_allowNextClick(){o_info.linkbusy=false;removeAjaxBusy()}function removeBusyAfterDownload(c,b,a){o2c=0;o_afterserver()}Array.prototype.search=function(c,d){var a=this.length;for(var b=0;b<a;b++){if(this[b].constructor==Array){if(this[b].search(c,d)){return true;break}}else{if(d){if(this[b].indexOf(c)!=-1){return true;break}}else{if(this[b]==c){return true;break}}}}return false};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c){if(this==null){throw new TypeError()}var d=Object(this);var a=d.length>>>0;if(a===0){return -1}var e=0;if(arguments.length>1){e=Number(arguments[1]);if(e!=e){e=0}else{if(e!=0&&e!=Infinity&&e!=-Infinity){e=(e>0||-1)*Math.floor(Math.abs(e))}}}if(e>=a){return -1}var b=e>=0?e:Math.max(a-Math.abs(e),0);for(;b<a;b++){if(b in d&&d[b]===c){return b}}return -1}}var b_onDomReplacementFinished_callbacks=new Array();function b_AddOnDomReplacementFinishedCallback(a){var b=jQuery(document).ooLog().isDebugEnabled();if(b){jQuery(document).ooLog("debug","callback stack size: "+b_onDomReplacementFinished_callbacks.length,"functions.js ADD")}if(b&&jQuery.browser.mozilla&&!jQuery.browser.webkit){jQuery(document).ooLog("debug","stack content"+b_onDomReplacementFinished_callbacks.toSource(),"functions.js ADD")}b_onDomReplacementFinished_callbacks.push(a);if(b){jQuery(document).ooLog("debug","push to callback stack, func: "+a,"functions.js ADD")}}var b_changedDomEl=new Array();function b_AddOnDomReplacementFinishedUniqueCallback(a){if(a.constructor==Array){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","add: its an ARRAY! ","functions.js ADD")}if(b_onDomReplacementFinished_callbacks.search(a[0])){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","push to callback stack, already there!!: "+a[0],"functions.js ADD")}return}}b_AddOnDomReplacementFinishedCallback(a)}var o_debug_trid=0;function o_ainvoke(H){if(H==undefined){return}o_info.inainvoke=true;var D=H.cmdcnt;if(D>0){b_changedDomEl=new Array();if(o_info.debug){o_debug_trid++}var v=H.cmds;for(var N=0;N<D;N++){var E=v[N];var x=E.cmd;var L=E.cda;var O=E.w;var b=this.window;var F;if(b){switch(x){case 1:var G=L.e;BLoader.executeGlobalJS(G,"o_ainvoker::jsexec");if(o_info.debug){o_log("c1: execute jscode: "+G)}case 2:var s=L.cc;var B=L.cps;for(var K=0;K<s;K++){var h=B[K];var g=h.cid;var J=h.cidvis;var u=h.hfrag;var I=h.jsol;var f=h.hdr;if(o_info.debug){o_log("c2: redraw: "+h.cname+" ("+g+") "+h.hfragsize+" bytes, listener(s): "+h.clisteners)}var Q=f+"\n\n"+u;var z="";var M=false;var y=jQuery("#o_c"+g);if(y==null||(y.length==0)){y=jQuery("#o_fi"+g);M=true}if(y!=null){if(J){y.css("display","")}else{y.css("display","none")}if(M){y.replaceWith(Q)}else{y.empty();try{y.html(Q)}catch(T){if(console){console.log(T)}if(console){console.log("Fragment",Q)}}b_changedDomEl.push("o_c"+g)}y=null;if(z!=""){z.each(function(e){BLoader.executeGlobalJS(e,"o_ainvoker::inscripts")})}if(I!=""){BLoader.executeGlobalJS(I,"o_ainvoker::jsol")}}}break;case 3:b.o2c=0;var R=L.rurl;b.o_afterserver();b.document.location.replace(R);break;case 5:b.o2c=0;var R=L.rurl;b.o_afterserver();b.document.location.replace(R);break;case 6:b.o2c=0;b.o_afterserver();break;case 7:var n=b.document.location;var w=n.protocol+"//"+n.hostname;if(n.port!=""){w+=":"+n.port}var t=L.cssrm;for(K=0;K<t.length;K++){var A=t[K];var C=A.id;var d=w+A.url;BLoader.unLoadCSS(d,C);if(o_info.debug){o_log("c7: rm css: id:"+C+" ,url:'"+d+"'")}}var P=L.cssadd;for(k=0;k<P.length;k++){var A=P[k];var C=A.id;var d=w+A.url;var m=A.pt;BLoader.loadCSS(d,C,m);if(o_info.debug){o_log("c7: add css: id:"+C+" ,url:'"+d+"'")}}var o=L.jsadd;for(l=0;l<o.length;l++){var A=o[l];var S=A.before;if(jQuery.type(S)==="string"){BLoader.executeGlobalJS(S,"o_ainvoker::preJsAdd")}var d=A.url;var p=A.enc;if(jQuery.type(d)==="string"){BLoader.loadJS(d,p,true)}if(o_info.debug){o_log("c7: add js: "+d)}}break;default:if(o_info.debug){o_log("?: unknown command "+x)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in o_ainvoke(), ?: unknown command "+x,"functions.js")}break}}else{if(o_info.debug){o_log("could not find window??")}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in o_ainvoke(), could not find window??","functions.js")}}}var a=b_onDomReplacementFinished_callbacks.length;if(jQuery.browser.mozilla&&!jQuery.browser.webkit){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","stack content"+b_onDomReplacementFinished_callbacks.toSource(),"functions.js")}}for(mycounter=0;a>mycounter;mycounter++){if(mycounter>50){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stopped executing DOM replacement callback functions - to many functions::"+b_onDomReplacementFinished_callbacks.length,"functions.js")}break}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stacksize before shift: "+b_onDomReplacementFinished_callbacks.length,"functions.js")}var q=b_onDomReplacementFinished_callbacks.shift();if(typeof q.length==="number"){if(q[0]=="glosshighlighter"){var c=q[1];if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","arr fct: "+c,"functions.js")}q=c}}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Executing DOM replacement callback function #"+mycounter+" with timeout funct::"+q,"functions.js")}q();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stacksize after timeout: "+b_onDomReplacementFinished_callbacks.length,"functions.js")}}}o_info.inainvoke=false}function clearAfterAjaxIframeCall(){if(o_info.linkbusy){o_afterserver();showMessageBox("info",o_info.i18n_noresponse_title,o_info.i18n_noresponse,undefined)}}function showAjaxBusy(){if(o_info.linkbusy){try{jQuery("#b_ajax_busy").delay(500).queue(function(b){jQuery(this).addClass("b_ajax_busy");jQuery("#b_body").addClass("b_ajax_busy")})}catch(a){}}return}function removeAjaxBusy(){try{jQuery("#b_ajax_busy").delay(500).queue(function(b){jQuery(this).removeClass("b_ajax_busy");jQuery("#b_body").removeClass("b_ajax_busy")})}catch(a){}}var htmlEditorEnabled=(jQuery.browser.msie||jQuery.browser.mozilla);var scormPlayerEnabled=(jQuery.browser.msie||jQuery.browser.mozilla||jQuery.browser.webkit);function setFormDirty(c){o2c=1;var a=document.getElementById(c);if(a!=null){var b=a.olat_fosm_0;if(b==null){b=a.olat_fosm}if(b){b.className="b_button b_button_dirty"}}else{if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in setFormDirty, myForm was null for formId="+c,"functions.js")}}}function contextHelpWindow(a){helpWindow=window.open(a,"HelpWindow","height=760, width=940, left=0, top=0, location=no, menubar=no, resizable=yes, scrollbars=yes, toolbar=no");helpWindow.focus()}function o_openPopUp(b,d,c,a,e){attributes="height="+a+", width="+c+", resizable=yes, scrollbars=yes, left=100, top=100, ";if(e){attributes+="location=yes, menubar=yes, status=yes, toolbar=yes"}else{attributes+="location=no, menubar=no, status=no, toolbar=no"}var f=window.open(b,d,attributes);f.focus()}function b_togglebox(a,b){jQuery("#"+a).slideToggle(400,function(){var c=jQuery(b);c.toggleClass("b_togglebox_closed");c.toggleClass("b_togglebox_opened")})}function b_handleFileUploadFormChange(e,b,d){var f=e.value;slashPos=f.lastIndexOf("/");if(slashPos!=-1){f=f.substring(slashPos+1)}slashPos=f.lastIndexOf("\\");if(slashPos!=-1){f=f.substring(slashPos+1)}b.value=f;if(d){d.className="b_button b_button_dirty"}var c=e.form.elements;for(i=0;i<c.length;i++){var a=c[i];if(a.name==b.name&&i+1<c.length){c[i+1].focus()}}}function gotonode(a){try{if(typeof o_activateCourseNode!="undefined"){o_activateCourseNode(a)}else{if(opener&&typeof opener.o_activateCourseNode!="undefined"){opener.o_activateCourseNode(a)}else{if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in gotonode(), could not find main window","functions.js")}}}}catch(b){alert("Goto node error:"+b);if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in gotonode()::"+b.message,"functions.js")}}}function o_openUriInMainWindow(b){var a=top;try{if(a.opener&&a.opener.o_info){a=a.opener}}catch(c){}a.focus();a.location.replace(b)}function b_viewportHeight(){var a=jQuery(document).height();if(a>0){return a}else{return 600}}OPOL.getMainColumnsMaxHeight=function(){var j=0,f=0,a=0,c=0,h=0,b,g=jQuery("#b_col1_content"),e=jQuery("#b_col2_content"),d=jQuery("#b_col3_content");if(g!="undefined"&&g!=null){j=g.height()}if(e!="undefined"&&e!=null){f=e.height()}if(d!="undefined"&&d!=null){a=d.height()}c=(j>f?j:f);c=(c>a?c:a);if(c>0){return c}b=jQuery("#b_main");if(b!="undefined"&&b!=null){h=b.height()}if(b>0){return b}return b_viewportHeight()};function b_resizeIframeToMainMaxHeight(f){alert("b_resizeIframeToMainMaxHeight");var d=jQuery("#"+f);if(d!="undefined"&&d!=null){var c=OPOL.getMainColumnsMaxHeight();var b=b_viewportHeight()-100;var e=jQuery("#b_header");if(e!="undefined"&&e!=null){b=b-e.getHeight()}e=jQuery("#b_nav");if(e!="undefined"&&e!=null){b=b-e.getHeight()}e=jQuery("#b_footer");if(e!="undefined"&&e!=null){b=b-e.getHeight()}var a=(b>c?b:c)+"px";d.setHeight(a)}}var o_debu_oldcn,o_debu_oldtt;function o_debu_show(b,a){if(o_debu_oldcn){o_debu_hide(o_debu_oldcn,o_debu_oldtt)}jQuery(b).css("border","3px solid #00F").css("margin","0px").css("background-color","#FCFCB8");jQuery(a).show();o_debu_oldtt=a;o_debu_oldcn=b}function o_debu_hide(b,a){jQuery(a).hide();jQuery(b).css("border","1px dotted black").css("margin","2px").css("background-color","")}function o_dbg_mark(a){var b=jQuery("#"+a);if(b){b.css("background-color","#FCFCB8");b.css("border","3px solid #00F")}}function o_dbg_unmark(a){var b=jQuery("#"+a);if(b){b.css("border","");b.css("background-color","")}}function o_clearConsole(){o_log_all="";o_log(null)}var o_log_all="";function o_log(b){if(b){o_log_all="\n"+o_debug_trid+"> "+b+o_log_all;o_log_all=o_log_all.substr(0,4000)}var a=jQuery("#o_debug_cons");if(a){if(o_log_all.length==4000){o_log_all=o_log_all+"\n... (stripped: to long)... "}a.value=o_log_all}if(!jQuery.browser.IE&&!jQuery.type(window.console)==="undefined"){window.console.log(b)}}function o_logerr(a){o_log("ERROR:"+a)}function o_logwarn(a){o_log("WARN:"+a)}function showerror(c){var a="";for(var b in c){a+=b+": "+c[b]+"\n"}return"error detail:\n"+a}function o_ffEvent(e,d,c,h,j){var f,g,b,a;f=document.getElementById(d);g=f.value;f.value=c;b=document.getElementById(h);a=b.value;b.value=j;if(document.forms[e].onsubmit()){document.forms[e].submit()}f.value=g;b.value=a}function o_ffXHREvent(f,e,a,h,j){var c=new Object();c.dispatchuri=a;c.dispatchevent=j;if(arguments.length>5){var g=arguments.length;for(var d=5;d<g;d=d+2){if(g>d+1){c[arguments[d]]=arguments[d+1]}}}var b=jQuery("#"+f).attr("action");jQuery.ajax(b,{type:"GET",data:c,dataType:"json",success:function(n,o,m){o_ainvoke(n)},error:function(m,o,n){if(console){console.log("Error status",o)}}})}function setFlexiFormDirtyByListener(a){setFlexiFormDirty(a.data.formId)}function setFlexiFormDirty(b){var a=o3c.indexOf(b)>-1;if(!a){o3c.push(b)}jQuery("#"+b).each(function(){var c=jQuery(this).data("FlexiSubmit");if(c!=null){jQuery("#"+c).addClass("b_button b_button_dirty");o2c=1}})}function o_ffRegisterSubmit(b,a){jQuery("#"+b).data("FlexiSubmit",a)}function showInfoBox(f,c){var b=Math.floor(Math.random()*65536).toString(16);var e='<div id="'+b+'" class="b_msg-div msg" style="display:none;"><div class="b_msg_info_content b_msg_info_winicon o_sel_info_message"><h3>'+f+"</h3>"+c+"<br/><br/></div></div>";var a=jQuery("#b_page").prepend(e);var d=(c.length>150)?8000:((c.length>70)?6000:4000);jQuery("#"+b).slideDown(300).delay(d).slideUp(300);jQuery("#"+b).click(function(g){jQuery("#"+b).remove()});f=null;c=null;a=null;d=null}function showMessageBox(b,e,c,a){if(b=="info"){showInfoBox(e,c)}else{var d;if("warn"==b){d='<div><div class="b_msg_info_content b_msg_warn_winicon">'}else{if("error"==b){d='<div><div class="b_msg_info_content b_msg_error_winicon">'}else{d="<div><div>"}}jQuery(d+"<p>"+c+"</p></div></div>").dialog({height:170,width:400,modal:true,title:e,resizable:false}).dialog("open")}}function tableFormInjectCommandAndSubmit(a,b,c){document.forms[a].elements.cmd.value=b;document.forms[a].elements.param.value=c;document.forms[a].submit()}function b_table_toggleCheck(d,c){var a=document.forms[d].elements.tb_ms;len=a.length;if(typeof(len)=="undefined"){a.checked=c}else{var b;for(b=0;b<len;b++){a[b].checked=c}}}function b_doPrint(){var d=$$("div.b_iframe_wrapper iframe");if(d.length>0){try{var a=d[0];frames[a.name].focus();frames[a.name].print();return}catch(c){for(i=0;frames.length>i;i++){a=frames[i];if(a.name=="oaa0"){continue}var b=document.getElementsByName(a.name)[0];if(b&&b.getAttribute("class")=="ext-shim"){continue}if(a.name!=""){try{frames[a.name].focus();frames[a.name].print()}catch(c){window.print()}return}}window.print()}}else{window.print()}}function b_attach_i18n_inline_editing(){jQuery("span.b_translation_i18nitem").hover(function(){jQuery(this.firstChild).show();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Entered i18nitem::"+this.firstChild,"functions.js:b_attach_i18n_inline_editing()")}},function(){jQuery("a.b_translation_i18nitem_launcher").hide();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Leaving i18nitem::"+this,"functions.js:b_attach_i18n_inline_editing()")}});jQuery("a.b_translation_i18nitem_launcher").hover(function(){var a=jQuery(this).parent("span.b_translation_i18nitem");a.effect("highlight")});b_AddOnDomReplacementFinishedCallback(b_attach_i18n_inline_editing)}var BDebugger={_lastDOMCount:0,_lastObjCount:0,_knownGlobalOLATObjects:["o_afterserver","o_onc","o_getOpenWin","o_ainvoke","o_info","o_beforeserver","o_ffEvent","o_openPopUp","o_debu_show","o_logwarn","o_dbg_unmark","o_ffRegisterSubmit","o_clearConsole","o_init","o_log","o_allowNextClick","o_dbg_mark","o_debu_hide","o_logerr","o_debu_oldcn","o_debu_oldtt","o_openUriInMainWindow","o_debug_trid","o_log_all"],_countDOMElements:function(){return document.getElementsByTagName("*").length},_countGlobalObjects:function(){var a=0;for(prop in window){a++}return a},logDOMCount:function(){var b=BDebugger;var a=b._countDOMElements();var c=a-b._lastDOMCount;console.log((c>0?"+":"")+c+" \t"+a+" \tDOM element count after DOM replacement");b._lastDOMCount=a;a=null},logGlobalObjCount:function(){var b=BDebugger;var a=b._countGlobalObjects();var c=a-b._lastObjCount;console.log((c>0?"+":"")+c+" \t"+a+" \tGlobal object count after DOM replacement");b._lastObjCount=a;a=null},logGlobalOLATObjects:function(){var b=BDebugger;var a=new Array();for(prop in window){if(prop.indexOf("o_")==0&&b._knownGlobalOLATObjects.indexOf(prop)==-1){a.push(prop)}}if(a.length>0){console.log(a.length+" global OLAT objects found:");a.each(function(c){console.log("\t"+typeof window[c]+" \t"+c)})}},logManagedOLATObjects:function(){var a=BDebugger;if(o_info.objectMap.length>0){console.log(o_info.objectMap.length+" managed OLAT objects found:");o_info.objectMap.eachKey(function(b){var c=o_info.objectMap.get(b);console.log("\t"+typeof c+" \t"+b);return true})}}};var Hashtable=(function(){var p="function";var n=(typeof Array.prototype.splice==p)?function(s,r){s.splice(r,1)}:function(u,t){var s,v,r;if(t===u.length-1){u.length=t}else{s=u.slice(t+1);u.length=t;for(v=0,r=s.length;v<r;++v){u[t+v]=s[v]}}};function a(t){var r;if(typeof t=="string"){return t}else{if(typeof t.hashCode==p){r=t.hashCode();return(typeof r=="string")?r:a(r)}else{if(typeof t.toString==p){return t.toString()}else{try{return String(t)}catch(s){return Object.prototype.toString.call(t)}}}}}function g(r,s){return r.equals(s)}function e(r,s){return(typeof s.equals==p)?s.equals(r):(r===s)}function c(r){return function(s){if(s===null){throw new Error("null is not a valid "+r)}else{if(typeof s=="undefined"){throw new Error(r+" must not be undefined")}}}}var q=c("key"),l=c("value");function d(u,s,t,r){this[0]=u;this.entries=[];this.addEntry(s,t);if(r!==null){this.getEqualityFunction=function(){return r}}}var h=0,j=1,f=2;function o(r){return function(t){var s=this.entries.length,v,u=this.getEqualityFunction(t);while(s--){v=this.entries[s];if(u(t,v[0])){switch(r){case h:return true;case j:return v;case f:return[s,v[1]]}}}return false}}function k(r){return function(u){var v=u.length;for(var t=0,s=this.entries.length;t<s;++t){u[v+t]=this.entries[t][r]}}}d.prototype={getEqualityFunction:function(r){return(typeof r.equals==p)?g:e},getEntryForKey:o(j),getEntryAndIndexForKey:o(f),removeEntryForKey:function(s){var r=this.getEntryAndIndexForKey(s);if(r){n(this.entries,r[0]);return r[1]}return null},addEntry:function(r,s){this.entries[this.entries.length]=[r,s]},keys:k(0),values:k(1),getEntries:function(s){var u=s.length;for(var t=0,r=this.entries.length;t<r;++t){s[u+t]=this.entries[t].slice(0)}},containsKey:o(h),containsValue:function(s){var r=this.entries.length;while(r--){if(s===this.entries[r][1]){return true}}return false}};function m(s,t){var r=s.length,u;while(r--){u=s[r];if(t===u[0]){return r}}return null}function i(r,s){var t=r[s];return(t&&(t instanceof d))?t:null}function b(t,r){var w=this;var v=[];var u={};var x=(typeof t==p)?t:a;var s=(typeof r==p)?r:null;this.put=function(B,C){q(B);l(C);var D=x(B),E,A,z=null;E=i(u,D);if(E){A=E.getEntryForKey(B);if(A){z=A[1];A[1]=C}else{E.addEntry(B,C)}}else{E=new d(D,B,C,s);v[v.length]=E;u[D]=E}return z};this.get=function(A){q(A);var B=x(A);var C=i(u,B);if(C){var z=C.getEntryForKey(A);if(z){return z[1]}}return null};this.containsKey=function(A){q(A);var z=x(A);var B=i(u,z);return B?B.containsKey(A):false};this.containsValue=function(A){l(A);var z=v.length;while(z--){if(v[z].containsValue(A)){return true}}return false};this.clear=function(){v.length=0;u={}};this.isEmpty=function(){return !v.length};var y=function(z){return function(){var A=[],B=v.length;while(B--){v[B][z](A)}return A}};this.keys=y("keys");this.values=y("values");this.entries=y("getEntries");this.remove=function(B){q(B);var C=x(B),z,A=null;var D=i(u,C);if(D){A=D.removeEntryForKey(B);if(A!==null){if(!D.entries.length){z=m(v,C);n(v,z);delete u[C]}}}return A};this.size=function(){var A=0,z=v.length;while(z--){A+=v[z].entries.length}return A};this.each=function(C){var z=w.entries(),A=z.length,B;while(A--){B=z[A];C(B[0],B[1])}};this.putAll=function(H,C){var B=H.entries();var E,F,D,z,A=B.length;var G=(typeof C==p);while(A--){E=B[A];F=E[0];D=E[1];if(G&&(z=w.get(F))){D=C(F,z,D)}w.put(F,D)}};this.clone=function(){var z=new b(t,r);z.putAll(w);return z}}return b})();(function(b){b.fn.ooLog=function(f,d,e){var c=null;b(this).each(function(){c=b(this).data("_ooLog");if(c==undefined){c=new a();b(this).data("_ooLog",c)}});if(f==undefined){return c}else{if(typeof f==="string"){if(c){c.log(f,d,e)}}}};function a(){return this}a.prototype={isDebugEnabled:function(){return o_info.JSTracingLogDebugEnabled},log:function(e,c,d){if(!this.isDebugEnabled()){return}jQuery.post(o_info.JSTracingUri,{level:e,logMsg:c,jsFile:d})}}})(jQuery);(function(b){b.fn.ooTranslator=function(){var d=null;b(document).each(function(){d=b(document).data("_ooTranslator");if(d==undefined){d=new a();b(document).data("_ooTranslator",d)}});return d};function a(){return this}a.prototype={mapperUrl:null,translators:null,initialize:function(d){this.mapperUrl=d;this.translators=new Object()},getTranslator:function(d,f){if(this.translators[d]==null){this.translators[d]=new Object()}if(this.translators[d][f]==null){var e=this.mapperUrl+"/"+d+"/"+f+"/translations.js";jQuery.ajax(e,{async:false,dataType:"json",success:function(g,i,h){jQuery(document).ooTranslator()._createTranslator(g,d,f)}})}return this.translators[d][f]},_createTranslator:function(e,d,f){this.translators[d][f]=new c().initialize(e,d,f)}};function c(){return this}c.prototype={localizationData:null,bundle:null,locale:null,initialize:function(f,d,e){this.bundle=e;this.locale=d;this.localizationData=f;return this},translate:function(d){if(this.localizationData[d]){return this.localizationData[d]}else{return this.bundle+":"+d}}}})(jQuery);/*!
  * jQuery periodic plugin
  *
  * Copyright 2010, Tom Anderson
diff --git a/src/main/webapp/static/movie/player.js b/src/main/webapp/static/movie/player.js
index dcc34378abf..eec44688ccd 100644
--- a/src/main/webapp/static/movie/player.js
+++ b/src/main/webapp/static/movie/player.js
@@ -9,7 +9,7 @@ var BPlayer = {
 			var flashvars = "file=" + soundUrl + "&start=0&autostart=true&repeat=none&controlbar=none&showicons=false";
 			if (swfobject.hasFlashPlayerVersion("9")) {
 	     		var fn = function() {
-	        		var att = { data:playerUrl, width:'1px', height:'1px', wmode:'transparent',};
+	        		var att = { data:playerUrl, width:'1px', height:'1px', wmode:'transparent'};
 	        		var par = { flashvars: flashvars };
 	        		var id = domId;
 	        		var myObject = swfobject.createSWF(att, par, id);
-- 
GitLab