// JavaScript Document

function LTrim( value ) {
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");	
}	
// Removes ending whitespaces
function RTrim( value ) {	
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");	
}	
// Removes leading and ending whitespaces
function trim( value ) {	
	return LTrim(RTrim(value));	
}
function checkForm(formname){
	var fId = document.formname;
	var msg="";
	alert(formname);
	alert("VALUE="+document.formname.prg.value);
	if(trim(document.formname.prg.value)=="") {		
		msg+="Choose program\n";
		alert(msg);
	}
	
	if(msg=="") return false;
	else {
		alert(msg);
		
	}return false
}
