/* dataentry.js */


//Clear Unwanted Fields
function clr_wvKnown(){
	if(document.form.calcLength.value.length >= 1){
		document.form.rowPoolSize.value='';
	}else if(document.form.calcWidth.value.length >= 1){
		document.form.rowPoolSize.value='';
	}else if(document.form.calcShallowEnd.value.length >= 1){
		document.form.rowPoolSize.value='';
	}else if(document.form.calcDeepEnd.value.length >= 1){
		document.form.rowPoolSize.value='';
	}
}

function clr_wvUnknown(){
	if(document.form.rowPoolSize.value.length >= 1){
		document.form.calcLength.value='';
		document.form.calcWidth.value='';
		document.form.calcShallowEnd.value='';
		document.form.calcDeepEnd.value='';
	}
}

function clr_Chlorine(){
	if(document.form.resultRBromine.value.length >= 1){
		document.form.resultRFreeChlorine.value='';
	}else if(document.form.resultRBromine.value.length >= 1 && document.form.resultRFreeChlorine.value.length >= 1){
		var confirmed = confirm('A value for both Bromine and Free Chlorine\ncan not be entered!\n\nWould you like to keep your value for Bromine?');

	   	if(confirmed){
			document.form.resultRFreeChlorine.value='';
   		}else{
   			document.form.resultRBromine.value='';
   		}	
	}
	
		if((document.form.resultRCyanuricAcid.value.length >= 1) && (document.form.resultRBromine.value.length >= 1)){
			var confirmed = confirm('Since Cyanuric Acid is not used in Bromine pools,\na value for both Bromine and Cyanuric Acid\ncan not be entered!\n\n\n\nSelect "Ok" to keep the entered Cyanuric Acid value and remove the Bromine value. \nOR\nSelect "Cancel" to enter a Bromine value and remove the Cyanuric Acid value.');
	
			//confirmed = MsgBox("Test",292,"Test?");
				if(confirmed){
				document.form.resultRBromine.value='';
				}else{
					document.form.resultRCyanuricAcid.value='';
				}
		}		
}

function clr_Bromine(){
	if(document.form.resultRFreeChlorine.value.length >= 1){
		document.form.resultRBromine.value='';
	}
}

function clr_Cyanuric(){
	if(document.form.resultRBromine.value.length >= 1 && document.form.resultRCyanuricAcid.value.length >= 1){
		document.form.resultRCyanuricAcid.value='';
		alert('Since Cyanuric Acid is not used in Bromine pools,\na value for both Bromine and Cyanuric Acid\ncan not be entered!');
	}	
}
/* end */

