// expose
$.validator.setDefaults({
	submitHandler: function() { alert("submitted!"); }
});
$().ready(function() {
	$("#expose_form").validate({
		rules: {
			email: {
				required: true,
				email: true
			},			
			captcha: {
				required: true,
				remote: "files/php/process.php"
			}
		}, 
        messages: { 
            anrede: { 
                required: " Bitte angeben!"
            }, 
            vorname: { 
                required: ""
            }, 
            nachname: { 
                required: ""
            }, 
            strasse: { 
                required: ""
            }, 
            hausnummer: { 
                required: ""
            }, 
            plz: { 
                required: ""
            }, 
            ort: { 
                required: ""
            },
            email: { 
                required: ""
            },
            telefon: { 
                required: ""
            },
            objektinformationen: { 
                required: ""
            },
            captcha: " Fehler!"
        }, 
        submitHandler: function(form) { 
            // do other stuff for a valid form 
           form.submit(); 
        }, 
        errorElement: 'label', 
        //errorPlacement: function(error, element) { 
            //error.appendTo(element.next()); 
       // }, 
        //wrapper: 'div class="error"', 
        success: "valid" 
        /*success: function(label) { 
            label.addClass("valid"); 
        }*/ 
    });

});
// navigation
if(window.navigator.systemLanguage && !window.navigator.language) {
	function hoverIE() {
	  var LI = document.getElementById("Navigation").firstChild;
	  do {
		if (sucheUL(LI.firstChild)) {
		  LI.onmouseover=einblenden; LI.onmouseout=ausblenden;
		}
		LI = LI.nextSibling;
	  }
	  while(LI);
	}
	function sucheUL(UL) {
	  do {
		if(UL) UL = UL.nextSibling;
		if(UL && UL.nodeName == "UL") return UL;
	  }
	  while(UL);
	  return false;
	}
	function einblenden() {
	  var UL = sucheUL(this.firstChild);
	  UL.style.display = "block";
	}
	function ausblenden() {
	  sucheUL(this.firstChild).style.display = "none";
	}
	window.onload = hoverIE();
}

