/* document.charset = "iso-88598-1"; */
document.write('<input type="hidden" name="market" value="Other">')

if (document.rselookup.check_primary_field.id == 'required') { 
if (document.rselookup.edu) { 
document.writeln('<p><b>* Which of the following best describes your primary field?</b><br/>'); 
}
else { 

document.writeln('<p><b>* Which of the following best describes your primary field?</b><br/>'); 
 }
document.writeln('<select class="single" name="primary_field" onChange="id_select();">'
+ '<option value="" selected="selected">Select...</option>'
+ '<option value="Aerospace/Automotive Comp Dsgn" id="MSD">Aerospace/Automotive Component Design</option>'
+ '<option value="Architectural Design" id="BSD">Architectural Design</option>'
+ '<option value="Building and Facility Mgmnt" id="ACS">Building and Facility Management</option>'
+ '<option value="Building Constr: Commercial" id="ACS">Building Construction: Commercial</option>'
+ '<option value="Building Construction: Residential" id="ACS">Construction de Maisons individuelles ou logements</option>'
+ '<option value="Building Equipment Mfg" id="MSD">Building Equipment Manufacturing</option>'
+ '<option value="Civil Eng / Land Planning" id="ISD">Civil Engineering / Land Planning</option>'
+ '<option value="Computer/ Medical/ Office Dsgn" id="MSD">Computer/ Medical/ Office Design</option>'
+ '<option value="Consumer Products Design" id="MSD">Consumer Products Design</option>'
+ '<option value="Corporate Building Ownership" id="BSD">Corporate Building Ownership</option>'
+ '<option value="Defense" id="MSD">Defense</option>'
+ '<option value="Design Visualization" id="MED">Design Visualization</option>'
+ '<option value="Electrical Controls Design" id="MSD">Electrical Controls Design</option>'
+ '<option value="Electrical Systems Engineering" id="BSD">Electrical Systems Engineering</option>'
+ '<option value="Emergency Management" id="ISD">Emergency Management</option>'
+ '<option value="Environmental Engineering" id="ISD">Environmental Engineering</option>'
+ '<option value="Fabricated Metal Products" id="MSD">Fabricated Metal Products</option>'
+ '<option value="Film" id="MED">Film</option>'
+ '<option value="Games" id="MED">Games</option>'
+ '<option value="Interior Design" id="BSD">Interior Design</option>'
+ '<option value="Machinery Design" id="MSD">Machinery Design</option>'
+ '<option value="Mfg Procurement / Sales / Mkt" id="MSD">Manufacturing Procurement / Sales / Marketing</option>'
+ '<option value="Mapping and Geospatial Design" id="ISD">Mapping / Geospatial Design</option>'
+ '<option value="Mech Syst Eng - HVAC / Piping" id="MSD">Mechanical Systems Engineering - HVAC / Piping</option>'
+ '<option value="Multimedia Design/Web" id="MED">Multimedia Design / Web</option>'
+ '<option value="Plumbing/ Fire Protection Syst" id="BSD">Plumbing/ Fire Protection Systems</option>'
+ '<option value="Process and Power Plant Design" id="MSD">Process and Power Plant Design</option>'
+ '<option value="Real Estate Development" id="BSD">Real Estate Development</option>'
+ '<option value="Structural Engineering" id="BSD">Structural Engineering</option>'
+ '<option value="Telecommunications" id="ISD">Telecommunications</option>'
+ '<option value="Tool and Die / Machine Shop" id="MSD">Tool and Die / Machine Shop</option>'
+ '<option value="Transportation Design" id="ISD">Transportation Design</option>'
+ '<option value="Utilities: Electric, Oil, Gas" id="ISD">Utilities: Electric / Oil / Gas</option>'
+ '<option value="Utilities: Water and Sewer" id="ISD">Utilities: Water / Sewer</option>'
+ '<option value="Other" id="Other">Other</option></select></p>');

document.writeln('<p><b>* If "Other", which of the following best describes your industry?</b><br>'
+ '<select class="single" name="field_other" disabled="true" onChange="field_select();">'
+ '<option value="" selected="selected">Select...</option>'
+ '<option value="Other" id="BSD">Building, Design, Construction and Management</option>'
+ '<option value="Other" id="MSD">Manufacturing Design and Process Management</option>'
+ '<option value="Other" id="ISD">Mapping, Civil Engineering, and Infrastructure Management</option>' 
+ '<option value="Other" id="MED">Media & Entertainment</option></select></p>');
}
else {
document.writeln('<input name="primary_field" type="hidden" value="Other" id="Other">');
}


function id_select() {
 	window.document.rselookup.market.value = window.document.rselookup.primary_field.options[window.document.rselookup.primary_field.selectedIndex].id;
  	
	if (window.document.rselookup.primary_field.options[window.document.rselookup.primary_field.selectedIndex].value == "Other")  {
	window.document.rselookup.field_other.disabled = false; 
	} 
  	
	else  {
  	window.document.rselookup.field_other.disabled = true;  
	window.document.rselookup.field_other.selectedIndex = 0;
	}
	
	if (document.rselookup.alt_activity_id){
	var aid_test = "|Architectural Design||Electrical Systems Engineering||Interior Design||Mech Syst Eng (HVAC / Piping)||Plumbing/ Fire Protection Syst||Structural Engineering|";
	if ( (aid_test.indexOf(document.rselookup.primary_field.value)) > 0 )
	{
		document.rselookup.activity_id.value = document.rselookup.alt_activity_id.value;
	}
	}
}

function field_select() {
 	window.document.rselookup.primary_field.options[window.document.rselookup.primary_field.selectedIndex].value  = window.document.rselookup.field_other.options[window.document.rselookup.field_other.selectedIndex].value; 
	window.document.rselookup.market.value = window.document.rselookup.field_other.options[window.document.rselookup.field_other.selectedIndex].id;
}

