function DependenceRequire(	
	oFrom,
	sPattern,
	iLogic,
	bInverse,
	iMin
	) {
	
	DependenceRequire.baseConstructor.call(
		this,
		Dependence.TYPE_REQUIRE,
		oFrom,
		sPattern,
		iLogic,
		bInverse
		);	
		
	this.iMin = iMin || 1;

}

DependenceRequire.inheritFrom(
	Dependence,
	{

		getMin : function() {
	
			return this.iMin;
	
		},			

		check : function() {

			if(this.oFrom.isTemplate()) {
				return true;
			}
	
			var
				iCountMatched = 0,
				bHasRequiredChild = false,
				bHasEnabledChild = true,
				bResult = false
				;
		
			if(this.oFrom instanceof InputGroup) {
				for(var i = 0; i < this.oFrom.aChildren.length; i++) {
					if(this.oFrom.aChildren[i].isChecked()) {
						iCountMatched++;
					}
				}
			}
			else if(this.oFrom instanceof FieldContainer &&
				!(this.oFrom instanceof DateInput)
				) {				
		
				bHasEnabledChild = false;
		
				for(var i = 0; i < this.oFrom.aChildren.length; i++) {	
		
					if(this.oFrom.aChildren[i].isEnabled()) {
						bHasEnabledChild = true;
					}
					else {					
						continue;
					}
					
					if(this.oFrom.aChildren[i] instanceof FieldContainer &&
						!(this.oFrom.aChildren[i] instanceof DateInput)) {
				
						if(this.oFrom.aChildren[i].isRequired()) {
							bHasRequiredChild = true;
						}
						else {
				
							var iCountUnrequiredChildren = 0;
					
							if(this.oFrom.aChildren[i] instanceof InputGroup) {

								for(var j = 0; j < this.oFrom.aChildren[i].aChildren.length; j++) {
									if(this.oFrom.aChildren[i].aChildren[j].isChecked()) {
										iCountUnrequiredChildren++;
									}
								}					
						
							}
							else {
								iCountUnrequiredChildren = this.oFrom.aChildren[i].getCountChildrenByPattern(this.sPattern);
							}
					
							if(this.oFrom.aChildren[i] instanceof Multiplicator) {
								iCountMatched += iCountUnrequiredChildren;
							}
							else if (iCountUnrequiredChildren > 0) {
								iCountMatched++;
							}
					
						}
				
					}				
					else if(this.oFrom.aChildren[i].isRequired()) {				
						bHasRequiredChild = true;
					}
					else if(this.oFrom.aChildren[i].getValue().match(this.sPattern)) {
						iCountMatched++;
					}
			
				}
		
			}
			else if(this.oFrom.getValue().match(this.sPattern)) {
				iCountMatched++;
			}						
	
			bResult = !bHasRequiredChild && (iCountMatched >= this.iMin || !bHasEnabledChild);
	
			return this.isInverse()? !bResult : bResult;

		},
		
		clone : function(oFrom) {
		
			return new DependenceRequire(		
				oFrom,
				this.getPattern(),
				this.getLogic(),
				this.isInverse(),
				this.getMin()
				);
		
		}
	
	}
	);
		