/*
NB - this requires FormHelper.js from _hbi and HBI.js from _hbi
*/
CommentsValidation					= {
	init:function() {
		if(!document.getElementById||!document.createTextNode){return;}
		var eForm								= document.getElementById('frmComments');
		if (!eForm) {
			return false;
		}
		eForm.onsubmit							= function() {return CommentsValidation.validate();}
	},
	
	validate:function() {
		var eBody								= document.getElementById('frmComments_sBody');
		var eBodyHelper							= document.getElementById('frmComments_sBodyHelper');
		
		var isValidForm							= true;
		
		// clear message
		eBodyHelper.innerHTML					= "";
		eBodyHelper.className					= "frmError";
		
		if (!FormHelper.hasValue(eBody.value, true)) {
			eBodyHelper.innerHTML				= "You must enter your comment";
			eBodyHelper.className				= "frmErrorActive";
			isValidForm							= false;
		}
		
		return isValidForm;
	}
}
WindowListener.add("load","CommentsValidation.init()");