// autosuggest.js: Suggestion dropdown box for HTML.
// Copyright exorbyte GmbH, 2005, 2006. All rights reserved.
// Author: Leo Meyer, leo.meyer_at_exorbyte.com
// Version: 2.2, 20.3.2006
//
// Usage: see demo.
//
// Veraenderungen an disem Code sind nur mit ausdruecklicher Zustimmung der 
// exorbyte GmbH gestattet.
// Modification of this code only with explicit permission by exorbyte GmbH.

var exLogo = "exlogo_tiny.gif";
var refcnt = 0;
var inputs = new Array();
var firefox = navigator.userAgent.search(/firefox/i) > 0;
var ie = navigator.userAgent.search(/MSIE/i) > 0;
var flashtime = 50; 	// ms
var debug = false;
var qtime = 0;
// bit flags
var AS_NOLOGO = 1;		// don't display exorbyte logo - only for licensed users
var AS_NOCOMMIT = 2;	// don't do a form commit on return while the suggest box is open
var AS_TABSELECTS = 4;	// jumping out with TAB uses the selected entry
var AS_DISPLAY_INPUT = 8;	// adds a header row containing the user's input
var fsel = false;

/** Parameter container for flexible parameter handling */
function SuggestParams() {
	this.requestURL = "";				// URL for the server side part
	this.headerFunction = null;			// custom function(parent, rowArray) returns header HTML for a set of rows. Parent is the parent DIV element to be filled
	this.rowFunction = null;			// custom function(rowArray, field_index, i) returns HTML. field_index is an array that contains the indexes of field names
	this.onActivate = null;				// custom function(input, rowArray, i) that is activated onClick or on enter key
	this.searchDelay = 250;				// ms until search is started
	this.width = -1;					// if -1, width is calculated automatically; can be set in the setup function
	this.normalfg = "black";			// default normal foreground
	this.normalbg = "white";			// default normal background
	this.highlightfg = "#078DFF";			// default highlighted foreground
	this.highlightbg = "navy";			// default highlighted background
	this.flags = 0;						// a combination of the AS_ flags
	this.debug = false;					// enables component-specific debugging
	this.overlappedSelects = null;		// Array of SELECT combobox objects that may be hidden by the dropdown (IE display bug workaround)
	this.align = "left";				// default: left alignment
	this.document = window.document;	// target document object, default: current document
	this.top = -1;						// fixed absolute top position (-1: dynamic)
	this.left = -1;						// fixed absolute left position (-1: dynamic)
	this.inputTitle	= "Ihre Eingabe";	// text that is displayed with the input if AS_DISPLAY_INPUT is set
        this.searchType ="";
	this.preFunction = null;			// preprocessing function(target, rows) returns rowArray
        
}

function doBlur(event) {
	if (!event && window.event) {
		event = window.event;
	}
	// hide suggestion boxes
	for (var i = 0; i < inputs.length; i++) {
		hideSuggBox(inputs[i]);
	}
	target = (typeof(event.srcElement) == "undefined" ? event.target : event.srcElement);
	// target lost focus
	target.lostFocus = true;
}
function doFocus(event) {
	if (!event && window.event) {
		event = window.event;
	}
	target = (typeof(event.srcElement) == "undefined" ? event.target : event.srcElement);
	// target has focus
	target.lostFocus = false;
}

function checkKey(event, target) {
	if (event.ctrlKey && event.altKey && (event.keyCode == 120)) {
		target.dynamicNotification = !target.dynamicNotification;
		return true;
	}
	if (event.ctrlKey && event.altKey && (event.keyCode == 119)) {
		doSearch(target.targetIndex, true);
		return true;
	}
	if (event.ctrlKey && event.altKey && (event.keyCode == 118)) {
		debug = true;
		return true;
	}	
	return false;
}

function cancelEvent(event) {
	event.cancelBubble = true;
	event.returnValue = false;
	event.cancel = true;
	return false;
}

function doFieldKeyDown(event) {
	if (!event && window.event) {
		event = window.event;
	}
	target = (typeof(event.srcElement) == "undefined" ? event.target : event.srcElement);
//	alert(event.keyCode);
	if (!target.xmlhttp) return;
	switch (event.keyCode) {
		case 40: {
			// down
			if (!target.suggVisible) {
				fsel = true;
				callSearch(target, 10);
			} else
				if (target.suggCount > 0) {
					if (target.lastHighlightedId < target.suggCount - 1) {
						selectRow(target, target.lastHighlightedId + 1);
						showSuggBox(target);
					}
					return cancelEvent(event);
				}
		}
		case 38: {
			// up
			if (target.suggCount > 0) {
				if (target.lastHighlightedId > 0) {
					selectRow(target, target.lastHighlightedId - 1);
					showSuggBox(target);
				}
				return cancelEvent(event);
			}
		}
		case 33: {
			// PgUp
			if (target.suggVisible && (target.suggCount > 0)) {
				selectRow(target, 0);
				return cancelEvent(event);

			}
		}
		case 34: {
			// PgDn
			if (target.suggVisible && (target.suggCount > 0)) {
				selectRow(target, target.suggCount - 1);
				return cancelEvent(event);
			}
		}
		case 35: {
			// End
			if (target.suggVisible && (target.suggCount > 0)) {
				selectRow(target, target.suggCount - 1);
				// don't cancel event				
				return true;
			}
		}
		case 36: {
			// Home
			if (target.suggVisible && (target.suggCount > 0)) {
				selectRow(target, 0);
				// don't cancel event				
				return true;
			}
		}
		case 13: {
			// Enter
			if (target.suggVisible && (target.lastHighlightedId >= 0)) {
				hideSuggBox(target);
				var row = target.parameters.document.getElementById("suggRow" + target.refcnt + "_" + target.lastHighlightedId);
				if (row) {
					var fx = row.onmousedown;
					fx();
				}
				return cancelEvent(event);
			}
		}
		case 9: {
			// TAB
//			alert(target.suggVisible + " " + target.lastHighlightedId + " " + target.parameters.flags);
			if (target.suggVisible && (target.lastHighlightedId >= 0) && (target.parameters.flags && AS_TABSELECTS == AS_TABSELECTS)) {
//				alert("Tab");
				hideSuggBox(target);
				var row = target.parameters.document.getElementById("suggRow" + target.refcnt + "_" + target.lastHighlightedId);
				if (row) {
					var fx = row.onmousedown;
					if (!fx()) return cancelEvent(event);
				}
				return true;
			}
		}
		case 27: {
			// Escape
			if (target.suggVisible) {
				selectRow(target, -1);
				hideSuggBox(target);
				return cancelEvent(event);
			}
		}
	}
	if (checkKey(event, target)) return false;
	if ((event.keyCode == 8) || (event.keyCode == 32) || (event.keyCode >= 46)) {
		callSearch(target, target.parameters.searchDelay);
	}
}

function getXMLHTTP() {
  var result = false;
  if(typeof XMLHttpRequest != "undefined") {
    result = new XMLHttpRequest();
  } else {
	try {
		result = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			result = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (ie) {}
	}
  }
  return result;
}

function getParentProps(elem, prop) {
	// returns the sum of the property "prop" along the offsetParent row of elem
	var result = 0;
	while (elem != null) {
		result += elem[prop];
		elem = elem.offsetParent;
	}
	return result;
}

function selectRow(target, row) {
	var rowDiv;
	if (target.lastHighlightedId > -1) {
		rowDiv = target.parameters.document.getElementById("suggRow" + target.refcnt + "_" + target.lastHighlightedId);
		if (rowDiv) {
			rowDiv.style.backgroundColor = rowDiv.oldBackgroundColor;
			rowDiv.style.color = rowDiv.oldColor;
			var children = rowDiv.childNodes;
			for (i = 0; i < children.length; i++) {
				children[i].style.backgroundColor = children[i].oldBackgroundColor;
				children[i].style.color = children[i].oldColor;
			}
		}
	}		
	target.lastHighlightedId = row;
	rowDiv = target.parameters.document.getElementById("suggRow" + target.refcnt + "_" + target.lastHighlightedId);
	if (rowDiv) {
		if (rowDiv.oldBackgroundColor != rowDiv.style.backgroundColor)
			rowDiv.oldBackgroundColor = rowDiv.style.backgroundColor;
		if (rowDiv.oldColor != rowDiv.style.color)
			rowDiv.oldColor = rowDiv.style.color;
		if (target.parameters.highlightbg != '')
			rowDiv.style.backgroundColor = target.parameters.highlightbg;
		if (target.parameters.highlightfg != '')
			rowDiv.style.color = target.parameters.highlightfg;
		var children = rowDiv.childNodes;
		for (i = 0; i < children.length; i++) {
			if (children[i].oldBackgroundColor != children[i].style.backgroundColor)
				children[i].oldBackgroundColor = children[i].style.backgroundColor;
			if (children[i].oldColor != children[i].style.color)
				children[i].oldColor = children[i].style.color;
			if (target.parameters.highlightbg != '')
				children[i].style.backgroundColor = target.parameters.highlightbg;
			if (target.parameters.highlightfg != '')
				children[i].style.color = target.parameters.highlightfg;
		}
	}
}

function mouseEnter(target_id, id) {
	var target = inputs[target_id];
	selectRow(target, id);
}

function submitString(target, string) {
	target.value = string;
	if ((target.form.action != "") && !(target.parameters.flags && AS_NOCOMMIT == AS_NOCOMMIT))
		target.form.submit();
}

function setDivSize(target) {
	if (target.suggBox) {
		var x,y;
		if (self.innerHeight) {
			x = self.innerWidth;
			y = self.innerHeight;
		}else if (target.parameters.document.documentElement && target.parameters.document.documentElement.clientHeight) {
			x = target.parameters.document.documentElement.clientWidth;
			y = target.parameters.document.documentElement.clientHeight;
		} else if (target.parameters.document.body) {
			x = target.parameters.document.body.clientWidth;
			y = target.parameters.document.body.clientHeight;
		}
		if (target.parameters.top < 0)
			target.suggBox.style.top = 
				getParentProps(target, "offsetTop") + target.offsetHeight + "px";
		else 
			target.suggBox.style.top = target.parameters.top + "px";
		var w = (target.parameters.width < 0 ? target.offsetWidth : target.parameters.width);
		target.suggBox.style.width = w + "px";
		var l = 0;
		if (target.parameters.align == "right")
			l = getParentProps(target, "offsetLeft") - w + target.offsetWidth;
		else 
			l = getParentProps(target, "offsetLeft");
		if (l + w > x) l = x - w;
		if (l < 0) l = 0;
		if (target.parameters.top < 0)
			target.suggBox.style.left = l + "px";
		else 
			target.suggBox.style.left = target.parameters.left + "px";			
	}
}

function unflash(target_id, oCol, nCol, count) {
	var target = inputs[target_id];
	target.style.backgroundColor = oCol;
	count--;
	if (count > 0) {
		setTimeout("flash(" + target_id + ", \"" + nCol + "\", " + count + ");", flashtime);
	}
}
function flash(target_id, nCol, count) {
	var target = inputs[target_id];
	var oCol = target.style.backgroundColor;
	target.style.backgroundColor = nCol;
	var cmd = "unflash(" + target_id + ", \"" + oCol + "\", \"" + nCol + "\", " + count + ");";
	setTimeout(cmd, flashtime);
}

function replaceHTMLEntities(str) {
	var result = str.replace(/&/g, "&amp;");	
	result = result.replace(/</g, "&lt;");	
	result = result.replace(/>/g, "&gt;");
        result = str;
        return result;
}

function redirectClick(target_id, row) {
	var target = inputs[target_id];
	if ((typeof target.parameters.onActivate != "undefined") && (target.parameters.onActivate != null) && (target.parameters.onActivate != "")) {
		target.parameters.onActivate(target, target.rows, row);
	} else {
		submitString(target, target.rows[row][0]);
	}
}

function fillDiv(target, fieldnames, rows) {
	// remove previous elements
	while (target.suggBox.hasChildNodes()) {
		target.suggBox.removeChild(target.suggBox.firstChild);
	}
	var localize = (fieldnames.length != 2) || (fieldnames[0] != "Name") || (fieldnames[1] != "Key");

	if (localize && (typeof target.parameters.headerFunction != "undefined") && (target.parameters.headerFunction != null) && (target.parameters.headerFunction != "")) {
		var iDiv = target.parameters.document.createElement("div");
		var ih = target.parameters.headerFunction(iDiv, rows);
		iDiv.innerHTML = ih;
		target.suggBox.appendChild(iDiv);
	}
	if (localize && (typeof target.parameters.rowFunction != "undefined") && (target.parameters.rowFunction != null) && (target.parameters.rowFunction != "")) {
		// prepare field names array
		var field_index = new Array();
		for (j = 0; j < fieldnames.length; j++) {
			field_index[fieldnames[j]] = j;

		}
	}
	for (i = 0; i < rows.length; i++) {

		var iDiv = target.parameters.document.createElement("div");
// Ian Hudson 07-02-07


if ( target.parameters.searchType == "what" )
{
    if (rows[i][3] == 0 ||rows[i][3] == 1 || rows[i][3] == 2 ||rows[i][3] == 3 || rows[i][3] == 4 )
    { 		
               iDiv.onmouseover = new Function("", "mouseEnter(" + target.refcnt + "," + i + ")");
		var fstr = "redirectClick(" + target.refcnt + ", '" + i + "')";
                iDiv.onmousedown = new Function("", fstr);
                iDiv.id = "suggRow"  + target.refcnt + "_" + i;
		iDiv.className = "suggRow";
		iDiv.style.cursor = "pointer";
    }
}else
{		


		iDiv.onmouseover = new Function("", "mouseEnter(" + target.refcnt + "," + i + ")");
		var fstr = "redirectClick(" + target.refcnt + ", '" + i + "')";
		iDiv.onmousedown = new Function("", fstr);
		iDiv.id = "suggRow"  + target.refcnt + "_" + i;
		iDiv.className = "suggRow";
		iDiv.style.cursor = "pointer";
}

//End Ian Hudson 07-02-07		




		if (localize && (typeof target.parameters.rowFunction != "undefined") && (target.parameters.rowFunction != null) && (target.parameters.rowFunction != "")) {
			
                var ih = target.parameters.rowFunction(rows, field_index, i, iDiv);
                
		} else {

			if (rows[i].length > 1)
				var ih = "<div class='suggItem'><span class='suggProduct'><nobr>" + replaceHTMLEntities(rows[i][0]) + "&nbsp;&nbsp;</nobr></span><span class='suggCat'><nobr>" + replaceHTMLEntities(rows[i][1]) + "</nobr></span></div>";
			else
				var ih = "<div class='suggItem'><span class='suggProduct'><nobr>" + replaceHTMLEntities(rows[i][0]) + "&nbsp;&nbsp;</nobr></span></div>";
		}
		iDiv.innerHTML = ih;
		target.suggBox.appendChild(iDiv);
	}
	// Following code may only be removed or modified if contract regulations permit
	// Der folgende Code darf nur entfernt oder veraendert werden, falls die Vertragsbedingungen es gestatten
	if ((target.parameters.flags && AS_NOLOGO) == 0) {
		var eDiv = target.parameters.document.createElement("div");
		eDiv.style.cursor = "pointer";
		eDiv.onmousedown = new Function("", "window.location.href = 'http://www.exorbyte.de';");
		eDiv.innerHTML = "<div align=right style='padding: 0; margin: 0; border-top:thin solid gray; vertical-align: middle;'><nobr><font size=1 style='font-family: Verdana, Arial, Helvetica, Sans-Serif; vertical-align: middle;'>Powered by <img src='" + exLogo + "' style='padding: 0; margin: 0; vertical-align: middle;' align='texttop' alt='www.exorbyte.de'></font></nobr></div>";
		target.suggBox.appendChild(eDiv);
	}
	// Der vorstehende Code darf nur entfernt oder veraendert werden, falls die Vertragsbedingungen es gestatten
	// Previous code may only be removed or modified if contract regulations permit
	
	if (fsel)
		selectRow(target, 0);
	else {
		target.lastHighlightedId = -1;
		fsel = false;
	}
}

function deliver(target_id, fieldnames, rows) {
	var target = inputs[target_id];
	if (target.dynamicNotification)
		window.status = "Received data after " + (new Date().getTime() - qtime) + " ms";
	// lost focus in the mean time?
	if (target.lostFocus) {
		hideSuggBox(target);
		return;
	}
	// no results?
	if (rows.length == 0) {
		hideSuggBox(target);
		if (target.dynamicNotification)
			flash(target.targetIndex, "gray", 3);		
		return;
	}
	// preprocessing?
	if ((typeof target.parameters.preFunction != "undefined") && (target.parameters.preFunction != null) && (target.parameters.preFunction != "")) {
		rows = target.parameters.preFunction(target, rows);
	}	
	// check for new values
	var identical = (target.rows) && (target.rows.length == rows.length);
	if (identical) 
		for (var i = 0; i < rows.length; i++) {
			if (rows[i].length != target.rows[i].length)
				identical = false;
			if (!identical) break;
			for (var j = 0; j < rows[i].length; j++) 
				if (rows[i][j] != target.rows[i][j]) {
					identical = false;
					break;
				}
		}
	var insert_input = (target.parameters.flags && AS_DISPLAY_INPUT) == AS_DISPLAY_INPUT;

	if (!identical || insert_input) {

		if (insert_input) {
    if (target.parameters.searchType == "where")
    {
  //Ian Hudson 07-02-07

 //       rows.unshift(new Array(target.value,target.parameters.inputTitle));
    }else{
 //     rows.unshift(new Array(target.value,"", target.parameters.inputTitle)); 
         }		
}



		
    if ( target.parameters.searchType == "what" ) {
    var tempArray = new Array();

    if (rows[0][3] == 2 || rows[0][3] == 0 )
    {
        tempArray.unshift(new Array("Product or Service","","","5","",""));
        for ( i =0; i < rows.length; i++)
        {
            if (rows[i][3] == 2 || rows[i][3] == 0)
            {
                tempArray.push(rows[i]);
            }
        } 
    }

    var companyTest = "False";
    for ( i =0; i < rows.length; i++)
    {

        if ( rows[i][3] == 3 )
        {
            companyTest = "True";
        }
    }   

 if (companyTest == "True")
    {
    
 tempArray.push(new Array("Business","","","6","",""));
    for ( i =0; i < rows.length; i++)
        {
            if (rows[i][3] == 3 )
            {
                tempArray.push(rows[i]);
            }
        } 

    }
    
    var rows = new Array();
    for ( i = 0; i < tempArray.length; i++ )
    {
        rows[i] = tempArray[i];
    }

 }

//End Ian Hudson 07-02-07		

		target.rows = rows;
		target.suggCount = rows.length;
		fillDiv(target, fieldnames, rows);
	}

	showSuggBox(target);
}

function callSearch(target, delay) {
	// target has focus
	target.lostFocus = false;
	if (target.timeout != 0)
		window.clearTimeout(target.timeout);
	target.timeout = setTimeout("doSearch(" + target.refcnt + ")", delay);
}

function doSearch(target_id, direct) {
	var target = inputs[target_id];
	target.timeout = 0;
	// lost focus in the mean time?
	if (target.lostFocus) {
		return;
	}
	if (target.value.length < 2) {
		hideSuggBox(target);
		return;
	}
	if (!target.xmlhttp) return;
	// search running right now?
	if (target.xmlhttp.readyState != 0) {
		// cancel current search
		target.xmlhttp.abort();
	}
	var url = target.parameters.requestURL;
	var v = target.value;
	// replace url parameters
	var turl = "";
	var inPar = false;
	var par = "";
	for (var i = 0; i < url.length; i++) {
		// in parameter?
		if (inPar) {
			// end of parameter?
			if (url.charAt(i) == '$') {
				// lookahead = 1
				if ((i < url.length - 1) && (url.charAt(i + 1) == '$')) {
					i++;
					turl += '$';
				} else {
					// evaluate parameter
					if (par != "") {
						// use input value?
						if (par == 'v') {
							turl += escape(v)
							inPar = false;
						} else {
							// evaluate parameter
							var pv = escape(eval(par));
							turl += pv;
							inPar = false;
						}
					}
				}
			} else
				// still in parameter
				par += url.charAt(i);
		} else 
		// out of parameter
		if (url.charAt(i) == '$') {
			// lookahead = 1
			if ((i < url.length - 1) && (url.charAt(i + 1) == '$')) {
				i++;
				turl += '$';
			} else {
				// start parameter
				par = "";
				inPar = true;
			}
		} else
			turl += url.charAt(i);
	}
	url = turl + escape(v) + "&target_id=" + target_id + "&ua=" + escape(navigator.userAgent);
	if (debug)
		url += "&db";
	if (direct) {
		target.parameters.document.location.href = url;
	} else {
		url += "&xmlhttp=true";
	//	target.xmlhttp.setRequestHeader("USER_AGENT", navigator.userAgent);
		
		target.xmlhttp.open("GET", url, true);
		target.xmlhttp.onreadystatechange = target.async_fn;
		if (target.parameters.debug) {
			alert("Sending request: " + url);
		}
	    target.xmlhttp.send(null);
		qtime = new Date().getTime();
	 }
}

function notifyError(target) {
	if (target.dynamicNotification) {
		flash(target.targetIndex, "red", 3);
	}
}

/** Returns true if setup is successful */
function SetupAutoSuggest(input, args) {
	try {
		// create parameter container
		input.parameters = new SuggestParams();
		for (var i in args) {

			if (typeof input.parameters[i] != "undefined") {
				input.parameters[i] = args[i];
			} else {
				// parameter specification error
				alert("SetupAutoSuggest parameter undefined: " + i + "=" + args[i]);
			}	
		}
		input.suggBox = null;			// suggestion box (DIV)
		input.suggVisible = false;
		input.xmlhttp = null;
		input.lastHighlightedId = -1;
		input.suggCount = -1;
		input.callcounter = 0;
		input.dynamicNotification = false;
		input.timeout = 0;	
		
		input.xmlhttp = getXMLHTTP();
		if (!input.xmlhttp) {
			return false;
		}
	
		// setup input field	
		input.autocomplete = "off";
		input.setAttribute("autocomplete", "off");
		input.onblur = doBlur;
		input.onfocus = doFocus;
		input.onkeydown = doFieldKeyDown;
//		input.onmousedown = doBlur;
	
		// remember input field
		inputs.push(input);
		input.targetIndex = inputs.length - 1;
		// setup state change fn
		var fn_code = "" +
			"var target = inputs[" + refcnt + "];" +
			"if (target.xmlhttp.readyState == 4 && target.xmlhttp.responseText) {" + 
			" if (target.xmlhttp.responseText.charAt(0) == \"<\") {" +
			"		if (target.parameters.debug) {" +
			"			alert(\"Error: Received XML reply\"); " +
			"	    }" +
			" } else {" +
			"   try {" +
			"		if (!debug && target.parameters.debug) {" +
			"			alert(\"Received response!\"); " +
			"	    }" +
			"   	if (debug) { alert(target.xmlhttp.responseText); debug = false; }" +
			"  	eval(target.xmlhttp.responseText);" +
			"  } catch (e) {" +
			"  }" +
			"  	var txt = target.xmlhttp.responseText.replace(/\'/g, \"\\\\'\");" +
			"  	try {" +
			"  		eval(txt);" +
			"  	} catch (ie) {" +
			"		if (target.parameters.debug) {" +
			"			alert('Error executing the response: ' + ie + '\\nThe response text was:\\n' + txt); " +
			"	    }" +
			"		notifyError(target);" +
			"  		hideSuggBox(target);" +
			"	}" +
			"  }" +
			" }" ;
		input.async_fn = new Function("", fn_code);
		input.xmlhttp.onreadystatechange = input.async_fn;
	
		// create visual element
		input.suggBox = input.parameters.document.createElement("div");
		input.suggBox.className = "suggBox";
		input.suggBox.name = "suggBox" + refcnt;
		input.suggBox.id = "suggBox" + refcnt;
		input.refcnt = refcnt;
		refcnt++;
		setDivSize(input);
	
		input.parameters.document.body.appendChild(input.suggBox);
		window.onresize = setDivSizes;
		if (input.parameters.debug) {
			alert("Setup successful for component " + input.name);
		}
		
		return true;
		
	} catch (e) {
		alert(e.message);
		return false;
	}
}


function showSuggBox(target) {
	target.parameters.document.getElementById("suggBox" + target.refcnt).style.visibility = "visible";
	target.suggVisible = true;
	if ((target.parameters.overlappedSelects != null) && ie) {
		for (var i = 0; i < target.parameters.overlappedSelects.length; i++) {
			if (target.parameters.overlappedSelects[i])
				target.parameters.overlappedSelects[i].style.visibility = "hidden";
		}
	}
}

function hideSuggBox(target) {
	target.parameters.document.getElementById("suggBox" + target.refcnt).style.visibility = "hidden";
	target.suggVisible = false;
	if ((target.parameters.overlappedSelects != null) && ie) {
		for (var i = 0; i < target.parameters.overlappedSelects.length; i++)
			if (target.parameters.overlappedSelects[i])
				target.parameters.overlappedSelects[i].style.visibility = "visible";
	}
}

function setDivSizes() {
	for (i = 0; i < inputs.length; i++) {
		setDivSize(inputs[i]);
	}
}
