var XmlUtils = {
	getContentAsString: function( parentNode, isEncoded ) {
	  if (isEncoded) return this._getEncodedContent(parentNode);
	  if (typeof parentNode.xml != 'undefined') return this._getContentAsStringIE(parentNode);
	  return this._getContentAsStringMozilla(parentNode);
	},

	_getEncodedContent: function(parentNode) {
	  if (parentNode.innerHTML) return parentNode.innerHTML;
	  switch (parentNode.childNodes.length) {
	    case 0:  return "";
	    case 1:  return parentNode.firstChild.nodeValue;
	    default: return parentNode.childNodes[1].nodeValue;
	  }
	},

	_getContentAsStringIE: function(parentNode) {
	  var contentStr = "";
	  for ( var i = 0 ; i < parentNode.childNodes.length ; i++ ) {
	     var n = parentNode.childNodes[i];
	     contentStr += (n.nodeType == 4) ? n.nodeValue : n.xml;
	  }
	  return contentStr;
	},

	_getContentAsStringMozilla: function(parentNode) {
	   var xmlSerializer = new XMLSerializer();
	   var contentStr = "";
	   for ( var i = 0 ; i < parentNode.childNodes.length ; i++ ) {
	        var n = parentNode.childNodes[i];
	        if (n.nodeType == 4) { // CDATA node
	            contentStr += n.nodeValue;
	        }
	        else {
	          contentStr += xmlSerializer.serializeToString(n);
	      }
	   }
	   return contentStr;
	}
};

//if (typeof Prototype != 'undefined') {
	var AjaxUtils = {
		updateContent: function(prototypeResponse, updaterFunction) {
			if (updaterFunction) {
				updaterFunction.ajaxUpdate(prototypeResponse.responseXML.documentElement);
			}
		}
	};
//}
	
	/**
	* Returns the value of the selected radio button in the radio group, null if
	* none are selected, and false if the button group doesn't exist
	*
	* @param {radio Object} or {radio id} el
	* OR
	* @param {form Object} or {form id} el
	* @param {radio group name} radioGroup
	*/
	function $RF(el, radioGroup) {
	    if($(el).type && $(el).type.toLowerCase() == 'radio') {
	        var radioGroup = $(el).name;
	        var el = $(el).form;
	    } else if ($(el).tagName.toLowerCase() != 'form') {
	        return false;
	    }

	    var checked = $(el).getInputs('radio', radioGroup).find(
	        function(re) {return re.checked;}
	    );
	    return (checked) ? $F(checked) : null;
	}

