

/**
* http://www.alistapart.com/articles/prettyaccessibleforms
*
* code updated for latest jquery version. Dominik Stucky 2007-10-24
* used in /kontakt/
*/
if( document.addEventListener ) document.addEventListener( 'DOMContentLoaded', form_kontakt, false );

function form_kontakt(){
	
	if (jQuery.browser.mozilla) { // nur firefox beruecksichtigen, opera 9.0 ausschliessen
	
		//jQuery.noConflict(); -> used in backoffice_header.tpl
		
		// Hide forms
		jQuery( 'form#form_kontakt' ).hide().end(); // latest prototype version and safari 2 does not recognize elements which are set display to hidden (as if they didn't exists)
		// with new jquery version 1.2.1 and noconflict(), it can be used again
		
		/**
		* with latest version of jquery 1.2.1 li/label does not function properly, only label used here
		* jQuery( 'form#editform' ).find( 'li/label' ).each( function( i ){
		*/
	  
		// Processing
		jQuery( 'form#form_kontakt' ).find( 'label' ).each( function( i ){
		
			//this.css('backgroundColor','#0ff');
		
			var labelContent = this.innerHTML;
			var labelWidth = document.defaultView.getComputedStyle( this, '' ).getPropertyValue( 'width' );
			var labelSpan = document.createElement( 'span' );
				labelSpan.style.display = 'block';
				labelSpan.style.width = labelWidth;
				labelSpan.innerHTML = labelContent;
			this.style.display = '-moz-inline-box';
			this.innerHTML = ""; // statt this.innerHTML = null; fuer opera 9.0
			this.appendChild( labelSpan );
		} ).end();
	  
		// Show forms
		jQuery( 'form#form_kontakt' ).show().end();
	
	}//end if
}