<!--
// JavaScript Document

//window.onload = setFOCUS;

function kontaktformularCHECK() {		
		
		//setFOCUS();
		
		var inputRETURN = inputCHECK();	
		var txtRETURN = txtareaCHECK();	
		
		if((inputRETURN == 0) && (txtRETURN == 0)) return true;
		else return false;

}
/*
function setFOCUS() {
	
	var label = document.getElementsByTagName("label");
	alert(label);
	for(var i = 0; i != label.length; i++) {
		alert(label[i]);
		label[i].onmouseover = function() {
			alert("Jetzt");	
		}
	}	
	
}
*/

	function inputCHECK() {
		
		var checkINPUT = 0;
		
		var element = document.getElementById("formfeld");		

		var input = element.getElementsByTagName("input");						
		
		// durchlaufen => auswerten der input felder
		for (var i = 0; i != input.length; i++) {
		
			var inputID = input[i].getAttribute("id");
			var inputVALUE = input[i].value;
			
				if(inputID != null) {
					
					var sel = inputID.split("_")
					
					if(sel[1] == "ja") {
					
						var label = input[i].parentNode.previousSibling;
						
							if(inputVALUE == "") {								
								label.style.color = "#ff0000";
								//input[i].focus();
								checkINPUT++;								
							} 
							
							if(inputVALUE != "") {
								label.style.color = "#606060";							
							} 						
						
					} // end if pflichtfeld abfrage
					
			}	// end if input feld type text 			
		
		} // end for input feld

		return checkINPUT;

	} // end function
		
	
	
	function txtareaCHECK() {
		
		var checkTXT = 0;
		
		var element = document.getElementById("formfeld");		

		var txtarea = element.getElementsByTagName("textarea");
		
		// durchlaufen => auswerten der textareas
		for (var x = 0; x != txtarea.length; x++) {
		
			var txtareaID = txtarea[x].getAttribute("id");			
			var txtVALUE = txtarea[x].value;
			
				if(txtareaID != null) {
					
					var sel = txtareaID.split("_")
					
					if(sel[1] == "ja") {

						var txt = txtarea[x].parentNode.previousSibling;
						
						if(txtVALUE == "")	{							
							txt.style.color = "#ff0000";
							//txtarea[x].focus();
							checkTXT++;							
						} 
						
						if(txtVALUE != "")	{							
							txt.style.color = "#606060";							
						} 
						
					} // end if pflichtfeld abfrage
					
			}	 // end if input feld type text			

		} // end for txtarea
		
		return checkTXT;

	} // end function
	
//-->
