/**
 *	@author Arturas Paleicikas <arturas@ideacode.lt>
 */

function formchk(){
	this.data = new Array;
	
	this.isEmpty = function(id){
		try {
			var c = document.getElementById(id);
			if(c.value != ''){
				c.style.borderColor = '#CCC';
				return false; 
			} else { 
				c.style.borderColor = '#EA701C';
				c.focus();
				return true;
			}
		} catch(e){ alert(e); }
	}

	this.add2Chk = function(id){
		this.data[this.data.length] = id;
	}

	this.isValid = function(){
		for(var e=0; e<this.data.length; e++){
			if(this.isEmpty(this.data[e])){ return false; }
		}
		return true;
	}
}

var formchk = new formchk();
