			function findPos( obj ) {
				var curleft = curtop = 0;
				if (obj.offsetParent) {
					curleft = obj.offsetLeft;
					curtop = obj.offsetTop;
					while (obj = obj.offsetParent) {
						curleft += obj.offsetLeft;
						curtop += obj.offsetTop;
					}
				}
				return [curleft,curtop];
			}
			
			function refineNavi() {
				var parent = document.getElementById( 'naviparent' );
				var child = document.getElementById( 'navichild' );
				if( parent && child ) {
					var pos = findPos( parent );
					child.style.left = ( pos[0] ) + 'px';
					child.style.top = ( pos[1] + 20 ) + 'px';
					child.style.visibility = 'visible';
				}
			}
			
			function validate_form()
			{
				var valid = true;
				var namehint = document.getElementById( 'namehint' );
				var mailhint = document.getElementById( 'mailhint' );
				var messagehint = document.getElementById( 'messagehint' );
				var filter = /.+@.+\..+/;

				// name
				if( namehint && namehint.childNodes.length > 0 )
					namehint.removeChild( namehint.firstChild );
						
				if( document.forms.mailform.name.value == "" )
				{
					if( namehint )
					{
						if( namehint.childNodes.length == 0 )
							namehint.appendChild( document.createTextNode( 'Bitte geben Sie Ihren Namen an.' ) );

						namehint.style.color = '#FF0000';
					}
					
					valid = false;
				}
				else if( document.forms.mailform.name.value.length < 4 )
				{
					if( namehint )
					{
						if( namehint.childNodes.length == 0 )
							namehint.appendChild( document.createTextNode( 'Der eingegebene Name ist zu kurz.' ) );
							
						namehint.style.color = '#FF0000';
					}
					
					valid = false;
				}

				// mail
				if( mailhint && mailhint.childNodes.length > 0 )
					mailhint.removeChild( mailhint.firstChild );
					
				if( document.forms.mailform.mail.value == "" )
				{
					if( mailhint )
					{
						if( mailhint.childNodes.length == 0 )
							mailhint.appendChild( document.createTextNode( 'Bitte geben Sie Ihre E-Mail Adresse an.' ) );
							
						mailhint.style.color = '#FF0000';
					}

					valid = false;
				}
				else if( !filter.test( document.forms.mailform.mail.value ) )
				{
					if( mailhint )
					{
						if( mailhint.childNodes.length == 0 )
							mailhint.appendChild( document.createTextNode( 'Bitte geben Sie eine gültige E-Mail Adresse an.' ) );
							
						mailhint.style.color = '#FF0000';
					}

					valid = false;
				}

				// message
				if( messagehint && messagehint.childNodes.length > 0 )
					messagehint.removeChild( messagehint.firstChild );
						
				if( document.forms.mailform.message.value == "" )
				{
					if( messagehint )
					{
						if( messagehint.childNodes.length == 0 )
							messagehint.appendChild( document.createTextNode( 'Bitte geben Sie Ihre Nachricht an.' ) );
							
						messagehint.style.color = '#FF0000';
					}

					valid = false;
				}
				else if( document.forms.mailform.message.value.length < 10 )
				{
					if( messagehint )
					{
						if( messagehint.childNodes.length == 0 )
							messagehint.appendChild( document.createTextNode( 'Die eingegebene Nachricht ist zu kurz.' ) );
							
						messagehint.style.color = '#FF0000';
					}
					
					valid = false;
				}

				return valid;
			}
