// check string for HTML code
function htmlCodeCheck(thefield, fieldLabel, noBlank, showalert) {
	var r_str = "";
	var str = thefield.value;
	// if the field is blank 
	if( str.length == 0 ) {
		if( noBlank )
			r_str = fieldLabel+ " can not be blank.\n";	
	}
	else {
		reg_str = "<[^>]+>";
		regex = new RegExp(reg_str);
		found = str.search(regex);
		// if html code is found
		if( found >= 0 ) {
			r_str = fieldLabel + " contains illegal characters.\n";
		}
	}// if (str.length == 0)
	
	if( r_str.length > 0 && showalert ) 
		alert(r_str);
	else
		return r_str;
}


