PACIFICFOX.buildValidation = function( arg ) { 
	var callback = { 
		success: function( o ) {
			var propertyCollection = o.responseXML.getElementsByTagName( "property" );
			for ( var i = 0; i < propertyCollection.length; i++ ) {
				var myProperty = propertyCollection[ i ];
				var myString = arg.objectName + ".addProperty({";
	
				var rangeCollection = myProperty.getElementsByTagName( "range" );
				var range = new Array();
				for ( var j = 0; j < rangeCollection.length; j++ ) {
					var myRange = rangeCollection[ j ];
					var oRange = {};
					oRange.lower = myRange.getAttribute( "lower" );
					oRange.upper = myRange.getAttribute( "upper" );
					range.push( oRange );
				}
	
				for ( var j = 0; j < myProperty.attributes.length; j++ ) {
					var myAttribute = myProperty.attributes[ j ];
					myString += myAttribute.nodeName + ":";
					if ( "required,countSpace,minimumLength,maximumLength,trim".search( myAttribute.nodeName ) != -1 ) {
						myString += myAttribute.nodeValue;
					}
					else {
						myString += "'" + myAttribute.nodeValue + "'";
					}
					
					if ( j < ( myProperty.attributes.length - 1 ) ) {
						myString += ", ";
					}
				}
	
				// set any conditions
				var conditionCollection = myProperty.getElementsByTagName( "condition" );
				var condition = new Array();
				for ( var j = 0; j < conditionCollection.length; j++ ) {
					var myCondition = conditionCollection[ j ];
					condition.push( myCondition.childNodes[ 0 ].nodeValue );
				}
	
				// if there are any ranges defined
				if ( range.length != 0 ) {
					myString += ", range:range";
				}
				// if there are any conditions defined
				if ( condition.length != 0 ) {
					myString += ", condition:condition";
				}
				
				myString += "});";
				property = eval( myString );
				//alert(myString);
	
				// set any custom functions
				var functionCollection = myProperty.getElementsByTagName( "function" );
				for ( var j = 0; j < functionCollection.length; j++ ) {
					var myFunction = functionCollection[ j ];
					switch ( myFunction.getAttribute( "type" ) ) {
						case "onerror": {
							property.onerror = function ( obj1, obj2 ) { eval( myFunction.childNodes[ 0 ].nodeValue ) };
							break;
						}
						case "onvalidation": {
							property.onvalidation = function ( obj1, obj2 ) { eval( myFunction.childNodes[ 0 ].nodeValue ) };
							break;
						}
					}
				}

				var myMessageString = "";
				var messageCollection = myProperty.getElementsByTagName( "message" );
				for ( var j = 0; j < messageCollection.length; j++ ) {
					var oMessage = messageCollection[ j ];
					var myMessage = oMessage.childNodes[ 0 ].nodeValue;
					myMessage = myMessage.replace( /'/g, "\\'" );
					myMessage = myMessage.replace( /"/g, '\\"' );
					var overrideDefault = oMessage.getAttribute( "overrideDefault" );
					myMessageString += 'property.setMessage({type:"' + oMessage.getAttribute( "type" ) + '"';
					myMessageString += ', message:"' + myMessage + '"';
					if ( overrideDefault != null ) myMessageString += ', overrideDefault:' + overrideDefault;
					myMessageString += '});';
				}
				eval( myMessageString );
			}
		} 
		, failure: function( o ) {
			alert(o.responseText);
		}
		, cache:false
	} 

	var request = YAHOO.util.Connect.asyncRequest( 'GET', arg.sMetaUrl, callback, null );
}
