	/*	 * Version 2009-07-09 16-46-24	 */	/**	* Init	*	*/	var currentActiveLeftBoxNavElement = null;	var currentActiveRightBoxElement = null;	var currentActivePage = null;	var elementIdOfCurrentAnimatingElement = null;	var subNavSuffix = "_sub_nav";	var subElemSuffix = "_sub_elem";	var contentTabSuffix = "_content";	var contentPageSuffix = "_content";	var contentTableViewSuffix = "_content";	var tableViewElements = new Array();	var tableViewGroupeHintMark = "auszahlungen";	var tableViewGroupeHintSuffix = "_hint";	/**	* toggel nav element	* 	* Modification by assono! 	* Arnd Koch <akoch@assono.de> / 2009-02-16:	* added extra check to avoid exceptions if no subnavigation is defined 	*/	function toggelNavElement(id){		var subNavID = currentActiveLeftBoxNavElement + subNavSuffix;		if(id != null){			if(id != elementIdOfCurrentAnimatingElement || elementIdOfCurrentAnimatingElement == null){				if(id != currentActiveLeftBoxNavElement || currentActiveLeftBoxNavElement == null){					if(currentActiveLeftBoxNavElement != null){						//set nav elem style						setNavElementStyleToInactive(currentActiveLeftBoxNavElement);						//hide displayed subnav						if($(subNavID) != null){							hideLeftBoxNavElementSubNav(currentActiveLeftBoxNavElement);						}					}					//set nav elem style					setNavElementStyleToActive(id);					//display subnav					displayLeftBoxNavElementSubNav(id);					//set currentActiveLeftBoxNavElement					currentActiveLeftBoxNavElement = id;					// set elementIdOfCurrentAnimatingElement					elementIdOfCurrentAnimatingElement = id;				} else {					//hide displayed subnav					hideLeftBoxNavElementSubNav(id);					//set nav elem style					setNavElementStyleToInactive(id);					}			} 		}	}	/**	* set nav element with out animating	*	* Modification by assono! 	* Bernd Hort <bhort@assono.de> / 2008-12-19:	* Check for subelement before showing it	*/	function setNavElement(id){	if(id != null){		if(id != elementIdOfCurrentAnimatingElement || elementIdOfCurrentAnimatingElement == null){			if(currentActiveLeftBoxNavElement != null){				//set nav elem style				setNavElementStyleToInactive(currentActiveLeftBoxNavElement);				//hide displayed subnav				$(currentActiveLeftBoxNavElement+subNavSuffix).hide();			}				//set nav elem style				setNavElementStyleToActive(id);				//display subnav			var subNavElement = $(id+subNavSuffix);				if (subNavElement != null){					subNavElement.show()					//set currentActiveLeftBoxNavElement				}				currentActiveLeftBoxNavElement = id;			} 		}	}	/**	* display sub nav	*	*/	function displayLeftBoxNavElementSubNav(id){		if(id != null){				//display element				displayElement(id+subNavSuffix);			}	}	/**	* hide sub nav	*	*/	function hideLeftBoxNavElementSubNav(id){		if(id != null){			if(id == currentActiveLeftBoxNavElement){				//set currentActiveLeftBoxNavElement				currentActiveLeftBoxNavElement = null;			}			//hide element			hidedElement(id+subNavSuffix);		}	}	/**	* set nav elem style to active	*	*/	function setNavElementStyleToActive(id){		if(id != null){			$(id).className = "nav_item_active";		}	}	/**	* set nav elem style to inactive	*	*/	function setNavElementStyleToInactive(id){		if(id != null){			$(id).className = "nav_item";		}	}	/**	* toggel right box element	*	*/	function toggelRightBoxElement(id){		if(id != null){			if(id != elementIdOfCurrentAnimatingElement || elementIdOfCurrentAnimatingElement == null){				if(id != currentActiveRightBoxElement || currentActiveRightBoxElement == null){			if(currentActiveRightBoxElement != null){						//hide displayed subnav						hideRightBoxSubElement(currentActiveRightBoxElement);					}					//display right box elem					displayRightBoxSubElement(id);					//set currentActiveRightBoxElement					currentActiveRightBoxElement = id;					// set elementIdOfCurrentAnimatingElement					elementIdOfCurrentAnimatingElement = id;				} else {					//hide displayed subnav					hideRightBoxSubElement(id);							}			} 		}	}	/**	* display Right box sub elem without animation	*	*/	function setRightBoxElement(id){	if(id != null){			if(id != elementIdOfCurrentAnimatingElement || elementIdOfCurrentAnimatingElement == null){					if(currentActiveRightBoxElement != null){						//hide displayed subnav						$(currentActiveRightBoxElement+subElemSuffix).hide();					}					//display right box elem					if($(id+subElemSuffix) != null){ /*assono-AKo; avoids exceptions in notes-views*/						$(id+subElemSuffix).show();					}					//set currentActiveRightBoxElement					currentActiveRightBoxElement = id;			} 		}	}	/**	* display sub elem	*	*/	function displayRightBoxSubElement(id){		if(id != null){				//display element				displayElement(id+subElemSuffix);			}	}	/**	* hide sub elem	*	*/	function hideRightBoxSubElement(id){		if(id != null){			if(id == currentActiveRightBoxElement){				//set currentActiveRightBoxElement				currentActiveRightBoxElement = null;			}			//hide element			hidedElement(id+subElemSuffix);		}	}	/**	* toggel tab	*	*/	function toggelTab(id){		if(id != null){			if(id != $(id).parentNode.activeTabId || $(id).parentNode.activeTabId == null){				if(id != elementIdOfCurrentAnimatingElement || elementIdOfCurrentAnimatingElement == null){					if($(id).parentNode.activeTabId != null){							//hide and display new if hide animation is finished							setTabFaceActive(id);							setTabFaceInactive($(id).parentNode.activeTabId);							if (Prototype.Browser.IE){								$($(id).parentNode.activeTabId+contentTabSuffix).hide();								displayTab(id);								$(id).parentNode.activeTabId = id;							} else {								Effect.SlideUp($(id).parentNode.activeTabId+contentTabSuffix,{ afterFinish:function(){ 												   								displayTab(id)										$(id).parentNode.activeTabId = id;								  }});								Effect.Fade($(id).parentNode.activeTabId+contentTabSuffix);							}					} else {							//show							setTabFaceActive(id);							displayTab(id);							//set 							$(id).parentNode.activeTabId = id;						}							}			}else{					//hide					setTabFaceInactive(id);					hideTab(id);					//set					$(id).parentNode.activeTabId = null;				}		}	}	/**	* set tab - show tab without animating	*	*/	function setTab(id){		if(id != null){			if(id != elementIdOfCurrentAnimatingElement || elementIdOfCurrentAnimatingElement == null){				if($(id).parentNode.activeTabId != null){						setTabFaceActive(id);						setTabFaceInactive($(id).parentNode.activeTabId);						$($(id).parentNode.activeTabId+contentTabSuffix).hide();						$(id+contentTabSuffix).show();						$(id).parentNode.activeTabId = id;				} else {						//show						setTabFaceActive(id);						$(id+contentTabSuffix).show();						//set 						$(id).parentNode.activeTabId = id;					}						}						}	}	/**	* close tab	*	*/	function closeTab(id){					setTabFaceInactive(id);					hideTab(id);					//set					$(id).parentNode.activeTabId = null;		}	/**	* show tab	*	*/	function displayTab(id){		if(id != null){			if (Prototype.Browser.IE){				$(id+contentTabSuffix).show();			elementIdOfCurrentAnimatingElement = null			} else {				elementIdOfCurrentAnimatingElement = id				displayElement(id+contentTabSuffix);			}		}	}	/**	* hide tab	*	*/	function hideTab(id){		if(id != null){			if (Prototype.Browser.IE){				$(id+contentTabSuffix).hide();				elementIdOfCurrentAnimatingElement = null			} else {				elementIdOfCurrentAnimatingElement = id				hidedElement(id+contentTabSuffix);			}		}	}	/**	* set tab face to active	*	*/	function setTabFaceActive(id){		if(id != null){		var tabFace = $(id).childElements()[0].childElements();			for(i=0;i<tabFace.length;i++){				if(tabFace[i].id == "tab_activ"){						tabFace[i].show();					}else{						//alert(tabFace[i].id);						tabFace[i].hide();						}				}		}		}	/**	* set tab face to inactive	*	*/	function setTabFaceInactive(id){		if(id != null){		var tabFace = $(id).childElements()[0].childElements();			for(i=0;i<tabFace.length;i++){				if(tabFace[i].id == "tab_activ"){						tabFace[i].hide();					}else{						//alert(tabFace[i].id);						tabFace[i].show();						}				}		}		}	/**	* toggel page	* 	* Modification by assono! 	* Arnd Koch <akoch@assono.de> / 2009-03-04:	* added code to display a message on PageChanges 	*/	function toggelPage(id){		if(id != null){			DisplayHeadlineNotice('Bitte f\u00FCllen Sie alle Seiten so vollst\u00E4ndig wie m\u00F6glich aus.'); /*assono*/			if(id != elementIdOfCurrentAnimatingElement || elementIdOfCurrentAnimatingElement == null){				if(id != currentActivePage || currentActivePage == null){					if(currentActivePage != null){						//hide displayed						hidePage(currentActivePage);						setPageFaceInactive(currentActivePage);					}					//display					displayPage(id);					//set currentActivePage					currentActivePage = id;					// set elementIdOfCurrentAnimatingElement					elementIdOfCurrentAnimatingElement = id;					setPageFaceActive(id)				} 			} 		}	}	/**	* set page	*	*/	function setPage(id){		if(id != null){			if(id != elementIdOfCurrentAnimatingElement || elementIdOfCurrentAnimatingElement == null){				if(id != currentActivePage || currentActivePage == null){					if(currentActivePage != null){						//hide displayed						$(currentActivePage+contentPageSuffix).hide();						setPageFaceInactive(currentActivePage);					}					//display					$(id+contentPageSuffix).show();					setPageFaceActive(id);					//set currentActivePage					currentActivePage = id;					// set elementIdOfCurrentAnimatingElement					elementIdOfCurrentAnimatingElement = id;				} 			} 		}	}	/**	* display page	*	*/	function displayPage(id){		if(id != null){			Effect.Appear(id+contentPageSuffix);			}		}	/**	* 	hidepage	*	*/	function hidePage(id){		if(id != null){			$(id+contentPageSuffix).hide();			}		}	/**	* set page face to active	*	*/	function setPageFaceActive(id){		if(id != null){		var pageFace = $(id).childElements();			for(i=0;i<pageFace.length;i++){				if(pageFace[i].id == "page_activ"){						pageFace[i].show();					}else{						//alert(tabFace[i].id);						pageFace[i].hide();						}				}		}		}	/**	* set tab face to inactive	*	*/	function setPageFaceInactive(id){		if(id != null){		var pageFace = $(id).childElements();			for(i=0;i<pageFace.length;i++){				if(pageFace[i].id == "page_activ"){						pageFace[i].hide();					}else{						//alert(tabFace[i].id);						pageFace[i].show();						}				}		}		}	/**	* display / hide elements useing scriptaculous blind effect  	*	*/	function displayElement(id){		if(id != null){			//display element			Effect.SlideDown(id ,{afterFinish:function(){elementIdOfCurrentAnimatingElement = null}});			//Effect.Appear(id);			//$(id).show();		}	}	function hidedElement(id){		if(id != null){			//hide element			Effect.SlideUp(id ,{afterFinish:function(){elementIdOfCurrentAnimatingElement = null}});			Effect.Fade(id);		//$(id).hide();		}	}	/**	* toggel tabel view	*	*/	function toggelTableView(id){		if(id != null){		tableViewElements.push(id);		if(!$(id).active){				if(id != elementIdOfCurrentAnimatingElement || elementIdOfCurrentAnimatingElement == null){							//show							setTableViewFaceActive(id);							displayTableView(id);							//set							$(id).active = true;				}			}else{					//hide					setTableViewFaceInactive(id);					hideTableView(id);					//set					$(id).active = false;				}		}	}	/**	* toggel hint	*/	function toggelHint(id){		if(id != null){			var displayHint = false;			for(i=0; i < tableViewElements.length ;i++){				if(tableViewElements[i].indexOf(id) > -1){					if(tableViewElements[i].indexOf(tableViewGroupeHintMark) > -1){						 if($(tableViewElements[i]).active == true){							 //$(id+tableViewGroupeHintSuffix).show();								displayHint = true;								Effect.Appear(id+tableViewGroupeHintSuffix);							 break;							 }						}					}				} 			if(!displayHint){				Effect.Fade(id+tableViewGroupeHintSuffix);				}		}	}	/**	* show table view 	*	*/	function displayTableView(id){		if(id != null){			if (Prototype.Browser.IE){				$(id+contentTableViewSuffix).show();				elementIdOfCurrentAnimatingElement = null;			} else {				elementIdOfCurrentAnimatingElement = id				displayElement(id+contentTableViewSuffix);			}		}	}	/**	* hide tab	*	*/	function hideTableView(id){		if(id != null){			if (Prototype.Browser.IE){				$(id+contentTableViewSuffix).hide();				elementIdOfCurrentAnimatingElement = null;			} else {				elementIdOfCurrentAnimatingElement = id				hidedElement(id+contentTableViewSuffix);			}		}	}	/**	* set tab face to active	*	*/	function setTableViewFaceActive(id){		if(id != null){		var tabelViewFace = $(id).childElements();//[0].childElements();			for(i=0;i<tabelViewFace.length;i++){				if(tabelViewFace[i].id == "table_active"){						tabelViewFace[i].show();					}else{						tabelViewFace[i].hide();						}				}		}		}	/**	* set tab face to inactive	*	*/	function setTableViewFaceInactive(id){		if(id != null){		var tabelViewFace = $(id).childElements();//[0].childElements();			for(i=0;i<tabelViewFace.length;i++){				if(tabelViewFace[i].id == "table_active"){						tabelViewFace[i].hide();					}else{						tabelViewFace[i].show();						}				}		}	}	/**	* open lightwindow	*	*/	function openlw(surl,stitle,nwidth,nheight){		lightwindowInit();		var lw = new lightwindow(); 		lw.activateWindow({href:surl, title:stitle, width:nwidth,height:nheight,type:"inline",lightwindow_loading_animation:false});		}	/**	* set size	*	* Modification by assono! 	* Bernd Hort <bhort@assono.de> / 2009-01-08:	* handler for main_content_box_text	* Arnd Koch <akoch@assono.de> / 2009-02-25	* fixed not working handler for main_content_box_dialog childs	* Arnd Koch <akoch@assono.de> / 2009-03-06	* added handler for view_scroll_box	*/	function setSize(){		var bottomOffset = 10;		var viewportHeight = document.viewport.getHeight();		if(viewportHeight > 880){			if($("main_wrapper")){				$("main_wrapper").setStyle({height:viewportHeight-139-64-bottomOffset+"px"});				}			if($("main")){				$("main").setStyle({height:viewportHeight-139-64-bottomOffset+"px"});				}			if($("main_nav_box")){				$("main_nav_box").setStyle({height:viewportHeight-139-64-7-bottomOffset+"px"});				}			if($("main_content_box")){				$("main_content_box").setStyle({height:viewportHeight-139-64-7-bottomOffset+"px"});				}			if($("main_service_box")){				$("main_service_box").setStyle({height:viewportHeight-139-64-7-bottomOffset+"px"});				}			if($("main_content_box_text_img")){				$("main_content_box_text_img").setStyle({height:viewportHeight-139-64-7-242-22-bottomOffset+"px"});				}			//assono - START				if($("main_content_box_text")){				$("main_content_box_text").setStyle({height:viewportHeight-139-64-7-22-bottomOffset+"px"});				}							if($('view_scroll_box')){				$('view_scroll_box').setStyle({height:viewportHeight-139-64-7-40-bottomOffset+"px"});			}			//assono - END				if($("main_content_box_dialog")){				$("main_content_box_dialog").setStyle({height:viewportHeight-139-64-7-bottomOffset+"px"});								/*				 * removed by assono;				 * begin of removed code				 *				var childElem = $("main_content_box_dialog").childElements();				for(var i = 0; i<childElem.length; i++){					var wrapperElem = childElem[i].childElements()[0];					var scrollElem = childElem[i].childElements()[0].childElements()[0];					if(wrapperElem){						wrapperElem.setStyle({height:viewportHeight-139-64-7-22-bottomOffset+"px"});					}					if(scrollElem){						scrollElem.setStyle({height:viewportHeight-139-64-7-22-bottomOffset+"px"});					}				}								 *				 * end of removed code				 */								/*				 * assono!!!				 * begin				 */				 if($("main_form_wrapper")){					$$('.main_form_wrapper').each(function(pagediv){						$(pagediv).setStyle({height:viewportHeight-139-64-7-22-bottomOffset+"px"});						});					//$("main_form_wrapper").setStyle({height:viewportHeight-139-64-7-22-bottomOffset+"px"});				 }				 if($("scroll")){					$$('.scroll').each(function(pagediv){						$(pagediv).setStyle({height:viewportHeight-139-64-7-22-bottomOffset+"px"});						});					//$("scroll").setStyle({height:viewportHeight-139-64-7-22-bottomOffset+"px"});				 }				 				 /*				  * end				  *				  */				 			}		} else {			if($("main_wrapper")){				$("main_wrapper").setStyle({height:""});				}			if($("main")){				$("main").setStyle({height:""});				}			if($("main_nav_box")){				$("main_nav_box").setStyle({height:""});				}			if($("main_content_box")){				$("main_content_box").setStyle({height:""});				}			if($("main_service_box")){				$("main_service_box").setStyle({height:""});				}			if($("main_content_box_text_img")){				$("main_content_box_text_img").setStyle({height:""});				}			//assono - START				if($("main_content_box_text")){				$("main_content_box_text").setStyle({height:""});				}			if($('view_scroll_box')){				$('view_scroll_box').setStyle({height:""});			}			//assono - END							if($("main_content_box_dialog")){				$("main_content_box_dialog").setStyle({height:""});								/*				 * removed by assono;				 * begin of removed code				 *								var childElem = $("main_content_box_dialog").childElements();				for(var i = 0; i<childElem.length; i++){					var wrapperElem = childElem[i].childElements()[0];					var scrollElem = childElem[i].childElements()[0].childElements()[0];					if(wrapperElem){						wrapperElem.setStyle({height:""});					}					if(scrollElem){						scrollElem.setStyle({height:""});					}				}								 *				 * end of removed code				 */								/*				 * assono!!!				 * begin				 */				 if($("main_form_wrapper")){					$$('.main_form_wrapper').each(function(pagediv){						$(pagediv).setStyle({height:""});						});					//$("main_form_wrapper").setStyle({height:""});				 }				 if($("scroll")){					$$('.scroll').each(function(pagediv){						$(pagediv).setStyle({height:""});						});					//$("scroll").setStyle({height:""});				 }				 				 				 				 /*				  * end				  *				  */				}			}	}	/********************************************************************************************************** 	* assono !!!	*	**********************************************************************************************************/	var defaultForm = 'doc';	/** 	* shows the more content of the glossar entries and hides the more link	*	* @param:	idname	name of the glossar	* @author:	Bernd Hort <bhort@assono.de>	* @version:	2008-12-17		*/	function glossarMore(idname){		if(idname != null){			var hideElements = $$('a[class="glossar$' + idname + '$more$link"]');			for (var i = 0; i < hideElements.length; i++) {						hideElements[i].hide();					};			var showElements = $$('span[class="glossar$' + idname + '$more"]');			for (var i = 0; i < showElements.length; i++) {						showElements[i].show();					};		}; 		return false	}	/**************************************************	*	* -> isEqual()	*	* @param:	fieldName	* @param:	value	* @author:	Jan Teumer <jteumer@assono.de> / Bernd Hort <bhort@assono.de>	* @version:	2009-06-11	************************************************/	function isEqual(fieldName, value) {		var form 	= $(defaultForm);						var input 	= form[fieldName];				//check if the field could be found		if (input == null){return false};						var type	= getTypeOfElement(input);		switch (type) {			case "checkbox":				/************************************************				 * Da die Funktionalit\u00E4t zwischen den Cases				 * "checkbox" und "radio" gleich ist,				 * wird der checkbox - Case - Container				 * nicht weiter behandelt. Stattdessen wird				 * der Case - Container "radio" ausgef\u00FChrt				 * und beinhaltet somit auch die Funktionalit\u00E4t				 * vom Case "checkbox"				 ***********************************************/			case "radio":				if (input.type == undefined) {					for (var i = 0; i < input.length; i++) {						if (input[i].checked && $F(input[i]).toLowerCase() == value.toLowerCase()) {							return true;						}					}				}				else {					if (input.checked && $F(input).toLowerCase() == value.toLowerCase()) 						return true;				}				break;			case "select-multiple":				var selectBoxString = new String($F(input));				if (selectBoxString.toLowerCase() == value.toLowerCase()) 					return true				break;			default:				if ($F(input).toLowerCase() == value.toLowerCase()) {					return true;				}				break;		};		return false	}; //end isEqual	/**************************************************	*	* -> isNotEqual()	*	* @param:	fieldName as element	* @param:	value as String	* @author:	Jan Teumer <jteumer@assono.de> / Bernd Hort <bhort@assono.de>	* @version:	2009-06-11		*************************************************/			function isNotEqual(fieldName, value) {		var form 	= $(defaultForm);						var input 	= form[fieldName];						//check if the field could be found		if (input == null){return false};				var type	= getTypeOfElement(input);		switch (type) {			case "checkbox":				/************************************************				 * Da die Funktionalit\u00E4t zwischen den Cases				 * "checkbox" und "radio" gleich ist,				 * wird der checkbox - Case - Container				 * nicht weiter behandelt. Stattdessen wird				 * der Case - Container "radio" ausgef\u00FChrt				 * und beinhaltet somit auch die Funktionalit\u00E4t				 * vom Case "checkbox"				 ***********************************************/			case "radio":				if (input.type == undefined) {					for (var i = 0; i < input.length; i++) {						if (input[i].checked && $F(input[i]).toLowerCase() != value.toLowerCase()) {							return true;						}					}				}				else {					if (input.checked && $F(input).toLowerCase() != value.toLowerCase()) 						return true;				}				break;			case "select-multiple":				var selectBoxString = new String($F(input));				if (selectBoxString.toLowerCase() != value.toLowerCase()) 					return true				break;			default:				if ($F(input).toLowerCase() != value.toLowerCase()) {					return true;				}				break;		};		return false	}; //end isNotEqual	/**************************************************	*	* -> isGreaterThen()	*	* @param:	fieldName as element	* @param:	value as String	* @author:	Jan Teumer <jteumer@assono.de> / Bernd Hort <bhort@assono.de>	* @version:	2009-06-11	*************************************************/			function isGreaterThen(fieldName, value) {		var form 	= $(defaultForm);						var input 	= form[fieldName];				//check if the field could be found		if (input == null){return false};						var type	= getTypeOfElement(input);		switch(type) {			case "checkbox":				/************************************************				 * Da die Funktionalit\u00E4t zwischen den Cases				 * "checkbox" und "radio" gleich ist,				 * wird der checkbox - Case - Container				 * nicht weiter behandelt. Stattdessen wird 				 * der Case - Container "radio" ausgef\u00FChrt				 * und beinhaltet somit auch die Funktionalit\u00E4t				 * vom Case "checkbox"				 ***********************************************/			case "radio":				if(input.type == undefined){					for(var i = 0; i < input.length; i++) {						if (input[i].checked && parseFloatDE($F(input[i])) > value) {							return true;						}					}				} else {					if(input.checked && parseFloatDE($F(input)) > value)						return true;				}				break;			case "select-multiple":				break;			default:				if(parseFloatDE($F(input)) > value) {					return true;				}				break;		};		return false	}; //end isGreaterThen	/**************************************************	*	* -> isLowerThen()	*	* @param:	fieldName as element	* @param:	value as String	* @author:	Jan Teumer <jteumer@assono.de> / Bernd Hort <bhort@assono.de>	* @version:	2009-06-11	*************************************************/			function isLowerThen(fieldName, value) {		var form 	= $(defaultForm);						var input 	= form[fieldName];						//check if the field could be found		if (input == null){return false};				var type	= getTypeOfElement(input);		switch(type) {			case "checkbox":				/************************************************				 * Da die Funktionalit\u00E4t zwischen den Cases				 * "checkbox" und "radio" gleich ist,				 * wird der checkbox - Case - Container				 * nicht weiter behandelt. Stattdessen wird 				 * der Case - Container "radio" ausgef\u00FChrt				 * und beinhaltet somit auch die Funktionalit\u00E4t				 * vom Case "checkbox"				 ***********************************************/			case "radio":				if(input.type == undefined){					for(var i = 0; i < input.length; i++) {						if (input[i].checked && parseFloatDE($F(input[i])) < value) {							return true;						}					}				} else {					if(input.checked && parseFloatDE($F(input)) < value)						return true;				}				break;			case "select-multiple":				break;			default:				if(parseFloatDE($F(input)) < value) {					return true;				}				break;		};		return false	}; //end isLowerThen	/**************************************************	*	* -> contains()	*	* @param:	fieldName	* @param:	value	* @author:	Jan Teumer <jteumer@assono.de> / Bernd Hort <bhort@assono.de>	* @version:	2009-06-11	*************************************************/	function doesContain(fieldName, value) {		var form 	= $(defaultForm);						var input 	= form[fieldName];				//check if the field could be found		if (input == null){return false};				var type	= getTypeOfElement(input);		switch(type) {			case "checkbox":				/************************************************				 * Da die Funktionalit\u00E4t zwischen den Cases				 * "checkbox" und "radio" gleich ist,				 * wird der checkbox - Case - Container				 * nicht weiter behandelt. Stattdessen wird 				 * der Case - Container "radio" ausgef\u00FChrt				 * und beinhaltet somit auch die Funktionalit\u00E4t				 * vom Case "checkbox"				 ***********************************************/			case "radio":				if(input.type == undefined){					for(var i = 0; i < input.length; i++) {						if (input[i].checked && $F(input[i]).toLowerCase().search(value.toLowerCase()) != -1) {							return true;						}					}				} else {					if(input.checked && $F(input).toLowerCase().search(value.toLowerCase()) != -1)						return true;				}				break;			case "select-multiple":				var selectBoxArray = new Array;				var selectBoxString = new String($F(input));				selecBoxString = split(selecBoxString);				for (var i = 0; i < selectBoxArray.length; i++) {					if(selectBoxArray[i].toLowerCase().search(value.toLowerCase()) != -1)						return true				};				break;			default:				if($F(input).toLowerCase().search(value.toLowerCase()) != -1) {					return true;				} 				break;		};		return false	}; //end doesContain	/**************************************************	*	* -> notContains()	*	* @param:	fieldName	* @param:	value	* @author:	Jan Teumer <jteumer@assono.de> / Bernd Hort <bhort@assono.de>	* @version:	2009-06-11		*************************************************/	function doesNotContain(fieldName, value) {		var form 	= $(defaultForm);						var input 	= form[fieldName];				//check if the field could be found		if (input == null){return false};						var type	= getTypeOfElement(input);		switch(type) {			case "checkbox":				/************************************************				 * Da die Funktionalit\u00E4t zwischen den Cases				 * "checkbox" und "radio" gleich ist,				 * wird der checkbox - Case - Container				 * nicht weiter behandelt. Stattdessen wird 				 * der Case - Container "radio" ausgef\u00FChrt				 * und beinhaltet somit auch die Funktionalit\u00E4t				 * vom Case "checkbox"				 ***********************************************/			case "radio":				if(input.type == undefined){					for(var i = 0; i < input.length; i++) {						if (input[i].checked && $F(input[i]).toLowerCase().search(value.toLowerCase()) == -1) {							return true;						}					}				} else {					if(input.checked && $F(input).toLowerCase().search(value.toLowerCase()) == -1)						return true;				}				break;			case "select-multiple":				var selectBoxArray = new Array;				var selectBoxString = new String($F(input));				selecBoxString = split(selecBoxString);				for (var i = 0; i < selectBoxArray.length; i++) {					if(selectBoxArray[i].toLowerCase().search(value.toLowerCase()) == -1)						return true				};				break;			default:				if($F(input).toLowerCase().search(value.toLowerCase()) == -1) {					return true;				} 				break;		};		return false	}; //end doesNotContain	// taken from isChanged  /*assono, Arnd Koch*/	function applyVisibilityRules(){		if (rulesVisibile != null){			for(var i = 0; i < rulesVisibile.rules.length; i++) {				var checkSumme;				checkSumme = false;				checkSumme = eval(rulesVisibile.rules[i].condition);				if (checkSumme == true)					$(rulesVisibile.rules[i].divToToggle).show();				else					$(rulesVisibile.rules[i].divToToggle).hide();			};		};	}		/********************************************************************************	 * @author	Jan Teumer/assono <jteumer@assono.de> / Bernd Hort <bhort@assono.de>	 * @version	2009-01-07	 * 	 *******************************************************************************/			 /******************************************************************************	  * An object holding additional functions to be called by is chanded	  ******************************************************************************/	var isChangedAddtionalApps = new Object(); 	function isChanged(){		//check additional functions			for(func in isChangedAddtionalApps){		  isChangedAddtionalApps[func]();		};		//search for all number input fields and formats the content		$$('p.number_input_box input').each(function(nrField, index){				formatNrFieldDE(nrField);			});/* moved to external function		if (rulesVisibile != null){			for(var i = 0; i < rulesVisibile.rules.length; i++) {				var checkSumme;				checkSumme = false;				checkSumme = eval(rulesVisibile.rules[i].condition);				if (checkSumme == true)					$(rulesVisibile.rules[i].divToToggle).show();				else					$(rulesVisibile.rules[i].divToToggle).hide();			};		};*/				applyVisibilityRules();		if (rulesLoadAJAX != null){			var tabsVisible = new Object();			var parentTabs = new Object();				for(var i = 0; i < rulesLoadAJAX.rules.length; i++) {				var checkSumme;				var myAjax;				checkSumme = false;				checkSumme = eval(rulesLoadAJAX.rules[i].condition);				if (checkSumme == true){											if (rulesLoadAJAX.rules[i].loaded!='true'){										myAjax = new Ajax.Updater(rulesLoadAJAX.rules[i].divToToggle, rulesLoadAJAX.rules[i].url, {method: 'get'});						rulesLoadAJAX.rules[i].loaded = 'true';					}					$(rulesLoadAJAX.rules[i].divToToggle).show();					tabsVisible[rulesLoadAJAX.rules[i].parentTabID] = true;					parentTabs[rulesLoadAJAX.rules[i].parentTabID] = rulesLoadAJAX.rules[i].parentID;				}				else					$(rulesLoadAJAX.rules[i].divToToggle).hide();					if (tabsVisible[rulesLoadAJAX.rules[i].parentTabID] != true) { //check if is not set already to visible						tabsVisible[rulesLoadAJAX.rules[i].parentTabID] = false;						parentTabs[rulesLoadAJAX.rules[i].parentTabID] = rulesLoadAJAX.rules[i].parentID;					}				};				//check all the tabs						for (tab in tabsVisible){					var parentTab = parentTabs[tab];					if (tabsVisible[tab] == true){						$(parentTab + '_tab').show();											$(tab).show();						setTab(tab);									setTabFaceActive(tab);					} else {																					if (tabsOnOpen[parentTab] == null){							$(tab).hide();							closeTab(tab);													$(parentTab + '_tab').hide();						} else {							if (tabsOnOpen[parentTab] != tab){								$(tab).hide();							}							setTab(tabsOnOpen[parentTab]);															setTabFaceActive(tab);						}					}							};		};	/* display of a Notice in info header*/	PageChanges++;	if(PageChanges == 0){		doFirstChange(null);	}else{		DisplayHeadlineNotice('<span style="color:red; font-size: 10px;">Noch nicht gespeichert.</span>');	}	}; //isChanged()	/**************************************************	*	* -> getTypeOfElement(elementToCheck)	* 	* @param:	elementToCheck	* @author:	Jan Teumer <jteumer@assono.de>	* @version:	08.12.2008		*************************************************/	function getTypeOfElement(elementToCheck){		if (elementToCheck.type == undefined) {			return elementToCheck[0].type;		} else {			return elementToCheck.type;		}		};	/**************************************************	*	* removes punctation char (dot) and exchange comma with dot before parsing the result as a float number	*	* @param:	numberValue	* @return:	float value / returns NaN if it was not a valid number	* @author:	Bernd Hort <bhort@assono.de>	* @version:	2009-01-07	*************************************************/	function parseFloatDE(numberValue){		var valueText = numberValue.replace(/\./g, "");		var valueNr = parseFloat(valueText.replace(/,/, '.'));		return valueNr;	}	/**************************************************	*	* formats a number with dot as thousand separator, comma as decimal separator and two places	*	* @param:	numberValue	* @return:	format number string	* @author:	Bernd Hort <bhort@assono.de>	* @version:	2009-01-07	*************************************************/	function formatNrDE(numberValue){		if (!isNaN(numberValue)){			numberValue = numberValue.toFixed(2).toString();			var posSeparator = numberValue.indexOf(".");			var integerPart = "";			var fractionPart = "";			if (posSeparator == -1){					integerPart = numberValue;			} else {				integerPart = numberValue.substring(0, posSeparator);				fractionPart = numberValue.substring(posSeparator+1);			}				var newIntegerPart = "";			var count = 0;			for (var i = integerPart.length-1; i >= 0; i--){				count++;				newIntegerPart = integerPart.charAt(i) + newIntegerPart;				if (count%3 == 0 && i!=0){					newIntegerPart = '.' + newIntegerPart;					count = 0;				}			};									return newIntegerPart + ',' + fractionPart;		} else {			return numberValue;		}			}	/**************************************************	*	* If the given field contains a number value it will be formated	*	* @param:	numberValue	* @author:	Bernd Hort <bhort@assono.de>	* @version:	2009-01-08	*************************************************/	function formatNrFieldDE(nrField){		if(nrField.className.toLowerCase().indexOf('nonumberformat')==-1){			var valueNr = parseFloatDE(nrField.value);			if (!isNaN(valueNr)){				nrField.value = formatNrDE(valueNr);			}		}	}		/**************************************************	*	* replaces dot with comma	*	* @param:	itemObject	* @author:	Arnd Koch <akoch@assono.de>	* @version:	2009-01-21	*************************************************/			function undoParseFloatDE(item){		item.value = item.value.replace(/[.]/g,",");	}			/**************************************************	*	* The same as ParseFloat but returns Ints (rounded) 	*	* @param:	numberValue	* @author:	Arnd Koch <akoch@assono.de> / Bernd Hort <bhort@assono.de>   	* @version:	2009-07-09	*************************************************/		function parseIntegerDE(number){		var temp = Math.round(parseFloatDE(number)).toString();		return parseInt(temp, 10);	}	/**************************************************	*	* formats numbers like formatNumberDE but	* as Integer   	*	* @param:	numberValue	* @author:	Arnd Koch <akoch@assono.de>	* @version:	2009-01-15	*************************************************/	function formatIntegerDE(number){		var temp = parseIntegerDE(number);		temp = formatNrDE(temp);		temp = temp.replace(/,\d+/g, "");		temp = temp.replace(/-[.]/g, "-");		return temp;	}	/***********************************************************************************	 * error logging of Java Script errors on domino server	 **********************************************************************************/	/**	 * if true, errors will be shown via alert (and ignored otherwise).	 */	var SHOW_ERRORS = false;	/**	 * logs a JavaScript error by creating a JSErrorLog document on the server.	 * This function uses Prototype.js	 *	 * @param		jsError		Error		Fehler-Objekt	 * 	 * @author		Thomas Ladehoff <tladehoff@assono.de>	 * @version		2008-12-16	 */	function logJSError(jsError) {		var url = '/' + webpath + '/JSErrorLog?CreateDocument';		var postArguments = 'Error=' + escape(jsError.name)			 + '&Zusammenfassung=' + escape("Es ist ein JavaScript Fehler aufgetreten")			 + '&Absender=' + escape("Client Browser")			 + '&Message=' + escape(jsError.message)			 + '&Location=' + escape(jsError.location)			 + '&Referer=' + escape(location.href)			 + '&AppCodeName=' + escape(navigator.appCodeName)			 + '&AppName=' + escape(navigator.appName)			 + '&AppVersion=' + escape(navigator.appVersion)			 + '&CookieEnabled=' + escape(navigator.cookieEnabled)			 + '&Language=' + escape(navigator.language)			 + '&Platform=' + escape(navigator.platform)			 + '&UserAgent=' + escape(navigator.userAgent)			 + '&JavaEnabled=' + escape(navigator.javaEnabled())			 + '&Cookie=' + escape(document.cookie);		new Ajax.Request(url, { method: 'post',  onSuccess: 'window.status("A JavaSript error occured and was logged on the server")', parameters: postArguments } );	} // logJSError	/**	 * ist called, after JavaScript error was logged.	 *	 * @param		result		string		result of log document creation	 * 	 * @author		Thomas Bahn <tbahn@assono.de>	 * @version		2007-01-13	 */	function errorLogged(result) {		if (result.indexOf('Form processed') >= 0 || result.indexOf('Maske verarbeitet') >= 0) { // ATTENTION: return value is language dependend (server language)!			window.status = 'A JavaScript error has occured and was logged on the server.';		} else {			window.status = result;		}	} // errorLogged	/**	 * handles JavaScript errors by sending an error report to the server.	 *	 * @param		message		string		error message	 * @param		url					string		current URL (as the error has occured)	 * @param		line				number		current line (as the error has occured)	 * 	 * @author		Thomas Bahn <tbahn@assono.de>	 * @version		2007-01-13	 */	function trapError(message, url, line) {		if (SHOW_ERRORS) {			alert(message);		}		//var error = new Error(message);		//error.location = url + ', line:' + line;		//logJSError(error);	} // trapError	// install error handling function	window.onerror = trapError;	/**	 * opens a popup window	 *	 * @author		Bernd Hort <bhort@assono.de>	 * @version		2008-12-18	 * ---	 * @modified		Arnd Koch <akoch@assono.de>; 2009-03-03	 * made the popup resizeable 	 */	function openPopup(popupURL, popupWindowName ){					var width = 974;						if (Prototype.Browser.IE){						popupwidth = width+50;						popupheight = document.viewport.getHeight();						} else if(Prototype.Browser.WebKit){						popupwidth = width+21;						popupheight = document.viewport.getHeight();						}else{						popupwidth = width+16;					    popupheight = document.viewport.getHeight();				};					var popup = window.open(popupURL,popupWindowName,'width='+popupwidth+',height='+popupheight+',innerWidth='+popupwidth+',innerHeight='+popupheight+",resizable=yes");										if(popup) {							 popup.focus();							}				}	/******************************************************************************************	 * Dynamically creating the todo-list	 * 	 * @author		Manuel Nientit <mnientit@assono.de>	 * @version	2008-11-26	*/	var TODO_VIEWNAME_SUBJECT = '(NotizenNachBetreff)';	var TODO_VIEWNAME_DATE = '(NotizenNachDatum)';	var TODO_FORMNAME = ('Notiz');	var TODO_ITEMNAME_SUBJECT = 'Betreff';	var TODO_HEADER_ELEM = 'Notiz_header';		var UNID = '';	/**	 * Initialize TodoList on load of page. Sets some defaults.	 * 	 * @author		Manuel Nientit <mnientit@assono.de>	 * @version	2009-02-19	 * @history	 *    MNi: 2009-02-19 check, if $todo_box exists, before hiding	*/	function initializeToDoList(){		if (username == 'Anonymous' && $('todo_box') != null){			$('todo_box').hide();			return false;		}				if( $('todo_box_sub_elem') == null){			return false;		}				var toggleElem = new Element('a');		var toggleElemID = document.createAttribute('id');		toggleElemID.nodeValue = 'todo_box_list_toggle';		toggleElem.setAttributeNode(toggleElemID);		var toggleElemHide = document.createAttribute('hide');		toggleElemHide.nodeValue = 'false';		toggleElem.setAttributeNode(toggleElemHide);			var toggleElemHref = document.createAttribute('href');		toggleElemHref.nodeValue = 'javascript:toggleToDoBoxList();';		toggleElem.setAttributeNode(toggleElemHref);						var toggleimg = new Element('img',{src:'/' +webpathInfo + '/image/notiz_listenansicht.gif', id:'todo_box_list_toggle_img'});		toggleElem.insert(toggleimg); 		document.getElementById('todo_box_sub_elem').appendChild(toggleElem);		// hide form, in which the notes will be shown on users interaction		$('note_form').hide();		createTodoList(TODO_VIEWNAME_DATE);	}	/**	* create TodoList with give view	*	* @param		view - view to get viewentries from	* @author		Manuel Nientit<mnientit@assono.de>	* @version		2008-12-17	*/	function createTodoList(view){		var VIEW_COUNT = 5000;		var USERNAME_ITEM = 'WebUserName';		if (typeof(view) == 'undefined'){			if ($('todo_box_list_toggle').readAttribute('hide') == 'false'){				view = TODO_VIEWNAME_DATE;			}else{				view = TODO_VIEWNAME_SUBJECT;			}		}		var url =  '/' +webpathDialog+ '/'+view+'?ReadViewEntries&RestrictToCategory='+ username +'&Count=5000';		new Ajax.Request(url, {			method: 'get',			onSuccess: function(transport) {			var entryDataArray= transport.responseXML.getElementsByTagName('viewentry');			var subjectArray = new Array();			var dateArray = new Array();			//build arrays for entries of called view			for (var i=0;i< entryDataArray.length;i++){				var dataArray = entryDataArray[i].getElementsByTagName('entrydata');				for (var j=0;j<dataArray.length;j++){					if (dataArray[j].getAttribute('name')=='Betreff'){						subjectArray[i] = dataArray[j].getElementsByTagName('text')[0].firstChild.nodeValue;}					if(dataArray[j].getAttribute('name')=='Datum'){						if (dataArray[j].getElementsByTagName('text').length > 0 && dataArray[j].getElementsByTagName('text')[0].firstChild != null && dataArray[j].getElementsByTagName('text')[0].firstChild.nodeValue != ''){							dateArray[i] = dataArray[j].getElementsByTagName('text')[0].firstChild.nodeValue;						}						else if (dataArray[j].getElementsByTagName('datetime').length > 0){							var value = dataArray[j].getElementsByTagName('datetime')[0].firstChild.nodeValue;							value = new Date(value.slice(0,4),value.slice(4,6)-1,value.slice(6,8));							value = value.getDate()+"."+new String(value.getMonth()+1)+"."+new String(1900 + value.getYear());							dateArray[i] = value;						}						else{							var date = new Date();							var today = date.getDate() +"." +  new String(date.getMonth()+ 1) + "." + new String(1900 + date.getYear());							dateArray[i] = today;						}					}//for j				} //for i			}			//remove old list before adding a new one			var oldList = $('todo_box_sub_elem').down('ol')			if ( oldList != undefined){				oldList.remove();			}			//Proceed  only when length of array is greater 0, else the server response  did not contain any valid data. No notes have been created yet.        				if (entryDataArray.length > 0){				var toDoList = document.createElement('ol');				for (var n = 0; n < entryDataArray.length; n++){					var listEntry = document.createElement('li');					var listclass = document.createAttribute('class')					listclass.nodeValue = 'sub_nav_link'					listEntry.setAttributeNode(listclass)					var html = "javascript:openToDoDoc('" + entryDataArray[n].getAttribute('unid') + "')";					var link = document.createElement('a');					var attr = document.createAttribute('href');						attr.nodeValue = html;					link.setAttributeNode(attr);										attr = document.createAttribute('title');					attr.nodeValue = 'Notiz \u00F6ffnen';					link.setAttributeNode(attr);										// if hide is true then date does not need to be created, because we show only list of notes.					if ($('todo_box_list_toggle').getAttributeNode('hide').nodeValue == 'false'){						var span = document.createElement('span');								var spanClass = document.createAttribute('class');						spanClass.nodeValue = "todo_box_date";						span.setAttributeNode(spanClass);									span.innerHTML = dateArray[n] + " | ";						link.appendChild(span);					}					link.innerHTML = link.innerHTML + subjectArray[n];					listEntry.appendChild(link);					toDoList.appendChild(listEntry);				} // for n				document.getElementById('todo_box_sub_elem').appendChild(toDoList);			}else{				var list = document.createElement('ol');				var listentry = document.createElement('li');				listentry.innerHTML = 'Es wurden noch keine Notizen angelegt';				listentry.addClassName('todo_box_list');				list.appendChild(listentry);				document.getElementById('todo_box_sub_elem').appendChild(list);			}	       }		});	}	/**	* Toggle visibility of Dates in Todolist	* @author		Manuel Nientit<mnientit@assono.de>	* @version		2008-12-05	*/	function toggleToDoBoxList(){		var todobox = $('todo_box_sub_elem');		new Effect.Fade(todobox.down('ol'));		var caller = $('todo_box_list_toggle');		if (todobox != null & caller != null){			var img = $('todo_box_list_toggle_img')			if (caller.getAttributeNode('hide').nodeValue == 'true'){				createTodoList(TODO_VIEWNAME_DATE);				caller.getAttributeNode('hide').nodeValue = 'false';				img.writeAttribute('src','/' + webpathInfo + '/image/notiz_listenansicht.gif');			}else{				createTodoList(TODO_VIEWNAME_SUBJECT);				caller.getAttributeNode('hide').nodeValue = 'true';				img.writeAttribute('src','/' + webpathInfo + '/image/notiz_kalender.gif');						}			}		new Effect.Appear(todobox.down('ol'))	}		/**	* Open Document in target div and show it	* @param		UNID - DocUNID of the Doc to open	* @author		Manuel Nientit<mnientit@assono.de>	* @version		2008-12-15	*/	function openToDoDoc(UID){		if (UID != ""){			var requestURL = '/' + webpathDialog +'/0/'+ UID +'?EditDocument';		}else{			var requestURL = '/' + webpathDialog +'/' +TODO_FORMNAME+'?OpenForm';		}		UNID = UID;		new Ajax.Request(requestURL,{method:'get', contentType:'text/javascript', encoding:'UTF-8',onComplete: show});	}function show(o_Request){	var elem = document.getElementById('note_form');	var childs = document.getElementById('note_form').childNodes;	if(childs.length > 0){		elem.innerHTML = '';	}	$('note_form').insert(o_Request.responseText);		if($('errmsg').innerHTML!=''){		$('errmsg').innerHTML = '';		$('errmsg').hide();	}		initializeToDoForm(UNID);}	/**	* Save Document	* @param		UNID - DocUNID of the Doc to open	* @author		Manuel Nientit<mnientit@assono.de>	* @version		2008-12-15	* @history:	* 	MNi: 18.02.09: changed to check for correct date and parse bodyvalue to escape Carriage Return	*/	function saveToDoDoc(UNID){		var BODY_ITEM = 'Body';		var DATE_ITEM = 'Datum';		var AUTHOR_ITEM = 'Bearbeiter';				var usernamestring = username;				usernamestring = usernamestring.replace(/=/g, '%3D');		usernamestring = usernamestring.replace(/(\/)/g, '%2F');				if($(DATE_ITEM).value==undefined){			var date = '';		}else{			var date = $(DATE_ITEM).value;			if(!isValidDate(date)){				if($('errmsg').childNodes.length > 0){					$('errmsg').firstChild[0].value = '';				}				$('errmsg').innerHTML = 'Die Validierung ist fehlgeschlagen. - Bitte geben Sie ein g\u00FCltiges Datum ein.';				// should not proceed to save, because server will return error when getting invalid value for DATUM				return;			}		}		// escape carriage return "\n" for it will destroy URL Parameter		var bodyvalue = $(BODY_ITEM).value.replace('\n','%0D');				var postBody = TODO_ITEMNAME_SUBJECT + '=' + $(TODO_ITEMNAME_SUBJECT).value + "&" + DATE_ITEM + "=" + date + "&"+ BODY_ITEM+ "="+bodyvalue; //+ "&" + AUTHOR_ITEM + "=" + usernamestring + ",[Admin]&Leser=[Admin]," + username;		if (UNID != ""){			var requestURL = '/' + webpathDialog +'/0/'+ UNID +'?saveDocument';		}else{			var requestURL = '/' + webpathDialog +'/'+ TODO_FORMNAME +'?CreateDocument';		}		var elem = $('note_form');		new Ajax.Request(requestURL,{postBody:postBody, onComplete:showsave});	}	function showsave(o_Request){			var MSG_NO_ACCESS = 'Sie sind als "Anonymous" angemeldet und haben als solcher keine Rechte zum Erstellen von Notizen. \n Bitte melden Sie sich mit einem g\u00FCltigen Login an'				var elem = document.getElementById('note_form');		var childs = document.getElementById('note_form').childNodes;		if((o_Request.status == 200) && (o_Request.responseText.match(/Maske verarbeitet/)!=null)){			if ($('errmsg').innerHTML==''){				$('img_mandatory').hide();					$(TODO_HEADER_ELEM).value ='Ihre Angaben wurden gespeichert: ';			}		}else if (o_Request.status == 200 || o_Request.status == 302){			if(o_Request.responseText.match(/No Access/)!=null){				$('note_form').hide();				$$('.main_wrapper')[0].setOpacity('1');				alert(MSG_NO_ACCESS);				return false;			}else{				if(childs.length > 0){					elem.innerHTML = '';				}								$('note_form').insert(o_Request.responseText);								if ($('errmsg')==''){					$('img_mandatory').hide();						$(TODO_HEADER_ELEM).value='Ihre Angaben wurden gespeichert: ';				}			}		}else{			if(childs.length > 0){				elem.innerHTML = '';			}			$('note_form').insert(o_Request.responseText);				}		initializeToDoForm(UNID);		}	/**	* Initialize Form with buttons	* @param		UNID - DocUNID of the Doc to open	* @author		Manuel Nientit<mnientit@assono.de>	* @version		2008-01-29	*/	function initializeToDoForm(UNID){						var NOTIZ_HEADER = 'Neue Notiz';			if (document.getElementById(TODO_HEADER_ELEM).value == 'Titel'){				if (document.getElementById(TODO_ITEMNAME_SUBJECT) != null){					if(document.getElementById(TODO_ITEMNAME_SUBJECT).value != ''){						$(TODO_HEADER_ELEM).value = $F(TODO_ITEMNAME_SUBJECT) ;					}else{					document.getElementById(TODO_HEADER_ELEM).value= NOTIZ_HEADER;					}				}			}						var button = $('Save_Notiz');			var event = document.createAttribute('href');			event.nodeValue = 'javascript:saveToDoDoc("'+UNID+'");';			button.setAttributeNode(event);						var img = document.createElement('img');			var src = document.createAttribute('src');			src.nodeValue = '/' + webpathInfo + '/image/gruendungsdialog/speichern_dialog.gif';			img.setAttributeNode(src);			var alt = document.createAttribute('alt');			if(UNID != ''){				alt.nodeValue = 'Notiz speichern';			}else{				alt.nodeValue = 'Notiz erstellen';			}			img.setAttributeNode(alt);			button.innerHTML = '';			button.insert(img);						/* No deletion possible because of access rights			if(UNID != ''){				var delbutton = $('Delete_Notiz');				var delEv = document.createAttribute('href');				var deletionRequest = '/' + webpathDialog + '/'+TODO_VIEWNAME_DATE+'/' + UNID+'?DeleteDocument';				delEv.nodeValue ='javascript:new Ajax.Request("'+deletionRequest+'");';				delbutton.setAttributeNode(delEv);								var img = document.createElement('img')				var src = document.createAttribute('src');				src.nodeValue = '/' + webpathInfo + '/image/loeschen.gif';				img.setAttributeNode(src);								var alt = document.createAttribute('alt');				alt.nodeValue = 'Notiz l\u00F6schen';				img.setAttributeNode(alt);								delbutton.innerHTML ='';				delbutton.insert(img);			}*/						var closebutton = $('Close_Notiz');			var img = document.createElement('img');			var src = document.createAttribute('src');			src.nodeValue = '/' + webpathInfo +'/image/schliessen.gif';			img.setAttributeNode(src);			var alt = document.createAttribute('alt');			alt.nodeValue = 'Notiz schlie\u00DFen';			img.setAttributeNode(alt);			closebutton.innerHTML = '';			closebutton.insert(img);			$$('.main_wrapper')[0].setOpacity('0.6');			$('note_form').appear();			new Draggable($('note_form'));	}	/*	 * Dynamically creating the todo-list END	/******************************************************************************************/	/*****************************************************************************************	 * FormValidator - validates a form	 *	 * Inspired by  	 * http://www.devshed.com/c/a/JavaScript/Form-Validation-with-JavaScript	 * 	 * @author Bernd Hort <bhort@assono.de> / Arnd Koch <akoch@assono.de>	 * @version 2008-11-18	 * 	 */ 	/* Usage: Put code like this into the form	// check form values	function checkForm()	{	// instantiate object	fv = new formValidator();	// perform checks	// Salutation	fv.checkNotEmpty('Salutation', 'Bitte w\u00E4hlen Sie die Anrede aus.');	// Firstname	fv.checkNotEmpty('Firstname', 'Bitte tragen Sie Ihren Vornamen ein.');	// Lastname	fv.checkNotEmpty('Lastname', 'Bitte tragen Sie Ihren Nachnamen ein.');	// StreetAddress	fv.checkNotEmpty('StreetAddress', 'Bitte geben Sie die Stra\u00DFe und Hausnummer an.');	// Zip	fv.checkNotEmpty('Zip', 'Bitte geben Sie die Postleitzahl an.');	// City	fv.checkNotEmpty('City', 'Bitte geben Sie den Ort an.');	// Country	fv.checkNotEmpty('Country', 'Bitte w\u00E4hlen Sie das Land aus.');	// PhoneNumber	fv.checkNotEmpty('PhoneNumber', 'Bitte geben Sie die Telefonnummer an.');	// MailAddress	fv.checkValidEMail('MailAddress', 'Bitte geben Sie eine g\u00FCltige E-Mail-Adresse an.');	// if errors, display, else proceed	return fv.isValid();	}	And add at the onSubmit event the following code	return checkForm();	*/	var currentFormValidator = '';	var tmpFieldname = '';	var tmpMsg = '';	// create object	function formValidator()	{			 //formName			 if (typeof(validationFormName) == "undefined" ||  validationFormName == "" ){				this.formname = 0;			 } else {				 this.formname = validationFormName;			 }			 // set up array to hold error messages			 this.errorList = new Array;			 this.borderColorMarked = '#800000';			 this.borderColorUnmarked = 'none';			 // set up object methods			 this.isEmpty = isEmpty;		 			 this.isNumber = isNumber;		 			 this.isAlphabetic = isAlphabetic;		 			 this.isAlphaNumeric = isAlphaNumeric;		 			 this.isWithinRange = isWithinRange;		 			 this.isEmailAddress = isEmailAddress;		 			 this.isChecked = isChecked;		 		 			 this.isValidDate = isValidDate;			 this.isValidNumber = isValidNumber;			 this.checkNotEmpty = checkNotEmpty;			 this.checkValidEMail = checkValidEMail;			 this.checkValidDate = checkValidDate;			 this.checkValidNumber = checkValidNumber;			 this.checkREPattern = checkREPattern;			 this.checkUniqueness = checkUniqueness;			 this.raiseError = raiseError;		 			 this.numErrors = numErrors;		 			 this.displayErrors = displayErrors;		 			 this.isValid = isValid;			 this.unmarkField = unmarkField;			 this.markField = markField;	}	// format message strings 	function formatmessage (msg, mark, value){		var match = '<%'+mark.toUpperCase()+'%>';		var result = "";				msgarray = msg.split(match);		msg = msgarray.join(value);		return msg;	}	// check to see if input is whitespace only or empty	function isEmpty(val)	{			 if (val.match(/^\s+$/) || val == "")			 {					 return true;			 }			 else			 {					 return false;			 }		 	}	// check to see if input is number	function isNumber(val)	{			 if (isNaN(val))			 {					 return false;			 }			 else			 {					 return true;			 }		 	}	// check to see if input is alphabetic	function isAlphabetic(val)	{			 if (val.match(/^[a-zA-Z]+$/))			 {					 return true;			 }			 else			 {					 return false;			 }		 	}	// check to see if input is alphanumeric	function isAlphaNumeric(val)	{			 if (val.match(/^[a-zA-Z0-9]+$/))			 {					 return true;			 }			 else			 {					 return false;			 }		 	}	// check to see if value is within range	function isWithinRange(val, min, max)	{			 if (val >= min && val <= max)			 {					 return true;			 }			 else			 {					 return false;			 }		 	}	// check to see if input is a valid email address	function isEmailAddress(val)	{			 //if (val.match(/^([a-zA-Z0-9])+([.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-]+)+/))			 if (val.match(/\b[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}\b/i))		 			 {					 return true;			 }			 else			 {					 return false;			 }		 	}	// check to see if form value is checked	function isChecked(obj)	{			 if (obj.checked)			 {					 return true;			 }			 else			 {					 return false;			 }		 	}	// display all errors	// iterate through error array and print each item	function displayErrors()	{			var msg = "";			 for (x=0; x<this.errorList.length; x++)			 {				msg = msg + this.errorList[x] + "\n";		 			 }			 if (language == "de") {				 alert("Fehler bei der Validierung der Eingabe:\n" + msg);		 				 } else {				alert("Error during input validation:\n" + msg);			 }		}	// add an error to error list	function raiseError(msg)	{			 this.errorList[this.errorList.length] = msg;	}	// return number of errors in error array	function numErrors()	{			 return this.errorList.length;	}	// checks and raises an error if is empty	function checkNotEmpty(fieldname, msg)	{		var theField = document.forms[this.formname].elements[fieldname];		var isEmptyValue = true;		if(theField == null){			//this.raiseError(msg);					return;		}		//Test for an array (radio buttons, checkboxes)		if (theField.length != null && theField.type == null ){		//for selection the type is not null			for (i = 0; i < theField.length; i ++) {				if (theField[i].checked) {					isEmptyValue = false;   // as long as one is chosen this gets set true				}					}									} else {			if (theField.type.substr(0,6) =='select'){				var i = 0;						while((i<theField.options.length) && isEmptyValue == true){					if(theField.options[i].selected){						if(isEmpty(theField.options[i].value) == false || isEmpty(theField.options[i].text) == false){							isEmptyValue = false;						}					};					i++;								};			} else {				isEmptyValue = isEmpty(theField.value)			}							} //not an array		if (isEmptyValue){			this.raiseError(msg);			this.markField(fieldname);		} else {			this.unmarkField(fieldname);		}	}	// filter for Date.parse operation	function parsefilter (datestring){	// unfinished	// return datestring;		var i;		var result = "";		var year = "";		var month = "";		var day = "";		var months = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec";		var monthslist = months.split(/\s/);		var dateparts = datestring.split(/\D/);		if (dateparts.length != 3) {			return result; // whenever the datestring contains not 3 elements its invalid		} 		for(i=0; i <= dateparts.length; i++){			// check / translate the date elements			if ((dateparts[i] > 999) && (year == "") && (dateparts[i] < 3000)){				year = dateparts[i];			}					if (dateparts[i] < 32){				if (dateparts[i] > 12 ){					//must be a day					if (day == ""){						day = dateparts[i];					} else {						// value of month is stored in day						month = day;						day = dateparts[i];					}				} else { // can be a month or day					if ( (i == 0) || (i == 2) && (dateparts[i] <= 31))  { // set the day in case of (dd-mm-yyyy or yyyy-mm-dd)						day = dateparts[i];					}					if ( (i == 1) && (dateparts[i] <= 12) ) {						month = dateparts[i];					}				}						}		}		// now check if the filter was successful		if ( ( month == "" )||( day == "" )||( year == "" ) ){			return result;		}		for (i=0; i <= monthslist.length; i++){			if (i+1 == month ){				result = monthslist[i];			}		}		result = result + " " + day + " " + year;		return result;	}	// check to see if input is a valid date value (simplified)	function isValidDate(date)	{			 if (date.match(/^(\d+[\\.\/-]?)+$/))			 {					if (parsefilter(date) == "" ){					  return false;					}					 return true;			 }			 else			 {					 return false;			 }		 	}	// checks and raises an error if is not a valid date (does not check valid date ranges yet)	function checkValidDate(fieldname, msg, beforemsg, aftermsg, pastmsg, futuremsg , emptymsg, errorifempty, fromdate, untildate, todaydate)	{		var numfromdate;		var numuntildate;		var numtoday;		var numvalue;		var value;		var daterange;		var dateobjfrom;		var dateobjuntil;		if (document.forms[this.formname].elements[fieldname] == null){		 return;		}		value =  document.forms[this.formname].elements[fieldname].value;		dateobjfrom = new Date(fromdate);		dateobjuntil = new Date(untildate);		numfromdate = Date.parse(dateobjfrom);		numuntildate = Date.parse(dateobjuntil);		numtoday = Date.parse(todaydate)		numvalue = Date.parse(parsefilter(value)) 		daterange = dateobjfrom.toLocaleString() + " - " + dateobjuntil.toLocaleString();		msg = formatmessage(msg, 'value', value);		beforemsg = formatmessage(beforemsg, 'value', value);		aftermsg = formatmessage(aftermsg, 'value', value);		beforemsg = formatmessage(beforemsg, 'daterange', daterange);		aftermsg = formatmessage(aftermsg, 'daterange', daterange);			pastmsg = formatmessage(pastmsg, 'fieldlabel', fieldname);		pastmsg = formatmessage(pastmsg, 'value', value);		futuremsg = formatmessage(futuremsg, 'fieldlabel', fieldname);		futuremsg = formatmessage(futuremsg, 'value', value);		if ( errorifempty && isEmpty(value)){			this.raiseError(emptymsg); //field is empty 			this.markField(fieldname);			return ;		} else {			this.unmarkField(fieldname);			if (isEmpty(value)){			return;			}			if (isNaN(numvalue)) {				//this.raiseError(msg); //parser returned NaN				//this.markField(fieldname);				//return ;			}			if (!isNaN(numvalue)) {				if (numvalue < numfromdate){					this.raiseError(beforemsg); 					this.markField(fieldname);					return ;				}			}			if (!isNaN(numvalue)) {				if (numvalue > numuntildate) {					this.raiseError(aftermsg); 					this.markField(fieldname);					return ;				}			}			if (!isNaN(numvalue)) {				if (numvalue < numfromdate) {					if(numfromdate == numtoday){						this.raiseError(pastmsg); 						this.markField(fieldname);						return ;							} else {						this.raiseError(beforemsg); 						this.markField(fieldname);						return ;			   }				}			}			if (!isNaN(numvalue)) {				if (numvalue > numuntildate) {					if(numuntildate == numtoday){						this.raiseError(futuremsg); 						this.markField(fieldname);						return ;							} else {						this.raiseError(aftermsg); 						this.markField(fieldname);						return ;			   }				}			}		}		if ( !isValidDate(value)){			this.raiseError(msg);			this.markField(fieldname);		} else {			this.unmarkField(fieldname);		}	}	// check to see if input is a valid number (simplified = no formatpattern)	function isValidNumber(number)	{			 if (number.match(/^(\d+[.]?)+[,]?(\d+)?$/))			 {					 return true;			 }			 else			 {					 return false;			 }		 	}	// checks and raises an error if is not a valid number ( no format pattern check implemented yet )	function checkValidNumber(fieldname, min, max, msgnull, msginvalid, msgbelow, msgabove)	{		if (document.forms[this.formname].elements[fieldname] == null){		 return;		}		var value = document.forms[this.formname].elements[fieldname].value;		msginvalid = formatmessage(msginvalid, 'value', value);		msgabove = formatmessage(msgabove, 'value', value);		msgbelow = formatmessage(msgbelow, 'value', value);		if (isEmpty(value)){			this.raiseError(msgnull);			this.markField(fieldname);				return;					}		if ( !isValidNumber(value)){			this.raiseError(msginvalid);			this.markField(fieldname);			return;		} else {			if ( value < min) {				this.raiseError(msgbelow);				this.markField(fieldname);					}else if (value > max){				this.raiseError(msgabove);				this.markField(fieldname);						} else {				this.unmarkField(fieldname);			}		}	}	// checks a list of fields for integervalues, and returns false when the sum is <= 0	function checkFieldlistNonZero(names, msg){		if (names != null){			var namelist = names.split(',');			var i;			var fieldname;			var fieldvalue;			var result = 0;			for(i=0; i < namelist.length; i++){				fieldname = namelist[i];				fieldvalue = document.forms[this.formname].elements[fieldname].value;				result += fieldvalue;			}			if (result <= 0 ){				return false;			}		}		return true;		} 	// checks and raises an error if is empty	function checkValidEMail(fieldname, msg)	{		if (isEmpty(document.forms[this.formname].elements[fieldname].value) || !isEmailAddress(document.forms[this.formname].elements[fieldname].value)){			this.raiseError(msg);			this.markField(fieldname);		} else {			this.unmarkField(fieldname);		}	}	/**	 * checks for RE pattern	 *	 * @param		fieldname		string		the name of the field with the value to be checked.	 * @param		repattern		string		the pattern to be mached.	 * @param		msg				string		the msg to be displayed if the pattern is no match	  * 	 * @author		Bernd Hort <bhort@assono.de>	 * @version		2008-07-10	 */	// 	function checkREPattern(fieldname, repattern, msg)	{		var fieldvalue = document.forms[this.formname].elements[fieldname].value;		var re = new RegExp(repattern);		if (re.test(fieldvalue))			 {					this.unmarkField(fieldname);			 }			 else			 {					this.raiseError(msg);					this.markField(fieldname);			 }			}	/**	 * checks for length of a field value	 *	 * @param	fieldname	string	the name of the field with the value to be checked.	 * @param	minLength	number	the min length	 * @param	maxLength	number	the max length	 * @param	msgToShort	string	the msg to be displayed if the text is to short	 * @param	msgToLong	string	the msg to be displayed if the text is to long	 * 	 * @author	Bernd Hort <bhort@assono.de>	 * @version	2009-01-08	 */	// 	function checkValueLength(fieldname, minLength, maxLength, msgToShort, msgToLong)	{		var fieldvalue = document.forms[this.formname].elements[fieldname].value;		var valid = true;		if (!isNaN(minLength)){			if (fieldvalue.length < minLength){				valid = false;				this.raiseError(msgToShort);			};		}; 		if (!isNaN(maxLength)){			if (fieldvalue.length > maxLength){				valid = false;				this.raiseError(msgToLong);			};			}; 		if (valid)			 {				this.unmarkField(fieldname);			 }			 else			 {				this.markField(fieldname);			 };	};	/**	 * checks for uniqueness	 *	 * @param		fieldname							string		the name of the field with the value to be checked.	 * @param		viewname						string		the name of the view with the.	 * @param		failureReason					string		the message to be returned.	 * @param		evaluateFailureReason	boolean		name of the function.	 * 	 * @return		function					statusOKHandler compatible function.	 * 	 * @author		Bernd Hort <bhort@assono.de>	 * @version		2008-12-22	 */	// 	function checkUniqueness(fieldname, viewname, failureReason, evaluateFailureReason)	{		currentFormValidator = this		tmpFieldname =fieldname;		tmpMsg = failureReason;		fieldvalue = document.forms[this.formname].elements[fieldname].value;		if (isEmpty(fieldvalue)){			return;		}		if(evaluateFailureReason == true){			var url = '/' + webpath + '/checkUnique?OpenAgent&view=' + viewname +'&key=' + escape(fieldvalue)+'&unid=' + unid + '&msg=' + failureReason;			new Ajax.Request(url, {				method: 'get',				asynchronous: false,				onSuccess: function(transport) {				var returnText = transport.responseText.replace(/\n$/, ''); //remove carriage return					if (returnText !='unique') {						currentFormValidator.raiseError(returnText);						currentFormValidator.markField(tmpFieldname);					} else {						currentFormValidator.unmarkField(tmpFieldname);					}					}			});		} else {			var url = '/' + webpath + '/' + viewname +'?ReadViewEntries&count=1&startKey=' + escape(fieldvalue);			new Ajax.Request(url, {				method: 'get',				asynchronous: false,				onSuccess: function(transport) {			/* The URL was constructed a in way, that exactly one docuemnt (viewentry) is returned:			the first one, with an ID greater or equal to the ID entered by the user.			The returned result begins like:			<viewentries toplevelentries=...>			<viewentry position=...>			<entrydata columnnumber=...>			<text>...</text>			</entrydata>			...			Is the ID entered greater then the biggest ID stored in the database, the result looks like this:			<viewentries toplevelentries="..." />			So, if there is no (first) <text> element, the ID does not exists,			else compare the value of its first text node with the value entered.			*/			var firstText = transport.responseXML.getElementsByTagName('text')[0];			var firstViewEntry = transport.responseXML.getElementsByTagName('viewentry')[0];			if (firstText) {				if (firstText.firstChild.nodeValue == document.forms[currentFormValidator.formname].elements[tmpFieldname].value && 					firstViewEntry.getAttribute('unid') != unid) {						currentFormValidator.raiseError(tmpMsg);						currentFormValidator.markField(tmpFieldname);					} else {						currentFormValidator.unmarkField(tmpFieldname);					}				} else {				currentFormValidator.unmarkField(tmpFieldname);				}			}			});		}		}	//mark the field	function markField(fieldname){		var theField = document.forms[this.formname].elements[fieldname];		if (theField == null) {return};		//check for an array		if (theField.length != null){			for (i = 0; i < theField.length; i ++) {				if (this.borderColorMarked.toLowerCase =="none" || this.borderColorMarked ==""){							theField[i].style.border = "none";						} else {					theField[i].style.border = "3px solid " + this.borderColorMarked;				}				}				} else {				if (this.borderColorMarked.toLowerCase =="none" || this.borderColorMarked ==""){						theField.style.border = "none";					} else {				theField.style.border = "3px solid " + this.borderColorMarked;			}			}	}	//unmark the field	function unmarkField(fieldname){		var theField = document.forms[this.formname].elements[fieldname];		if (theField == null) {return};		//check for an array		if (theField.length != null){			for (i = 0; i < theField.length; i ++) {				if (this.borderColorMarked.toLowerCase =="none" || this.borderColorMarked ==""){							theField[i].style.border = "none";						} else {					theField[i].style.border = "1px solid " + this.borderColorUnmarked;				}				}				} else {				if (this.borderColorMarked.toLowerCase =="none" || this.borderColorMarked ==""){						theField.style.border = "none";					} else {				theField.style.border = "1px solid " + this.borderColorUnmarked;			}			}		}	// checks if this document is valid	function isValid()	{		// all done		// if errors, display, else proceed		if (this.numErrors() > 0)		{			this.displayErrors();			return false;		}		else		{			return true;		}	}	// end object	/******************************************************************************************/	// Project: Dynamic Date Selector (DtTvB) - 2006-03-16	// Script featured on JavaScript Kit- http://www.javascriptkit.com	// Code begin...	// Set the initial date./*	var ds_i_date = new Date();	ds_c_month = ds_i_date.getMonth() + 1;	ds_c_year = ds_i_date.getFullYear();	// Get Element By Id	function ds_getel(id) {		return document.getElementById(id);	}	// Get the left and the top of the element.	function ds_getleft(el) {		var tmp = el.offsetLeft;		el = el.offsetParent		while(el) {			tmp += el.offsetLeft;			el = el.offsetParent;		}		return tmp;	}	function ds_gettop(el) {		var tmp = el.offsetTop;		el = el.offsetParent		while(el) {			tmp += el.offsetTop;			el = el.offsetParent;		}		return tmp;	}	// Output Buffering	var ds_ob = ''; 	function ds_ob_clean() {		ds_ob = '';	}	function ds_ob_flush(){		// Output Element		var ds_oe = ds_getel('ds_calclass');		ds_oe.innerHTML = ds_ob;		ds_ob_clean();	}	function ds_echo(t) {		ds_ob += t;	}	var ds_element; // Text Element...	var ds_monthnames = [	'Januar', 'Februar', 'M\u00E4rz', 'April', 'Mai', 'Juni',	'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'	]; // You can translate it for your language.	var ds_daynames = [	'Son', 'Mon', 'Di', 'Mi', 'Do', 'Fr', 'Sa'	]; // You can translate it for your language.	// Calendar template	function ds_template_main_above(t) {		return '<table cellpadding="3" cellspacing="1" class="ds_tbl">'		     + '<tr>'			 + '<td class="ds_head" style="cursor: pointer" onclick="ds_py();">&lt;&lt;</td>'			 + '<td class="ds_head" style="cursor: pointer" onclick="ds_pm();">&lt;</td>'			 + '<td class="ds_head" style="cursor: pointer" onclick="ds_hi();" colspan="3">[Schlie\u00DFen]</td>'			 + '<td class="ds_head" style="cursor: pointer" onclick="ds_nm();">&gt;</td>'			 + '<td class="ds_head" style="cursor: pointer" onclick="ds_ny();">&gt;&gt;</td>'			 + '</tr>'		     + '<tr>'			 + '<td colspan="7" class="ds_head">' + t + '</td>'			 + '</tr>'			 + '<tr>';	}	function ds_template_day_row(t) {		return '<td class="ds_subhead">' + t + '</td>';		// Define width in CSS, XHTML 1.0 Strict doesn't have width property for it.	}	function ds_template_new_week() {		return '</tr><tr>';	}	function ds_template_blank_cell(colspan) {		return '<td colspan="' + colspan + '"></td>'	}	function ds_template_day(d, m, y) {		return '<td class="ds_cell" onclick="ds_onclick(' + d + ',' + m + ',' + y + ')">' + d + '</td>';		// Define width the day row.	}	function ds_template_main_below() {		return '</tr>'		     + '</table>';	}*/	// Project: Dynamic Date Selector (DtTvB) - 2006-03-16	// Script featured on JavaScript Kit- http://www.javascriptkit.com	// Code begin...	// Set the initial date.	var ds_i_date = new Date();	ds_c_month = ds_i_date.getMonth() + 1;	ds_c_year = ds_i_date.getFullYear();	// Get Element By Id	function ds_getel(id) {		return document.getElementById(id);	}	// Get the left and the top of the element.	function ds_getleft(el) {		var tmp = el.offsetLeft;		el = el.offsetParent		while(el) {			tmp += el.offsetLeft;			el = el.offsetParent;		}		return tmp;	}	function ds_gettop(el) {		var tmp = el.offsetTop;		el = el.offsetParent		while(el) {			tmp += el.offsetTop;			el = el.offsetParent;		}		return tmp;	}	// Output Buffering	var ds_ob = ''; 	function ds_ob_clean() {		ds_ob = '';	}	function ds_ob_flush(){		// Output Element		var ds_oe = new Element('div',{id:'ds_calclass'});		ds_oe.innerHTML = ds_ob;		$('ds_conclass').update(ds_oe);		ds_ob_clean();	}	function ds_echo(t) {		ds_ob += t;	}	var ds_element; // Text Element...	var ds_monthnames = [	'Januar', 'Februar', 'M\u00E4rz', 'April', 'Mai', 'Juni',	'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'	]; // You can translate it for your language.	var ds_daynames = [	'Son', 'Mon', 'Di', 'Mi', 'Do', 'Fr', 'Sa'	]; // You can translate it for your language.	// Calendar template	function ds_template_main_above(t) {		return '<table cellpadding="3" cellspacing="1" class="ds_tbl">'		     + '<tr>'			 + '<td class="ds_head" style="cursor: pointer" onclick="ds_py();">&lt;&lt;</td>'			 + '<td class="ds_head" style="cursor: pointer" onclick="ds_pm();">&lt;</td>'			 + '<td class="ds_head" style="cursor: pointer" onclick="ds_hi();" colspan="3">[Schlie\u00DFen]</td>'			 + '<td class="ds_head" style="cursor: pointer" onclick="ds_nm();">&gt;</td>'			 + '<td class="ds_head" style="cursor: pointer" onclick="ds_ny();">&gt;&gt;</td>'			 + '</tr>'		     + '<tr>'			 + '<td colspan="7" class="ds_head">' + t + '</td>'			 + '</tr>'			 + '<tr>';	}	function ds_template_day_row(t) {		return '<td class="ds_subhead">' + t + '</td>';		// Define width in CSS, XHTML 1.0 Strict doesn't have width property for it.	}	function ds_template_new_week() {		return '</tr><tr>';	}	function ds_template_blank_cell(colspan) {		return '<td colspan="' + colspan + '"></td>'	}	function ds_template_day(d, m, y) {		return '<td class="ds_cell" onclick="ds_onclick(' + d + ',' + m + ',' + y + ')">' + d + '</td>';		// Define width the day row.	}	function ds_template_main_below() {		return '</tr>'		     + '</table>';	}	// This one draws calendar...	function ds_draw_calendar(m, y) {		// First clean the output buffer.		ds_ob_clean();		// Here we go, do the header		ds_echo (ds_template_main_above(ds_monthnames[m - 1] + ' ' + y));		for (i = 0; i < 7; i ++) {			ds_echo (ds_template_day_row(ds_daynames[i]));		}		// Make a date object.		var ds_dc_date = new Date();		ds_dc_date.setMonth(m - 1);		ds_dc_date.setFullYear(y);		ds_dc_date.setDate(1);		if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12) {			days = 31;		} else if (m == 4 || m == 6 || m == 9 || m == 11) {			days = 30;		} else {			days = (y % 4 == 0) ? 29 : 28;		}		var first_day = ds_dc_date.getDay();		var first_loop = 1;		// Start the first week		ds_echo (ds_template_new_week());		// If sunday is not the first day of the month, make a blank cell...		if (first_day != 0) {			ds_echo (ds_template_blank_cell(first_day));		}		var j = first_day;		for (i = 0; i < days; i ++) {			// Today is sunday, make a new week.			// If this sunday is the first day of the month,			// we've made a new row for you already.			if (j == 0 && !first_loop) {				// New week!!				ds_echo (ds_template_new_week());			}			// Make a row of that day!			ds_echo (ds_template_day(i + 1, m, y));			// This is not first loop anymore...			first_loop = 0;			// What is the next day?			j ++;			j %= 7;		}		// Do the footer		ds_echo (ds_template_main_below());		// And let's display..		ds_ob_flush();		// Scroll it into view.		// Container		var ds_ce = $('ds_conclass');		//ds_ce.scrollIntoView();	}	// A function to show the calendar.	// When user click on the date, it will set the content of t.	function ds_sh(t) {		// Set the element to set...		ds_element = t;		// Make a new date, and set the current month and year.		var ds_sh_date = new Date();		ds_c_month = ds_sh_date.getMonth() + 1;		ds_c_year = ds_sh_date.getFullYear();		// Draw the calendar		ds_draw_calendar(ds_c_month, ds_c_year);		// To change the position properly, we must show it first.		var ds_ce = $('ds_conclass');		ds_ce.style.display = '';		// Move the calendar container!		//the_left = ds_getleft(t);		the_left = t.offsetLeft;		//the_top = ds_gettop(t) + t.offsetHeight;		the_top = t.offsetHeight + t.offsetParent.offsetHeight;		ds_ce.style.left = '160px'; //the_left + 'px'; //hardcoded postion		ds_ce.style.top = '80px'; //the_top + 'px';		// Scroll it into view.		//ds_ce.scrollIntoView();	}	// Hide the calendar.	function ds_hi() {		var ds_ce = $('ds_conclass');		ds_ce.style.display = 'none';	}	// Moves to the next month...	function ds_nm() {		// Increase the current month.		ds_c_month ++;		// We have passed December, let's go to the next year.		// Increase the current year, and set the current month to January.		if (ds_c_month > 12) {			ds_c_month = 1; 			ds_c_year++;		}		// Redraw the calendar.		ds_draw_calendar(ds_c_month, ds_c_year);	}	// Moves to the previous month...	function ds_pm() {		ds_c_month = ds_c_month - 1; // Can't use dash-dash here, it will make the page invalid.		// We have passed January, let's go back to the previous year.		// Decrease the current year, and set the current month to December.		if (ds_c_month < 1) {			ds_c_month = 12; 			ds_c_year = ds_c_year - 1; // Can't use dash-dash here, it will make the page invalid.		}		// Redraw the calendar.		ds_draw_calendar(ds_c_month, ds_c_year);	}	// Moves to the next year...	function ds_ny() {		// Increase the current year.		ds_c_year++;		// Redraw the calendar.		ds_draw_calendar(ds_c_month, ds_c_year);	}	// Moves to the previous year...	function ds_py() {		// Decrease the current year.		ds_c_year = ds_c_year - 1; // Can't use dash-dash here, it will make the page invalid.		// Redraw the calendar.		ds_draw_calendar(ds_c_month, ds_c_year);	}	// Format the date to output.	function ds_format_date(d, m, y) {		// 2 digits month.		m2 = '00' + m;		m2 = m2.substr(m2.length - 2);		// 2 digits day.		d2 = '00' + d;		d2 = d2.substr(d2.length - 2);		// YYYY-MM-DD		return d2+'.'+m2+'.'+y;	//	return y + '-' + m2 + '-' + d2;	}	// When the user clicks the day.	function ds_onclick(d, m, y) {		// Hide the calendar.		ds_hi();		// Set the value of it, if we can.		if (typeof(ds_element.value) != 'undefined') {			ds_element.value = ds_format_date(d, m, y);		// Maybe we want to set the HTML in it.		} else if (typeof(ds_element.innerHTML) != 'undefined') {			ds_element.innerHTML = ds_format_date(d, m, y);		// I don't know how should we display it, just alert it to user.		} else {			alert (ds_format_date(d, m, y));		}	}	// And here is the end.     /** assono **/	/** Default Setting for below Functions**/		var PageContext = null;	/**************************************************	*	* generic function for printing 	*	* @author:	Arnd Koch <akoch@assono.de>	* @version:	2009-02-19	*************************************************/			function doPrintPage(contextData) {		window.print();	}				/**************************************************	*	* generic function for Document Exports 	*	* @author:	Arnd Koch <akoch@assono.de>	* @version:	2009-02-19	*************************************************/			function doExportPage(contextData) {		alert('Diese Funktion steht in diesem Kontext nicht zur Verf\u00FCgung.');		return false;	}	/**************************************************	*	* generic function for search input	*	* @author:	Arnd Koch <akoch@assono.de>	* @version:	2009-02-20	*************************************************/			function doClickSearchbar(contextData) {		if(contextData != null){			if(contextData.value == 'Suchen und Finden'){				contextData.value = '';			}		}	}		/** save the count of changes to the form **/	var PageChanges = -1;		/**************************************************	*	* generic function for save notifiation	*	* @author:	Arnd Koch <akoch@assono.de>	* @version:	2009-02-25	*************************************************/			function unloadSaveNotify(contextData) {		var msgboxtitle = 'Hinweis';		var message  = "Sie haben Ihre \u00C4nderungen noch nicht gespeichert. \n\nW\u00E4hlen Sie OK, wenn Sie die Seite jetzt verlassen m\u00F6chten, ohne zu speichern. \n\nAbbrechen um zu speichern und auf der aktuellen Seite zu bleiben."; 		if(!handleBrowser(false,true)){return;}		if(PageChanges > 0 && isFounder){			var choice = confirm(message);							if (!choice){					PageChanges = 0;					document.forms.doc.submit();					return  true;				}else{					PageChanges = 0;					return false;				}		}else{			return true;		}	}		/**************************************************	*	* generic function for save notifiation	*	* @author:	Arnd Koch <akoch@assono.de>	* @version:	2009-03-05	*************************************************/			function beforeUnloadSaveNotify(contextData) {				if(!handleBrowser(true,false)){return;}		var msgboxtitle = 'Hinweis';		var message  = "Sie Haben Ihre \u00C4nderungen noch nicht gespeichert. \n\nWenn Sie den Vorgang fortsetzen gehen alle nicht gespeicherten \u00C4nderungen verloren."; 		if(PageChanges > 0 && isFounder){			return message;		}else{			return;		}	}	/**************************************************	*	* generic function for clearing the Changes Counter	*	* @author:	Arnd Koch <akoch@assono.de>	* @version:	2009-02-20	*************************************************/			function doResetChangeCount(contextData) {		PageChanges = 0;	}		/** Saves the Title of the current Page **/	var CurrentPageTitleHTML = '';			/**************************************************	*	* generic function called on 1st time onChange is called	* 	*	* @author:	Arnd Koch <akoch@assono.de>	* @version:	2009-03-03	*************************************************/			function doFirstChange(contextData) {		var TitleObj = $$('.header_center_info_headline').first();		//var PageDiv = $$('header_center_seiten').first();		if (TitleObj != null && CurrentPageTitleHTML == ''){						CurrentPageTitleHTML = TitleObj.innerHTML;		}		if($('page1') != null && $('page2') != null){			var imagehtml =$('page1').innerHTML + " " + $('page2').innerHTML ;			imagehtml = imagehtml.replace(/20/g, "12" );			imagehtml = imagehtml.replace(/15/g, "8" );			DisplayHeadlineNotice('Benutzen Sie die '+ imagehtml +' - Symbole um weiter zu bl\u00E4ttern.');					}	}		/**************************************************	*	* displayes a message in the info headline 	* 	*	* @author:	Arnd Koch <akoch@assono.de>	* @version:	2009-03-04	*************************************************/			function DisplayHeadlineNotice(message) {		var TitleObj = $$('.header_center_info_headline').first();		var clearheader = CurrentPageTitleHTML.replace(/<([\W])?(h|H)1>/g, "");		if (TitleObj != null && isFounder){			TitleObj.innerHTML = '<h1>'+clearheader+' - <span id="SiteNotice" style="font-size: 10px; display:none;">'+message+'</span></h1>';			new Effect.Appear('SiteNotice');		}			}	/**************************************************	*	* browser switch function to handle unload events	* 	*	* @author:	Arnd Koch <akoch@assono.de>	* @version:	2009-03-06	*************************************************/			function handleBrowser(isOnBeforeUnload,isOnUnload) {				if (isOnBeforeUnload){			//alert("debug> browser version string: Name["+navigator.appName+"] version["+navigator.appVersion+"]\n\nSupports [onBeforeUnload]");			return true;			switch(navigator.appName){									default:					return true;						}		}else if(isOnUnload){			//alert("debug> browser version string: Name["+navigator.appName+"] version["+navigator.appVersion+"]\n\nSupports [onUnload]");						switch(navigator.appName){				case "Opera":					return true;						break;									default:					return false;						}		}else{			return false;		}			}		