function doReset() {
	var elems = document.getElementById('suchassistent').getElementsByTagName('select');
	for (var i = 0; i < elems.length; i++) elems[i].selectedIndex = 0;
}

function getElementsByAttribute(attname, attvalue, case_sensitive) {
	var elems = new Array();
	var case_sensitive = !!case_sensitive;
	var allelems = document.all || document.getElementsByTagName('*');
	for (var i = 0; i < allelems.length; i++) {
		if (case_sensitive) {
			if (allelems[i].getAttribute(attname) && allelems[i].getAttribute(attname) == attvalue) {
				elems.push(allelems[i]);
			}
		} else {
			if (allelems[i].getAttribute(attname) && allelems[i].getAttribute(attname).toLowerCase() == attvalue.toLowerCase()) {
				elems.push(allelems[i]);
			}
		}
	}
	
	return elems;
}

var Select = {
	hasOptionValue: function(sel, val) {
		var sel = $(sel);
		for (var i = 0; i < sel.options.length; i++) {
			if (sel.options[i].value == val) return true;
		}
		return false;
	},
	
	hasOptionText: function(sel, text) {
		var sel = $(sel);
		for (var i = 0; i < sel.options.length; i++) {
			if (sel.options[i].text == text) return true;
		}
		return false;
	},
	
	getValue: function(sel) {
		var sel = $(sel);
		var valAr = [];
		for (var i = 0; i < sel.options.length; i++) {
			if (sel.options[i].selected) valAr.push(sel.options[i].value);
		}
		if (!sel.multiple) return valAr[0];
		return valAr;
	},
	
	setValue: function(sel, valAr) {
		var sel = $(sel);
		var valAr = typeof(valAr) == 'string' ? [valAr] : valAr;
		for (var i = 0; i < sel.options.length; i++) {
			for (var j = 0; j < valAr.length; j++) {
				if (sel.options[i].value == valAr[j]) sel.options[i].selected = true;
			}
		}
	}
}

function submitForm(form, i2methode, action, target, method) {
	var form = $(form);
	var t_method = null;
	var inp = form.getElementsByTagName('input');
	for (var i = 0; i < inp.length; i++) {
		if (inp[i].name.toLowerCase() == 't_methode') t_method = inp[i];
	}

	var action    = (typeof(action) == 'undefined' || action === null)       ? form.getAttribute('action')         : action;
	var target    = (typeof(target) == 'undefined' || target === null)       ? (form.getAttribute('target') || '') : target;
	var method    = (typeof(method) == 'undefined' || method === null)       ? form.getAttribute('method')         : method;
	var i2methode = (typeof(i2methode) == 'undefined' || i2methode === null) ? t_method.value  : i2methode;
	if (i2methode == 'WKadd' && target != '') method = 'POST';
	var old_action    = form.getAttribute('action');
	var old_target    = form.getAttribute('target');
	var old_method    = form.getAttribute('method');
	var old_i2methode = t_method.value;
	form.setAttribute('action', action);
	form.setAttribute('target', target);
	form.setAttribute('method', method);
	t_method.value = i2methode;
	form.submit();
	form.setAttribute('action', old_action);
	form.setAttribute('target', old_target);
	form.setAttribute('method', old_method);
	t_method.value = old_i2methode;
}

function $(obj) {
	if (typeof(obj) != 'object') obj = document.getElementById(obj);
	return obj;
}

function showObj(obj) {
	var obj = $(obj);
	if (obj && obj.style) obj.style.display = '';
}

function hideObj(obj) {
	var obj = $(obj);
	if (obj && obj.style) obj.style.display = 'none';
}

function toggleObj(obj) {
	var obj = $(obj);
	if (obj && obj.style) obj.style.display = obj.style.display == 'none' ? '' : 'none';
}

function getX(obj) {
	var obj = $(obj);
	if (!obj) return 0;
	if (obj.offsetParent) return obj.offsetLeft + getX(obj.offsetParent);
	return obj.offsetLeft;
}

function getY(obj) {
	var obj = $(obj);
	if (!obj) return 0;
	if (obj.offsetParent) return obj.offsetTop + getY(obj.offsetParent);
	return obj.offsetTop;
}

if (!Array.prototype.push) {
	Array.prototype.push = function() {
		var startLength = this.length;
		for (var i = 0; i < arguments.length; i++) this[startLength + i] = arguments[i];
		return this.length;
	}
}

if (!Array.find) {
	Array.find = function(arr, val) {
		for (var i = 0; i < arr.length; i++) {
			if (arr[i] == val) return i;
		}
		return -1;
	}
}

function getSelection() {
	if (window.getSelection) {
		return window.getSelection();
	}
	else if (document.getSelection) {
		return document.getSelection();
	}
	else if (document.selection) {
		return document.selection.createRange().text;
	}
	else return null;
}

if (typeof XMLHttpRequest == 'undefined' && document.all) document.write('<script type="text/javascript" src="/jscripts/iframeajax.js"></script>');

showdiv = showObj;
hidediv = hideObj;

function showselects() {
	if (document.getElementsByTagName("select").length > 0) {
		for (i = 0; i < document.getElementsByTagName("select").length; i++) document.getElementsByTagName("select")[i].style.visibility = 'visible';
	}
}
function hideselects(){
	if (document.getElementsByTagName("select").length > 0) {
		for (i = 0; i < document.getElementsByTagName("select").length; i++) document.getElementsByTagName("select")[i].style.visibility = 'hidden';
	}
}

function openPicWin(pFileName,pWinName,pWidth,pHeight) {
	var isNS = (document.layers) ? true : false;
	if (isNS) pHeight = pHeight + 19;
	eval("allSettings = 'width="+pWidth+",height="+pHeight+",menubar=yes,scrollbars=yes,status=yes,resizable=yes'");
	w=window.open(pFileName,pWinName,allSettings);
	w.window.focus();
}

function hideAllDivs(divname){
	var elements = document.all || document.getElementsByTagName("*");
	for (i = 0; i < elements.length; i++) {
		if (elements[i].getAttribute("id") != null && elements[i].getAttribute("id").substr(0, divname.length) == divname) {
			hidediv(elements[i].getAttribute("id"));
		}
	}
}

function resetComission() {
	var objectElement = document.forms['Warenkorb'].elements['t_baustelle'];
    var commissionElement = document.forms['Warenkorb'].elements['t_kommission'];
    if (objectElement.selectedIndex > 0) commissionElement.selectedIndex=0;
    document.Warenkorb.submit();
}

function resetObject() {
	var objectElement = document.forms['Warenkorb'].elements['t_baustelle'];
    var commissionElement = document.forms['Warenkorb'].elements['t_kommission'];
    if (commissionElement.selectedIndex > 0) objectElement.selectedIndex=0;
    document.Warenkorb.submit();   
}

/******************************************************************************/
/* JS-FORMCHECKER                                                             */
/* ==============                                                             */
/*                                                                            */
/* (C) 2005, Polynorm AG                                                      */
/*                                                                            */
/* Author:   Marcel Tschopp <m.tschopp@phpwheezl.net>                         */
/* Created:  08.08.2005                                                       */
/* Modified: 08.08.2005 - Marcel Tschopp                                      */
/*                                                                            */
/* This script uses the DOM model to set special formchecking related         */
/* attributes to input elements.                                              */
/*                                                                            */
/* Valid attributes are:                                                      */
/* - fc_name     (name of the field, would be displayed in alert box)         */
/* - fc_required ("true"|"false")                                             */
/* - fc_type     ("email", "integer" ,"float", "alpha")                       */
/* - fc_minsize  (any number)                                                 */
/* - fc_maxsize  (any number)                                                 */
/******************************************************************************/

// Language specific texts
// =======================
var txt_title      = 'Folgende Felder wurden nicht korrekt ausgefüllt:\n\n\n';
var txt_max        = '(max. %x Zeichen)';
var txt_min        = '(min. %x Zeichen)';
var txt_numMin     = '(grösser %x)';
var txt_numMax     = '(kleiner %x)';
var txt_notEqual   = '(%first und %second müssen gleich sein)';
var txt_required   = '(*)';
var txt_typ        = [];
txt_typ['email']   = '(inkorrekte E-Mail-Adresse)';
txt_typ['integer'] = '(darf nur aus Zahlen von 0-9 bestehen)';
txt_typ['float']   = '(muss eine korrekte Fliesskommazahl sein)';
txt_typ['alpha']   = '(darf nur aus Buchstaben (A-z) bestehen)';
// set your own texts in html-document AFTER this script is included


// Input types
// ===========
var types = [];
types['email']   = /^[\w-]+?(\.[\w-]+)*@([\w-]+?\.)+([a-z]){2,}$/i;
types['integer'] = /^[0-9]*$/;
types['alpha']   = /^[A-Z]*$/i;
types['float']   = /^[0-9]*([,.][0-9]+)?$/;
// add your own types in html-document AFTER this script is included


// Colors
// ======
var err_color = false;
var ok_color = '#FFFFFF';
// set error color to a color of your choice to mark the inputs with illegal values


// Silent mode
// ===========
var useSilentCheck = false;
var silentCheck = null;


// Should be called whenever a form is submitted
// silent mode: <form onsubmit="checkForm(this, true)">
// normal mode: <form onsubmit="checkForm(this, false)">
function checkForm(theForm, silent) {
	var theForm = $(theForm);
	var ret = true;
	var al = txt_title;
	
	var stack = [];
	
	// get all inputs
	elems = document.getElementsByTagName('input');
	for (var i = 0; i < elems.length; i++) {
		// check if current element is one of the submitted form
		if (elems[i].form != theForm) {
			continue;
		}
		
		switch (elems[i].type.toLowerCase()) {
			case 'submit':
			case 'button':
			case 'hidden':
				break;
			case 'checkbox':
			case 'radio':
				// NOT TESTED!!!
				if (Array.find(stack, elems[i].name)) {
					stack.push(elems[i].name);
					var he = $('fc_' + elems[i].name);
					if (he) {
						var el = theForm.getElementsByName(elems[i].name);
						var ok = false;
						if (he && he.getAttribute('fc_required') == 'true') {
							for (var j = 0; j < el.length; j++) {
								if (el[j].checked) {
									ok = true;
									break;
								}
							}
						} else {
							ok = true;
						}
						
						if (!ok) {
							if (he.getAttribute('fc_markID') && $(he.getAttribute('fc_markID'))) {
								if (err_color) {
									$(he.getAttribute('fc_markID')).style.backgroundColor = err_color;
								}
								al += '- ' + he.getAttribute('fc_name') + ' ' + txt_required + '\n';
								ret = false;
							}
							continue;
						}
						
						if (he.getAttribute('fc_markID') && $(he.getAttribute('fc_markID')) && err_color && ok_color) {
							$(he.getAttribute('fc_markID')).style.backgroundColor = ok_color;
						}
					}
				}
				break;
			default:
				
				// checks for equal values
				if (elems[i].getAttribute('fc_mustEqual') !== null) {
					if (elems[i].value != $(elems[i].getAttribute('fc_mustEqual')).value) {
						if (err_color) {
							elems[i].style.backgroundColor = err_color;
							$(elems[i].getAttribute('fc_mustEqual')).style.backgroundColor = err_color;
						}
						al += '- ' + elems[i].getAttribute('fc_name') + ' ' + txt_notEqual.replace(/%second/, elems[i].getAttribute('fc_name')).replace(/%first/, $(elems[i].getAttribute('fc_mustEqual')).getAttribute('fc_name')) + '\n';
						ret = false;
						continue;
					}
				}
				
				// checks for required element
				if (elems[i].getAttribute('fc_required') == 'true' && elems[i].value == '') {
					if (err_color) {
						elems[i].style.backgroundColor = err_color;
					}
					al += '- ' + elems[i].getAttribute('fc_name') + ' ' + txt_required + '\n';
					ret = false;
					continue;
				}
				
				// dont check anything more if value is empty
				if (elems[i].value != '') {
					// checks for correct element type
					if (elems[i].getAttribute('fc_type') && types[elems[i].getAttribute('fc_type')]) {
						if (elems[i].value.search(types[elems[i].getAttribute('fc_type')]) == -1) {
							if (err_color) {
								elems[i].style.backgroundColor = err_color;
							}
							al += '- ' + elems[i].getAttribute('fc_name') + ' ' + (txt_typ[elems[i].getAttribute('fc_type')] || '') + '\n';
							ret = false;
							continue;
						}
					}
					
					// checks for a given pattern that matches
					if (elems[i].getAttribute('fc_type') == 'pattern' && elems[i].getAttribute('fc_pattern')) {
						if (elems[i].value.search(elems[i].getAttribute('fc_pattern')) == -1) {
							if (err_color) {
								elems[i].style.backgroundColor = err_color;
							}
							al += '- ' + elems[i].getAttribute('fc_name') + ' ' + (txt_typ[elems[i].getAttribute('fc_name')] || '') + '\n';
							ret = false;
							continue;
						}
					}
					
					// checks for min size of elements value
					if (elems[i].getAttribute('fc_minsize')) {
						if (parseInt(elems[i].getAttribute('fc_minsize')) > elems[i].value.length) {
							if (err_color) {
								elems[i].style.backgroundColor = err_color;
							}
							al += '- ' + elems[i].getAttribute('fc_name') + ' ' + txt_min.replace(/%x/, elems[i].getAttribute('fc_minsize')) + '\n';
							ret = false;
							continue;
						}
					}
					
					// checks for max size of elements value
					if (elems[i].getAttribute('fc_maxsize')) {
						if (parseInt(elems[i].getAttribute('fc_maxsize')) < elems[i].value.length) {
							if (err_color) {
								elems[i].style.backgroundColor = err_color;
							}
							al += '- ' + elems[i].getAttribute('fc_name') + ' ' + txt_max.replace(/%x/, elems[i].getAttribute('fc_maxsize')) + '\n';
							ret = false;
							continue;
						}
					}
					
					if (elems[i].getAttribute('fc_type') == 'integer') {
						// checks for maximum of elements value
						if (elems[i].getAttribute('fc_max')) {
							if (parseInt(elems[i].getAttribute('fc_max')) <= parseInt(elems[i].value, 10)) {
								if (err_color) {
									elems[i].style.backgroundColor = err_color;
								}
								al += '- ' + elems[i].getAttribute('fc_name') + ' ' + txt_numMax.replace(/%x/, elems[i].getAttribute('fc_max')) + '\n';
								ret = false;
								continue;
							}
						}
						
						// checks for minimum of elements value
						if (elems[i].getAttribute('fc_min')) {
							if (parseInt(elems[i].getAttribute('fc_min')) >= parseInt(elems[i].value, 10)) {
								if (err_color) {
									elems[i].style.backgroundColor = err_color;
								}
								al += '- ' + elems[i].getAttribute('fc_name') + ' ' + txt_numMin.replace(/%x/, elems[i].getAttribute('fc_min')) + '\n';
								ret = false;
								continue;
							}
						}
					}
				}
				
				// reset element color
				if (err_color && ok_color) {
					if (!elems[i].getAttribute('fc_nocheck') || elems[i].getAttribute('fc_nocheck') != '1') {
						elems[i].style.backgroundColor = ok_color;
					}
				}
				break;
		}
	}
	
	// we have an error. we should only alert it, when we are not in silent mode
	if (!ret && !silent) {
		if (useSilentCheck && theForm.id) {
			// we are not in silent mode, but we should be
			silentCheck = setInterval('checkForm("' + theForm.id + '", true)', 200);
		}
		
		alert(al);
	}
	
	return ret;
}

err_color = '#FFDDDD';
useSilentCheck = true;

var printWindow = document.location.href;
printWindow = printWindow.replace('?', '?t_loc=p&');
if (printWindow.indexOf('t_loc=p') == -1) printWindow = printWindow + '?t_loc=p&';

_ncache = {};
_nto = null;
_sto = null;

function checkValidation(land, fields) {
	if (land.selectedIndex == 0) {
		for (var i = 0, l = fields.length; i < l; i++) {
			if (!$(fields[i]).getAttribute('fc_pattern')) $(fields[i]).setAttribute('fc_pattern', $(fields[i]).getAttribute('x_fc_pattern'));
		}
	} else {
		for (var i = 0, l = fields.length; i < l; i++) {
			if ($(fields[i]).getAttribute('fc_pattern')) {
				$(fields[i]).setAttribute('x_fc_pattern', $(fields[i]).getAttribute('fc_pattern'));
				$(fields[i]).setAttribute('fc_pattern', '');
			}
		}
	}
}

function pingPopupnav() {
	if (_hto) clearTimeout(_hto);
}

function getxmlhttp() {
	var xmlhttp;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	try {
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
	} catch (e) {
		try {
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
		} catch (E) {
			xmlhttp=false
		}
	}
	@else
		xmlhttp=false
	@end @*/
	
	if (!xmlhttp) {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			if (window.ActiveXObject) { // IE
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} else {
				xmlhttp=false;
			}
		}
	}
	
	return xmlhttp;
}

function showPopupnav(el, x, waited) {
	x = x.split('|');
	var kontext = x[0];
	var id = x[1];
	x = x.join('|');
	
	if (_hto) clearTimeout(_hto);
	
	if ($('popupnav').style.display != 'none' && !waited) {
		if (_sto) clearTimeout(_sto);
		_sto = setTimeout(function() {
			showPopupnav(el, x, true);
		}, 100);
		
		return;
	} else if (!waited) {
		if (_sto) clearTimeout(_sto);
		_sto = setTimeout(function() {
			showPopupnav(el, x, true);
		}, 100);
		
		return;
	}
	
	if (_nto) clearTimeout(_nto);
	
	if (!_ncache[x]) {
		var url = '/hidden/dynkatalog/index.html?t_Kontext=' + kontext + '&t_ParentID=' + id;
		var xmlhttp = getxmlhttp();
		if (xmlhttp) {
			xmlhttp.open('GET', url, true);
			xmlhttp.onreadystatechange = function() {
				if (xmlhttp.readyState == 4) _ncache[x] = xmlhttp.responseText;
			}
			xmlhttp.setRequestHeader('Accept', 'message/x-formresult');
			xmlhttp.send(null);
		}
	}
	
	_nto = setTimeout(function() {
		reallyShowPopupnav(el, x);
	}, 300);
}

_rto = null;
function reallyShowPopupnav(el, x) {
	if (_ncache[x]) {
		var popupnav = $('popupnav');
		popupnav.innerHTML = _ncache[x];
		if (_ncache[x].split('float: right;').length > 1) {
			popupnav.style.width = '366px';
		} else {
			popupnav.style.width = '';
		}
		showObj(popupnav);
		var t = getY(el) - $('nf_content').scrollTop - $('left').scrollTop;
		popupnav.style.top = t + 'px';
		if (msie < 7) {
			if ($('nf_fixed').parentNode.offsetWidth < $('nf_fixed').parentNode.scrollWidth) {
				if (t + popupnav.offsetHeight > $('nf_fixed').offsetHeight - 16) {
					popupnav.style.top = $('nf_fixed').offsetHeight - popupnav.offsetHeight - 16 + 'px';
				}
			} else {
				if (t + popupnav.offsetHeight > $('nf_fixed').offsetHeight) {
					popupnav.style.top = $('nf_fixed').offsetHeight - popupnav.offsetHeight + 'px';
				}
			}
		} else {
			if (t + popupnav.offsetHeight > $('nf_fixed').offsetHeight) {
				popupnav.style.top = $('nf_fixed').offsetHeight - popupnav.offsetHeight + 'px';
			}
		}
	} else {
		setTimeout(function() {
			reallyShowPopupnav(el, x);
		}, 50);
	}
}

_hto = null;
function hidePopupnav(el) {
	if (_rto) clearTimeout(_rto);
	if (_nto) clearTimeout(_nto);
	if (_sto) clearTimeout(_sto);
	_hto = setTimeout(function() {
		reallyHidePopupnav(el);
	}, 500);
}

function reallyHidePopupnav(el) {
	if (_hto) clearTimeout(_hto);
	if (_nto) clearTimeout(_hto);
	if (_sto) clearTimeout(_hto);
	if (_rto) clearTimeout(_hto);
	hideObj('popupnav');
}

if (typeof haendler == 'undefined' || !haendler) {
	resetNavHeight = function() {
		try {
			var menuContainer = $('left');
			if (document.all) {
				if (msie < 7) {
					if ($('nf_fixed').parentNode.offsetWidth < $('nf_fixed').parentNode.scrollWidth) {
						menuContainer.style.height = document.documentElement.offsetHeight - 190 + 'px';
					} else {
						menuContainer.style.height = document.documentElement.offsetHeight - 175 + 'px';
					}
				} else {
					if (msie > 7) {
						if ($('nf_fixed').parentNode.offsetWidth < $('nf_fixed').offsetWidth) {
							menuContainer.style.height = document.documentElement.offsetHeight - 190 + 'px';
						} else {
							menuContainer.style.height = document.documentElement.offsetHeight - 175 + 'px';
						}
						$('nf_content').onscroll();
					} else {
						menuContainer.style.height = document.documentElement.offsetHeight - 170 + 'px';
					}
				}
			} else {
				menuContainer.style.height = $('nf_height').offsetHeight + 'px';
			}
		} catch(e) {}
		
		return true;
	}
} else {
	resetNavHeight = function() {
		var menuContainer = $('left');
		if (document.all) {
			if (msie < 7) {
				if ($('nf_fixed').parentNode.offsetWidth < $('nf_fixed').parentNode.scrollWidth) {
					menuContainer.style.height = document.documentElement.offsetHeight - 80 + 'px';
				} else {
					menuContainer.style.height = document.documentElement.offsetHeight - 65 + 'px';
				}
			} else {
				if (msie > 7) {
					if ($('nf_fixed').parentNode.offsetWidth < $('nf_fixed').offsetWidth) {
						menuContainer.style.height = document.documentElement.offsetHeight - 80 + 'px';
					} else {
						menuContainer.style.height = document.documentElement.offsetHeight - 65 + 'px';
					}
				} else {
					menuContainer.style.height = document.documentElement.offsetHeight - 60 + 'px';
				}
			}
		} else {
			menuContainer.style.height = $('nf_height').offsetHeight + 'px';
		}
		
		return true;
	}
}

var msie = 0;
var scrollto = null;

function initPage() {
	setFocus();
	
	var d_nf_content = $('nf_content');
	var d_se_parent = $('schnellerfassungbox').parentNode;
	var d_left = $('left');
	var d_right = $('right');
	
	if (navigator.userAgent.toLowerCase().match(/msie (\d+)/)) {
		msie = parseInt(navigator.userAgent.toLowerCase().match(/msie (\d+)/)[1]);
	}
	
	if (!document.all || msie > 7) {
		d_nf_content.onscroll = function() {
			if (scrollto) clearTimeout(scrollto);
			scrollto = setTimeout(function() {
				d_left.style.top = d_right.style.top = d_nf_content.scrollTop + 'px';
			}, 200);
		}
	} else {
		if (msie < 7) {
			$('nf_content').style.overflowY = 'auto';
			$('nf_content').style.overflowX = 'hidden';
			$('nf_fixed').style.display = 'none';
			$('nf_fixed').style.display = 'block';
			resetNavHeight();
		}
	}
	
	d_se_parent.appendChild($('schnellerfassungbox'));
	if ($('staffelung')) d_se_parent.appendChild($('staffelung'));
	if ($('WKAdded')) d_se_parent.appendChild($('WKAdded'));
	if ($('searchbox')) d_se_parent.appendChild($('searchbox'));
	if ($('csvexport')) d_se_parent.appendChild($('csvexport'));
	if ($('staffelung')) d_se_parent.appendChild($('staffelung'));
	if ($('csvexport2')) d_se_parent.appendChild($('csvexport2'));
	if ($('Empfehlen')) d_se_parent.appendChild($('Empfehlen'));
	if (typeof haendler != 'undefined' && haendler) {
		$('schnellerfassungbox').style.top = $('searchboxheader').style.display == 'none' ? '169px' : '191px';
		if ($('searchbox')) $('searchbox').style.top = '93px';
	} else {
		$('schnellerfassungbox').style.top = $('searchboxheader').style.display == 'none' ? '203px' : '226px';
		if ($('searchbox')) $('searchbox').style.top = '203px';
	}
	
	resetNavHeight();
}

window.onresize = resetNavHeight;

function getMenuData() {
	if (parent.menu2) return [parent.menu1,parent.menu2,parent.menu3];
}

function showSelects() {
	var sel = document.getElementsByTagName('select');
	for (var i = 0; i < sel.length; i++) sel[i].style.visibility = 'visible';
}

function hideSelects(id) {
	var sel = document.getElementsByTagName('select');
	var div = $(id);
	var d_l = getX(div);
	var d_t = getY(div);
	var d_r = d_l + div.offsetWidth;
	var d_b = d_t + div.offsetHeight;
	
	for (var i = 0; i < sel.length; i++) {
		var found = false;
		var pnode = sel[i];
		while (pnode.parentNode) {
			if (pnode.parentNode.id && pnode.parentNode.id == id) {
				found = true;
				break;
			}
			pnode = pnode.parentNode;
		}
		
		if (found) continue;
		var l = getX(sel[i]);
		var t = getY(sel[i]);
		var r = l + sel[i].offsetWidth;
		var b = t + sel[i].offsetHeight;
		
		if ((l >= d_l && l <= d_r) || (r >= d_l && r <= d_r) || (l <= d_l && r >= d_r)) {
			if ((t >= d_t && t <= d_b) || (b >= d_t && b <= d_b) || (t <= d_t && b >= d_b)) {
				sel[i].style.visibility = 'hidden';
			}
		}
	}
}

function toggleDiv(id) {
	if ($(id).style.display == 'none') {
		showSelects();
		if ($('searchbox') && $('searchboxheader')) {
			hideObj('searchbox');
			hideObj('searchboxheaderout');
			showObj('searchboxheader');
		}
		
		hideObj('schnellerfassungbox');
		hideObj('schnellerfassungboxheaderout');
		showObj('schnellerfassungboxheader');
		
		setTimeout(function() {
			showObj(id);
			showObj(id + 'headerout');
			hideObj(id + 'header');
			hideSelects(id);
		}, 200);
	} else {
		hideObj(id);
		hideObj(id + 'headerout');
		showObj(id + 'header');
		showSelects();
	}
}

function releaseUserInfo() {
	var url = '/hidden/xmlproduktevergleich/index.html?i2cms_i2connect=i2c_benutzer.i2connect(Method,releaseUserInfo,)';
	var xmlhttp = getxmlhttp();
	if (xmlhttp) {
		xmlhttp.open('GET', url, true);
		xmlhttp.setRequestHeader('Accept', 'message/x-formresult');
		xmlhttp.send(null);
	} 
}

function updatePos(mengefeld ) {
	if (mengefeld.value.length < 1 || mengefeld.value == '0' ) mengefeld.value = '1';
}
	
function showStaffeln(artNr) {
	el = $('staffelungContent');
	al = $('staffelungHeader');
	var staffeln = getStaffel(artNr);
	el.innerHTML = staffeln;
	al.innerHTML = al.innerHTML + " " + artNr;
	showObj('staffelung');
}	

function showStaffelnMitHeader(artNr, windowTitle) {
	el = $('staffelungContent');
	al = $('staffelungHeader');
	var staffeln = getStaffel(artNr);
	el.innerHTML = staffeln;
	al.innerHTML = windowTitle + " - " + artNr;
	showObj('staffelung');
}