//przygotowuje specyficzne pola formularza przed wysłaniem do serwera (np. edytor XHTML)
function prepareFields() {
	
	//pola XHTML
	
	var xhtmlFields = new Array();
	xhtmlFields = document.getElementsByName('xhtmlPointer');
	
	for(var i = 0; i < xhtmlFields.length; i++) {
		
		//if(xhtmlFields[i].value) {
		
			var hiddenField = xhtmlFields[i].value;
			var editorField = 'editor_'+hiddenField;
			var alternateField = 'alternate_'+hiddenField;
		
			try {
				if(typeof(document.getElementById(editorField).EscapeUnicode) == 'undefined') {			
	 				throw "Error"
				} else {
					//document.getElementById(editorField).EscapeUnicode = true;
				    document.getElementById(hiddenField).value = document.getElementById(editorField).value;
				}			
			}
			catch(er) {
				document.getElementById(hiddenField).value = document.getElementById(alternateField).value;
			}
		//}
	}
}
