anchor.diff:  
   	<div>
   		<b>Weight Range</b>
  -		<html:select property="weightLower" style="width:60px">
  +		<html:select property="weightLower" styleId="weightLower" style="width:60px">
   			<option value="">N/A</option>
   			<html:options collection="avWeight" property="value" labelProperty="label"/>
   		</html:select>
   		to
  -		<html:select property="weightUpper" style="width:60px">
  +		<html:select property="weightUpper" styleId="weightUpper" style="width:60px">
   			<option value="">N/A</option>
   			<html:options collection="avWeight" property="value" labelProperty="label"/>
   		</html:select> kg
  
positive.code: 	</h4>
  	<div>
  		<b>Fagerstrom Range</b>
  		<html:select property="fagerstromScoreLower">
  			<option value="">Any</option>
  			<html:option value="1">1</html:option>
  			<html:option value="2">2</html:option>
  
negative.code: 			}
  		}
  	},
  	'validate': function(fromwhere)	{
  	//return false;
  	
  		var errors = new Array();
  		var estyle = "1px solid red";
  		if($('queryName').value == "")	{
  			errors.push("Please Enter a Query Name");
  			debug("error found");
  			$('queryName').style.border=estyle;
  		}
  		
  		
  		try	{
  			//check the ranges	
  			var ranges = new Array();
  			ranges.push('intensity');
  			ranges.push('duration');
  			ranges.push('ageAtInitiation');
  			ranges.push('yearsSinceQuitting');
  			ranges.push('fagerstromScore');
  			ranges.push('age');
  			ranges.push('weight');
  			ranges.push('height');
  			for(var i=0; i<ranges.length; i++)	{
  				//debug(ranges[i]);
  				var low = $(ranges[i]+"Lower").value;
  				var high = $(ranges[i]+"Upper").value;
  				if(high==low)	{
  					//debug("dont check " + ranges[i]);
  					continue; //both equal to "" or set to equal
  				}
  				//debug("check " + ranges[i]);
  				if( (low!="" && high=="") || (low=="" && high!="")  || (low>high) )	{
  					//havent filled in both fields
  					errors.push(ranges[i].underscore().replace(/[_]+/g, " ").capitalize() + " range is incorrect");
  					$(ranges[i]+"Lower").style.color = "red";
  					$(ranges[i]+"Upper").style.color = "red";
  				}
  				else	{
  					$(ranges[i]+"Lower").style.color = "#000";
  					$(ranges[i]+"Upper").style.color = "#000";
  				}
  			}
  			
  					
  			if(errors.length>0)	{
  				//dont submit
  				//debug("dont submit");
  				var ehtml = "";
  				for(var i=0; i<errors.length; i++)	{
  					ehtml += "-" + errors[i] + "<br/>";
  				}
  				//errors.each(function()	{ ehtml += e + "<br/>";} );	
  				$('errors').innerHTML = "<b>Please fix the following errors:</b><br/>" + ehtml;
  				scroll(0,0);
  				return false;
  			}
  			else	{
  				//debug("SUBMIT FORM");
  				//return false; //never submit;		
  				
  				if(fromwhere == 'enter')	{
  					return true;
  				}
  				else	{
  					document.forms[0].submit();
  				}
  			}
  		}
  		catch(err)	{
  			debug("caught: " + err);
  			return false;
  		}
  	}
  
  };
  </script>
  
  <html:form action="epiQuery.do?method=submit" onsubmit="return EpiQuery.validate('enter');" >
  <html:errors property="queryErrors" />
  
  <p>
  