<!--//--><![CDATA[//><!--

	/**
	* dynamicTextBoxRegion
	*
	* change control to editable mode
	*
	* @param	controlId		name of control
	* @return	bool						TRUE if successfull
	*/
	function dynamicTextBoxRegion( controlId ) {

		if( document.getElementById( controlId )) {

			if( document.getElementById( controlId ).style.display == 'none' ) {
				// get static text node
				var childNodes = document.getElementById( controlId + '_node' ).getElementsByTagName( 'span' );
				var childNode = childNodes[0];

				// remove textNode from edit region
				if( childNode ) {
					document.getElementById( controlId + '_node' ).removeChild( childNode );
				}

				// show control and set focus
				document.getElementById( controlId ).style.display = 'inline';
				document.getElementById( controlId ).focus();
				return true;
			}
		}
		return false;
	}


	/**
	* staticTextBoxRegion
	*
	* change control to static mode
	*
	* @param	controlId		name of control
	* @param	blankFieldText	blank text field
	* @return	TRUE if successfull
	*/
	function staticTextBoxRegion( controlId, blankFieldText ) {

		if( document.getElementById( controlId )) {

			if( document.getElementById( controlId ).style.display != 'none' ) {

				// create static text node
				var childNode = document.createElement( 'span' );

				if( document.getElementById( controlId ).value ) {

					var lines = document.getElementById( controlId ).value.split( "\n" );

					// break node into lines seperated by line break tags
					childNode.appendChild( document.createTextNode( lines[0] ));

					if( lines.length > 1 ) {
						for( var i = 1; i < lines.length; i++ ) {
							var br = document.createElement( 'br' );
							childNode.appendChild( br );
							childNode.appendChild( document.createTextNode( lines[i] ));
						}
					}
				}
				else if( blankFieldText ) {
					childNode.appendChild( document.createTextNode( blankFieldText ));
				}
				else {
					return false;
				}

				// add textNode to edit region
				document.getElementById( controlId + '_node' ).appendChild( childNode );

				// hide control
				document.getElementById( controlId ).style.display = 'none';
				return true;
			}
		}
		return false;
	}

//--><!]]>