function Trim(sString) {while (sString.substring(0,1) == ' '){sString = sString.substring(1, sString.length);}while (sString.substring(sString.length-1, sString.length) == ' '){sString = sString.substring(0,sString.length-1);}return sString;} 
function doSearch(oF){if(oF){if(Trim(oF.q.value)==""){oF.q.focus();return false;}oF.submit();}}
function validateform(){
 	document.getElementById('btnsubmit').disabled = true;
	if(document.frmcomments){
		tname = Trim(document.frmcomments.txtName.value);
		tcompany = Trim(document.frmcomments.txtCompany.value);
		tcomment = Trim(document.frmcomments.txtComment.value)
		if(tname == ""){
			alert('Name cannot be empty');
			document.frmcomments.txtName.focus();
			document.getElementById('btnsubmit').disabled = false;
			return false;
		}else if(tcompany == ""){
			alert('Company cannot be empty');
			document.frmcomments.txtCompany.focus();
			document.getElementById('btnsubmit').disabled = false;
			return false;
		}else if(tcomment ==""){
			alert('Comments cannot be empty');
			document.frmcomments.txtComment.focus();
			document.getElementById('btnsubmit').disabled = false;
			return false;
		}
		document.frmcomments.submit();
		return false;
	}
	return true;
}
function checksrch(o,b){
 	if(b){YAHOO.util.Dom.addClass(o.id, 'focus');}else{
 	 	if(Trim(o.value)==""){
		YAHOO.util.Dom.removeClass(o.id, 'focus');
		}
	}
}