	function filterHelper(control) {
    
		if ( document.filter_form.Modell_1.options[document.filter_form.Modell_1.selectedIndex].text != '' && isNaN(control) ) {
			document.filter_form.Modell_3.value = document.filter_form.Modell_1.options[document.filter_form.Modell_1.selectedIndex].text;
			document.filter_form.Fgst_3.value = '';
			document.filter_form.Optcode_3.value = '';
		} else if ( document.filter_form.Modell_1.options[document.filter_form.Modell_1.selectedIndex].text != '' && document.getElementsByName("Modell_2")[0].value != '' ) {
		  //Wert wird durch searchHelper() schon eingetragen
    } else if ( document.filter_form.Modell_1.options[document.filter_form.Modell_1.selectedIndex].text == '' && isNaN(document.getElementsByName("Modell_2")[0]) && isNaN(control) ) {
			document.filter_form.Modell_3.value = '';
		}
		if ( isNaN(document.getElementsByName("Fgst_1")[0]) && isNaN(control) ) {
			document.filter_form.Fgst_3.value = '';
    } else if ( document.getElementsByName("Fgst_1")[0].value == '' ) {
			document.filter_form.Fgst_3.value = '';
		}
		if ( isNaN(document.getElementsByName("Optcode_1")[0]) && isNaN(control) ) {
			document.filter_form.Optcode_3.value = '';
		} else if ( document.getElementsByName("Optcode_1")[0].value == '' ) {
			document.filter_form.Optcode_3.value = '';
		}
	}
	
	function searchHelper() {	
		var reg = /\*/;
		
		document.filter_form.Modell_3.value = '*' + document.getElementsByName("Modell_2")[0].value + '*';
		document.filter_form.Fgst_3.value = '*' + document.getElementsByName("Fgst_1")[0].value;
		document.filter_form.Optcode_3.value = '*' + document.getElementsByName("Optcode_1")[0].value + '*';
		
		while ( reg.test(document.filter_form.Modell_3.value) == true ) {
			document.filter_form.Modell_3.value = document.filter_form.Modell_3.value.replace(/\*/, '%');
		}
		
		while ( reg.test(document.filter_form.Fgst_3.value) == true ) {
			document.filter_form.Fgst_3.value = document.filter_form.Fgst_3.value.replace(/\*/, '%');
		}
		
		while ( reg.test(document.filter_form.Optcode_3.value) == true ) {
			document.filter_form.Optcode_3.value = document.filter_form.Optcode_3.value.replace(/\*/, '%');
		}
	}

	function Semaphor(i) {
		sem = window.open("semaphor.php", "Semaphor");
	    sem.focus;
	}

	function table_resize(){
		if(document.getElementsByName('datefrom')[0]){
			if(document.getElementsByName('datefrom')[0].value != '' && document.getElementsByName('dateuntil')[0].value != ''){
				var field1_exp = document.getElementsByName('datefrom')[0].value.split("-");
				var field2_exp = document.getElementsByName('dateuntil')[0].value.split("-");
				if(field1_exp.length == 3)
					document.getElementsByName('datefrom')[0].value = field1_exp[2]+"."+field1_exp[1]+"."+field1_exp[0];
				if(field2_exp.length == 3)
					document.getElementsByName('dateuntil')[0].value = field2_exp[2]+"."+field2_exp[1]+"."+field2_exp[0];
			}
		}


		if(document.all['report_content_header_table'] && document.all['report_content_table_table']){
			window.status = "Die Darstellung der Tabelle ist von der Auflösung Ihres Desktops abhängig.";
/*			document.all['report_content'].style.height = document.all['report_content'].offsetHeight;
			document.all['report_content_table'].style.width = document.all['report_content'].offsetWidth;
			document.all['report_content_header'].style.width = document.all['report_content'].offsetWidth;
			document.all['report_content_header_table'].style.width = "100%";
			document.all['report_content_table_table'].style.width = "100%";
			alert(document.all['report_content_header_table'].getElementsByTagName("tr")[0].getElementsByTagName("td").length + ' - ' + document.all['report_content_table_table'].getElementsByTagName("tr")[0].getElementsByTagName("td").length);
			if(document.all['report_content_header_table'].getElementsByTagName("tr")[0].getElementsByTagName("td").length == document.all['report_content_table_table'].getElementsByTagName("tr")[0].getElementsByTagName("td").length){
*/


/*				for(i=0; i < document.all['report_content_header_table'].getElementsByTagName("tr")[0].getElementsByTagName("td").length; i++){
					if(document.all['report_content_header_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].offsetWidth < document.all['report_content_table_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].offsetWidth){
						document.all['report_content_table_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].style.width = document.all['report_content_table_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].offsetWidth
						document.all['report_content_header_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].style.width = document.all['report_content_table_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].offsetWidth;
					}else{
						document.all['report_content_header_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].style.width = document.all['report_content_header_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].offsetWidth;
						document.all['report_content_table_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].style.width = document.all['report_content_header_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].offsetWidth;
					}alert("stop");

				}
*/
				document.all['report_content_table'].style.height = (document.all['report_content'].offsetHeight - document.all['report_content_header'].offsetHeight) - 10;
				document.all['report_content_table'].style.top = document.all['report_content_header'].offsetHeight + 5;

/*			}else{
				alert("Auf dieser Seite wurde ein Fehler in der grafischen Darstellung festgestellt der nicht behoben werden konnte. Bitte wenden Sie sich an den Systemadministrator.");
			}
*/
		}
	}

    //Alte Funktion für die Bearbeiten Seite NICHT LÖSCHEN (wird noch benötigt für WV Feld)
	function dateFormatEdit()
	{
		var elementValue = new Array;
		var ret = true;

        for(var i = 0; i < document.phpMyEdit_form.elements.length; i++)
        {
        	if(document.phpMyEdit_form.elements[i].getAttribute("date"))
            {
            	if(document.phpMyEdit_form.elements[i].value != '')
                {
                	elementValue = document.phpMyEdit_form.elements[i].value.split(".");
                    if(elementValue.length != 3)
                    {
                    	alert("Der Vorgang kann nicht durchgeführt werden!\nEin von Ihnen eingegebenes Datum kann nicht verabeitet werden.");
                        document.phpMyEdit_form.elements[i].style.borderColor = "#FF0000";
                        ret = false;
                    }
                    else
                    {
                    	document.phpMyEdit_form.elements[i].style.borderColor = "#E8EEFF";
                    }
                }
            }
        	if(document.phpMyEdit_form.elements[i].getAttribute("amount"))
            {
            	if(document.phpMyEdit_form.elements[i].value != '')
                {
                    if(document.phpMyEdit_form.elements[i].value.search(/\w/) == -1)
                    {
                    	alert("Der Vorgang kann nicht durchgeführt werden!\nEin von Ihnen eingegebener Betrag kann nicht verabeitet werden.");
                        document.phpMyEdit_form.elements[i].style.borderColor = "#FF0000";
                        ret = false;
                    }
                    else
                    {
                    	document.phpMyEdit_form.elements[i].style.borderColor = "#E8EEFF";
                    }
                }
            }
        }

		if(ret === true)
		{
	        for(var i = 0; i < document.phpMyEdit_form.elements.length; i++)
	        {
	            if(document.phpMyEdit_form.elements[i].getAttribute("date"))
	            {
	                if(document.phpMyEdit_form.elements[i].value != '')
	                {
						document.phpMyEdit_form.elements[i].style.color = '#FFFFFF';
                        elementValue = document.phpMyEdit_form.elements[i].value.split(".");
                        document.phpMyEdit_form.elements[i].value = elementValue[2]+"-"+elementValue[1]+"-"+elementValue[0];
					}
				}
	            if(document.phpMyEdit_form.elements[i].getAttribute("amount"))
	            {
	                if(document.phpMyEdit_form.elements[i].value != '')
	                {
						document.phpMyEdit_form.elements[i].style.color = '#FFFFFF';
                		document.phpMyEdit_form.elements[i].value = document.phpMyEdit_form.elements[i].value.replace(/\./, "");
                        document.phpMyEdit_form.elements[i].value = document.phpMyEdit_form.elements[i].value.replace(/,/, ".");
					}
				}
			}
		}
		return ret;
	}

    //Neue Funktion für die Anzeigeseite
	function dateFormat(field_name_array)
	{
		var field_name_array = field_name_array.split(':');
		var field_value_array = new Array;
		var field_bgcolor_array = new Array;
		var ret = true;

		for(var i in field_name_array)
		{
			if(document.getElementsByName(field_name_array[i])[0]){
				if(document.getElementsByName(field_name_array[i])[0].value != '')
				{
					field_value_array[i] = document.getElementsByName(field_name_array[i])[0].value.split(".");

					if(field_value_array[i].length != 3)
					{
						alert('Der Vorgang kann nicht durchgeführt werden! \nEin von Ihnen eingegebenes Datum kann nicht verarbeitet werden. \n\nBestätigen Sie bitte diese Nachricht und ändern Sie das rot makierte Feld.');
						document.getElementsByName(field_name_array[i])[0].style.borderColor = '#FF0000';
						ret = false;
					}else
						document.getElementsByName(field_name_array[i])[0].style.borderColor = "#E8EEFF";
				}
			}
		}



		if(ret === true)
		{
			for(var i in field_name_array)
			{
				if(document.getElementsByName(field_name_array[i])[0]){
					if(document.getElementsByName(field_name_array[i])[0].value != '')
					{
						document.getElementsByName(field_name_array[i])[0].style.color = '#FFFFFF';
						//document.getElementsByName(field_name_array[i])[0].value = field_value_array[i][2]+"-"+field_value_array[i][1]+"-"+field_value_array[i][0];
					}
				}
			}
		}
		return ret;
	}
