// JavaScript Document

//*****************************************************************************************************************************************
// This function is used ro disable a Section that has values that are not applicable
//*****************************************************************************************************************************************
function disableSection(section,numValues){
	value = 'document.auBuilderForm2.' + section + '[' + numValues + '].checked = true';
	eval(value);
	for( i = 0; i < numValues; i++){
		value = 'document.auBuilderForm2.' + section + '[' + i + '].disabled = true';
		eval(value);
	}
}

//*****************************************************************************************************************************************
// This function is used ro enable a Section that has values that are applicable
//*****************************************************************************************************************************************
function enableSection(section,numValues){
	for( i = 0; i < numValues; i++ ){
		value = 'document.auBuilderForm2.' + section + '[' + i + '].disabled = false';
		eval(value);
	}
}
//*****************************************************************************************************************************************
// This function is used ro disable a Section that has values that are not applicable
//*****************************************************************************************************************************************
function disableSection2(section,numValues){
	value = 'document.auBuilderForm.' + section + '[' + numValues + '].checked = true';
	eval(value);
	for( i = 0; i < numValues; i++){
		value = 'document.auBuilderForm.' + section + '[' + i + '].disabled = true';
		eval(value);
	}
}

//*****************************************************************************************************************************************
// This function is used ro enable a Section that has values that are applicable
//*****************************************************************************************************************************************
function enableSection2(section,numValues){
	for( i = 0; i < numValues; i++ ){
		value = 'document.auBuilderForm.' + section + '[' + i + '].disabled = false';
		eval(value);
	}
}

//*****************************************************************************************************************************************
// This function is used ro enable a Section that has values that are applicable
//*****************************************************************************************************************************************
function getSelectedValue(section){
		
	tempString = 'document.auBuilderForm2.' + section + '.length';
	numValues = eval(tempString);
	
   for (var i=0; i<numValues; i++)  { 
		if (eval('document.auBuilderForm2.' + section + '[' + i + '].checked'))  {
			found_it = eval('document.auBuilderForm2.' + section + '[' + i + '].value');
		} 
	}
	
	return found_it;
}
//*****************************************************************************************************************************************
// This function is used ro enable a Section that has values that are applicable
//*****************************************************************************************************************************************
function getSelectedValue2(section){
		
	tempString = 'document.auBuilderForm.' + section + '.length';
	numValues = eval(tempString);
	
   for (var i=0; i<numValues; i++)  { 
		if (eval('document.auBuilderForm.' + section + '[' + i + '].checked'))  {
			found_it = eval('document.auBuilderForm.' + section + '[' + i + '].value');
		} 
	}
	
	return found_it;
}

//*****************************************************************************************************************************************
// This function is used ro Set the Background Colors
//*****************************************************************************************************************************************
function setBackgroundColors(change, val, section){
	if ( change == 1 && val != "notSelected"){
		eval("document.all." + section + ".style.backgroundColor='#E8E5EC';");		
	}
	else{
		eval("document.all." + section + ".style.backgroundColor='#FFFFFF';");		
	}
}

