/*
#####################################################################
## Project		:
## File			: validation_message.js
## Create Date	: 4/15/2005 5:27 PM
## Purpose		: 
##					
## Developer	: Manish Kumar Namdeo
#####################################################################
*/

function validationClass()
{
	this.arrEmptyField = Array();
	this.arrInvalidField = Array();
	this.sErrorMessage = "";

	this.addEmptyField = addEmptyField;
	this.addInvalidField = addInvalidField;
	this.showMessage = showMessage;
}

function addEmptyField(s){
	this.arrEmptyField[this.arrEmptyField.length] = s;
}

function addInvalidField(s){
	this.arrInvalidField[this.arrInvalidField.length] = s;

}

function showMessage(){

	if(this.arrEmptyField.length > 0){
		this.sErrorMessage = this.sErrorMessage + "\nFollowing fields are empty :\n";
		for(ctr = 0; ctr < this.arrEmptyField.length; ctr++){
			this.sErrorMessage = this.sErrorMessage + eval(ctr + 1) + ") " + this.arrEmptyField[ctr] + "\n";
		}
	}

	if(this.arrInvalidField.length > 0){
		this.sErrorMessage = this.sErrorMessage + "\nFollowing fields are invalid :\n";
		for(ctr = 0; ctr < this.arrInvalidField.length; ctr++){
			this.sErrorMessage = this.sErrorMessage + eval(ctr + 1) + ") " + this.arrInvalidField[ctr] + "\n";
		}
	}
	
	if(this.sErrorMessage != ""){
		alert(this.sErrorMessage);
		return false;
	}else{
		return true;
	}
}

